| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
好水啊#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
int solved = -1, ppoints = 2147483647;
string name = "";
while(n--){
string tname;
int sub[4], time[4];
cin >> tname;
for(int i = 0; i < 4; i++) cin >> sub[i] >> time[i];
int tsolved = 0, tpoints = 0;
for(int i = 0; i < 4; i++){
if(!time[i]) continue;
tsolved++;
tpoints += (time[i] + 20 * (sub[i]-1));
}
if(tsolved > solved || (tsolved==solved && tpoints < ppoints)){
name = tname;
solved = tsolved;
ppoints = tpoints;
}
}
cout << name << " " << solved << " " << ppoints << endl;
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator