# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
546305 | AJ00 | Pohlepko (COCI16_pohlepko) | C++14 | 39 ms | 65536 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
char ch[2000][2000];
string st[2000][2000];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int t=1,r,c;
//cin >> t;
while (t--){
cin >> r >> c;
for (int i = 0; i < r; i++){
for (int j = 0; j < c; j++){
st[i][j] = "";
cin >> ch[i][j];
}
}
st[0][0].push_back(ch[0][0]);
for (int i = 1; i < r; i++){
st[i][0] = st[i-1][0];
st[i][0].push_back(ch[i][0]);
}
for (int j = 1; j < c; j++){
st[0][j] = st[0][j-1];
st[0][j].push_back(ch[0][j]);
}
for (int i = 1; i < r; i++){
for (int j = 1; j < c; j++){
if (st[i-1][j] < st[i][j-1]){
st[i][j] = st[i-1][j];
}
else {
st[i][j] = st[i][j-1];
}
st[i][j].push_back(ch[i][j]);
}
}
cout << st[r-1][c-1] << " ";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |