제출 #699442

#제출 시각아이디문제언어결과실행 시간메모리
699442rohithk123Memory (IOI10_memory)C++14
컴파일 에러
0 ms0 KiB
#include "grader.h" #include "memory.h" #include<iostream> #include<utility> #include<vector> void play() { std::vector<std::pair<char,int> > positions(50); for(int i = 1;i<= 50;i++){ positions[i-1].second = i; positions[i-1].first = faceup(i); } char z; sort(positions.begin(),positions.end()); for(int i = 0;i<positions.size();i++){ z = faceup(positions[i].second); } return; }

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

memory.cpp: In function 'void play()':
memory.cpp:14:4: error: 'sort' was not declared in this scope; did you mean 'qsort'?
   14 |    sort(positions.begin(),positions.end());
      |    ^~~~
      |    qsort
memory.cpp:15:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<char, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |    for(int i = 0;i<positions.size();i++){
      |                  ~^~~~~~~~~~~~~~~~~