CSES - Putka Open 2015 – finaali - Results
Submission details
Task:Neliöt
Sender:
Submission time:2015-12-20 13:51:35 +0200
Language:C++
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED27
#2ACCEPTED41
#3ACCEPTED32
Test results
testverdicttimegroup
#1ACCEPTED0.16 s1details
#2ACCEPTED0.18 s2details
#3ACCEPTED0.29 s3details

Code

#include <iostream>
using namespace std;

int t;


int main(){
  cin >> t;
  for (int i=0; i<t; ++i){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a>b) swap(a, b);
    if (a>c) swap(a, c);
    if (a>d) swap(a, d);
    if (b>c) swap(b, c);
    if (b>d) swap(b, d);
    if (c>d) swap(c, d);
    
    bool p=0;
    if (a==b && b==c && a+b+c==d) p=1;
    if (a==b && b==c && c==d) p=1;
    if (a==b && c==d && a+b==c) p=1;
    if (a==b && a+b==c && a+c==d) p=1;
    
    if (p) 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
...