Submission #157574

#TimeUsernameProblemLanguageResultExecution timeMemory
157574ToniBElder (COCI19_elder)C++14
26 / 50
2 ms376 KiB
#include <iostream> using namespace std; // int v[90]; int main(){ int N, v[90]; int broj = 1; char sol, X, Y; cin >> sol; cin >> N; v[(int)sol] += 1; for(int i = 0; i < N; ++i){ cin >> X >> Y; if(sol == Y){ sol = X; v[(int)X] += 1; if(v[(int)X] == 1){ broj += 1; } } } cout << sol << endl; cout << broj; return 0; }

Compilation message (stderr)

elder.cpp: In function 'int main()':
elder.cpp:13:14: warning: 'v[<unknown>]' is used uninitialized in this function [-Wuninitialized]
  v[(int)sol] += 1;
  ~~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...