Submission #148735

# Submission time Handle Problem Language Result Execution time Memory
148735 2019-09-01T05:01:01 Z Weeeee(#3729, Alexa2001) King of Chairs (FXCUP4_chairs) C++17
100 / 100
175 ms 10536 KB
#include "king.h"

long long SendInfo(std::vector<int> W, std::vector<int> C)
{
    return 0;
}
#include "vassal.h"
#include <bits/stdc++.h>

using namespace std;

multiset< pair<int,int> > S;

void Init(long long B, std::vector<int> C)
{
    int i;
    for(i=0; i<C.size(); ++i)
        S.insert({ C[i], i });
}

int Maid(int W)
{
    multiset< pair<int,int> > :: iterator it;

    it = S.lower_bound({W, 0});
    if(it == S.end()) return -1;

    int where = it->second;
    S.erase(it);
    return where;
}

Compilation message

vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:11:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0; i<C.size(); ++i)
              ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1052 KB Correct
2 Correct 11 ms 1052 KB Correct
3 Correct 10 ms 1060 KB Correct
4 Correct 10 ms 972 KB Correct
5 Correct 10 ms 1060 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 65 ms 5844 KB Correct
2 Correct 113 ms 9632 KB Correct
3 Correct 119 ms 10452 KB Correct
4 Correct 121 ms 10200 KB Correct
5 Correct 122 ms 10328 KB Correct
6 Correct 128 ms 10448 KB Correct
7 Correct 129 ms 10452 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 81 ms 5872 KB Correct
2 Correct 170 ms 9636 KB Correct
3 Correct 140 ms 10412 KB Correct
4 Correct 163 ms 10376 KB Correct
5 Correct 175 ms 10448 KB Correct
6 Correct 152 ms 10536 KB Correct
7 Correct 131 ms 10460 KB Correct
8 Correct 118 ms 10448 KB Correct