Submission #660937

#TimeUsernameProblemLanguageResultExecution timeMemory
660937Trisanu_DasGo (COCI16_go)C++17
0 / 50
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n, need, has, ans = 0, mx = 0, cnt; string pok, anss; while(n--){ cin >> pok >> need >> has; cnt = 0; while(need <= has){ cnt++; has -= need - 2; } ans += cnt; if(cnt > mx){ mx = cnt; anss = pok; } } cout << ans << '\n' << anss << '\n'; }

Compilation message (stderr)

go.cpp: In function 'int main()':
go.cpp:7:10: warning: 'n' is used uninitialized in this function [-Wuninitialized]
    7 |   while(n--){
      |         ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...