답안 #250151

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
250151 2020-07-17T05:05:42 Z lyc Minerals (JOI19_minerals) C++14
6 / 100
7 ms 384 KB
#include "minerals.h"
#include <bits/stdc++.h>

#define TRACE(x) std::cerr << #x << " :: " << x << std::endl
#define _ << " " <<
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(),(x).end()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for (int i=(a);i>=(b);--i)

const int mxN = 43005;

int match[2*mxN];

void Solve(int N) {
	FOR(i,1,2*N) match[i] = -1;
	
	FOR(i,1,2*N) if (match[i] == -1) {
		Query(i); // add
		FOR(j,1,2*N) if (match[j] == -1 && j != i) {
			int x = Query(j);
			Query(j);
			if (x == 1) {
				match[i] = j;
				match[j] = i;
				//TRACE(x _ i _ j);
				Answer(i,j);
				break;
			}
		}
		Query(i); // rem
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 384 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Incorrect 7 ms 384 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Incorrect 7 ms 384 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Incorrect 7 ms 384 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Incorrect 7 ms 384 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Incorrect 7 ms 384 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Incorrect 7 ms 384 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Incorrect 7 ms 384 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -