QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#234982#7062. Prince and PrincessnekoWA 0ms3692kbC++14584b2023-11-02 09:50:082024-03-10 21:15:22

Judging History

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

  • [2024-03-10 21:15:22]
  • 自动重测本题所有获得100分的提交记录
  • 测评结果:WA
  • 用时:0ms
  • 内存:3692kb
  • [2024-03-10 21:15:22]
  • hack成功,自动添加数据
  • (/hack/570)
  • [2024-03-10 21:10:57]
  • 自动重测本题所有获得100分的提交记录
  • 测评结果:100
  • 用时:0ms
  • 内存:3644kb
  • [2024-03-10 21:10:56]
  • hack成功,自动添加数据
  • (/hack/569)
  • [2023-11-02 09:50:09]
  • 评测
  • 测评结果:100
  • 用时:0ms
  • 内存:3732kb
  • [2023-11-02 09:50:08]
  • 提交

answer

#include<bits/stdc++.h>

#define ll long long
using namespace std;

int f, t, a;

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 0 0

output:

YES
1

result:

ok 2 lines

Test #2:

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

input:

1 1 0

output:

NO

result:

ok single line: 'NO'

Test #3:

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

input:

89586 69086 24655

output:

NO

result:

ok single line: 'NO'

Test #4:

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

input:

158180 57864 93937

output:

YES
303603

result:

ok 2 lines

Test #5:

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

input:

51497 19791 57294

output:

NO

result:

ok single line: 'NO'

Test #6:

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

input:

37924 72502 88364

output:

NO

result:

ok single line: 'NO'

Test #7:

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

input:

38506 50719 9243

output:

NO

result:

ok single line: 'NO'

Test #8:

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

input:

44623 66300 29302

output:

NO

result:

ok single line: 'NO'

Test #9:

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

input:

164851 97868 94938

output:

NO

result:

ok single line: 'NO'

Test #10:

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

input:

163100 62397 99567

output:

YES
323929

result:

ok 2 lines

Test #11:

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

input:

180210 69137 35332

output:

YES
208939

result:

ok 2 lines

Test #12:

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

input:

108374 4656 91320

output:

YES
191953

result:

ok 2 lines

Test #13:

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

input:

1 0 0

output:

YES
0

result:

ok 2 lines

Test #14:

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

input:

10 0 0

output:

YES
1

result:

ok 2 lines

Extra Test:

score: -3
Extra Test Failed : Wrong Answer on 2
time: 0ms
memory: 3696kb

input:

1 5 2

output:

YES
7

result:

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