| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1328759 | Tyx2019 | Mensza (COI22_mensza) | C++20 | 5079 ms | 589824 KiB |
#include <bits/stdc++.h>
#define dbg(x) if(dd) cout << #x << " is " << x << endl;
#define debug(x) if(dd) cout << #x << " is " << x << endl;
#define int long long
bool dd = 1;
using namespace std;
void print(vector<int> V){
cout << V.size() << " ";
for(int x:V) cout << x << " ";
cout << endl;
}
void Alice(){
int A;
cin >> A;
vector<int> V;
int c = A;
int x = 1e9;
while(c != 0){
if(c % 2 == 0) V.push_back(c+1);
else V.push_back(x--);
c/=2;
}
while(V.size() < 20) V.push_back(V[0]);
print(V);
}
void Bob(){
int B;
cin >> B;
vector<int> V;
int c = B;
while(c != 0){
V.push_back(c);
c/=2;
}
print(V);
}
void Charlie(){
vector<int> C;
int s;
cin >> s;
for(int i=0;i<s;i++){
int x;
cin >> x;
C.push_back(x);
}
int sm = accumulate(C.begin(), C.end(), 0);
int Bsz = sm - 20;
if(C[s-2] >= 2){
int Asz = 21 - C[s-1];
cout << (Asz <= Bsz ? "B" : "A") << endl;
}
else{
int Asz = 21 - C[s-1];
cout << (Asz < Bsz ? "B" : "A") << endl;
}
}
main(){
int L, Q;
cin >> L >> Q;
while(Q--){
string op;
cin >> op;
if(op == "alojzije"){
Alice();
}
else if(op == "benjamin"){
Bob();
}
else{
Charlie();
}
}
}
컴파일 시 표준 에러 (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... | ||||
