제출 #150117

#제출 시각아이디문제언어결과실행 시간메모리
150117shdut0901 (#200)On the Grid (FXCUP4_grid)C++17
0 / 100
6 ms384 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...