답안 #250759

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
250759 2020-07-19T05:06:37 Z IsaacMoris Minerals (JOI19_minerals) C++14
6 / 100
85 ms 384 KB
#include<iostream>
#include <bits/stdc++.h>
#include "minerals.h"
#define ll long long
#define ld long double
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
void Solve(int N)
{
    vector<int> v;
    for (int i = 1; i <= 2 * N; ++i)
        v.push_back(i);
    for(int i=0; i<1000; i++)
        random_shuffle(v.begin(),v.end());
    stack<int> st;
    int last=0;
    while(!v.empty())
    {
        int x= Query(v.back());
        if(x!=last)
        {
            st.push(v.back());
            v.pop_back();
            last=x;
            continue;
        }
        int a=v.back();
        v.pop_back();
        while(1)
        {
            x=Query(st.top());
            if(x!=last)
            {
                v.push_back(st.top());
                st.pop();
                last=x;
                continue;
            }
            Answer(st.top(), a);
            st.pop();
            last=Query(a);
            break;
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 41 ms 384 KB Output is correct
2 Incorrect 85 ms 384 KB Wrong Answer [2]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 41 ms 384 KB Output is correct
6 Incorrect 85 ms 384 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 41 ms 384 KB Output is correct
6 Incorrect 85 ms 384 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 41 ms 384 KB Output is correct
6 Incorrect 85 ms 384 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 41 ms 384 KB Output is correct
6 Incorrect 85 ms 384 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 41 ms 384 KB Output is correct
6 Incorrect 85 ms 384 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 41 ms 384 KB Output is correct
6 Incorrect 85 ms 384 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 41 ms 384 KB Output is correct
6 Incorrect 85 ms 384 KB Wrong Answer [2]
7 Halted 0 ms 0 KB -