Submission #147203

#TimeUsernameProblemLanguageResultExecution timeMemory
147203MatesV13Preokret (COCI18_preokret)C++11
50 / 50
2 ms376 KiB
#include <bits/stdc++.h> using namespace std; int a[2881],b[2881],A, B, x, reza, rezb, vod, ok; int main (){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>A; for(int i=1;i<A+1;i++) {cin>>x;a[x]++;} cin>>B; for(int j=1;j<B+1;j++) {cin>>x;b[x]++;} x=0; for (int i=0;i<1441;i++){if(a[i])x++; if(b[i])x++;} for(int i=1;i<2881;i++){ if(a[i])reza++; if(b[i])rezb++; if (reza+rezb==1){if(reza) vod=1; else vod=2;} if (reza>rezb and vod==2){vod=1; ok++;} if (reza<rezb and vod==1){vod=2; ok++;} } cout << x << endl << ok; return 0; }

Compilation message (stderr)

preokret.cpp: In function 'int main()':
preokret.cpp:11:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if(a[i])reza++; if(b[i])rezb++;
   ^~
preokret.cpp:11:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   if(a[i])reza++; if(b[i])rezb++;
                   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...