Submission #1058539

# Submission time Handle Problem Language Result Execution time Memory
1058539 2024-08-14T10:42:50 Z 1ne Xylophone (JOI18_xylophone) C++17
0 / 100
0 ms 356 KB
#include "xylophone.h"
#include <bits/stdc++.h>
using namespace std;
static int A[5000];
 
void solve(int N) {
    int i = 1;
    while(query(i,N) == N - 1){
    	++i;
    }
	answer(i - 1,1);
	for (int j = 1;j<=N;++j){
		if (j != i - 1){
			int u = j,v = i - 1;
			if (u > v)swap(u,v);
			answer(j,query(u,v)  + 1);
		}		
	}
}

Compilation message

xylophone.cpp:4:12: warning: 'A' defined but not used [-Wunused-variable]
    4 | static int A[5000];
      |            ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 356 KB Wrong Answer [7]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 356 KB Wrong Answer [7]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 356 KB Wrong Answer [7]
3 Halted 0 ms 0 KB -