Submission #701715

#TimeUsernameProblemLanguageResultExecution timeMemory
701715chenyanKocka (COCI18_kocka)C++17
28 / 70
1052 ms3708 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define ff first #define ss second #define all(x) x.begin(),x.end() #define pb emplace_back #define N 200010 vector<pii>v; int a[4][N]; signed main(){ ios::sync_with_stdio(0); cin.tie(0); int n,m,i,j,k; cin>>n; for(j=0;j<4;j++)for(i=0;i<n;i++)cin>>a[j][i]; for(i=0;i<n;i++){ for(j=0;j<3;j+=2){ if((a[j][i]==-1||a[j+1][i]==-1)&&a[j][i]!=a[j+1][i]){ cout<<"NE\n"; return 0; } if(a[j][i]>n-1-a[j+1][i]){ cout<<"NE\n"; return 0; } } for(k=0;k<a[0][i];k++){ if(a[2][k]==i||a[3][k]==n-1-i){ cout<<"NE\n"; return 0; } } for(k=0;k<a[1][i];k++){ if(a[2][n-1-k]==i||a[3][n-1-k]==n-1-i){ cout<<"NE\n"; return 0; } } } cout<<"DA\n"; }

Compilation message (stderr)

kocka.cpp: In function 'int main()':
kocka.cpp:15:8: warning: unused variable 'm' [-Wunused-variable]
   15 |  int n,m,i,j,k;
      |        ^
#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...