QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#234963#7062. Prince and PrincessnekoWA 0ms3732kbC++14511b2023-11-02 09:31:522023-11-02 09:31:52

Judging History

你现在查看的是最新测评结果

  • [2024-03-10 21:15:22]
  • hack成功,自动添加数据
  • (/hack/570)
  • [2024-03-10 21:10:56]
  • hack成功,自动添加数据
  • (/hack/569)
  • [2023-11-02 09:31:52]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3732kb
  • [2023-11-02 09:31:52]
  • 提交

answer

#include<bits/stdc++.h>

#define ll long long
using namespace std;

int f, t, a, res;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> f >> t >> a;
    if (f + a == t || t + a == f || t == f) {
        cout << "NO" << endl;
        return 0;
    }
    if (f + a < t) res = 2 * (f + a) + 1;
    if (t > f - a) res = 2 * (f - a) + 1;
    if (t < f - a) res = 2 * t + 1;
    cout << "YES" << endl;
    cout << res << endl;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3732kb

input:

2 0 0

output:

YES
1

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

1 1 0

output:

NO

result:

ok single line: 'NO'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3728kb

input:

89586 69086 24655

output:

YES
129863

result:

wrong answer 1st lines differ - expected: 'NO', found: 'YES'