Submission #156756

#TimeUsernameProblemLanguageResultExecution timeMemory
156756martinunterPreokret (COCI18_preokret)C++14
2 / 50
3 ms504 KiB
#include <iostream> using namespace std; int main () { int final_score_a = 0; int final_score_b = 0; int preokret; int score_a;//broj koseva ekipe a int sekunda_a; int ekipa_a[score_a]; int score_b; int sekunda_b; int ekipa_b[score_b]; cin >> score_a; for (int i = 0; i < score_a;i ++){ cin >> sekunda_a; if (sekunda_a <= 1440){ final_score_a++; } } cin >> score_b; for (int i = 0; i < score_b;i ++){ cin >> sekunda_b; if (sekunda_b <= 1440){ final_score_b++; } if (ekipa_a[i] > ekipa_b[i]) { preokret ++; } if (ekipa_b[i] > ekipa_a[i]) { preokret ++; } } cout << final_score_a + final_score_b<< endl; cout << preokret << endl; return 0; }

Compilation message (stderr)

preokret.cpp: In function 'int main()':
preokret.cpp:14:21: warning: 'score_a' is used uninitialized in this function [-Wuninitialized]
  int ekipa_a[score_a];
                     ^
preokret.cpp:18:21: warning: 'score_b' is used uninitialized in this function [-Wuninitialized]
  int ekipa_b[score_b];
                     ^
preokret.cpp:57:10: warning: 'preokret' may be used uninitialized in this function [-Wmaybe-uninitialized]
  cout << preokret << endl;
          ^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...