CSES - COCI 2006/2007 #6 - Results
Submission details
Task:Maraton
Sender:untokarila
Submission time:2019-07-25 17:08:34 +0300
Language:C++ (C++11)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.01 sdetails
#20.01 sdetails
#30.01 sdetails
#4ACCEPTED0.01 sdetails
#50.01 sdetails
#60.01 sdetails
#70.01 sdetails
#8ACCEPTED0.01 sdetails
#9ACCEPTED0.01 sdetails
#100.01 sdetails

Code

#include <bits/stdc++.h>

using namespace std;

int main(){

    vector<complex<int> > v[27];

    int n;
    cin >> n;

    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            char c;
            cin >> c;
            if(c=='.') continue;
            else v[c-65].push_back({i, j});
        }
    }


    for(int p=0; p<27; p++){
        int z = v[p].size();
        for(int i=0; i<z; i++){
            for(int j=i+1; j<z; j++){
                for(int k=j+1; k<z; k++){
                    if((conj(v[p][i]-v[p][k])*(v[p][i]-v[p][j])).imag() == 0){
                        char ch = 65+p;
                        cout << ch;
                        return 0;
                    }
                }
            }
        }
    }
    cout << "ongoing";
    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
5
LUKA.
LOVRO
LUKA.
VR...
...

correct output
L

user output
L

Test 2

Verdict:

input
10
K.Z.....X.
F....ZJ.T.
...XIK..J.
TZQ.I.T.QK
...

correct output
ongoing

user output
I

Test 3

Verdict:

input
10
RGZRJJ.XPI
.RPZPZPGG.
XIPT.JIPZZ
ZT.G.JX..P
...

correct output
X

user output
G

Test 4

Verdict: ACCEPTED

input
5
..YYA
HDHAD
DAHAY
YYHD.
...

correct output
H

user output
H

Test 5

Verdict:

input
15
MG.YGVUGU.F.F.G
MQYWAEB.EB.U..O
M.PW.FCBLADGWTH
NHDEY..YKDFRF.A
...

correct output
M

user output
A

Test 6

Verdict:

input
19
JRHCV..QNN.NQVE...O
OE..R.VDT..DPNJK.M.
.MQ.BYVHVJDE....J.I
YBTMLJYKEO..OM.BHCR
...

correct output
Y

user output
B

Test 7

Verdict:

input
19
.X.........X..W....
W...........X..XXW.
...........XX......
.....W.....XX......
...

correct output
X

user output
W

Test 8

Verdict: ACCEPTED

input
19
...G..X.V.J.....P..
....FT..Y.Y.G......
..J.O..YQ..H.......
......UDF....H.P...
...

correct output
D

user output
D

Test 9

Verdict: ACCEPTED

input
19
V.................V
...................
..V.............V..
...................
...

correct output
V

user output
V

Test 10

Verdict:

input
18
D...Y...S.OSOY....
..YR...Z..I......R
.....M.MDK..A.....
Z.LO..L..KX...Z...
...

correct output
M

user output
D