QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#351385 | #7062. Prince and Princess | Yshanqian | AC ✓ | 1ms | 3676kb | C++14 | 1.3kb | 2024-03-11 21:24:29 | 2024-03-11 21:24:30 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1)
#define xx first
#define yy second
#define endl "\n"
#define lowbit(x) x & (-x)
#define int long long
#define ull unsigned long long
#define pb push_back
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
#define LF(x) fixed << setprecision(x)
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define Yshanqian ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
const int N = 1e6 + 10, M = 1010, inf = 0x3f3f3f3f, mod = 1e9 + 7, P = 13331;
const double eps = 1e-8;
void solve()
{
int a, b, c;
cin >> a >> b >> c;
int s = a + b + c;
if (s == 1)
{
cout << "YES" << endl;
cout << 0 << endl;
return;
}
else if (s == a)
{
cout << "YES" << endl;
cout << 1 << endl;
return;
}
if (a > b + c)
{
cout << "YES" << endl;
cout << min(s, 2 * (b + c) + 1) << endl;
}
else
{
cout << "NO" << endl;
}
}
signed main()
{
Yshanqian;
int T;
T = 1;
// cin >> T;
for (int cases = 1; cases <= T; ++cases)
{
// cout<<"Case #"<<cases<<": ";
solve();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
input:
2 0 0
output:
YES 1
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1 1 0
output:
NO
result:
ok single line: 'NO'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
89586 69086 24655
output:
NO
result:
ok single line: 'NO'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
158180 57864 93937
output:
YES 303603
result:
ok 2 lines
Test #5:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
51497 19791 57294
output:
NO
result:
ok single line: 'NO'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
37924 72502 88364
output:
NO
result:
ok single line: 'NO'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
38506 50719 9243
output:
NO
result:
ok single line: 'NO'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
44623 66300 29302
output:
NO
result:
ok single line: 'NO'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
164851 97868 94938
output:
NO
result:
ok single line: 'NO'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
163100 62397 99567
output:
YES 323929
result:
ok 2 lines
Test #11:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
180210 69137 35332
output:
YES 208939
result:
ok 2 lines
Test #12:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
108374 4656 91320
output:
YES 191953
result:
ok 2 lines
Test #13:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 0 0
output:
YES 0
result:
ok 2 lines
Test #14:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
10 0 0
output:
YES 1
result:
ok 2 lines
Extra Test:
score: 0
Extra Test Passed