Submission #1130073

#TimeUsernameProblemLanguageResultExecution timeMemory
1130073irmuunMake them Meet (EGOI24_makethemmeet)C++20
34 / 100
3 ms580 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n,m; cin>>n>>m; bool star=true; vector<int>g[n]; for(int i=0;i<m;i++){ int u,v; cin>>u>>v; if(u>v) swap(u,v); if(u!=0){ star=false; } g[u].pb(v); g[v].pb(u); } if(star){ cout<<4<<"\n"; for(int i=0;i<n;i++){ cout<<0<<' '; } cout<<"\n"; for(int i=0;i<n;i++){ if(i<=1) cout<<0<<' '; else cout<<1<<' '; } cout<<"\n"; for(int i=0;i<n;i++){ if(i==1) cout<<0<<' '; else cout<<1<<' '; } cout<<"\n"; for(int i=0;i<n;i++){ if(i<=1) cout<<0<<' '; else cout<<1<<' '; } cout<<"\n"; return 0; } cout<<4*n<<"\n"; for(int c=0;c<4*n;c++){ if(c%2==0){ for(int i=0;i<n;i++){ cout<<i/2<<' '; } cout<<"\n"; } else{ for(int i=0;i<n;i++){ cout<<(i+1)/2<<' '; } cout<<"\n"; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...