| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1353082 | vjudge1 | Intercastellar (JOI22_ho_t1) | C++17 | 617 ms | 589824 KiB |
#include <bits/stdc++.h>
using namespace std;
#define kien long long
#define int long long
#define pb push_back
#define FOR(i, a, b) for (int i = a;i <= b; i++)
#define FORD(i, a, b) for (int i = a;i >= b; i--)
#define pii pair<int, int>
#define dembit(a) __builtin_popcountll(a)
#define task "a"
#define fin(x) freopen(x".inp","r",stdin)
#define fou(x) freopen(x".out","w",stdout)
#define debug(x) cout << x << " ";
#define down cout << "\n"
const kien MOD = 1e9 + 7;
const int NTEST = 100;
const int Million = 1e6 + 5;
const int MXN = 2e5 + 5;
const int LOG = 18;
mt19937 rd(chrono::high_resolution_clock::now().time_since_epoch().count());
kien rand(kien l, kien r) {
assert(l <= r);
return uniform_int_distribution<kien>(l, r)(rd);
}
kien n, k, m, dem, u, v, a[MXN];
kien maxx, minn, l, r, ans;
vector <int> res;
void change (kien n) {
int time = 1;
while (n % 2 == 0) {
n /= 2;
time *= 2;
}
// cout << time << " ";
FOR (i, 1, time) res.pb(n);
}
main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
if (fopen(task".inp", "r")) {
fin(task); fou(task);
}
cin >> n;
FOR (i, 1, n) {
cin >> a[i];
if (a[i] % 2 == 0) { change(a[i]); }
else res.pb(a[i]);
}
// for (auto x : res) cout << x << " ";
// cout << "\n---------------";
kien q; cin >> q;
while (q--) {
cin >> r;
cout << res[r - 1] << "\n";
}
cerr << "\n" << 1.0 * clock() / CLOCKS_PER_SEC << "s ";
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
