# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
138514 | 2019-07-30T05:55:56 Z | 이온조(#3319) | Who wants to live forever? (CERC12_B) | C++14 | 2 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; char S[200009]; int main() { int T; scanf("%d",&T); while(T--) { scanf(" %s", S+1); int N = strlen(S+1), c = 1, s = 0; while(s < N) { s += c; c *= 2; } bool f = (s != N), o = 0; for(int i=1; i<=N; i++) if(S[i] == '1') o = 1; f &= o; puts(f ? "LIVES" : "DIES"); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |