Submission #94131

#TimeUsernameProblemLanguageResultExecution timeMemory
94131AKaan37Go (COCI16_go)C++14
50 / 50
2 ms380 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long int lo;
typedef pair<int,int> PII;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define FOR for(int i=1;i<=n;i++)
#define mid (start+end)/2

const lo mod = 1000000007;
const lo li = 100005;
const lo inf = 1000000000;
const lo MAX = 1000000000000000000;
const lo MIN = -1000000000000000000;
const lo LOG = 30;

lo n,m,cev,k,mx=-inf,yes;
string s;
string ss;

int main(){
	scanf("%lld",&n);
	FOR{
		cin>>s;
		cin>>m>>k;
		lo at=0;
		while(k>=m){
			k-=m;
			k+=2;
			at++;
		}
		//~ int at=k/(m-2);
		yes+=at;
		//~ if(s=="Weedle")cout<<at;
		if(at>mx){ss=s;}
		mx=max(mx,at);
	}
	cout<<yes<<endl;
	cout<<ss;
	return 0;
}

Compilation message (stderr)

go.cpp: In function 'int main()':
go.cpp:27:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld",&n);
  ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...