답안 #137897

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
137897 2019-07-28T13:31:13 Z zoooma13 Minerals (JOI19_minerals) C++14
6 / 100
13 ms 376 KB
#include "bits/stdc++.h"
#include "minerals.h"
using namespace std;

void Solve(int N) {
  srand(time(NULL));
    vector <bool> taken(2*N+1);
    vector <int> ord(2*N+1);
    iota(ord.begin() ,ord.end() ,0);
    random_shuffle(ord.begin()+1 ,ord.end());
    for(int i=1; i<=2*N; i++) if(!taken[ord[i]]){
        Query(ord[i]);
        for(int j=i+1; j<=2*N; j++) if(!taken[ord[j]]){
            int x = Query(ord[j]);
            if(x == 1){
                Answer(ord[i] ,ord[j]);
                taken[ord[i]] = taken[ord[j]] = 1;
                Query(ord[j]);
                break;
            }
            Query(ord[j]);
        }
        Query(ord[i]);
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 248 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 376 KB Output is correct
2 Incorrect 13 ms 376 KB Wrong Answer [2]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 248 KB Output is correct
5 Correct 13 ms 376 KB Output is correct
6 Incorrect 13 ms 376 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 248 KB Output is correct
5 Correct 13 ms 376 KB Output is correct
6 Incorrect 13 ms 376 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 248 KB Output is correct
5 Correct 13 ms 376 KB Output is correct
6 Incorrect 13 ms 376 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 248 KB Output is correct
5 Correct 13 ms 376 KB Output is correct
6 Incorrect 13 ms 376 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 248 KB Output is correct
5 Correct 13 ms 376 KB Output is correct
6 Incorrect 13 ms 376 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 248 KB Output is correct
5 Correct 13 ms 376 KB Output is correct
6 Incorrect 13 ms 376 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 248 KB Output is correct
5 Correct 13 ms 376 KB Output is correct
6 Incorrect 13 ms 376 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -