This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "king.h"
//#include <bits/stdc++.h>
#include <vector>
using namespace std;
long long SendInfo(vector<int> W, vector<int> C) {
int N = W.size();
if(N > 10) return 0;
vector<bool> isused(N,false);
long long ret = 0;
for(int i = 0; i < N; i++){
int curidx = -1;
for(int j = 0; j < N; j++){
if(isused[j]) continue;
if(W[i] > C[j]) continue;
if(curidx == -1) curidx = j;
else{
if(C[curidx] > C[j]) curidx = j;
}
}
if(curidx != -1) isused[curidx] = true;
curidx++;
ret = ret*11+curidx;
}
return ret;
}
#include "vassal.h"
//#include <bits/stdc++.h>
#include <vector>
using namespace std;
long long BB;
vector<int> schedule(11);
int N;
int idx = -1;
void Init(long long B, vector<int> C){
int N = C.size();
BB = B;
for(int i = N-1; i >= 0; i--){
schedule[i] = B%11-1;
B /= 11;
}
}
int Maid(int W){
idx++;
return schedule[idx];
//return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |