QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#671500 | #7158. Carnival General | njoop | 0 | 0ms | 3676kb | C++17 | 818b | 2024-10-24 12:54:35 | 2024-10-24 12:54:35 |
answer
#include <bits/stdc++.h>
using namespace std;
int n, in;
bool arr[1010][1010];
vector<int> ans;
int main() {
cin >> n;
for(int i=1; i<=n; i++) {
for(int j=0; j<i; j++) {
cin >> in;
if(j < i/2) arr[i][in] = 1;
}
}
ans.push_back(0);
for(int i=1; i<n; i++) {
if(arr[i][ans[0]]) {
ans.insert(ans.begin(), i);
goto cont;
}
for(int j=0; j<i-1; j++) {
if(arr[i][ans[j]] && arr[i][ans[j+1]]) {
ans.insert(ans.begin()+j+1, i);
goto cont;
}
}
if(arr[i][ans[i-1]]) {
ans.insert(ans.begin()+i, i);
}
cont:;
}
for(int i: ans) {
cout << i << " ";
}
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
2 0
output:
0
result:
wrong output format Unexpected end of file - int32 expected
Subtask #2:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 3676kb
input:
2 0
output:
0
result:
wrong output format Unexpected end of file - int32 expected
Subtask #3:
score: 0
Wrong Answer
Test #12:
score: 0
Wrong Answer
time: 0ms
memory: 3604kb
input:
2 0
output:
0
result:
wrong output format Unexpected end of file - int32 expected
Subtask #4:
score: 0
Skipped
Dependency #1:
0%