Submission #150924

#TimeUsernameProblemLanguageResultExecution timeMemory
150924baikdohyupKing of Chairs (FXCUP4_chairs)C++17
17 / 100
1117 ms8548 KiB
#include "king.h" long long SendInfo(std::vector<int> W, std::vector<int> C) { return 0; }
#include "vassal.h" #include <algorithm> std::vector<std::pair<int, int>> chair; void Init(long long B, std::vector<int> C){ int N = C.size(); for (int i = 0; i < N; i++) { chair.push_back(std::pair<int,int>(C[i], i)); } sort(chair.begin(), chair.end()); } int Maid(int W){ for (int i = 0; i < chair.size(); i++) { if (chair[i].first >= W) { chair[i].first = 0; return chair[i].second; } } return -1; }

Compilation message (stderr)

vassal.cpp: In function 'int Maid(int)':
vassal.cpp:17:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < chair.size(); i++) {
                  ~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...