답안 #102435

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
102435 2019-03-25T02:04:18 Z DrumpfTheGodEmperor Xylophone (JOI18_xylophone) C++14
0 / 100
2 ms 384 KB
#include <bits/stdc++.h>
#include "xylophone.h"
#define bp __builtin_popcountll
#define pb push_back
#define in(s) freopen(s, "r", stdin);
#define inout(s, end1, end2) freopen((string(s) + "." + end1).c_str(), "r", stdin),\
		freopen((string(s) + "." + end2).c_str(), "w", stdout);
#define fi first
#define se second
#define bw(i, r, l) for (int i = r - 1; i >= l; i--)
#define fw(i, l, r) for (int i = l; i < r; i++)
#define fa(i, x) for (auto i: x)
using namespace std;
const int mod = 1e9 + 7, inf = 1061109567;
const long long infll = 4557430888798830399;
const int N = 5005;
int ask(int l, int r) { return query(l + 1, r + 1); }
void ans(int i, int a) { answer(i + 1, a); }
void solve(int n) {
	int pos1 = -1;
	fw (i, 0, n) {
		int tmp = ask(i, n - 1);
		if (tmp != n - 1) {
			pos1 = i - 1;
			break;
		}
	}
	ans(pos1, 1);
	fw (i, 0, n) {
		if (pos1 == i) continue;
		if (i < pos1) {
			int tmp = ask(i, pos1);
			ans(i, tmp + 1);
		} else {
			int tmp = ask(pos1, i);
			ans(i, tmp + 1);
		}
	}
}
//signed main() {
//	#ifdef BLU
//	in("blu.inp");
//	#endif
//	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//
//	return 0;
//}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 2 ms 256 KB Wrong Answer [7]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 2 ms 256 KB Wrong Answer [7]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Incorrect 2 ms 256 KB Wrong Answer [7]
3 Halted 0 ms 0 KB -