Submission #793019

#TimeUsernameProblemLanguageResultExecution timeMemory
793019Trisanu_DasKocka (COCI18_kocka)C++17
70 / 70
82 ms4300 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int polje[4*n]; for(int i=0;i<4*n;i++){ cin>>polje[i]; } for(int i=0;i<3*n;i++){ if(i<n or i>=2*n and i<3*n){ if(polje[i]==-1 && polje[i+n]!=-1 || polje[i+n]==-1 && polje[i]!=-1){ cout<<"NE"; return 0; } else if(polje[i]+polje[i+n]>=n){ cout<<"NE"; return 0; } } } cout<<"DA"; return 0; }

Compilation message (stderr)

kocka.cpp: In function 'int main()':
kocka.cpp:11:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   11 |   if(i<n or i>=2*n and i<3*n){
      |             ~~~~~~~^~~~~~~~~
kocka.cpp:12:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   12 |    if(polje[i]==-1 && polje[i+n]!=-1 || polje[i+n]==-1 && polje[i]!=-1){
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
#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...