Submission #426619

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4266192021-06-14 07:58:12TLP39Hotspot (NOI17_hotspot)C++14
100 / 100
1076 ms1180 KiB
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,pair<int,int>> pii;
int n,m,k;
vector<int> adj[5003];
int shortest_path[2][5003];
int num_shortest_path[2][5003];
bool marked[2][5003];
double final[5003];
void bfs(int a,int pos)
{
for(int i=0;i<n;i++)
{
marked[pos][i]=false;
shortest_path[pos][i]=1000000;
num_shortest_path[pos][i]=0;
}
queue<int> q;
int temp;
q.push(a);
marked[pos][a]=true;
shortest_path[pos][a]=0;
num_shortest_path[pos][a]=1;
while(!q.empty())
{
temp=q.front();
q.pop();
for(int i=0;i<adj[temp].size();i++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

hotspot.cpp: In function 'void bfs(int, int)':
hotspot.cpp:30:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |     for(int i=0;i<adj[temp].size();i++)
      |                 ~^~~~~~~~~~~~~~~~~
hotspot.cpp: In function 'int main()':
hotspot.cpp:46:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   46 |   scanf("%d %d",&n,&m);
      |   ~~~~~^~~~~~~~~~~~~~~
hotspot.cpp:50:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   50 |     scanf("%d %d",&u,&v);
      |     ~~~~~^~~~~~~~~~~~~~~
hotspot.cpp:55:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   55 |   scanf("%d",&k);
      |   ~~~~~^~~~~~~~~
hotspot.cpp:58:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   58 |     scanf("%d %d",&u,&v);
      |     ~~~~~^~~~~~~~~~~~~~~
#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...