# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1072698 | 2024-08-24T03:01:52 Z | Cyanberry | Minerals (JOI19_minerals) | C++14 | 1 ms | 344 KB |
#include <bits/stdc++.h> using namespace std; #include "minerals.h" void Solve(int types) { bool side[types * 2]; int sT[types], sF[types], relT[types], relF[types], match[types * 2]; for (int i=0; i<types * 2; ++i) { side[i] = false; match[i] = 0; } int last = 0, sTc = 0, sFc = 0; for (int i=0; i<types * 2; ++i) { int curr = Query(i+1); if (curr > last) { ++last; sT[sTc] = i+1; ++sTc; side[i] = true; } else { sF[sFc] = i+1; ++sFc; } } bool inside[types]; for (int i =0; i < types; ++i) { inside[i] = true; } for (int i = log2(types) + 1; i >= 0; --i) { for (int i : match) { cout<<i<<' '; } cout<<'\n'; for (int j = 0; j < types; ++j) { if (((sT[j] & (1<<i)) > 0) == inside[j]) { last = Query(sT[j]); inside[j] = !inside[j]; } } for (int j =0; j < types; ++j) { int curr = Query(sF[j]); if (curr != last) { match[sF[j]-1] |= (1<<i); last = curr; } } } for (int i = 0; i < types * 2; ++i) { if (match[i] > 0) { Answer(i, match[i]-1); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 | Halted | 0 ms | 0 KB | - |