# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
167270 | 2019-12-07T07:01:39 Z | theStaticMind | Izlet (COI19_izlet) | C++14 | 702 ms | 88676 KB |
#include<bits/stdc++.h> #define mp make_pair #define pb push_back #define ii pair<int,int> #define all(x) (x).begin(),(x).end() #define INF 100000000000000000 #define modulo 1000000007 #define mod 998244353 #define int long long int using namespace std; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); // freopen("q.gir","r",stdin); // freopen("q.cik","w",stdout); int k; cin>>k; if(k==2){ int n; cin>>n; vector<vector<int>>adj(n,vector<int>(n)); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>adj[i][j]; } } vector<int>color(n,-1); color[0]=1; for(int i=1;i<n;i++){ if(adj[0][i]!=adj[0][i-1])color[i]=adj[0][i]; } for(int i=0;i<n;i++){ if(color[i]>0)continue; set<int>vis; for(int j=i-1;j>=0;j--){ if(!vis.count(color[j])&&adj[i][j]==adj[i][j+1]){ color[i]=adj[i][j]; break; } vis.insert(color[j]); } if(color[i]==-1)color[i]=1; } for(int i=0;i<n;i++)cout<<color[i]<<" ";cout<<"\n"; for(int i=1;i<=n-1;i++)cout<<i<<" "<<i+1<<"\n"; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 380 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 702 ms | 88676 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 380 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |