제출 #1342640

#제출 시각아이디문제언어결과실행 시간메모리
1342640akqxolotl컴퓨터 네트워크 (BOI14_network)C++20
50 / 100
50 ms4380 KiB
#include "network.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pii> ipii;
#define pb push_back
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define rdint(x,y) rnd()%(y-x+1)+x
#define debug(x) cerr<<#x<<" is "<<x<<endl;
#define debugp(x,y) cerr<<#x<<' '<<#y<<" is "<<x<<' '<<y<<endl;
#define debugl(x) cerr<<#x<<" is ";for(auto p:x)cerr<<p<<" ";cerr<<endl;
#define debugpl(x) cerr<<#x<<" is ";for(auto p:x)cerr<<p.first<<" "<<p.second<<" , ";cerr<<endl;

int r[1005];
int n;
vi ap[1005];

void findRoute (int N, int a, int b){
	n=N;
    r[0]=a;
    int s=ping(a,b);
    r[s+1]=b;
    for(int i=1;i<=n;i++){
		if(i==a||i==b)continue;
		int d=ping(i,a);
		ap[d].pb(i);
	}
	int p=a;
	for(int i:ap[0]){
		if(ping(i,b)==s-1){
			p=i;
			r[1]=p;
			//debug(p)
			break;
		}
	}
	for(int i=1;i<s;i++){
		for(auto j:ap[i]){
			if(ping(j,b)==s-i-1){
				if(ping(p,j)==0){
					p=j;
					r[i+1]=p;
					//debug(p)
					break;
				}
			}
		}
	}
	for(int i=1;i<=s+1;i++)travelTo(r[i]);
}

컴파일 시 표준 에러 (stderr) 메시지

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]
   48 |     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]
   51 |             scanf("%d", &distance[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...