제출 #1013760

#제출 시각아이디문제언어결과실행 시간메모리
1013760m5588ohammed새로운 문제 (POI13_mor)C++14
0 / 100
716 ms131072 KiB
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <bits/stdc++.h> using namespace std; #define endl "\n" int dis[5001][5001][2]; vector <int> v[5001]; int n,m,k; void bfs(int x){ for(int i=1;i<=n;i++) dis[x][i][0]=dis[x][i][1]=1e9+1; dis[x][x][0]=0; queue <pair<int,int>> qu; qu.push({0,x}); while(qu.size()!=0){ auto[mydis,i]=qu.front(); qu.pop(); if(mydis>dis[x][i][mydis%2]) continue; for(int j:v[i]){ int w=mydis+1; if(dis[x][j][w%2]>w){ dis[x][j][w%2]=w; qu.push({w,j}); } } } return; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>n>>m>>k; for(int i=0;i<m;i++){ int a,b; cin>>a>>b; v[a].push_back(b); v[b].push_back(a); } //bfs(); for(int i=1;i<=n;i++) bfs(i); while(k--){ int a,b,d; cin>>a>>b>>d; if((a!=b||d==0)&&dis[a][b][d%2]<=d&&dis[a][b][d%2]!=1e9+1) cout<<"TAK"<<endl; else cout<<"NIE"<<endl; } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

mor.cpp: In function 'void bfs(int)':
mor.cpp:22:13: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   22 |         auto[mydis,i]=qu.front();
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...