Submission #149022

# Submission time Handle Problem Language Result Execution time Memory
149022 2019-09-01T05:35:29 Z 코딩은 체육과목입니다(#3561, jwvg0425, 16silver, jhuni) King of Chairs (FXCUP4_chairs) C++17
100 / 100
165 ms 10452 KB
#include "king.h"

long long SendInfo(std::vector<int> W, std::vector<int> C) {
	int N = W.size();
	return 0;
}
#include "vassal.h"

#include <set>
using namespace std;

long long BB;
multiset<pair<int,int>> CC;
void Init(long long B, std::vector<int> C){
	int N = C.size();
	BB = B;
	// ToDo
    for (int i=0;i<C.size();i++){
        CC.emplace(C[i], i);
    }
}

int Maid(int W){
    auto it = CC.lower_bound(pair<int,int>(W, 0));
    if (it == CC.end())return -1;
    int ans = (*it).second;
    CC.erase(it);
    return ans;
}

Compilation message

king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:4:6: warning: unused variable 'N' [-Wunused-variable]
  int N = W.size();
      ^

vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:12:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0;i<C.size();i++){
                  ~^~~~~~~~~
vassal.cpp:9:6: warning: unused variable 'N' [-Wunused-variable]
  int N = C.size();
      ^
# Verdict Execution time Memory Grader output
1 Correct 11 ms 1056 KB Correct
2 Correct 10 ms 1060 KB Correct
3 Correct 10 ms 1064 KB Correct
4 Correct 10 ms 1052 KB Correct
5 Correct 10 ms 1060 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 71 ms 5948 KB Correct
2 Correct 104 ms 9644 KB Correct
3 Correct 117 ms 10364 KB Correct
4 Correct 121 ms 10452 KB Correct
5 Correct 134 ms 10324 KB Correct
6 Correct 113 ms 10392 KB Correct
7 Correct 121 ms 10388 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 76 ms 5944 KB Correct
2 Correct 142 ms 9640 KB Correct
3 Correct 131 ms 10448 KB Correct
4 Correct 165 ms 10408 KB Correct
5 Correct 146 ms 10444 KB Correct
6 Correct 153 ms 9940 KB Correct
7 Correct 138 ms 10452 KB Correct
8 Correct 123 ms 10444 KB Correct