# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
846406 | vjudge1 | ČVENK (COI15_cvenk) | C++17 | 807 ms | 524288 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long long ll;
#define yem(re) (1ll<<((ll)(re)))
#define endl '\n'
#define pb push_back
#define int long long
#define mid ((left+right)/2)
using namespace std;
int n;
queue<pair<pair<int,int>,int>>q;
map<int,map<int,bool>>vis;
int32_t main(){
cin>>n;
pair<int,int>bas,tar;
cin>>bas.first>>bas.second>>tar.first>>tar.second;
q.push({bas,0});
while(q.size()){
int x=q.front().first.first,y=q.front().first.second,total=q.front().second;
q.pop();
if(vis[x][y])continue;
if(x&y!=0)continue;
if(x<0||y<0)continue;
if(x>=1e9||y>=1e9)continue;
if(x==tar.first&&y==tar.second){cout<<total;return 0;}
q.push({{x+1,y},total+1});
q.push({{x-1,y},total+1});
q.push({{x,y-1},total+1});
컴파일 시 표준 에러 (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... |