Submission #107825

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1078252019-04-26 00:54:20degeloDreaming (IOI13_dreaming)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
//#include"dreaming.h"
#define maxn 100005
using namespace std;
int dist[maxn][3],marc[maxn][3];
vector<int> grafo[maxn],peso[maxn],cc[maxn],raios;
void dfs(int v,int k,int id){
marc[v][id]=k;
for(int i=0;i<grafo[v].size();i++){
int viz=grafo[v][i];
int p=peso[v][i];
if(marc[viz][id]==0){
dist[viz][id]=dist[v][id]+p;
dfs(viz,k,id);
}
}
}
int travelTime(int N,int M,int L,int A[],int B[],int T[]){
int k=1;
for(int i=0;i<M;i++){
grafo[A[i]].push_back(B[i]);
peso[A[i]].push_back(T[i]);
grafo[B[i]].push_back(A[i]);
peso[B[i]].push_back(T[i]);
}
for(int i=0;i<N;i++){
if(marc[i][0]==0){
dist[i][0]=0;
dfs(i,k,0);
k++;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

dreaming.cpp: In function 'void dfs(int, int, int)':
dreaming.cpp:9:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<grafo[v].size();i++){
              ~^~~~~~~~~~~~~~~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:37:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<cc[i].size();j++){
               ~^~~~~~~~~~~~~
dreaming.cpp:45:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<cc[i].size();j++){
               ~^~~~~~~~~~~~~
dreaming.cpp:53:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0;j<cc[i].size();j++){
               ~^~~~~~~~~~~~~
dreaming.cpp:66:7: warning: unused variable 'resp' [-Wunused-variable]
   int resp=max(m1+m2+L,m2+m3+2*L);
       ^~~~
dreaming.cpp:70:7: warning: unused variable 'resp' [-Wunused-variable]
   int resp=m1+m2+L;
       ^~~~
dreaming.cpp: In function 'int main()':
dreaming.cpp:88:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d %d",&n,&m,&l);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~
dreaming.cpp:92:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d %d",&a,&b,&p);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~
/tmp/cclNc3aA.o: In function `main':
dreaming.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccTDg3AL.o:grader.c:(.text.startup+0x0): first defined here
/tmp/ccTDg3AL.o: In function `main':
grader.c:(.text.startup+0xa2): undefined reference to `travelTime'
collect2: error: ld returned 1 exit status