| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 742625 | fanwen | 순열 (APIO22_perm) | C++17 | 15 ms | 1580 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define MASK(x) (1LL << (x))
#define BIT(x, i) (((x) >> (i)) & 1)
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (int i = 0, _n = n; i < _n; ++i)
#define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i)
#define FORD(i, a, b) for (int i = (a), _b = (b); i >= _b; --i)
#define FORE(it, s) for (__typeof(s.begin()) it = (s).begin(); it != (s).end(); ++it)
template <class U, class V> bool maximize(U &A, const V &B) { return (A < B) ? (A = B, true) : false; }
template <class U, class V> bool minimize(U &A, const V &B) { return (A > B) ? (A = B, true) : false; }
template <class T> void print_vector(const vector <T> &a) {
for (auto x : a) cout << x << " "; cout << '\n';
}
vector <int> addition(vector <int> a, vector <int> b) {
for (auto &x : a) x += (int) b.size();
for (auto &x : b) a.push_back(x);
return a;
}
vector <int> get(int p) {
vector <int> ans(p);
iota(ALL(ans), 0);
return ans;
}
vector <int> construct_permutation(long long K) {
vector <int> ans;
REP(i, 60) if(BIT(K, i)) ans = addition(ans, get(i));
REP(i, (int) __builtin_popcountll(K) - 1) ans.insert(ans.begin(), (int) ans.size());
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
