QOJ.ac

QOJ

ID提交记录ID题目HackerOwner结果提交时间测评时间
#569#223713#7062. Prince and Princess111445vegSuccess!2024-03-10 21:10:502024-03-10 21:10:50

詳細信息

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题目提交者结果用时内存语言文件大小提交时间测评时间
#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;
}