Submission #1072890

# Submission time Handle Problem Language Result Execution time Memory
1072890 2024-08-24T06:33:14 Z HappyCapybara Minerals (JOI19_minerals) C++17
6 / 100
5 ms 488 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);
      if (y == m){
        //cout << i+1 << " " << cur+1 << "\n";
        Answer(i+1, cur+1);
        done[i] = true;
        done[cur] = true;
        break;
      }
      Query(i+1);
    }
    cur++;
  }
}
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Incorrect 5 ms 488 KB Wrong Answer [2]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 340 KB Output is correct
6 Incorrect 5 ms 488 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 340 KB Output is correct
6 Incorrect 5 ms 488 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 340 KB Output is correct
6 Incorrect 5 ms 488 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 340 KB Output is correct
6 Incorrect 5 ms 488 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 340 KB Output is correct
6 Incorrect 5 ms 488 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 340 KB Output is correct
6 Incorrect 5 ms 488 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 340 KB Output is correct
6 Incorrect 5 ms 488 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -