Submission #65356


ソースコード

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
#include<bits/stdc++.h> //hoj-imos いもす法 やればできる!
#define lol long long
using namespace std;
int main(){
lol n,l,r,imos[200099]={};
cin>>n;
string s;
for(lol i=0;i<n;i++){
cin>>l>>r>>s;
l+=100000;
r+=100000;
if(s=="+"){
imos[l]++;
imos[r+1]--;
}else{
imos[l]--;
imos[r+1]++;
}
}
lol sum=LONG_LONG_MIN,now=0;
for(lol i=0;i<200098;i++){
imos[i+1]+=imos[i];
sum=max(sum,imos[i]);
}
cout<<sum<<"\n";
return(0);
} //0000000000 00+100000-10 これを累積和すれば、、、→ 0011111100 となる!

ステータス

項目 データ
問題 0974 - 場のポテンシャル
ユーザー名 ei2038
投稿日時 2021-01-22 17:47:45
言語 C++17
状態 Accepted
得点 10
ソースコード長 704 Byte
最大実行時間 83 ms
最大メモリ使用量 2208 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample01 AC 31 ms 2136 KB
1
input-sample02 AC 28 ms 1952 KB
1
input01 AC 47 ms 2032 KB
1
input02 AC 64 ms 1984 KB
1
input03 AC 66 ms 2060 KB
1
input04 AC 55 ms 2128 KB
1
input05 AC 29 ms 2080 KB
1
input06 AC 55 ms 2156 KB
1
input07 AC 20 ms 2108 KB
1
input08 AC 36 ms 2064 KB
1
input09 AC 64 ms 2012 KB
1
input10 AC 36 ms 2080 KB
1
input11 AC 32 ms 2028 KB
1
input12 AC 20 ms 1976 KB
1
input13 AC 30 ms 2056 KB
1
input14 AC 76 ms 2132 KB
1
input15 AC 55 ms 2208 KB
1
input16 AC 43 ms 2152 KB
1
input17 AC 71 ms 2104 KB
1
input18 AC 73 ms 2056 KB
1
input19 AC 80 ms 2136 KB
1
input20 AC 83 ms 2084 KB
1
input21 AC 75 ms 2156 KB
1
input22 AC 23 ms 2108 KB
1
input23 AC 24 ms 2180 KB
1