Submission #43943

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
439432018-03-28 12:55:55ik_ecmp (balkan11_cmp)C++17
100 / 100
2094 ms96772 KiB
#include "cmp.h"
int sec[4] = { 409, 51,8,2 };
int ch[4][2] = {
4,4,
7,6,
3,2,
4,3
};
int p[4], ofs[4] = { 4096, 4106, 4186, 4666 };
bool big;
int index(int lev, int rm) {
int div = 10 - 2 * lev;
for (int i = 0; i < div; ++i) {
if (i < ch[lev][big]) {
if (rm >= sec[lev]) rm -= sec[lev];
else {
big = 0;
p[lev] = i;
break;
}
}
else {
if (rm >= sec[lev] + 1) rm -= (sec[lev] + 1);
else {
big = 1;
p[lev] = i;
break;
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...