QOJ.ac
QOJ
ID | Submission ID | Problem | Hacker | Owner | Result | Submit time | Judge time |
---|---|---|---|---|---|---|---|
#569 | #223713 | #7062. Prince and Princess | 111445 | veg | Success! | 2024-03-10 21:10:50 | 2024-03-10 21:10:50 |
Details
Extra Test:
Wrong Answer
time: 0ms
memory: 3916kb
input:
2 1 0
output:
YES 2
result:
wrong answer 2nd lines differ - expected: '3', found: '2'
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#223713 | #7062. Prince and Princess | veg# | AC ✓ | 0ms | 3976kb | C++14 | 229b | 2023-10-22 15:47:04 | 2023-10-22 15:47:04 |
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
if (a <= b + c) puts("NO");
else {
puts("YES");
printf("%d\n",min(a+b+c-1, 2 * (b + c) + 1));
}
return 0;
}