# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
124770 | 2019-07-03T22:24:43 Z | Touubs | CATS (NOI14_cats) | C++17 | 48 ms | 432 KB |
#include <bits/stdc++.h> using namespace std; #define dout if(false) cout void testcase() { int X, L, N; cin >> X >> L >> N; int level = L/(2*N) + 1; dout << level << endl; int flips = 0; int counterPerIter = 1 << level; int flipPerIter = 2 * counterPerIter - 1; int iterations = X / counterPerIter; flips += iterations * flipPerIter; X = X % counterPerIter; dout << counterPerIter << endl; dout << flipPerIter << endl; cout << 0/0; while (counterPerIter > 0 && X != 0) { dout << counterPerIter << endl; dout << flipPerIter << endl; dout << flips << endl << endl; if (counterPerIter <= X) { X -= counterPerIter; flips += flipPerIter; } else { flips++; } counterPerIter = counterPerIter >> 1; flipPerIter = flipPerIter >> 1; level--; } dout << endl << flips << endl; int min = (L/(2*N) + 1) * (2*N); cout << (min | (flips & 1)) << endl; dout << flips << "\n"; } signed main() { int Q; cin >> Q; for (int i = 0; i < Q; i++) { testcase(); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 11 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 48 ms | 432 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 376 KB | Execution killed with signal 8 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |