QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#378883 | #7062. Prince and Princess | Captainfly# | WA | 1ms | 3716kb | C++20 | 1.0kb | 2024-04-06 15:05:32 | 2024-04-06 15:05:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
#define mp make_pair
inline int read()
{
int X=0; bool flag=1; char ch=getchar();
while(ch<'0'||ch>'9') {if(ch=='-') flag=0; ch=getchar();}
while(ch>='0'&&ch<='9') {X=(X<<1)+(X<<3)+ch-'0'; ch=getchar();}
if(flag) return X;
return ~(X-1);
}
const ll mod=1000000007;
ll qpow(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
inline int gcd(int a, int b){return b == 0 ? a : gcd(b, a % b);}
inline int lcm(int a, int b){return a / gcd(a, b) * b;}
#define maxn 200010
void solve()
{
int a,b,c;
cin>>a>>b>>c;
if(!b&&!c)
{
cout<<"YES"<<'\n';
cout<<1<<'\n';
}
else if(a>b+c)
{
cout<<"YES"<<'\n';
cout<<2*(b+c)+1<<'\n';
}
else cout<<"NO"<<'\n';
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t=1;
//cin>>t;
while(t--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3608kb
input:
2 0 0
output:
YES 1
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1 1 0
output:
NO
result:
ok single line: 'NO'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
89586 69086 24655
output:
NO
result:
ok single line: 'NO'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
158180 57864 93937
output:
YES 303603
result:
ok 2 lines
Test #5:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
51497 19791 57294
output:
NO
result:
ok single line: 'NO'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
37924 72502 88364
output:
NO
result:
ok single line: 'NO'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
38506 50719 9243
output:
NO
result:
ok single line: 'NO'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
44623 66300 29302
output:
NO
result:
ok single line: 'NO'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
164851 97868 94938
output:
NO
result:
ok single line: 'NO'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
163100 62397 99567
output:
YES 323929
result:
ok 2 lines
Test #11:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
180210 69137 35332
output:
YES 208939
result:
ok 2 lines
Test #12:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
108374 4656 91320
output:
YES 191953
result:
ok 2 lines
Test #13:
score: -100
Wrong Answer
time: 0ms
memory: 3620kb
input:
1 0 0
output:
YES 1
result:
wrong answer 2nd lines differ - expected: '0', found: '1'