QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#494094#5004. FinalistsAbclAC ✓0ms3836kbC++14820b2024-07-27 14:04:552024-07-27 14:04:55

Judging History

你现在查看的是最新测评结果

  • [2024-07-27 14:04:55]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3836kb
  • [2024-07-27 14:04:55]
  • 提交

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'