Submission #47315

# Submission time Handle Problem Language Result Execution time Memory
47315 2018-04-30T13:39:42 Z ista2000 Computer Network (BOI14_network) C++17
100 / 100
148 ms 47668 KB
#include <bits/stdc++.h>
#include "network.h"
using namespace std;

void findRoute (int n, int a, int b)
{
    /*
     *  Obviously, this is not a good solution.
     *  Replace it with your own code.
     */

    vector<int> v(n);
	for(int i = 0;i<n;i++)
		if(i!=b-1)
			v[i] = ping(i+1, b)+1;
	int cur = a-1;
	while(cur!=b-1)
	{
		for(int i = 0;i<n;i++)
		{
			if(v[i]==v[cur]-1)
			{
				int x = ping(cur+1, i+1);
				if(!x)
				{
					travelTo(i+1);
					cur = i;
					break;
				}
			}
		}
	}
}

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 Correct 126 ms 4216 KB Output is correct
2 Correct 117 ms 7516 KB Output is correct
3 Correct 110 ms 10392 KB Output is correct
4 Correct 105 ms 13200 KB Output is correct
5 Correct 105 ms 15928 KB Output is correct
6 Correct 109 ms 18288 KB Output is correct
7 Correct 2 ms 18288 KB Output is correct
8 Correct 2 ms 18288 KB Output is correct
9 Correct 2 ms 18288 KB Output is correct
10 Correct 2 ms 18288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 108 ms 18288 KB Output is correct
2 Correct 29 ms 18288 KB Output is correct
3 Correct 148 ms 22316 KB Output is correct
4 Correct 92 ms 24492 KB Output is correct
5 Correct 121 ms 28132 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 115 ms 28132 KB Output is correct
2 Correct 29 ms 28132 KB Output is correct
3 Correct 123 ms 32384 KB Output is correct
4 Correct 95 ms 34328 KB Output is correct
5 Correct 122 ms 38004 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 115 ms 38004 KB Output is correct
2 Correct 27 ms 38004 KB Output is correct
3 Correct 126 ms 41992 KB Output is correct
4 Correct 96 ms 44064 KB Output is correct
5 Correct 123 ms 47668 KB Output is correct