# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
127728 | ainta | 철도 요금 (JOI16_ho_t3) | C++17 | 2 ms | 504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<cstdio>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
#define pii pair<int,int>
int n, K;
char p[101000];
map<pii, int>Map;
vector<pii> TP;
struct point {
int x, y;
};
int main() {
int i, j, x = 0, y = 0;
scanf("%d%d", &n, &K);
scanf("%s", p);
Map[{0, 0}] = 1;
for (i = 0; i < n; i++) {
if (p[i] == 'E')x++;
if (p[i] == 'W')x--;
if (p[i] == 'N')y++;
if (p[i] == 'S')y--;
Map[{x, y}] = 1;
}
if (x == 0 && y == 0) {
int res = 0;
for (auto &t : Map) {
int x = t.first.first, y = t.first.second;
if (Map[{x, y}] == 1 && Map[{x + 1, y}] == 1 && Map[{x, y + 1}] == 1 && Map[{x + 1, y + 1}] == 1)res++;
}
printf("%d\n", res);
return 0;
}
for (auto &t : Map) {
pii tp = t.first;
TP.push_back({ tp.first,tp.second });
TP.push_back({ tp.first-1,tp.second });
TP.push_back({ tp.first,tp.second-1 });
TP.push_back({ tp.first-1,tp.second-1 });
}
sort(TP.begin(), TP.end());
TP.resize(unique(TP.begin(), TP.end()) - TP.begin());
for (auto &t : TP) {
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |