# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
932808 | De3b0o | Vinjete (COI22_vinjete) | C++14 | 7 ms | 344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define in insert
#define er erase
#define pb push_back
#define ppb pop_back()
#define ph push
#define pp pop()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "YES" << "\n";
#define no cout << "NO" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define sqr 340
#define mod 1000000007
#define mid (l+r)/2
using namespace std;
ll fp(ll x , ll y)
{
if(y==0)
return 1;
ll z = fp(x,y/2);
if(y&1)
return z*z*x;
else
return z*z;
}
int sqrot(ll x)
{
int l = 0 , r = INT_MAX;
while(l<=r)
{
if(mid*mid>=x)
r=mid-1;
else
l=mid+1;
}
return r+1;
}
ll cel(ll x , ll y)
{
return x/y + bool(x/y);
}
string tb(ll x)
{
string s = "";
while(x>0)
{
if(x&1)
s+='1';
else
s+='0';
x/=2;
}
while(s.size()<60)
s+='0';
return s;
}
ll fb(string s)
{
ll x = 0;
ll c = 1;
for(int8_t i = 0 ; 60>i ; i++)
{
if(s[i]=='1')
x+=c;
c*=2;
}
return x;
}
int main()
{
ll L;
cin >> L;
ll q;
cin >> q;
while(q--)
{
string s;
cin >> s;
if(s=="alojzije")
{
ll A;
cin >> A;
vector<ll> a;
if(A>110)
{
ll x = A/10;
x/=2;
ll y = A/10;
y = y/2 + y%2;
while(x--)
a.pb(10000000);
while(y--)
a.pb(100000000);
A=A%10;
}
while(A--)
a.pb(A);
cout << a.size() << " ";
for(int i = 0 ; a.size()>i ; i++)
cout << a[i] << " ";
lin
}
else if(s=="benjamin")
{
ll B;
cin >> B;
vector<ll> b;
if(B>110)
{
ll x = B/10;
while(x--)
b.pb(1000000);
B=B%10;
}
while(B>=2)
{
b.pb(10000-B);
b.pb(10000-B);
B-=2;
}
cout << b.size() << " ";
for(int i = 0 ; b.size() > i ; i++)
cout << b[i] << " ";
lin
}
else
{
ll n;
cin >> n;
ll a[n];
ll x = 0;
ll A = 0 , B = 0;
for(int i = 0 ; n>i ; i++)
{
cin >> a[i];
if(a[i]!=1&&a[i]!=2)
x++;
}
for(int i = 0 ; n>i ; i++)
{
if(a[i]==1)
A++;
else
B+=2;
}
if(x==1)
B+=a[n-1]*10;
else if(x==2)
A+=a[n-1]*10+a[n-2]*10;
else if(x)
{
if(abs(a[n-1]-a[n-2])<=1)
{
A+=10*(a[n-1]+a[n-2]);
B+=10*a[n-3];
}
else
{
A+=10*(a[n-2]+a[n-3]);
B+=10*(a[n-1]);
}
}
if(B>=A)
cout << "B\n";
else
cout << "A\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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |