Submission #150899

# Submission time Handle Problem Language Result Execution time Memory
150899 2019-09-01T10:18:43 Z Alexa2001 King of Chairs (FXCUP4_chairs) C++17
100 / 100
153 ms 12352 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 4 ms 876 KB Correct
2 Correct 4 ms 888 KB Correct
3 Correct 4 ms 764 KB Correct
4 Correct 4 ms 764 KB Correct
5 Correct 4 ms 764 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 55 ms 6832 KB Correct
2 Correct 100 ms 11020 KB Correct
3 Correct 109 ms 11844 KB Correct
4 Correct 111 ms 11808 KB Correct
5 Correct 109 ms 11808 KB Correct
6 Correct 108 ms 11856 KB Correct
7 Correct 108 ms 12100 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 73 ms 7040 KB Correct
2 Correct 139 ms 11240 KB Correct
3 Correct 133 ms 12104 KB Correct
4 Correct 152 ms 12008 KB Correct
5 Correct 153 ms 12228 KB Correct
6 Correct 150 ms 12352 KB Correct
7 Correct 132 ms 12232 KB Correct
8 Correct 124 ms 12304 KB Correct