Submission #00054


ソースコード

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
#include <bits/stdc++.h>
#define rep(i, x, n) for(int i=(x);i<(n);i++)
#define reps(i, x, n) for(int i=(x);i<=(n);i++)
#define lol long long
#define SUM(n) ((n)+1)*(n)/2 //1〜nまでの総和を求める式
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) fixed<<setprecision(x+1) //小数点桁数を指定する
#define abs(x,y) max(x,y)-min(x,y)
#define all(v) v.begin(),v.end()
#define UPDigit(a,b) (a+b-1)/b //小数点切り上げ
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD=int(1e9)+7;
using namespace std;
using pii = pair<int, int>;
typedef vector<int> vit;
//八方向を見るのに使うと便利(楽)
const int dy[] = {0, 1, 0, -1, -1, 1, 1, -1};
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
signed main(void){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
lol a[n + 5];
set<int> st;
reps(i, 1, n){
cin >> a[i];
st.insert(a[i]);
}
int ans = 1;
for(auto x : st){
int na, su;
na = su = 0;
if(a[1] >= x){
na ++;
}
reps(i, 2, n){
if(a[i - 1] < x && a[i] >= x){
na ++;
}
}
ans = max({ans, na, su});
}
/*for(int i = n;i >= 0;i --){ //島がi個になるようにできるか調べる
}*/
cout << ans << '\n';
return 0;
}

ステータス

項目 データ
問題 0004 - 日本沈没 (Japan Sinks)
ユーザー名 NASSUN_ei1906
投稿日時 2020-12-08 17:50:06
言語 C++17
状態 Wrong Answer
得点 0
ソースコード長 1391 Byte
最大実行時間 2000 ms
最大メモリ使用量 7252 KB

セット

セット 得点 Cases
1 Subtask1 0 / 7 01-*.txt
2 Subtask2 0 / 8 0[12]-*.txt
3 Subtask 0 / 85 0[123]-*.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
01-01.txt AC 20 ms 476 KB
1
2
3
01-02.txt AC 19 ms 424 KB
1
2
3
01-03.txt AC 21 ms 504 KB
1
2
3
01-04.txt AC 18 ms 456 KB
1
2
3
01-05.txt AC 21 ms 532 KB
1
2
3
01-06.txt AC 20 ms 472 KB
1
2
3
01-07.txt AC 19 ms 540 KB
1
2
3
01-08.txt WA 28 ms 416 KB
1
2
3
01-09.txt AC 27 ms 608 KB
1
2
3
01-10.txt AC 27 ms 708 KB
1
2
3
01-11.txt AC 22 ms 680 KB
1
2
3
01-12.txt AC 25 ms 492 KB
1
2
3
01-13.txt AC 24 ms 572 KB
1
2
3
01-14.txt AC 20 ms 520 KB
1
2
3
01-15.txt AC 22 ms 592 KB
1
2
3
01-16.txt AC 34 ms 660 KB
1
2
3
02-01.txt AC 18 ms 640 KB
2
3
02-02.txt AC 21 ms 596 KB
2
3
02-03.txt AC 18 ms 556 KB
2
3
02-04.txt AC 29 ms 764 KB
2
3
02-05.txt AC 21 ms 612 KB
2
3
02-06.txt AC 15 ms 552 KB
2
3
02-07.txt AC 19 ms 624 KB
2
3
02-08.txt AC 18 ms 564 KB
2
3
02-09.txt AC 17 ms 632 KB
2
3
02-10.txt AC 22 ms 700 KB
2
3
03-01.txt AC 215 ms 1096 KB
3
03-02.txt WA 23 ms 1404 KB
3
03-03.txt AC 25 ms 1352 KB
3
03-04.txt AC 26 ms 1296 KB
3
03-05.txt AC 53 ms 1368 KB
3
03-06.txt AC 290 ms 1432 KB
3
03-07.txt TLE 2000 ms 1836 KB
3
03-08.txt TLE 2000 ms 4388 KB
3
03-09.txt TLE 2000 ms 6236 KB
3
03-10.txt TLE 2000 ms 7252 KB
3
03-11.txt TLE 2000 ms 6220 KB
3
03-12.txt AC 24 ms 1352 KB
3
03-13.txt AC 32 ms 1296 KB
3
03-14.txt AC 31 ms 1368 KB
3
03-15.txt AC 41 ms 1436 KB
3
03-16.txt AC 52 ms 1512 KB
3
03-17.txt AC 255 ms 1452 KB
3
03-18.txt TLE 2000 ms 1988 KB
3
03-19.txt TLE 2000 ms 4280 KB
3
03-20.txt TLE 2000 ms 6004 KB
3
sample-01.txt AC 24 ms 620 KB
sample-02.txt AC 19 ms 576 KB
sample-03.txt AC 20 ms 660 KB