QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#494094 | #5004. Finalists | Abcl | AC ✓ | 0ms | 3836kb | C++14 | 820b | 2024-07-27 14:04:55 | 2024-07-27 14:04:55 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=200005;
struct node{
string s;
double sum;
double a,b,c,d,e;
};
int n;
bool cmp(node k1,node k2){
return k1.sum>k2.sum;
}
void solve(){
cin>>n;
node nums[8];
for(int i=1;i<=6;i++){
cin>>nums[i].s>>nums[i].a>>nums[i].b>>nums[i].c>>nums[i].d>>nums[i].e;
nums[i].sum=nums[i].a*0.56+nums[i].b*0.24+nums[i].c*0.14+nums[i].d*0.06+nums[i].e*0.3;
}
sort(nums+1,nums+7,cmp);
int ans=n/6;
int k=n%6;
for(int i=1;i<=k;i++){
if(nums[i].s=="Taiwan"){
ans++;
}
}
cout<<ans;
return;
}
signed main() {
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int t=1;
// cin>>t;
while(t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3676kb
input:
17 Japan 500 95 40 30 5 Vietnam 400 50 150 40 20 Indonesia 700 25 80 35 20 Taiwan 200 30 100 35 1 Korea 600 100 100 70 0 Philippines 50 10 40 15 15
output:
3
result:
ok single line: '3'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
16 Japan 500 95 40 30 5 Taiwan 200 30 100 35 1 Indonesia 700 25 80 35 20 Philippines 50 10 40 15 15 Korea 600 100 100 70 0 Vietnam 400 50 150 40 20
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
16 Vietnam 321 51 113 48 0 Indonesia 690 19 60 17 15 Korea 333 54 59 39 0 Japan 294 86 40 29 0 Taiwan 145 26 101 30 0 Philippines 29 26 50 30 4
output:
2
result:
ok single line: '2'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
17 Vietnam 321 51 113 48 0 Indonesia 690 19 60 17 15 Korea 333 54 59 39 0 Japan 294 86 40 29 0 Taiwan 145 26 101 30 0 Philippines 29 26 50 30 4
output:
3
result:
ok single line: '3'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
17 Japan 294 86 40 29 0 Philippines 145 26 101 30 0 Taiwan 29 26 50 30 4 Vietnam 321 51 113 48 0 Indonesia 690 19 60 17 15 Korea 333 54 59 39 0
output:
2
result:
ok single line: '2'