Submission #3006431
Source Code Expand
#include<iostream> #include<algorithm> #include<math.h> #include<set> #include<vector> #include<map> #include<functional> #include<iomanip> #include<queue> #include<random> #include<numeric> #include<string> #include<stack> #include<cstring> typedef long long ll; typedef long double ld; using namespace std; ll dx[] = { 0,0,1,-1 }; ll dy[] = { 1,-1,0,0 }; ll gcd(ll a, ll b) { if (a<b) { return gcd(b, a); } else if (a%b) { return gcd(b, a%b); } else { return b; } } ll lcm(ll a, ll b) { return a / gcd(a, b)*b; } int main() { ll table[200001]; ll N, M; cin >> N >> M; for (ll i = 0; i < N; i++) { table[i] = 0; } for (ll i = 0; i < M; i++) { ll l, r; cin >> l >> r; l--; r--; table[l]++; table[r+1]--; } for (ll i = 0; i < N; i++) { if (i > 0) table[i] += table[i - 1]; } for (ll i = 0; i < N; i++) { if (table[i] % 2 == 0) cout << 0; else cout << 1; } cout << "" << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - オセロ |
User | sintan |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 979 Byte |
Status | AC |
Exec Time | 131 ms |
Memory | 2048 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 60 / 60 | 40 / 40 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt |
Subtask1 | 00_example_01.txt, 00_example_02.txt, 10_small_01.txt, 10_small_02.txt, 10_small_03.txt, 10_small_04.txt, 10_small_05.txt, 10_small_06.txt, 10_small_07.txt, 10_small_08.txt, 10_small_09.txt, 10_small_10.txt |
All | 00_example_01.txt, 00_example_02.txt, 10_small_01.txt, 10_small_02.txt, 10_small_03.txt, 10_small_04.txt, 10_small_05.txt, 10_small_06.txt, 10_small_07.txt, 10_small_08.txt, 10_small_09.txt, 10_small_10.txt, 20_rand_01.txt, 20_rand_02.txt, 20_rand_03.txt, 20_rand_04.txt, 20_rand_05.txt, 20_rand_06.txt, 20_rand_07.txt, 20_rand_08.txt, 20_rand_09.txt, 20_rand_10.txt, 30_max_01.txt, 30_max_02.txt, 30_max_03.txt, 30_max_04.txt, 30_max_05.txt, 40_corner_01.txt, 40_corner_02.txt, 40_corner_03.txt, 40_corner_04.txt, 40_corner_05.txt, 40_corner_06.txt, 40_corner_07.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 1 ms | 256 KB |
00_example_02.txt | AC | 1 ms | 256 KB |
10_small_01.txt | AC | 1 ms | 256 KB |
10_small_02.txt | AC | 1 ms | 256 KB |
10_small_03.txt | AC | 1 ms | 256 KB |
10_small_04.txt | AC | 1 ms | 256 KB |
10_small_05.txt | AC | 1 ms | 256 KB |
10_small_06.txt | AC | 1 ms | 256 KB |
10_small_07.txt | AC | 1 ms | 256 KB |
10_small_08.txt | AC | 1 ms | 256 KB |
10_small_09.txt | AC | 1 ms | 256 KB |
10_small_10.txt | AC | 1 ms | 256 KB |
20_rand_01.txt | AC | 52 ms | 640 KB |
20_rand_02.txt | AC | 13 ms | 384 KB |
20_rand_03.txt | AC | 8 ms | 1280 KB |
20_rand_04.txt | AC | 30 ms | 512 KB |
20_rand_05.txt | AC | 13 ms | 256 KB |
20_rand_06.txt | AC | 30 ms | 768 KB |
20_rand_07.txt | AC | 8 ms | 1280 KB |
20_rand_08.txt | AC | 3 ms | 384 KB |
20_rand_09.txt | AC | 18 ms | 256 KB |
20_rand_10.txt | AC | 9 ms | 384 KB |
30_max_01.txt | AC | 113 ms | 2048 KB |
30_max_02.txt | AC | 107 ms | 2048 KB |
30_max_03.txt | AC | 107 ms | 2048 KB |
30_max_04.txt | AC | 107 ms | 2048 KB |
30_max_05.txt | AC | 107 ms | 2048 KB |
40_corner_01.txt | AC | 60 ms | 256 KB |
40_corner_02.txt | AC | 103 ms | 2048 KB |
40_corner_03.txt | AC | 102 ms | 2048 KB |
40_corner_04.txt | AC | 131 ms | 2048 KB |
40_corner_05.txt | AC | 79 ms | 2048 KB |
40_corner_06.txt | AC | 63 ms | 256 KB |
40_corner_07.txt | AC | 102 ms | 2048 KB |