| Task: | Neliöt |
| Sender: | |
| Submission time: | 2015-12-20 13:27:12 +0200 |
| Language: | C++ |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 27 |
| #2 | ACCEPTED | 41 |
| #3 | ACCEPTED | 32 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.07 s | 1 | details |
| #2 | ACCEPTED | 0.08 s | 2 | details |
| #3 | ACCEPTED | 0.09 s | 3 | details |
Code
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
void yes() {
cout<<"10-4\n";
}
void no() {
cout<<"QAQ\n";
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int tcs;
cin>>tcs;
for (int tc=0;tc<tcs;tc++) {
ll a[4];
for (int i=0;i<4;i++) cin>>a[i];
sort(a,a+4);
if (a[0]!=a[1]) no();
else if (a[3]==a[2]) {
if (a[1]==a[2]/2 && a[2]%2==0) {
yes();
} else if (a[1]==a[2]) yes();
else no();
}
else {
if (a[2]==a[1]) {
if (3*a[0]==a[3]) yes();
else no();
} else {
if (a[3]==a[2]+a[1] && 2*a[1]==a[2]) yes();
else no();
}
}
}
}Test details
Test 1
Group: 1
Verdict: ACCEPTED
| input |
|---|
| 100000 6 9 3 3 1 3 1 1 3 3 6 9 2 2 4 4 ... |
| correct output |
|---|
| 10-4 10-4 10-4 10-4 QAQ ... |
| user output |
|---|
| 10-4 10-4 10-4 10-4 QAQ ... |
Test 2
Group: 2
Verdict: ACCEPTED
| input |
|---|
| 100000 270 90 90 90 372 914 438 84 304 152 152 304 238 238 714 238 ... |
| correct output |
|---|
| 10-4 QAQ 10-4 10-4 10-4 ... |
| user output |
|---|
| 10-4 QAQ 10-4 10-4 10-4 ... |
Test 3
Group: 3
Verdict: ACCEPTED
| input |
|---|
| 100000 821863964 821863964 821863964 ... |
| correct output |
|---|
| 10-4 10-4 QAQ 10-4 10-4 ... |
| user output |
|---|
| 10-4 10-4 QAQ 10-4 10-4 ... |
