Submission #73782


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define ll long long
#define ptn(v) next_permutation(v.begin(), v.end())
#define fixed(v) fixed << setprecision(v)
#define total(n) ((n) * ((n) + 1) / 2)
#define combi(n) ((n) * ((n) - 1) / 2) // n個の数の組み合わせ数
#define lcm(a, b) ((a) * (b) / __gcd(a, b))
// binery_search(all(v),key) = keyがあるかないかをboolで返す
// lower_bound(all(v),key) = key以上のイテレーターを返す(一番左)
// upper_bound(all(v),key) = keyより大きい要素のイテレーターを返す
// 最小値=max_element(v.begin(),v.end());
// 最大値=min_element(v.begin(),v.end());
template <class x> x rng_total(x l, x r) { // l ~ rまでの数の総和
return((l + r) * (r - l + 1) / 2);
}
template <class x> x rng_combi(x l, x r) { //「n個の物からr個取った組み合わせ数」
x ans = 1;
l++;
for (x i = 1; i <= r; i++) {
x sub = l - i;
ans *= sub;
ans /= i;
}
return(ans);
}
template <class x> x dig_sum(x num) { // 各桁の総和
x ans = 0;
while (num > 0) {
ans += num % 10;
num /= 10;
}
return(ans);
}
using namespace std;
int main(){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
//-----------------------------------------------------
int n;
cin >> n;
vector<int> a(n);
vector<int> t(n);
for (int i = 0; i < n; i++) {
cin >> a[i] >> t[i];
}
int max_cnt = 0;
for (int i = 0; i < n; i++) {
max_cnt = max(max_cnt, a[i] * 2);
}
for (int i = 0; i < n; i++) {
max_cnt = max({max_cnt, a[i], a[i] + t[i]});
}
cout << max_cnt << endl;
return (0);
}

ステータス

項目 データ
問題 1266 - いちご (Strawberry)
ユーザー名 ei2134
投稿日時 2022-10-14 17:45:47
言語 C++17
状態 Accepted
得点 100
ソースコード長 1819 Byte
最大実行時間 45 ms
最大メモリ使用量 1564 KB

セット

セット 得点 Cases
1 ALL 100 / 100 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
01-01.txt AC 20 ms 604 KB
1
01-02.txt AC 27 ms 688 KB
1
01-03.txt AC 19 ms 512 KB
1
01-04.txt AC 17 ms 460 KB
1
01-05.txt AC 21 ms 540 KB
1
01-06.txt AC 20 ms 616 KB
1
01-07.txt AC 21 ms 572 KB
1
01-08.txt AC 21 ms 656 KB
1
01-09.txt AC 21 ms 612 KB
1
01-10.txt AC 35 ms 1348 KB
1
01-11.txt AC 24 ms 1160 KB
1
01-12.txt AC 27 ms 1420 KB
1
01-13.txt AC 33 ms 1288 KB
1
01-14.txt AC 32 ms 1192 KB
1
01-15.txt AC 31 ms 1392 KB
1
01-16.txt AC 22 ms 944 KB
1
01-17.txt AC 29 ms 1036 KB
1
01-18.txt AC 22 ms 648 KB
1
01-19.txt AC 28 ms 1260 KB
1
01-20.txt AC 37 ms 1416 KB
1
01-21.txt AC 26 ms 712 KB
1
01-22.txt AC 30 ms 628 KB
1
01-23.txt AC 34 ms 1216 KB
1
01-24.txt AC 32 ms 1396 KB
1
01-25.txt AC 34 ms 1460 KB
1
01-26.txt AC 36 ms 1520 KB
1
01-27.txt AC 29 ms 1452 KB
1
01-28.txt AC 41 ms 1392 KB
1
01-29.txt AC 41 ms 1456 KB
1
01-30.txt AC 33 ms 1392 KB
1
01-31.txt AC 37 ms 1328 KB
1
01-32.txt AC 26 ms 1384 KB
1
01-33.txt AC 43 ms 1448 KB
1
01-34.txt AC 34 ms 1504 KB
1
01-35.txt AC 32 ms 1440 KB
1
01-36.txt AC 42 ms 1372 KB
1
01-37.txt AC 32 ms 1564 KB
1
01-38.txt AC 33 ms 1496 KB
1
01-39.txt AC 45 ms 1564 KB
1
01-40.txt AC 34 ms 1500 KB
1
01-41.txt AC 33 ms 1436 KB
1
01-42.txt AC 35 ms 1500 KB
1
01-43.txt AC 41 ms 1556 KB
1
sample-01.txt AC 23 ms 588 KB
1
sample-02.txt AC 26 ms 668 KB
1
sample-03.txt AC 25 ms 624 KB
1