# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1072713 | 2024-08-24T03:15:40 Z | Cyanberry | Minerals (JOI19_minerals) | C++14 | 15 ms | 2136 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], limits[types * 2]; for (int i=0; i<types * 2; ++i) { side[i] = false; match[i] = 0; } int last = 0, sTc = 0, sFc = 0, maxi = 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; maxi = i; } else { sF[sFc] = i+1; ++sFc; limits[i] = sTc; } } bool inside[types]; for (int i =0; i < types; ++i) { inside[i] = true; } for (int i = log2(maxi) + 1; i >= 0; --i) { // for (int i : match) { // cerr<<i<<' '; // } // cerr<<'\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) { if (j > limits[sF[j]-1]) continue; 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+1, match[i]); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 1 ms | 344 KB | Output is correct |
3 | Correct | 1 ms | 600 KB | Output is correct |
4 | Correct | 4 ms | 856 KB | Output is correct |
5 | Correct | 5 ms | 1064 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 600 KB | Output is correct |
8 | Correct | 4 ms | 856 KB | Output is correct |
9 | Correct | 5 ms | 1064 KB | Output is correct |
10 | Correct | 1 ms | 344 KB | Output is correct |
11 | Correct | 4 ms | 936 KB | Output is correct |
12 | Correct | 7 ms | 1064 KB | Output is correct |
13 | Correct | 5 ms | 1112 KB | Output is correct |
14 | Correct | 4 ms | 1112 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 600 KB | Output is correct |
8 | Correct | 4 ms | 856 KB | Output is correct |
9 | Correct | 5 ms | 1064 KB | Output is correct |
10 | Correct | 1 ms | 344 KB | Output is correct |
11 | Correct | 4 ms | 936 KB | Output is correct |
12 | Correct | 7 ms | 1064 KB | Output is correct |
13 | Correct | 5 ms | 1112 KB | Output is correct |
14 | Correct | 4 ms | 1112 KB | Output is correct |
15 | Incorrect | 15 ms | 2136 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 600 KB | Output is correct |
8 | Correct | 4 ms | 856 KB | Output is correct |
9 | Correct | 5 ms | 1064 KB | Output is correct |
10 | Correct | 1 ms | 344 KB | Output is correct |
11 | Correct | 4 ms | 936 KB | Output is correct |
12 | Correct | 7 ms | 1064 KB | Output is correct |
13 | Correct | 5 ms | 1112 KB | Output is correct |
14 | Correct | 4 ms | 1112 KB | Output is correct |
15 | Incorrect | 15 ms | 2136 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 600 KB | Output is correct |
8 | Correct | 4 ms | 856 KB | Output is correct |
9 | Correct | 5 ms | 1064 KB | Output is correct |
10 | Correct | 1 ms | 344 KB | Output is correct |
11 | Correct | 4 ms | 936 KB | Output is correct |
12 | Correct | 7 ms | 1064 KB | Output is correct |
13 | Correct | 5 ms | 1112 KB | Output is correct |
14 | Correct | 4 ms | 1112 KB | Output is correct |
15 | Incorrect | 15 ms | 2136 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 600 KB | Output is correct |
8 | Correct | 4 ms | 856 KB | Output is correct |
9 | Correct | 5 ms | 1064 KB | Output is correct |
10 | Correct | 1 ms | 344 KB | Output is correct |
11 | Correct | 4 ms | 936 KB | Output is correct |
12 | Correct | 7 ms | 1064 KB | Output is correct |
13 | Correct | 5 ms | 1112 KB | Output is correct |
14 | Correct | 4 ms | 1112 KB | Output is correct |
15 | Incorrect | 15 ms | 2136 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 600 KB | Output is correct |
8 | Correct | 4 ms | 856 KB | Output is correct |
9 | Correct | 5 ms | 1064 KB | Output is correct |
10 | Correct | 1 ms | 344 KB | Output is correct |
11 | Correct | 4 ms | 936 KB | Output is correct |
12 | Correct | 7 ms | 1064 KB | Output is correct |
13 | Correct | 5 ms | 1112 KB | Output is correct |
14 | Correct | 4 ms | 1112 KB | Output is correct |
15 | Incorrect | 15 ms | 2136 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 600 KB | Output is correct |
8 | Correct | 4 ms | 856 KB | Output is correct |
9 | Correct | 5 ms | 1064 KB | Output is correct |
10 | Correct | 1 ms | 344 KB | Output is correct |
11 | Correct | 4 ms | 936 KB | Output is correct |
12 | Correct | 7 ms | 1064 KB | Output is correct |
13 | Correct | 5 ms | 1112 KB | Output is correct |
14 | Correct | 4 ms | 1112 KB | Output is correct |
15 | Incorrect | 15 ms | 2136 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |