Submission #39359

#TimeUsernameProblemLanguageResultExecution timeMemory
3935914kg라멘 (JOI14_ramen)C++11
50 / 100
0 ms1120 KiB
#include "ramen.h" void Ramen(int n) { int d[300][2], k=1; for (int i = 0; i < n; i++) d[i][0] = d[i][1] = i; while (k < n) { for (int i = 0; i + k < n; i += k * 2) { d[i][0] = Compare(d[i][0], d[i + k][0]) > 0 ? d[i][0] : d[i + k][0]; if (k > 1) d[i][1] = Compare(d[i][1], d[i + k][1]) < 0 ? d[i][1] : d[i + k][1]; else d[i][1] = (i * 2 + k) - d[i][0]; } k *= 2; } Answer(d[0][1], d[0][0]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...