Submission #44737
ソースコード
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 | #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cassert> #include <climits> #include <algorithm> #include <string> #include <sstream> #include <complex> #include <vector> #include <list> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include <fstream> using namespace std; #define TOSTRING(x) #x #define SZ(x) (int)(x).size() #define REP(i,n) for(int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REPR(i,n) for(int i=(n)-1;i>=0;i--) #define ALL(s) (s).begin(), (s).end() #define so(V) sort(ALL(V)) #define rev(V) reverse(ALL(V)) #define uni(v) v.erase( unique(ALL(v)) , v.end()); #define PAU system("pause") typedef long long unsigned int llu; typedef long long ll; typedef vector< int > vi; typedef vector<ll> vll; typedef vector< bool > vb; typedef vector<vi> vvi; typedef vector<vll> vvll; typedef vector<vb> vvb; const double EPS = 1e-9; const int MOD = 1e9 + 7; const int INF = (1 << 28); const double PI = acos (-1); int main() { cin.tie(0); ios::sync_with_stdio( false ); int N; cin >> N; vi Imos(200005); REP(i, N) { int l, r; cin >> l >> r; l += 100000; r += 100000; char type; cin >> type; if (type == '+' ) { Imos[l]++; Imos[r + 1]--; } else { Imos[l]--; Imos[r + 1]++; } } int ans = 0; int sum = 0; REP(i, 200005) { sum += Imos[i]; ans = max(ans, sum); } cout << ans << endl; PAU; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0974 - 場のポテンシャル |
ユーザー名 | Daylight |
投稿日時 | 2018-11-12 21:09:12 |
言語 | C++11 |
状態 | Accepted |
得点 | 10 |
ソースコード長 | 1517 Byte |
最大実行時間 | 87 ms |
最大メモリ使用量 | 20484 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 10 / 10 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
input-sample01 | AC | 51 ms | 1484 KB |
1
|
input-sample02 | AC | 28 ms | 1512 KB |
1
|
input01 | AC | 56 ms | 2312 KB |
1
|
input02 | AC | 86 ms | 3484 KB |
1
|
input03 | AC | 34 ms | 4784 KB |
1
|
input04 | AC | 87 ms | 5964 KB |
1
|
input05 | AC | 65 ms | 6120 KB |
1
|
input06 | AC | 50 ms | 6904 KB |
1
|
input07 | AC | 22 ms | 7056 KB |
1
|
input08 | AC | 28 ms | 7468 KB |
1
|
input09 | AC | 68 ms | 8764 KB |
1
|
input10 | AC | 28 ms | 9056 KB |
1
|
input11 | AC | 66 ms | 9340 KB |
1
|
input12 | AC | 23 ms | 9612 KB |
1
|
input13 | AC | 32 ms | 9632 KB |
1
|
input14 | AC | 68 ms | 11188 KB |
1
|
input15 | AC | 31 ms | 12100 KB |
1
|
input16 | AC | 25 ms | 12640 KB |
1
|
input17 | AC | 72 ms | 14064 KB |
1
|
input18 | AC | 35 ms | 15500 KB |
1
|
input19 | AC | 45 ms | 17188 KB |
1
|
input20 | AC | 34 ms | 18872 KB |
1
|
input21 | AC | 34 ms | 20428 KB |
1
|
input22 | AC | 21 ms | 20444 KB |
1
|
input23 | AC | 21 ms | 20484 KB |
1
|