Submission #00047
ソースコード
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 | //#define _GLIBCXX_DEBUG #include<bits/stdc++.h> using namespace std; template < class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true ); } template < class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true ); } typedef long long ll; typedef vector< int > vint; typedef pair< int , int > pint; typedef vector< long long > vlong; typedef vector<string> vstring; #define vpush(a,x) a.push_back(x); #define rep(i, n) REP(i, 0, n) #define all(v) v.begin(), v.end() #define REP(i, x, n) for(int i = x; i < n; i++) const int INF = 1 << 30; const int dx[] = {1,0,-1,0,1,1,-1,-1}; const int dy[] = {0,-1,0,1,1,-1,-1,1}; #define stp(x) setprecision(x) const long double PI=3.14159265358979323846264338327950; int main(){ cin.tie(nullptr); ios::sync_with_stdio( false ); int n; cin>>n; vlong a(n); rep(i,n){ cin>>a[i]; } map< int , int > M; int cnt=0,fg=0,now=0; rep(i,n){ if (now>a[i]){ M[now]--; } if (now<a[i]){ M[now]++; } now=a[i]; } int max=0; for (auto x:M){ cnt+=x.second; // cout<<cnt<<'\n'; chmax(max,cnt); } if (a[0]==0){ max--; } cout<<max<< '\n' ; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0004 - 日本沈没 (Japan Sinks) |
ユーザー名 | ei1918 |
投稿日時 | 2020-12-08 17:37:10 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 1248 Byte |
最大実行時間 | 73 ms |
最大メモリ使用量 | 6200 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 | 17 ms | 600 KB |
1
|
2
|
3
|
01-02.txt | AC | 17 ms | 428 KB |
1
|
2
|
3
|
01-03.txt | WA | 20 ms | 516 KB |
1
|
2
|
3
|
01-04.txt | AC | 27 ms | 592 KB |
1
|
2
|
3
|
01-05.txt | WA | 20 ms | 528 KB |
1
|
2
|
3
|
01-06.txt | WA | 16 ms | 592 KB |
1
|
2
|
3
|
01-07.txt | WA | 18 ms | 652 KB |
1
|
2
|
3
|
01-08.txt | WA | 35 ms | 652 KB |
1
|
2
|
3
|
01-09.txt | WA | 28 ms | 712 KB |
1
|
2
|
3
|
01-10.txt | AC | 20 ms | 680 KB |
1
|
2
|
3
|
01-11.txt | AC | 21 ms | 648 KB |
1
|
2
|
3
|
01-12.txt | WA | 24 ms | 580 KB |
1
|
2
|
3
|
01-13.txt | WA | 16 ms | 516 KB |
1
|
2
|
3
|
01-14.txt | WA | 24 ms | 580 KB |
1
|
2
|
3
|
01-15.txt | AC | 20 ms | 636 KB |
1
|
2
|
3
|
01-16.txt | WA | 32 ms | 572 KB |
1
|
2
|
3
|
02-01.txt | AC | 18 ms | 536 KB |
2
|
3
|
|
02-02.txt | AC | 22 ms | 624 KB |
2
|
3
|
|
02-03.txt | WA | 24 ms | 584 KB |
2
|
3
|
|
02-04.txt | WA | 27 ms | 656 KB |
2
|
3
|
|
02-05.txt | AC | 17 ms | 628 KB |
2
|
3
|
|
02-06.txt | AC | 15 ms | 568 KB |
2
|
3
|
|
02-07.txt | AC | 27 ms | 504 KB |
2
|
3
|
|
02-08.txt | WA | 17 ms | 572 KB |
2
|
3
|
|
02-09.txt | AC | 21 ms | 636 KB |
2
|
3
|
|
02-10.txt | WA | 28 ms | 696 KB |
2
|
3
|
|
03-01.txt | WA | 25 ms | 1212 KB |
3
|
||
03-02.txt | WA | 26 ms | 1512 KB |
3
|
||
03-03.txt | WA | 28 ms | 1448 KB |
3
|
||
03-04.txt | WA | 21 ms | 1384 KB |
3
|
||
03-05.txt | WA | 28 ms | 1444 KB |
3
|
||
03-06.txt | WA | 32 ms | 1500 KB |
3
|
||
03-07.txt | WA | 36 ms | 1900 KB |
3
|
||
03-08.txt | WA | 48 ms | 4436 KB |
3
|
||
03-09.txt | WA | 56 ms | 6144 KB |
3
|
||
03-10.txt | WA | 44 ms | 6128 KB |
3
|
||
03-11.txt | AC | 46 ms | 6116 KB |
3
|
||
03-12.txt | AC | 27 ms | 1364 KB |
3
|
||
03-13.txt | AC | 23 ms | 1424 KB |
3
|
||
03-14.txt | WA | 40 ms | 1492 KB |
3
|
||
03-15.txt | WA | 29 ms | 1428 KB |
3
|
||
03-16.txt | WA | 32 ms | 1492 KB |
3
|
||
03-17.txt | WA | 40 ms | 1544 KB |
3
|
||
03-18.txt | WA | 40 ms | 1944 KB |
3
|
||
03-19.txt | WA | 53 ms | 4484 KB |
3
|
||
03-20.txt | WA | 73 ms | 6200 KB |
3
|
||
sample-01.txt | AC | 20 ms | 816 KB | |||
sample-02.txt | AC | 17 ms | 776 KB | |||
sample-03.txt | AC | 25 ms | 728 KB |