QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#862462 | #8812. Library 3 | sichengzhou | Compile Error | / | / | C++17 | 449b | 2025-01-19 01:37:11 | 2025-01-19 01:37:13 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void solve(int N) {
std::vector<int> b(N, 0);
for (int i = 0; i < N; i++) {
b[i] = i;
}
int ret=query(b);
for (int i = 0; i < N; i++){
int x=i,cur=ret;
for (int j = i+1; j < N; j++){
swap(b[i],b[j]);
// answer(b);
ret=query(b);
if(ret<cur)
{
cur=ret;
x=j;
}else{
swap(b[i],b[j]);
}
}
ret=cur;
}
answer(b);
}
Details
implementer.cpp: In function ‘int query(std::vector<int>)’: implementer.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d",&ret); | ~~~~~^~~~~~~~~~~ implementer.cpp: In function ‘int main()’: implementer.cpp:24:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 24 | scanf("%d",&n); | ~~~~~^~~~~~~~~ answer.code: In function ‘void solve(int)’: answer.code:8:11: error: ‘query’ was not declared in this scope 8 | int ret=query(b); | ^~~~~ answer.code:25:3: error: ‘answer’ was not declared in this scope 25 | answer(b); | ^~~~~~