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 "ramen.h"
bool v1[410], v2[410];
void Ramen(int N) {
int i, t, p, c, r1, r2;
while (1){
t = -1;
c = 0;
for (i = 0; i < N; i++){
if (!v1[i]){
c++;
r1 = i;
if (t == -1) t = i;
else{
p = Compare(t, i);
if (p == 1) v1[i] = true, v2[t] = true;
else v2[i] = true, v1[t] = true;
t = -1;
}
}
}
if (c == 1)break;
}
while (1){
t = -1;
c = 0;
for (i = 0; i < N; i++){
if (!v2[i]){
c++;
r2 = i;
if (t == -1) t = i;
else{
p = Compare(t, i);
if (p == 1) v2[t] = true;
else v2[i] = true;
t = -1;
}
}
}
if (c == 1)break;
}
Answer(r1, r2);
}
Compilation message (stderr)
ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:41:16: warning: 'r2' may be used uninitialized in this function [-Wmaybe-uninitialized]
Answer(r1, r2);
^
ramen.cpp:41:16: warning: 'r1' may be used uninitialized in this function [-Wmaybe-uninitialized]
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |