QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#234965 | #7062. Prince and Princess | neko | WA | 0ms | 3572kb | C++14 | 488b | 2023-11-02 09:33:28 | 2023-11-02 09:33:28 |
Judging History
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 (abs(f-t)<=a) {
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: 3568kb
input:
2 0 0
output:
YES 1
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3392kb
input:
1 1 0
output:
NO
result:
ok single line: 'NO'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3400kb
input:
89586 69086 24655
output:
NO
result:
ok single line: 'NO'
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3572kb
input:
158180 57864 93937
output:
YES 115729
result:
wrong answer 2nd lines differ - expected: '303603', found: '115729'