#34882: c++ AC (2ms, 360KB)


yp11151208@yphs.tp.edu.tw (805-42葉宏湧)

學校 : 臺北市私立延平高級中學
編號 : 197051
來源 : [203.72.178.1]
最後登入時間 :
2023-09-24 09:29:19
e622. 3. 虛擬寵物大師 (Master) -- 2019年10月TOI練習賽新手組 | From: [27.51.74.140] | 發表日期 : 2023-04-23 19:50

#include<bits/stdc++.h>
using namespace std;
main(){
    ios_base::sync_with_stdio(false);
    int n,m,max,maxn,a,b,i;
    while(cin>>n>>m){
        max=0,m/=1000;
        for(i=1;i<=n;i++){
            cin>>a>>b;
            if(b<30) a+=10*m;
            else if(b<40) a+=50*m;
            else a+=100*m;
            if(a>max) max=a,maxn=i;
        }
        cout<<maxn<<' '<<max<<endl;
    }
}

 
ZeroJudge Forum