Submission #41942


ソースコード

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
#include <iostream>
using namespace std;
static constexpr int L = -100'000;
static constexpr int R = +100'000;
int _imos[200'100];
int* imos = _imos + 100'005; //添字に負の数を使えるように
int main()
{
cin.tie(0), ios::sync_with_stdio(false);
int N;
cin >> N;
for (int i=0; i<N; ++i) {
int l, r;
char type;
cin >> l >> r >> type;
if (type == '+') {
++imos[l];
--imos[r+1];
} else {
--imos[l];
++imos[r+1];
}
}
int maxv = 0;
for (int i=L; i <= R; ++i) {
imos[i+1] += imos[i];
maxv = max(maxv, imos[i]);
}
cout << maxv << endl;
return 0;
}

ステータス

項目 データ
問題 0974 - 場のポテンシャル
ユーザー名 Arumakan_ei1727
投稿日時 2018-08-26 23:36:49
言語 C++14
状態 Accepted
得点 10
ソースコード長 755 Byte
最大実行時間 41 ms
最大メモリ使用量 1516 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample01 AC 21 ms 1244 KB
1
input-sample02 AC 20 ms 1192 KB
1
input01 AC 27 ms 1264 KB
1
input02 AC 30 ms 1332 KB
1
input03 AC 40 ms 1408 KB
1
input04 AC 32 ms 1348 KB
1
input05 AC 24 ms 1288 KB
1
input06 AC 30 ms 1360 KB
1
input07 AC 23 ms 1304 KB
1
input08 AC 32 ms 1376 KB
1
input09 AC 32 ms 1448 KB
1
input10 AC 36 ms 1264 KB
1
input11 AC 24 ms 1340 KB
1
input12 AC 25 ms 1284 KB
1
input13 AC 20 ms 1360 KB
1
input14 AC 37 ms 1432 KB
1
input15 AC 32 ms 1372 KB
1
input16 AC 33 ms 1444 KB
1
input17 AC 32 ms 1516 KB
1
input18 AC 41 ms 1460 KB
1
input19 AC 32 ms 1280 KB
1
input20 AC 35 ms 1480 KB
1
input21 AC 28 ms 1428 KB
1
input22 AC 21 ms 1500 KB
1
input23 AC 24 ms 1448 KB
1