QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#862442 | #8812. Library 3 | sichengzhou | Compile Error | / | / | C++17 | 457b | 2025-01-19 01:17:31 | 2025-01-19 01:17:33 |
Judging History
answer
#include "library3.h"
#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]);
ret=query(b);
if(ret<cur)
{
cur=ret;
x=j;
}
swap(b[i],b[j]);
}
swap(b[i],b[j]);
ret=cur;
}
answer(b);
}
详细
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:23:15: error: ‘j’ was not declared in this scope 23 | swap(b[i],b[j]); | ^