답안 #148561

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148561 2019-09-01T04:39:58 Z Dopatii(#3751, bogdan10bos, Gioto, Bodo171) King of Chairs (FXCUP4_chairs) C++17
100 / 100
159 ms 10568 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;

long long BB;
set <pair <int, int> > s;
void Init(long long B, std::vector<int> C){
	int N = C.size();
	BB = B;

	int i = 0;
    for(auto it : C){
        s.insert({it, i});
        ++i;
    }

}

int Maid(int W){
    set <pair <int, int> > :: iterator it = s.lower_bound({W, 0});

    if(it->first < W) return -1;

    int pos = it->second;
    s.erase(it);

    return pos;
}

Compilation message

vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:8:6: warning: unused variable 'N' [-Wunused-variable]
  int N = C.size();
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 800 KB Correct
2 Correct 10 ms 1060 KB Correct
3 Correct 10 ms 1056 KB Correct
4 Correct 10 ms 1056 KB Correct
5 Correct 10 ms 1052 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 66 ms 5952 KB Correct
2 Correct 106 ms 9636 KB Correct
3 Correct 118 ms 10448 KB Correct
4 Correct 120 ms 9936 KB Correct
5 Correct 113 ms 10444 KB Correct
6 Correct 119 ms 10292 KB Correct
7 Correct 120 ms 10416 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 79 ms 5436 KB Correct
2 Correct 141 ms 9624 KB Correct
3 Correct 135 ms 10464 KB Correct
4 Correct 155 ms 10568 KB Correct
5 Correct 159 ms 10436 KB Correct
6 Correct 152 ms 10448 KB Correct
7 Correct 136 ms 10320 KB Correct
8 Correct 126 ms 10448 KB Correct