# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
794729 | 2023-07-26T20:14:45 Z | AbdullahMohammedAhmad | Minerals (JOI19_minerals) | C++14 | 244 ms | 584 KB |
#include "minerals.h" #include <bits/stdc++.h> using namespace std; void Solve(int N) { deque<int> in; deque<int> order; int prev_ans = 0, ans = 0; for(int i = 1; i <= 2*N; i++){order.push_back(i);} while(!order.empty()) { ans = prev_ans = in.size(); in.push_back(order.front()); ans = Query(order.front()); order.pop_front(); if(ans != prev_ans){continue;} vector<int> toput; while(true) { prev_ans = ans; int now = in.front(); ans = Query(now); in.pop_front(); if(ans != prev_ans) { toput.push_back(now); } else { Query(in.back()); Answer(now, in.back()); in.pop_back(); break; } } if(toput.empty()){continue;} int dist = (int)order.size()/(int)toput.size(); int idx = dist; for(int i = 0; i < toput.size(); i++) { if(idx >= order.size()-1) { order.push_back(toput[i]); idx+=dist; continue; } order.insert(order.begin()+idx, toput[i]); idx+=dist; } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 336 KB | Output is correct |
2 | Correct | 11 ms | 400 KB | Output is correct |
3 | Correct | 51 ms | 476 KB | Output is correct |
4 | Incorrect | 244 ms | 584 KB | Wrong Answer [2] |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 336 KB | Output is correct |
6 | Correct | 11 ms | 400 KB | Output is correct |
7 | Correct | 51 ms | 476 KB | Output is correct |
8 | Incorrect | 244 ms | 584 KB | Wrong Answer [2] |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 336 KB | Output is correct |
6 | Correct | 11 ms | 400 KB | Output is correct |
7 | Correct | 51 ms | 476 KB | Output is correct |
8 | Incorrect | 244 ms | 584 KB | Wrong Answer [2] |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 336 KB | Output is correct |
6 | Correct | 11 ms | 400 KB | Output is correct |
7 | Correct | 51 ms | 476 KB | Output is correct |
8 | Incorrect | 244 ms | 584 KB | Wrong Answer [2] |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 336 KB | Output is correct |
6 | Correct | 11 ms | 400 KB | Output is correct |
7 | Correct | 51 ms | 476 KB | Output is correct |
8 | Incorrect | 244 ms | 584 KB | Wrong Answer [2] |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 336 KB | Output is correct |
6 | Correct | 11 ms | 400 KB | Output is correct |
7 | Correct | 51 ms | 476 KB | Output is correct |
8 | Incorrect | 244 ms | 584 KB | Wrong Answer [2] |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 336 KB | Output is correct |
6 | Correct | 11 ms | 400 KB | Output is correct |
7 | Correct | 51 ms | 476 KB | Output is correct |
8 | Incorrect | 244 ms | 584 KB | Wrong Answer [2] |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 3 ms | 336 KB | Output is correct |
6 | Correct | 11 ms | 400 KB | Output is correct |
7 | Correct | 51 ms | 476 KB | Output is correct |
8 | Incorrect | 244 ms | 584 KB | Wrong Answer [2] |
9 | Halted | 0 ms | 0 KB | - |