第十一届浙江省赛题目

Pokemon Master

Time Limit: 2 Seconds      Memory Limit: 65536 KB

Calem and Serena are pokemon masters. One day they decided to have a pokemon battle practice before Pokemon World Championships. Each of them has some pokemons in each's team. To make the battle more interesting, they decided to use a special rule to determine the winner: the team with heavier total weight will win the battle!

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains two integers N and M (1 <= N, M <= 6), which describes that Calem has N pokemons and Serena has M pokemons.

The second line contains N integers indicating the weight of Calem's pokemons. The third line contains M integers indicating the weight of Serena's pokemons. All pokemons' weight are in the range of [1, 2094] pounds.

Output

For each test case, output "Calem" if Calem's team will win the battle, or "Serena" if Serena's team will win. If the two team have the same total weight, output "Draw" instead.

Sample Input
1
6 6
13 220 199 188 269 1014
101 176 130 220 881 396
Sample Output
Serena

Author: JIANG, Kai

Source: The 11th Zhejiang Provincial Collegiate Programming Contest

类似A+B

#include<stdio.h>
int main()
{
	int t, n, m;
	scanf("%d", &t);
	while (t--)
	{
		scanf("%d %d", &n, &m);
		int i, num, s1 = 0, s2 = 0;
		for (i = 0; i < n; i++)
		{
			scanf("%d", &num);
			s1 += num;
		}
		for (i = 0; i < m; i++)
		{
			scanf("%d", &num);
			s2 += num;
		}
		if (s1 == s2)
			puts("Draw");
		else
			puts(s1 > s2 ? "Calem" : "Serena");
	}
	return 0;
}

Talented Chef

Time Limit: 2 Seconds      Memory Limit: 65536 KB

As we all know, Coach Gao is a talented chef, because he is able to cook M dishes in the same time. Tonight he is going to have a hearty dinner with his girlfriend at his home. Of course, Coach Gao is going to cook all dishes himself, in order to show off his genius cooking skill to his girlfriend.

To make full use of his genius in cooking, Coach Gao decides to prepare N dishes for the dinner. The i-th dish contains Ai steps. The steps of a dish should be finished sequentially. In each minute of the cooking, Coach Gao can choose at most M different dishes and finish one step for each dish chosen.

Coach Gao wants to know the least time he needs to prepare the dinner.

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains two integers N and M (1 <= N, M <= 40000). The second line contains N integers Ai (1 <= Ai <= 40000).

Output

For each test case, output the least time (in minute) to finish all dishes.

Sample Input
2
3 2
2 2 2
10 6
1 2 3 4 5 6 7 8 9 10
Sample Output
3
10

这个题目是很有意思的,其实不难,估计失误
#include<iostream>
using namespace std;

int main()
{
    int t,sum,max,p,q;
    cin>>t;
    while(t--)
    {
        int n,m;
        cin>>n>>m;
        sum=0;
        max=0;
        for(int i=0; i<n; i++)
        {
            int a;
            cin>>a;
            if(max<a) max=a;
            sum+=a;
        }
        if(max>sum/m)
        {
            cout<<max<<endl;
        }
        else
        {
            p=sum/m;
            q=sum%m;
            if(q)p++;
            if(p<max)p=max;
            cout<<p<<endl;
        }
    }
    return 0;
}


What day is that day?

Time Limit: 2 Seconds      Memory Limit: 65536 KB

It's Saturday today, what day is it after 11 + 22 + 33 + ... + NN days?

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

There is only one line containing one integer N (1 <= N <= 1000000000).

Output

For each test case, output one string indicating the day of week.

Sample Input
2
1
2
Sample Output
Sunday
Thursday
Hint

A week consists of Sunday, Monday, Tuesday, Wednesday, Thursday, Friday and Saturday.


Author: ZHOU, Yuchen
Source: The 11th Zhejiang Provincial Collegiate Programming Contest

只要打表,再用记事本查找就好了,其实很水的,看来java大数很重要啊

#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;

void modday(int n)
{
    if(n%7==0)
        cout<<"Saturday"<<endl;
    else if(n%7==1)
        cout<<"Sunday"<<endl;
    else if(n%7==2)
        cout<<"Monday"<<endl;
    else if(n%7==3)
        cout<<"Tuesday"<<endl;
    else if(n%7==4)
        cout<<"Wednesday"<<endl;
    else if(n%7==5)
        cout<<"Thursday"<<endl;
    else if(n%7==6)
        cout<<"Friday"<<endl;
}



int main()
{
    int testcase;
    cin>>testcase;
    int a[300]={
 0,1 ,5 ,4 ,1, 4, 5 ,5 ,6 ,0, 4, 6 ,0 ,6, 6, 0 ,2 ,0, 1, 6, 0, 0, 1 ,5 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;
        N=N%294;
        modday(a[N]);


    }


    return 0;
}

Access System

Time Limit: 2 Seconds      Memory Limit: 65536 KB

For security issues, Marjar University has an access control system for each dormitory building.The system requires the students to use their personal identification cards to open the gate if they want to enter the building.

The gate will then remain unlocked for L seconds. For example L = 15, if a student came to the dormitory at 17:00:00 (in the format of HH:MM:SS) and used his card to open the gate. Any other students who come to the dormitory between [17:00:00, 17:00:15) can enter the building without authentication. If there is another student comes to the dorm at 17:00:15 or later, he must take out his card to unlock the gate again.

There are N students need to enter the dormitory. You are given the time they come to the gate. These lazy students will not use their cards unless necessary. Please find out the students who need to do so.

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains two integers N (1 <= N <= 20000) and L (1 <= L <= 3600). The next N lines, each line is a unique time between [00:00:00, 24:00:00) on the same day.

Output

For each test case, output two lines. The first line is the number of students who need to use the card to open the gate. The second line the the index (1-based) of these students in ascending order, separated by a space.

Sample Input
3
2 1
12:30:00
12:30:01
5 15
17:00:00
17:00:15
17:00:06
17:01:00
17:00:14
3 5
12:00:09
12:00:05
12:00:00
Sample Output
2
1 2
3
1 2 4
2
2 3

Author: DAI, Longao
Source: The 11th Zhejiang Provincial Collegiate Programming Contest

简单模拟题目,水

#include<cstdio>
#include<algorithm>
using namespace std;
struct node
{
	int ti;
	int num;
	int a,b,c;
};
bool cmp(node a,node b)
{
	return a.ti<b.ti;
}
main()
{
	node st[20005];
	int i,j;
	int t;
	int hao[20005];
	int num,time;
	int count;
	int ct,k;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d%d",&num,&time);
		for(i=0;i<num;i++)
		{
		    scanf("%d:%d:%d",&st[i].a,&st[i].b,&st[i].c);
		    st[i].ti=st[i].a*3600+st[i].b*60+st[i].c;
		    st[i].num=i+1;
		}
		sort(st,st+num,cmp);
		count=1;
		k=0;
		hao[k]=st[0].num;
		ct=st[0].ti;
		for(i=1;i<num;i++)
		{
			if((st[i].ti-ct)>=time)
			{
				ct=st[i].ti;
				k++;
				hao[k]=st[i].num;
				count++;
			}
			
		}
		int fff=0;
		sort(hao,hao+count);
		printf("%d\n",count);
		for(i=0;i<count;i++)
		{
			if(fff)
			printf(" ");
			printf("%d",hao[i]);
			fff=1;
		}
		printf("\n");
	}
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值