Task: | Ruudukko |
Sender: | Ollie |
Submission time: | 2015-01-29 15:58:35 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1 | details |
#2 | ACCEPTED | 0.04 s | 1 | details |
#3 | WRONG ANSWER | 0.06 s | 1 | details |
#4 | ACCEPTED | 0.06 s | 1 | details |
#5 | WRONG ANSWER | 0.06 s | 1 | details |
#6 | ACCEPTED | 0.06 s | 2 | details |
#7 | WRONG ANSWER | 0.06 s | 2 | details |
#8 | WRONG ANSWER | 0.07 s | 2 | details |
#9 | WRONG ANSWER | 0.07 s | 2 | details |
#10 | WRONG ANSWER | 0.07 s | 2 | details |
#11 | ACCEPTED | 0.52 s | 3 | details |
#12 | WRONG ANSWER | 0.50 s | 3 | details |
#13 | WRONG ANSWER | 0.68 s | 3 | details |
#14 | WRONG ANSWER | 0.69 s | 3 | details |
#15 | WRONG ANSWER | 0.68 s | 3 | details |
Code
#include <bits/stdc++.h> #define ll long long #define mp make_pair #define pb push_back #define pii pair<int,int> #define vpii vector<pii> using namespace std; char c[501][501]; int n; vector<string> ls; int p[501][501]; void search(int x, int y,string s,int ff) { //cout << ff << endl; //cout << x << "," << y << endl; if(x>n||y>n) return; if(ff >= p[x][y]) return; p[x][y] = ff; if(x==n-1&&y==n-1) ls.pb(s); search(x+1,y,s+c[x][y],c[x][y]); search(x,y+1,s+c[x][y],c[x][y]); } int main() { cin.tie(0); cin >> n; for(int y=0;y<n;y++) { for(int x=0;x<n;x++) { char a; cin >> a; c[x][y] = a; p[x][y] = 99999999; } } search(0,0,"",0); sort(ls.begin(), ls.end()); string best = ls[0]+c[n-1][n-1]; cout << best << endl; return 0; }
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
5 AAAAA AAAAA AAAAA AAAAA ... |
correct output |
---|
AAAAAAAAB |
user output |
---|
AAAAAAAAB |
Test 2
Group: 1
Verdict: ACCEPTED
input |
---|
5 ABABA BABAB ABABA BABAB ... |
correct output |
---|
ABABABABA |
user output |
---|
ABABABABA |
Test 3
Group: 1
Verdict: WRONG ANSWER
input |
---|
5 WRYIU TWLKH UJMJC GRDJW ... |
correct output |
---|
WRWJMDJWK |
user output |
---|
WRYIUHCWK |
Test 4
Group: 1
Verdict: ACCEPTED
input |
---|
5 RUEAE ZYHHW KDBPD DXREW ... |
correct output |
---|
RUEAEWDWX |
user output |
---|
RUEAEWDWX |
Test 5
Group: 1
Verdict: WRONG ANSWER
input |
---|
5 SRGYR MYDOB GNOVM SZOZK ... |
correct output |
---|
SMGNOOLTU |
user output |
---|
SRGYRBMKU |
Test 6
Group: 2
Verdict: ACCEPTED
input |
---|
100 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
Test 7
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
ABABABABABABABABABABABABABABAB... |
Test 8
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 FWOVNYKNMMQCNHJGUYPNEDXGVVGONC... |
correct output |
---|
FWDBDECKBHKIACOVUCJGDJOHAYIBHO... |
user output |
---|
FWOVNYKNMMQCNHJGUYPNEDXGVVGONC... |
Test 9
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 ETGCJABWKMAAEOQXWFFYMDJBMNKMQK... |
correct output |
---|
EAARGLBRLHCDHHBPABHDAJBEEBHQBE... |
user output |
---|
ETGCJABWKMAAEOQXWFFYMDJBMNKMQK... |
Test 10
Group: 2
Verdict: WRONG ANSWER
input |
---|
100 GNWMLJNHSBAADUFCSGIZMWHZTVDHNR... |
correct output |
---|
GEGOFRDKBNLLEUOPOEQCEFMTKANLNC... |
user output |
---|
GNWMLJNHSBAADUFCSGIZMWHZTVDHNR... |
Test 11
Group: 3
Verdict: ACCEPTED
input |
---|
500 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
Test 12
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 ABABABABABABABABABABABABABABAB... |
correct output |
---|
ABABABABABABABABABABABABABABAB... |
user output |
---|
ABABABABABABABABABABABABABABAB... |
Test 13
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 HGADXTSFXYIEMDWMFIVQGHTACFUPYI... |
correct output |
---|
HGADEJOGAKPJCRAHTABRSDLAVGBFAG... |
user output |
---|
HGADXTSFXYIEMDWMFIVQGHTACFUPYI... |
Test 14
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 SBLNMAZESQVGWAPZYHQJMQTNGMEZWS... |
correct output |
---|
SBLCAMDHILGIDRCIDUNMMAHFYCENOS... |
user output |
---|
SBLNMAZESQVGWAPZYHQJMQTNGMEZWS... |
Test 15
Group: 3
Verdict: WRONG ANSWER
input |
---|
500 AOXYXRYFWPYWQDPWXQITLHQQUAYZAJ... |
correct output |
---|
AOJLDOAPBGEKSGCNKBUMKAJCCWCOOD... |
user output |
---|
AOXYXRYFWPYWQDPWXQITLHQQUAYZAJ... |