Submission #148754

#TimeUsernameProblemLanguageResultExecution timeMemory
148754티셔츠 콜렉터 (#200)King of Chairs (FXCUP4_chairs)C++17
55 / 100
101 ms6988 KiB
#include "king.h" long long SendInfo(std::vector<int> W, std::vector<int> C) { return 0; }
#include "vassal.h" #include <algorithm> struct data { int c, pos; }; bool cmp(const data& a, const data& b) { return a.c < b.c; } int cnt, N, idx; std::vector<data> C2; bool check[100001]; void Init(long long B, std::vector<int> C) { cnt = 0; N = C.size(); idx = 0; for (int i=0; i<N; i++) { C2.push_back({C[i], i}); check[i] = false; } std::sort(C2.begin(), C2.end(), cmp); } int Maid(int W) { if (N <= 10) { for (int i=0; i<N; i++) { if (check[i] || C2[i].c < W) continue; check[C2[i].pos] = true; return C2[i].pos; } return -1; } else { while (idx < N && C2[idx].c < W) { idx++; } if (idx >= N) { return -1; } else { return C2[idx++].pos; } } return -1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...