# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
771415 | gggkik | 영역 (JOI16_ho_t4) | C++14 | 701 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int,int>;
#define ll long long
set<pii> s;
int dx[512], dy[512];
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, k; cin >> n >> k;
string A; cin >> A;
dx['S']--, dx['N']++, dy['E']++, dy['W']--;
int x = 0, y = 0;
s.insert({x,y});
for(;k--;){
for(char i : A) {
x += dx[i], y += dy[i];
s.insert({x,y});
}
}
ll c = 0;
for(auto i : s) if(
s.find({i.first+1,i.second}) != s.end() &&
s.find({i.first,i.second+1}) != s.end() &&
s.find({i.first+1,i.second+1}) != s.end()
) c++;
cout << c;
}
컴파일 시 표준 에러 (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... |