Task: | Maraton |
Sender: | henrikaalto |
Submission time: | 2019-07-25 16:28:10 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | ACCEPTED | 0.01 s | details |
#4 | ACCEPTED | 0.01 s | details |
#5 | ACCEPTED | 0.01 s | details |
#6 | ACCEPTED | 0.01 s | details |
#7 | ACCEPTED | 0.01 s | details |
#8 | ACCEPTED | 0.01 s | details |
#9 | ACCEPTED | 0.01 s | details |
#10 | ACCEPTED | 0.01 s | details |
Code
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define F first #define S second using pi=pair<int,int>; using ii=long long; int main() { int n; cin >> n; vector<string>v(n); for (int i = 0; i < n; ++i) { cin>>v[i]; } char lol = '.'; for (int i = 0; i < n; ++i) { for (int j = 0; j< n; ++j) { if (i + 2 < n) { if (v[i][j] == v[i + 1][j] && v[i][j] == v[i + 2][j]) { if (v[i][j] != '.')lol = v[i][j]; } } if (j + 2 < n) { if (v[i][j] == v[i][j + 1] && v[i][j] == v[i][j+2]) { if (v[i][j] != '.')lol = v[i][j]; } } if (j + 2 < n && i + 2 < n) { if (v[i][j] == v[i + 1][j + 1] && v[i][j] == v[i + 2][j + 2]) { if (v[i][j] != '.')lol = v[i][j]; } } if (j - 2 >= 0 && i + 2 < n) { if (v[i][j] == v[i + 1][j - 1] && v[i][j] == v[i + 2][j - 2]) { if (v[i][j] != '.') lol = v[i][j]; } } } } if (lol=='.') cout << "ongoing\n"; else cout << lol << "\n"; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
5
LUKA. LOVRO LUKA. VR... ... |
correct output |
---|
L |
user output |
---|
L |
Test 2
Verdict: ACCEPTED
input |
---|
10
K.Z.....X. F....ZJ.T. ...XIK..J. TZQ.I.T.QK ... |
correct output |
---|
ongoing |
user output |
---|
ongoing |
Test 3
Verdict: ACCEPTED
input |
---|
10
RGZRJJ.XPI .RPZPZPGG. XIPT.JIPZZ ZT.G.JX..P ... |
correct output |
---|
X |
user output |
---|
X |
Test 4
Verdict: ACCEPTED
input |
---|
5
..YYA HDHAD DAHAY YYHD. ... |
correct output |
---|
H |
user output |
---|
H |
Test 5
Verdict: ACCEPTED
input |
---|
15
MG.YGVUGU.F.F.G MQYWAEB.EB.U..O M.PW.FCBLADGWTH NHDEY..YKDFRF.A ... |
correct output |
---|
M |
user output |
---|
M |
Test 6
Verdict: ACCEPTED
input |
---|
19
JRHCV..QNN.NQVE...O OE..R.VDT..DPNJK.M. .MQ.BYVHVJDE....J.I YBTMLJYKEO..OM.BHCR ... |
correct output |
---|
Y |
user output |
---|
Y |
Test 7
Verdict: ACCEPTED
input |
---|
19
.X.........X..W.... W...........X..XXW. ...........XX...... .....W.....XX...... ... |
correct output |
---|
X |
user output |
---|
X |
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: ACCEPTED
input |
---|
18
D...Y...S.OSOY.... ..YR...Z..I......R .....M.MDK..A..... Z.LO..L..KX...Z... ... |
correct output |
---|
M |
user output |
---|
M |