| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 476292 | Mackerel_Pike | Patkice (COCI20_patkice) | C++14 | 1 ms | 332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define fst first
#define snd second
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {-1, 0, 1, 0};
const char CH[5] = "WNES";
const int maxn = 105;
int n, m;
int dis[maxn][maxn];
char s[maxn][maxn];
vector<pair<int, char> > vec;
int main(){
//freopen("patkice.in", "r", stdin);
scanf("%d%d", &n, &m);
for(int i = 0; i < n; ++i)
scanf("%s", s[i]);
for(int i = 0; i < n; ++i)
for(int j = 0; j < m; ++j)
if(s[i][j] == 'o'){
for(int k = 0; k < 4; ++k){
memset(dis, -1, sizeof(dis));
dis[i][j] = 0; int cur = 1, x, y;
for(x = i + dx[k], y = j + dy[k]; x >= 0 && x < n && y >= 0 && y < m && !~dis[x][y] && s[x][y] != '.' && s[x][y] != 'x'; ++cur){
dis[x][y] = cur;
if(s[x][y] == '<')
--y;
else if(s[x][y] == '>')
++y;
else if(s[x][y] == '^')
--x;
else
++x;
}
if(s[x][y] == 'x')
vec.PB(MP(cur, CH[k]));
}
}
sort(vec.begin(), vec.end());
if(!vec.size())
puts(":(");
else
puts(":)"), putchar(vec[0].snd);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
