CSES - Putka Open 2015 – finaali - Results
Submission details
Task:Neliöt
Sender:
Submission time:2015-12-20 13:22:24 +0200
Language:C++
Status:READY
Result:73
Feedback
groupverdictscore
#10
#2ACCEPTED41
#3ACCEPTED32
Test results
testverdicttimegroup
#10.17 s1details
#2ACCEPTED0.18 s2details
#3ACCEPTED0.28 s3details

Code

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
ll t[4];
int main() {
    ll qq;
    cin>>qq;
    for(ll xx = 0; xx < qq; ++xx) {
        for(ll i =0; i < 4; ++i) {
            cin>>t[i];
        }
        sort(t, t+4);
        if(t[2] < t[3]) {
            if(t[0] == t[1] && t[0] == t[3]-t[2] && t[0] * 2 == t[2]) {
                cout<<"10-4\n";
                goto ohi;
            }
            if(t[0] == t[2] && 3*t[0] == t[3]) {
                cout<<"10-4\n";
                goto ohi;
            }
        }
        if(t[1] < t[2]) {
            if(t[0] == t[1] && 2*t[1] == t[2]) {
                cout<<"10-4\n";
                goto ohi;
            }
        }
        if(t[0] == t[3]) {
                cout<<"10-4\n";
                goto ohi;
        }
        cout<<"QAQ\n";
        ohi:;
    }

}

Test details

Test 1

Group: 1

Verdict:

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
...