| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1354380 | branches1029 | Carnival (EGOI23_carnival) | C++20 | 46 ms | 4336 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
bool no[1005];
int a[1005][1005];
vector<int> ans;
int main(){
//ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n;
for( int i=1 ; i<n ; i++ ){
for( int j=0 ; j<i ; j++ ){
cin >> a[i][j];
}
}
ans.push_back(0);
ans.push_back(1);
for( int i=2 ; i<n ; i++ ){
for( int j=0 ; j<n ; j++ ) no[j]=false;
for( int j=0 ; j<i ; j++ ){
if( a[i][j]>=(i+1)/2 ) no[j]=true;
}
bool f=false;
if( !no[ans[0]] ){
ans.insert( ans.begin(), i );
continue;
}
for( int j=1 ; j<ans.size() ; j++ ){
if( !no[ans[j-1]] && !no[ans[j]] ){
ans.insert( ans.begin()+j, i );
f=true;
break;
}
}
if( !f ){
ans.push_back(i);
}
}
for( int u : ans ){
cout << u << ' ';
}
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
