| Task: | Neliöt |
| Sender: | Henrik Lievonen |
| Submission time: | 2015-12-20 13:26:55 +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.18 s | 1 | details |
| #2 | ACCEPTED | 0.20 s | 2 | details |
| #3 | ACCEPTED | 0.30 s | 3 | details |
Code
// A
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long int ll;
bool test(ll a, ll b, ll c, ll d) {
vector<ll> v = {a, b, c, d};
sort(v.begin(), v.end());
if (v[0] == v[3])
return true; // All same size
if (v[0] == v[1] && 2*v[0] == v[2] && (v[2] == v[3] || v[0] + v[2] == v[3]))
return true;
if (v[0] == v[2] && 3*v[0] == v[3])
return true;
return false;
}
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
ll a, b, c, d;
cin >> a >> b >> c >> d;
if (test(a, b, c, d)) {
cout << "10-4\n";
} else {
cout << "QAQ\n";
}
}
}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 ... |
