Submission #668570

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6685702022-12-04 06:53:55RambaXGorilla007 (CEOI14_007)C++17
100 / 100
301 ms16444 KiB
#include<cstdio>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
using namespace std;
typedef pair <int,int> ii;
int N, M, S, D, A, B;
vector <int> adj[200010];
queue <ii> near;
int dists[2][200010] = {};
bool vis[200010] = {};
void bfs(int X, int n){
near.push(ii(X, 0));
while(!near.empty()){
int node = near.front().first;
int dist = near.front().second;
near.pop();
if(dists[n][node]) continue;
dists[n][node] = dist;
for(int i : adj[node]){
near.push(ii(i, dist + 1));
}
}
}
int both(int X){
int most;
near.push(ii(X, 0));
while(!near.empty()){
int node = near.front().first;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

007.cpp: In function 'int main()':
007.cpp:44:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   44 |     scanf("%d%d%d%d%d%d",&N,&M,&S,&D,&A,&B);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
007.cpp:47:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   47 |         scanf("%d%d",&a,&b);
      |         ~~~~~^~~~~~~~~~~~~~
007.cpp: In function 'int both(int)':
007.cpp:41:12: warning: 'most' may be used uninitialized in this function [-Wmaybe-uninitialized]
   41 |     return most;
      |            ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...