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 <algorithm>
#include <vector>
#include <string>
#include <iostream>
using namespace std;
typedef pair<int, int> pii;
long long SendInfo(vector<int> W, vector<int> C) {
int N = W.size();
vector<pii> ws, cs;
for(int i=0;i<N;i++) {
cs.push_back({C[i], i});
}
sort(cs.begin(), cs.end());
for(int i=0;i<N;i++) {
ws.push_back({W[i], i});
}
sort(ws.begin(), ws.end());
int ans[12]={};
int wi=0;
int ci=0;
for(;wi<N && ci<N;) {
while(ci<N && ws[wi].first>cs[ci].first) {
ci++;
}
if(ci==N) break;
ans[ws[wi].second] = cs[ci].second;
wi++; ci++;
}
for(int i=wi;i<N;i++)
ans[ws[i].second] = 10;
long long ret = 0;
long long K = 1;
for(int i=0;i<N;i++) {
ret += K*ans[i];
K *= 11;
}
return ret;
}
#include "vassal.h"
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
long long BB;
void Init(long long B, vector<int> C){
int N = C.size();
BB = B;
// ToDo
}
int Maid(int W){
int ret = BB%11;
BB/=11;
if(ret==10) return -1;
return ret;
}
Compilation message (stderr)
vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:9:6: warning: unused variable 'N' [-Wunused-variable]
int N = C.size();
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |