# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
86256 | MatesV13 | Pohlepko (COCI16_pohlepko) | C++11 | 15 ms | 15292 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
long long n, m;
string word, path;
char unos[2000][2000];
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for (int i=0;i<n;i++){
cin >> word;
for(int j=0;j<m;j++){
unos[i][j] = word[j];
}
}
path = unos[0][0];
int i=0, j=0;
while (i!=n-1 and j!=m-1){
if (unos[i][j+1] > unos[i+1][j]){
i++;
path = path + unos[i][j];
}
else{
j++;
path = path + unos[i][j];
}
}
while (i!=n-1){
i++;
path = path + unos[i][j];
}
while (j!=m-1){
j++;
path = path + unos[i][j];
}
cout << path;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |