Submission #208865

#TimeUsernameProblemLanguageResultExecution timeMemory
208865MertD014Go (COCI16_go)C++17
50 / 50
5 ms380 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define pob pop_back using namespace std; pair<string,int> d[100]; int a,b,ans,aans,n; int main(){ cin>>n; for(int i=0;i<n;i++){ cin>>d[i].first; cin>>a>>b; ans=b/a; b+=ans*(2-a); while(b>=a){ ans++; b-=a; b+=2; } d[i].second=ans; aans+=ans; } int mx=INT_MIN,mxi; for(int i=n-1;i>=0;i--){ if(d[i].second>=mx){ mx=d[i].second; mxi=i; } } cout<<aans<<endl<<d[mxi].first; return 0; }

Compilation message (stderr)

go.cpp: In function 'int main()':
go.cpp:27:17: warning: 'mxi' may be used uninitialized in this function [-Wmaybe-uninitialized]
  int mx=INT_MIN,mxi;
                 ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...