QOJ.ac

QOJ

IDSubmission IDProblemHackerOwnerResultSubmit timeJudge time
#569#223713#7062. Prince and Princess111445vegSuccess!2024-03-10 21:10:502024-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'

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#223713#7062. Prince and Princessveg#AC ✓0ms3976kbC++14229b2023-10-22 15:47:042023-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;
}