Submission #10301888
Source Code Expand
#include <iostream> #include <queue> #include <map> #include <set> #include <algorithm> using namespace std; typedef long long ll; typedef __int128 lll; constexpr ll mod = 1000000007; int main() { int n,m,x,y,c[100001],p[100001]; for(int i = 0;i < 100001;i++) { c[i] = 1; p[i] = 0; } p[1] = 1; cin >> n >> m; for(int i = 0;i < m;i++) { cin >> x >> y; if(p[x]) { p[y]++; if(c[x] == 1) p[x] = 0; } c[x]--; c[y]++; } int r = 0; for(auto e:p) if(e) r++; cout << r << endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Box and Ball |
User | linare |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 625 Byte |
Status | AC |
Exec Time | 71 ms |
Memory | 1024 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 2 ms | 1024 KB |
0_01.txt | AC | 2 ms | 1024 KB |
0_02.txt | AC | 2 ms | 1024 KB |
1_00.txt | AC | 2 ms | 1024 KB |
1_01.txt | AC | 2 ms | 1024 KB |
1_02.txt | AC | 2 ms | 1024 KB |
1_03.txt | AC | 2 ms | 1024 KB |
1_04.txt | AC | 54 ms | 1024 KB |
1_05.txt | AC | 71 ms | 1024 KB |
1_06.txt | AC | 54 ms | 1024 KB |
1_07.txt | AC | 70 ms | 1024 KB |
1_08.txt | AC | 44 ms | 1024 KB |
1_09.txt | AC | 47 ms | 1024 KB |
1_10.txt | AC | 14 ms | 1024 KB |
1_11.txt | AC | 26 ms | 1024 KB |
1_12.txt | AC | 3 ms | 1024 KB |
1_13.txt | AC | 59 ms | 1024 KB |
1_14.txt | AC | 31 ms | 1024 KB |
1_15.txt | AC | 52 ms | 1024 KB |
1_16.txt | AC | 3 ms | 1024 KB |
1_17.txt | AC | 71 ms | 1024 KB |
1_18.txt | AC | 63 ms | 1024 KB |
1_19.txt | AC | 68 ms | 1024 KB |
1_20.txt | AC | 62 ms | 1024 KB |
1_21.txt | AC | 55 ms | 1024 KB |
1_22.txt | AC | 70 ms | 1024 KB |
1_23.txt | AC | 19 ms | 1024 KB |