답안 #150117

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150117 2019-09-01T07:45:24 Z shdut0901(#3758, shdut) On the Grid (FXCUP4_grid) C++17
0 / 100
6 ms 384 KB
#include "grid.h"
#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <algorithm>
#include <assert.h>

using namespace std;

#define rep(i, a, b) for(int i = a; i < b; i++)
#define per(i, a, b) for(int i = b - 1; i >= a; i--)
#define ll long long
#define x first
#define y second
#define vi vector<int>
#define pii pair<int, int>
#define SZ(x) (int)(x.size())
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
#define mod 1000000007
#define inf 1000000007
#define DBG(x) cout << (#x) << "=" << x << "\n";

#define N 100005

template<typename U, typename V> void Min(U &a, const V &b){if(a > b) a = b;}
template<typename U, typename V> void Max(U &a, const V &b){if(a < b) a = b;}
template<typename U, typename V> void add(U &a, const V &b){a = (a+b) % mod;}



std::vector<int> SortDisks(int n) {
	vi v(n), a(n, 0);
	rep(i, 0, n)v[i] = i;
	int sz = n, y;
	while(sz > 1){
		int x = PutDisks(v);
		rep(i, 1, sz){
			swap(v[0], v[i]);
			y = PutDisks(v);
			swap(v[0], v[i]);
			if(y >= x){
				a[v[i]]++;
			}
			else a[v[0]]++;
		}
		x = v[0];
		rep(i, 0, sz-1)v[i] = v[i+1];
		v[sz-1] = x;
		sz--;
	}
	rep(i, 0, n)a[i]++;
	//rep(i, 0, n)cerr << a[i] << " ";puts("");
	return a;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 6 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 6 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
3 Correct 5 ms 384 KB Output is correct