답안 #151626

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
151626 2019-09-03T22:04:05 Z thebes King of Chairs (FXCUP4_chairs) C++17
100 / 100
246 ms 63072 KB
#include <bits/stdc++.h>
#include "king.h"
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

multiset<int> s;
vi id[1000006];

ll SendInfo(vi W,vi C){return 0;}
#include <bits/stdc++.h>
#include "vassal.h"
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

#define pb push_back

multiset<int> s;
vi id[1000006];

void Init(ll B,vi C){
    for(auto v : C) s.insert(v);
    for(int i=0;i<C.size();i++)
        id[C[i]].pb(i);
}

int Maid(int w){
    auto it = s.lower_bound(w);
    if(it==s.end()) return -1;
    int idd = *it; s.erase(s.find(*it));
    int r = id[idd][0];
    id[idd].erase(id[idd].begin());
    return r;
}

Compilation message

vassal.cpp: In function 'void Init(ll, vi)':
vassal.cpp:16:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<C.size();i++)
                 ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 47732 KB Correct
2 Correct 45 ms 47768 KB Correct
3 Correct 46 ms 47872 KB Correct
4 Correct 45 ms 47604 KB Correct
5 Correct 46 ms 47812 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 106 ms 55464 KB Correct
2 Correct 154 ms 61632 KB Correct
3 Correct 165 ms 62908 KB Correct
4 Correct 164 ms 62720 KB Correct
5 Correct 165 ms 62712 KB Correct
6 Correct 165 ms 62888 KB Correct
7 Correct 166 ms 62852 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 147 ms 55516 KB Correct
2 Correct 220 ms 61748 KB Correct
3 Correct 200 ms 62872 KB Correct
4 Correct 241 ms 62912 KB Correct
5 Correct 239 ms 62932 KB Correct
6 Correct 246 ms 62984 KB Correct
7 Correct 200 ms 63072 KB Correct
8 Correct 169 ms 62312 KB Correct