답안 #1072885

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1072885 2024-08-24T06:27:17 Z HappyCapybara Minerals (JOI19_minerals) C++17
6 / 100
4 ms 344 KB
#include "minerals.h"
#include<bits/stdc++.h>
using namespace std;

void Solve(int N){
  vector<bool> done(2*N);
  int cur = 0, m = 0;
  while (cur < 2*N){
    int x = Query(cur+1);
    if (x == m+1){
      m = x;
      cur++;
      continue;
    }
    for (int i=0; i<cur; i++){
      if (done[i]) continue;
      if (i == cur-1){
        Answer(i+1, cur+1);
        done[i] = true;
        done[cur] = true;
        break;
      }
      int y = Query(i+1);
      Query(i+1);
      if (y == m){
        //cout << y+1 << " " << cur+1 << "\n";
        Answer(i+1, cur+1);
        done[i] = true;
        done[cur] = true;
        break;
      }
    }
    cur++;
  }
}
# 결과 실행 시간 메모리 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 2 ms 344 KB Output is correct
2 Incorrect 4 ms 344 KB Wrong Answer [2]
3 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 2 ms 344 KB Output is correct
6 Incorrect 4 ms 344 KB Wrong Answer [2]
7 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 2 ms 344 KB Output is correct
6 Incorrect 4 ms 344 KB Wrong Answer [2]
7 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 2 ms 344 KB Output is correct
6 Incorrect 4 ms 344 KB Wrong Answer [2]
7 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 2 ms 344 KB Output is correct
6 Incorrect 4 ms 344 KB Wrong Answer [2]
7 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 2 ms 344 KB Output is correct
6 Incorrect 4 ms 344 KB Wrong Answer [2]
7 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 2 ms 344 KB Output is correct
6 Incorrect 4 ms 344 KB Wrong Answer [2]
7 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 2 ms 344 KB Output is correct
6 Incorrect 4 ms 344 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -