Submission #59268
ソースコード
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 | #include <bits/stdc++.h> #define F first #define S second #define MP make_pair #define pb push_back #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define LCM(a, b) (a) / __gcd((a), (b)) * (b) #define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0) #define ln '\n' using namespace std; using LL = long long ; using ldouble = long double ; using P = pair< int , int >; using LP = pair<LL, LL>; static const int INF = INT_MAX; static const LL LINF = LLONG_MAX; static const int MIN = INT_MIN; static const LL LMIN = LLONG_MIN; static const int MOD = 1e9 + 7; static const int SIZE = 200005; const int dx[] = {0, -1, 1, 0}; const int dy[] = {-1, 0, 0, 1}; vector<LL> Div(LL n) { vector<LL> ret; for (LL i = 1; i * i <= n; ++i) { if (n % i == 0) { ret.pb(i); if (i * i != n) ret.pb(n / i); } } sort(all(ret)); return ret; } int main() { ios::sync_with_stdio( false ); cin.tie(0); int N; cin >> N; int imos[SIZE] = {}; while (N--) { int l, r; char type; cin >> l >> r >> type; l += 100000; r += 100000; if (type == '+' ) imos[l]++, imos[r + 1]--; else imos[l]--, imos[r + 1]++; } int now = 0, res = 0; for ( int i = 0; i <= 200000; ++i) { now += imos[i]; res = max(now, res); } cout << res << endl; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0974 - 場のポテンシャル |
ユーザー名 | crom |
投稿日時 | 2020-05-05 05:41:10 |
言語 | C++14 |
状態 | Accepted |
得点 | 10 |
ソースコード長 | 1454 Byte |
最大実行時間 | 106 ms |
最大メモリ使用量 | 20304 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 10 / 10 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
input-sample01 | AC | 36 ms | 1372 KB |
1
|
input-sample02 | AC | 21 ms | 1196 KB |
1
|
input01 | AC | 48 ms | 2168 KB |
1
|
input02 | AC | 83 ms | 3264 KB |
1
|
input03 | AC | 40 ms | 4612 KB |
1
|
input04 | AC | 106 ms | 5704 KB |
1
|
input05 | AC | 60 ms | 5908 KB |
1
|
input06 | AC | 50 ms | 6620 KB |
1
|
input07 | AC | 23 ms | 6688 KB |
1
|
input08 | AC | 35 ms | 7276 KB |
1
|
input09 | AC | 59 ms | 8496 KB |
1
|
input10 | AC | 33 ms | 8948 KB |
1
|
input11 | AC | 45 ms | 9276 KB |
1
|
input12 | AC | 22 ms | 9348 KB |
1
|
input13 | AC | 26 ms | 9420 KB |
1
|
input14 | AC | 68 ms | 10776 KB |
1
|
input15 | AC | 37 ms | 11868 KB |
1
|
input16 | AC | 28 ms | 12452 KB |
1
|
input17 | AC | 65 ms | 13928 KB |
1
|
input18 | AC | 37 ms | 15404 KB |
1
|
input19 | AC | 64 ms | 17140 KB |
1
|
input20 | AC | 33 ms | 18624 KB |
1
|
input21 | AC | 38 ms | 20232 KB |
1
|
input22 | AC | 33 ms | 20304 KB |
1
|
input23 | AC | 24 ms | 20248 KB |
1
|