# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1016004 | ZeroCool | Intercastellar (JOI22_ho_t1) | C++14 | 55 ms | 9404 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ar array
#define ld long double
const int N = 3e5 + 30;
const int M = 10;
const int MOD = 998244353;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
const int inv = 499122177;
signed main(){ios::sync_with_stdio(false);cin.tie(0);
int n;
cin>>n;
int c = 0;
vector<ar<int, 2> > v;
for(int i = 0;i < n;i++){
int x;
cin>>x;
int cnt = 1;
while(x % 2 == 0){
x /= 2;
cnt *= 2;
}
v.push_back({c, x});
c += cnt;
}
//for(auto [a, b]: v)cout<<a<<" "<<b<<endl;
int q;
cin>>q;
while(q--){
int x;
cin>>x;
auto it = upper_bound(v.begin(), v.end(), ar<int,2>{x, 0});
--it;
cout<<(*it)[1]<<'\n';
}
}
컴파일 시 표준 에러 (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... |