# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
149254 | 2019-09-01T06:04:11 Z | =SUM(D1:D9)(#3629, ydk1104, stet_stet, Hyperbolic) | Bulb Game (FXCUP4_bulb) | C++17 | 1000 ms | 376 KB |
#include "bulb.h" int FindWinner(int T, std::vector<int> R, std::vector<int> L){ int N = L.size(); int now = 0; std::vector<int> v; while(R[now]>=0){ v.push_back(L[now]); now = R[now]; } v.push_back(L[now]); if(R[now] == -2) return 0; int cnt=0; for(auto &i : v){ int check = 1; while(R[i] >= 0){ int temp = L[i]; while(R[temp]>=0) temp = R[temp]; if(R[temp] == -1) check=0; i = R[i]; } int temp = L[i]; while(R[temp]>=0) temp = R[temp]; if(R[temp]==-1) check=0; if(R[i] == -2 && check) return 0; if(R[i] == -2) cnt++; } if(cnt>1) return 0; return 1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Execution timed out | 1095 ms | 348 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Execution timed out | 1095 ms | 348 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Execution timed out | 1095 ms | 348 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |