QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#671710#7158. Carnival Generalnjoop0 0ms3612kbC++17820b2024-10-24 14:09:142024-10-24 14:09:15

Judging History

你现在查看的是最新测评结果

  • [2024-10-24 14:09:15]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3612kb
  • [2024-10-24 14:09:14]
  • 提交

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-1][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-2; 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: 3612kb

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: 3572kb

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: 3536kb

input:

2
0

output:

0 

result:

wrong output format Unexpected end of file - int32 expected

Subtask #4:

score: 0
Skipped

Dependency #1:

0%