Submission #347211

#TimeUsernameProblemLanguageResultExecution timeMemory
347211IwanttobreakfreePoi (IOI09_poi)C++14
Compilation error
0 ms0 KiB
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int N,T,P,contador,objetivopuntos,objetivopreg,rank; int main(){ while(cin>>N>>T>>P){ rank=1; int puntos[N][T]; vector <int> puntospreg(T);//Valor de cada pregunta vector <int> puntosconc(N,0); //Calificación de cada concursante vector <int> pregconc(N,0); //Nº de preguntas que respondió cada concursante for(int a=0;a<N;a++){ for(int b=0;b<T;b++){ cin>>puntos[a][b]; } } for(int b=0;b<T;b++){ contador=0; for(int a=0;a<N;a++){ if(puntos[a][b]==0) contador++; } puntospreg[b]=contador; } for(int a=0;a<N;a++){ for(int b=0;b<T;b++){ if(puntos[a][b]==1) puntosconc[a]+=puntospreg[b],pregconc[a]++; } } objetivopuntos=puntosconc[P-1]; //Puntos de Philip objetivopreg=pregconc[P-1]; //Preguntas respondidas x Philip for(int a=0;a<P-1;a++){ if(objetivopuntos==puntosconc[a]){ if(objetivopreg>=pregconc[a]) rank++; } } sort(puntosconc.rbegin(),puntosconc.rend()); int pasada=0; while(puntosconc[pasada]>objetivopuntos){ rank++; pasada++; } cout<<objetivopuntos<<" "<<rank<<'\n'; } return 0; }

Compilation message (stderr)

poi.cpp: In function 'int main()':
poi.cpp:10:3: error: reference to 'rank' is ambiguous
   10 |   rank=1;
      |   ^~~~
In file included from /usr/include/c++/9/bits/move.h:55,
                 from /usr/include/c++/9/bits/stl_pair.h:59,
                 from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/vector:60,
                 from poi.cpp:3:
/usr/include/c++/9/type_traits:1257:12: note: candidates are: 'template<class> struct std::rank'
 1257 |     struct rank
      |            ^~~~
poi.cpp:7:48: note:                 'int rank'
    7 | int N,T,P,contador,objetivopuntos,objetivopreg,rank;
      |                                                ^~~~
poi.cpp:36:35: error: reference to 'rank' is ambiguous
   36 |     if(objetivopreg>=pregconc[a]) rank++;
      |                                   ^~~~
In file included from /usr/include/c++/9/bits/move.h:55,
                 from /usr/include/c++/9/bits/stl_pair.h:59,
                 from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/vector:60,
                 from poi.cpp:3:
/usr/include/c++/9/type_traits:1257:12: note: candidates are: 'template<class> struct std::rank'
 1257 |     struct rank
      |            ^~~~
poi.cpp:7:48: note:                 'int rank'
    7 | int N,T,P,contador,objetivopuntos,objetivopreg,rank;
      |                                                ^~~~
poi.cpp:42:4: error: reference to 'rank' is ambiguous
   42 |    rank++;
      |    ^~~~
In file included from /usr/include/c++/9/bits/move.h:55,
                 from /usr/include/c++/9/bits/stl_pair.h:59,
                 from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/vector:60,
                 from poi.cpp:3:
/usr/include/c++/9/type_traits:1257:12: note: candidates are: 'template<class> struct std::rank'
 1257 |     struct rank
      |            ^~~~
poi.cpp:7:48: note:                 'int rank'
    7 | int N,T,P,contador,objetivopuntos,objetivopreg,rank;
      |                                                ^~~~
poi.cpp:46:30: error: reference to 'rank' is ambiguous
   46 |   cout<<objetivopuntos<<" "<<rank<<'\n';
      |                              ^~~~
In file included from /usr/include/c++/9/bits/move.h:55,
                 from /usr/include/c++/9/bits/stl_pair.h:59,
                 from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/vector:60,
                 from poi.cpp:3:
/usr/include/c++/9/type_traits:1257:12: note: candidates are: 'template<class> struct std::rank'
 1257 |     struct rank
      |            ^~~~
poi.cpp:7:48: note:                 'int rank'
    7 | int N,T,P,contador,objetivopuntos,objetivopreg,rank;
      |                                                ^~~~