Submission #41957


ソースコード

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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <cstring>
#include <algorithm>
#include <vector>
//#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <map>
#include <numeric>
using namespace std;
#define elif else if
#define echo cout <<
#define read cin >>
#define fin << '\n'
#define finn cout << '\n'
#define forin(i, n) for ( int i = 0; i < n; i++ )
#define unless(flg) if(!(flg))
#define zu >>
#define und <<
#define alles(obj) obj.begin(), obj.end()
#define bash push_back
#define makePair make_pair
// type-define
#define String string
#define Stack stack
#define Queue queue
#define pQueue priority_queue
#define Vector vector
#define Pair pair
#define Map map
typedef long long llong;
typedef bool boolean;
typedef Pair<int,int> Pii;
typedef Vector<int> Vi;
// utils
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
boolean canMove(int x,int y,int w,int h){return (x>=0&&y>=0&&x<w&&y<h);};
const int INF = 1 << 29;
int hoge[200200];
int main(){
cin.tie(0); ios::sync_with_stdio(false);
int n;
read n;
for ( int i = 0; i < n; i++ ) {
int l, r;
char type;
read l >> r >> type;
r += 100000;
l += 100000;
if ( type == '+' ) {
hoge[l]++;
hoge[r+1]--;
}
else {
hoge[l]--;
hoge[r+1]++;
}
}
int maxv = 0;
int tmp = 0;
for ( int i = 0; i < 200100; i++ ) {
tmp += hoge[i];
maxv = max(maxv, tmp);
}
echo maxv fin;
return 0;
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample01 AC 28 ms 480 KB
1
input-sample02 AC 19 ms 432 KB
1
input01 AC 24 ms 1156 KB
1
input02 AC 34 ms 1236 KB
1
input03 AC 37 ms 1308 KB
1
input04 AC 30 ms 1380 KB
1
input05 AC 19 ms 1324 KB
1
input06 AC 27 ms 1396 KB
1
input07 AC 29 ms 1340 KB
1
input08 AC 29 ms 1288 KB
1
input09 AC 37 ms 1360 KB
1
input10 AC 29 ms 1432 KB
1
input11 AC 24 ms 1248 KB
1
input12 AC 25 ms 1324 KB
1
input13 AC 21 ms 1268 KB
1
input14 AC 36 ms 1340 KB
1
input15 AC 28 ms 1408 KB
1
input16 AC 27 ms 1352 KB
1
input17 AC 31 ms 1420 KB
1
input18 AC 31 ms 1364 KB
1
input19 AC 32 ms 544 KB
1
input20 AC 34 ms 624 KB
1
input21 AC 41 ms 700 KB
1
input22 AC 32 ms 656 KB
1
input23 AC 24 ms 620 KB
1