Submission #398841

#TimeUsernameProblemLanguageResultExecution timeMemory
398841AlexandraGo (COCI16_go)C++14
50 / 50
2 ms320 KiB
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n, resp, max; cin >> n; string out; for (int i=0; i<n; i++) { long long m; int k; string poke; cin >> poke; cin >> k >> m; int a=0; while (m>=k) { resp++; m = m - k + 2; a++; } if (a>max) { max = a; out = poke; } } cout << resp << endl; cout << out; return 0; }

Compilation message (stderr)

go.cpp: In function 'int main()':
go.cpp:35:10: warning: 'resp' may be used uninitialized in this function [-Wmaybe-uninitialized]
   35 |  cout << resp << endl;
      |          ^~~~
go.cpp:29:3: warning: 'max' may be used uninitialized in this function [-Wmaybe-uninitialized]
   29 |   if (a>max) {
      |   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...