답안 #216938

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
216938 2020-03-28T13:27:15 Z bharat2002 컴퓨터 네트워크 (BOI14_network) C++14
25 / 100
138 ms 8568 KB
#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;
	}
	distb[b]=0;
	vector<int> vals;
	for(int i=1;i<=n;i++)
	{
		if(dista[i] + distb[i]==dista[b]&&i!=a)
		{
			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]);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 135 ms 4216 KB Output is correct
2 Correct 128 ms 4344 KB Output is correct
3 Correct 122 ms 4472 KB Output is correct
4 Correct 118 ms 4456 KB Output is correct
5 Correct 119 ms 4344 KB Output is correct
6 Correct 138 ms 4344 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 4 ms 384 KB Output is correct
9 Correct 4 ms 384 KB Output is correct
10 Correct 5 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 121 ms 8440 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 124 ms 8568 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 126 ms 8440 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -