Submission #42228
ソースコード
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 | #include<bits/stdc++.h> using namespace std; #define S 100000 int sum[200009]; int main(){ int n; int ans=0; cin>>n; for ( int i=0;i<n;i++){ int l,r; char t; cin>>l>>r>>t; if (t== '+' ){ sum[l+S]++; sum[r+1+S]--; } else if (t== '-' ){ sum[l+S]--; sum[r+1+S]++; } } for ( int i=1;i<=2*S;i++){ sum[i]=sum[i]+sum[i-1]; ans=max(ans,sum[i]); } ans=max(ans,sum[0]); cout<<ans<<endl; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0974 - 場のポテンシャル |
ユーザー名 | r1705 |
投稿日時 | 2018-08-29 12:11:25 |
言語 | C++11 |
状態 | Accepted |
得点 | 10 |
ソースコード長 | 491 Byte |
最大実行時間 | 74 ms |
最大メモリ使用量 | 1492 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 10 / 10 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
input-sample01 | AC | 26 ms | 1248 KB |
1
|
input-sample02 | AC | 22 ms | 1212 KB |
1
|
input01 | AC | 52 ms | 1296 KB |
1
|
input02 | AC | 49 ms | 1264 KB |
1
|
input03 | AC | 56 ms | 1232 KB |
1
|
input04 | AC | 56 ms | 1328 KB |
1
|
input05 | AC | 40 ms | 1284 KB |
1
|
input06 | AC | 40 ms | 1248 KB |
1
|
input07 | AC | 23 ms | 1208 KB |
1
|
input08 | AC | 32 ms | 1300 KB |
1
|
input09 | AC | 60 ms | 1392 KB |
1
|
input10 | AC | 34 ms | 1356 KB |
1
|
input11 | AC | 31 ms | 1316 KB |
1
|
input12 | AC | 21 ms | 1284 KB |
1
|
input13 | AC | 27 ms | 1252 KB |
1
|
input14 | AC | 67 ms | 1472 KB |
1
|
input15 | AC | 53 ms | 1312 KB |
1
|
input16 | AC | 48 ms | 1400 KB |
1
|
input17 | AC | 64 ms | 1492 KB |
1
|
input18 | AC | 61 ms | 1320 KB |
1
|
input19 | AC | 74 ms | 1280 KB |
1
|
input20 | AC | 70 ms | 1244 KB |
1
|
input21 | AC | 72 ms | 1340 KB |
1
|
input22 | AC | 20 ms | 1300 KB |
1
|
input23 | AC | 22 ms | 1396 KB |
1
|