Submission #1107690

#TimeUsernameProblemLanguageResultExecution timeMemory
1107690ozner77Parachute rings (IOI12_rings)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; vector<vector<long long>> V; vector<long long> sumas; int init(long long N){ vector<long long> V1(N,0); for(int i=0;i<N;i++){ V.push_back(V1); } return 0; } int Link(long long A,long long B){ V[A][B]=1; V[B][A]=1; sumas[A]++; sumas[B]++; return 0; } int CountCritical(){ long long critical=0; for(int i=0;i<V.size();i++){ bool es=true; for(int j=0;j<V.size();j++){ if(i!=j){ if(V[j][i]==1){ if(sumas[j]-1>2){ es=false; break; } }else{ if(sumas[j]>2){ es=false; break; } } } } if(es){ critical++; } } return critical; }

Compilation message (stderr)

rings.cpp: In function 'int CountCritical()':
rings.cpp:21:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int i=0;i<V.size();i++){
      |                 ~^~~~~~~~~
rings.cpp:23:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         for(int j=0;j<V.size();j++){
      |                     ~^~~~~~~~~
/usr/bin/ld: /tmp/cctLi94L.o: in function `main':
grader.cpp:(.text.startup+0x88): undefined reference to `Init(int)'
/usr/bin/ld: grader.cpp:(.text.startup+0xca): undefined reference to `Link(int, int)'
collect2: error: ld returned 1 exit status