Submission #216935

# Submission time Handle Problem Language Result Execution time Memory
216935 2020-03-28T13:25:32 Z bharat2002 Computer Network (BOI14_network) C++14
0 / 100
141 ms 8696 KB
/*input

*/
#include "network.h"
#include<bits/stdc++.h>
using namespace std;
const int N=1e3 + 100;
int dista[N], distb[N];
bool sf(int a, int b)
{
	return dista[a]<dista[b];
}
void findRoute(int n, int a, int b)
{
	for(int i=1;i<=n;i++)
	{
		if(i==a) continue;
		dista[i]=ping(i, a) +1;
	}
	for(int i=1;i<=n;i++)
	{
		if(i==b) continue;
		distb[i]=ping(i, b) + 1;
	}
	vector<int> vals;
	for(int i=1;i<=n;i++)
	{
		if(dista[i] + distb[i]==dista[b]&&i!=a&&i!=b)
		{
			vals.push_back(i);
		}
	}
	sort(vals.begin(), vals.end(), sf);
	int prev=0;
	for(auto i:vals)
	{
		assert(dista[i]==prev+1);prev++;
		travelTo(i);
	}
}

Compilation message

grader.c: In function 'int main()':
grader.c:48:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%d%d%d%d", &N, &a, &b, &M);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
grader.c:51:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &distance[u][v]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 141 ms 4288 KB Message has not reached its target
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 140 ms 8544 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 130 ms 8696 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 138 ms 8508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -