计科软件对抗赛。。。说多了都是泪

RE选老婆

Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^

题目描述

RE最近为情所困,甚至代码都不想敲了。。天天抽刀断水水更流,举杯消愁愁更愁啊。。对酒哭人生,对月诉衷肠。。。于是身为他的队长的我很是着急啊。。这不校赛已经结束了,于是想要给他从参加校赛的中找个妹子,他是疯子她是傻,与他缠缠绵绵敲代码到天涯。但是不知道参赛者是男的还是妹子,据后台说,男的ID名中的不同字母数都是偶数,而妹子ID名中的不同字母数都是奇数。于是这完全可以编个代码来实现啊,这对于RE来说还不是小菜一碟啊。。但是他喝酒已喝晕。。连字母都认不清了,于是你来帮他写个代码来找妹子吧。如果是男的,则输出“GET OUT!”,如果是妹子的话就输出“I WANT YOU!”。

输入

每一行是一串只有小写字母组成的字符串(不含空格),不超过100个字符。

输出

输出“GET OUT!”或“I WANT YOU!”。

示例输入

wjmzbmr
cjl

示例输出

GET OUT!
I WANT YOU!

简单小哈希


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    char a[1000];
    int b[1000];
    int len,i;
    while (~scanf ("%s",a))
    {
        int t=0;
        len =strlen (a);
        memset (a,'\0',sizeof (a));
        memset (b,0,sizeof (b));
        for (i=0; i<len; i++)
        {
            b[a[i]-'a']++;
        }
        for (i=0;i<27;i++)
        {
            if (b[i]!=0)
                t++;
        }
        if (t % 2 == 0)
            printf ("GET OUT!\n");
        else printf ("I WANT YOU!\n");
    }
    return 0;
}


Easy的题

Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^

题目描述

YZL说她的线代很好,但是我们大家都不服啊,这坚决不能忍啊。。连我这上学期把所有能挂的科目都挂了的学渣渣都表示不服。。。于是我们一起出了个看似是矩阵或者行列式的题目给她,让她来做。她一看惊呼“so easy!”,然后。。。就没然后了。。只是从她嘴里知道她现在突然变得特别忙。。。。(赤果果的借口!)她想要找你来帮她做一下,但是用脚趾头想想都知道你肯定不想帮她做,但是聪明的你一眼就看出了里边的规律,而且编程能力很强的你,可不可以写个程序来算呢,就可以不用手工来帮她算了。为了给YZL增加难度,于是给她出的英文题(现在发现确实是高估了她了。。。)。

The dot product of two integer number vectors x and y of size n is the sum of the products of the corresponding components of the vectors. The unusual square of an n × n square matrix A is defined as the sum of n dot products. The i-th of them is the dot product of the i-th row vector and the i-th column vector in the matrix A.Fortunately for Chris, he has to work only in GF(2)! This means that all operations (addition, multiplication) are calculated modulo 2. In fact, the matrix A is binary: each element of A is either 0 or 1. For example, consider the following matrix A:
 
The unusual square of A is equal to (1·1 + 1·0 + 1·1) + (0·1 + 1·1 + 1·0) + (1·1 + 0·1 + 0·0) = 0 + 1 + 1 = 0.However, there is much more to the homework. Chris has to process q queries; each query can be one of the following:
given a row index i, flip all the values in the i-th row in A;
 
given a column index i, flip all the values in the i-th column in A;
 
find the unusual square of A.
To flip a bit value w means to change it to 1 - w, i.e., 1 changes to 0 and 0 changes to 1.Given the initial matrix A, output the answers for each query of the third type! Can you solve Chris's homework?

输入

The first line of input contains an integer n (1 ≤ n ≤ 1000), the number of rows and the number of columns in the matrix A. The next n lines describe the matrix: the i-th line contains n space-separated bits and describes the i-th row of A. The j-th number of the i-th line aij (0 ≤ aij ≤ 1) is the element on the intersection of the i-th row and the j-th column of A.
 
The next line of input contains an integer q (1 ≤ q ≤ 106), the number of queries. Each of the next q lines describes a single query, which can be one of the following:
 
1 i — flip the values of the i-th row;
2 i — flip the values of the i-th column;
3 — output the unusual square of A.
Note: since the size of the input and output could be very large, don't use slow output techniques in your language. For example, do not use input and output streams (cin, cout) in C++.

输出

Let the number of the 3rd type queries in the input be m. Output a single string s of length m, where the i-th symbol of s is the value of the unusual square of A for the i-th query of the 3rd type as it appears in the input.

示例输入

3
1 1 1
0 1 1
1 0 0
12
3
2 3
3
2 2
2 2
1 3
3
3
1 2
2 1
1 1
3

示例输出

01001







#include<stdio.h>
#include<string.h>
int a[1005][1005],b[1005];
int main()
{
    int n,i,j,s;
    int q,x,y;
    while(~scanf("%d",&n))
    {
        s=0;
        int k=0;
        memset(b,0,sizeof (b));
        for(i=1; i<=n; i++)
        {
            for( j=1; j<=n; j++)
            {
                scanf("%d",&a[i][j]);
            }
        }
        for( i=1; i<=n; i++)
        {
            for( j=1; j<=n; j++)
            {
                s+=a[i][j]*a[j][i];
                s=s%2;
            }
        }
        scanf("%d",&q);
        for(i=0; i<q; i++)
        {
            scanf("%d",&x);
            if(x==1)
            {
                scanf("%d",&y);
                s=!s;
            }
            else if(x==2)
            {
                scanf("%d",&y);
                s=!s;
            }
            else b[k++]=s;
        }
        for (i=0;i<k;i++)
        {
            printf ("%d",b[i]);
            if (i==k-1)
                printf ("\n");
        }
    }
    return 0;
}



爱上CF

Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^

题目描述

CF,codeforces不是Crossfire。身为一个Acmer,RE大神与Soaring大神最喜欢做每五天一次的CF,从11:30到1:30,然后和逗比学长们一起等着跑数据等到两点半,然后再一起嘲笑一坨学长和柴爷,实在是人生一大快事。
但是Triple_S队的另一员——Winddreams,竟然还不会算CF的单局积分。实在是略萌啊。身为队长的RE大神只能把CF的详细规则再给Winddreams讲一遍了。
CF中共A,B,C,D,E五道题,其初始分分别为500,1000,1500,2000,2500。
比赛共两个小时,每过一分钟每道题目的分数分别下降2,4,8,16,32分。例如你在00:08的时候提交A题,就会获得484分。
比赛中对于不成功的提交(统称为WA)将扣掉该题50分;每道题的分数是单独的,如果没有AC不管这道题WA几次,不会扣总分。而且每道题的最低得分为150分,当分数降低至150分时,不在进行分数削减。
比赛中还有一种叫做HACK的玩法,就是在锁定自己的题目代码后,你可以查看他人的代码,如果别人的代码有漏洞你可以出一组测试数据证明他是错的,如果你成功了(Successful Hack)你讲获得100分,如果你失败了(Unsuccessful Hack)你将被扣50分。同理,你也可以被Hack如果你被Hack成功了(Hack)将视为该题WA。
由于最近RE大神和Soaring要忙一下补觉的问题,所以,需要你来为Winddreams写一个程序来计算得分情况。

输入

多组输入。输入一个T(T<=50)表示有T个操作,在接下来的T行里,每行输入三个个变量(中间用空格隔开),分别是时间t(XX:XX),题目No(A,B,C,D,E)以及题目返回结果E(WA ,AC,Hack,Successful Hack,Unsuccessful Hack)。

输出

最终得分。

示例输入

19
00:03 A AC
00:10 B WA
00:12 B WA
00:13 B AC
00:30 C WA
00:40 B Hack
00:45 B WA
00:45 B WA
00:46 B WA
00:47 B WA
00:48 B WA
00:48 B WA
00:50 B WA
00:54 B WA
00:55 B WA
00:57 B WA
00:59 B AC
01:10 A Successful Hack
01:49 B Unsuccessful Hack

示例输出

694


小模拟题,感觉自己写的代码好幼稚,定义了s[6],e[6],sum[6],w[6],f[6],h[6],ss这么多东西。。。//s是AC的小时,e是AC的分钟,sum表示分数,w是错几回,f标记有没有AC ,h代表的是被Hack的次数。。。WA,Hack,和Unsuccessful Hack时 都会减50 ,Hack之后 即使这时的分数已经降到150了,也会再减50.


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main()
{
    int t,x,y,i;
    int s[6],e[6],sum[6],w[6],f[6],h[6],ss=0;
//s是AC的小时e是AC的分钟,sum表示分数,w是错几回,f标记有没有AC
    char a[100],v;
    while (~scanf ("%d",&t))
    {
        sum[1]=500;
        sum[2]=1000;
        sum[3]=1500;
        sum[4]=2000;
        sum[5]=2500;
        ss=0;
        for (i=1; i<=5; i++)
        {
            s[i]=0;
            e[i]=0;
            w[i]=0;
            f[i]=0;
            h[i]=0;
        }
        while (t--)
        {
            scanf ("%d:%d %c%*c",&x,&y,&v);
            gets (a);
            if (v=='A')
            {
                if ( strcmp (a,"AC")==0)
                {
                    s[1]=x;
                    e[1]=y;
                    f[1]=1;
                }
                else if ((strcmp (a,"WA")==0)||(strcmp(a,"Hack")==0))
                {
                    w[1]++;
                    f[1]=0;
                }
                else if ((strcmp(a,"Unsuccessful Hack")==0))
                {
                    w[1]++;
                    h[1]++;
                }
                else if (strcmp (a,"Successful Hack")==0)
                    sum[1]+=100;
            }
            else if (v=='B')
            {
                if ( strcmp (a,"AC")==0)
                {
                    s[2]=x;
                    e[2]=y;
                    f[2]=1;
                }
                else if ((strcmp (a,"WA")==0)||(strcmp(a,"Hack")==0))
                {
                    w[2]++;
                    f[2]=0;
                }
                else if ((strcmp(a,"Unsuccessful Hack")==0))
                {
                    w[2]++;
                    h[2]++;
                }
                else if (strcmp (a,"Successful Hack")==0)
                    sum[2]+=100;
            }
            else if (v=='C')
            {
                if ( strcmp (a,"AC")==0)
                {
                    s[3]=x;
                    e[3]=y;
                    f[3]=1;
                }
                else if ((strcmp (a,"WA")==0)||(strcmp(a,"Hack")==0))
                {
                    w[3]++;
                    f[3]=0;
                }
                else if ((strcmp(a,"Unsuccessful Hack")==0))
                {
                    w[3]++;
                    h[3]++;
                }
                else if (strcmp (a,"Successful Hack")==0)
                    sum[3]+=100;
            }
            else if (v=='D')
            {
                if ( strcmp (a,"AC")==0)
                {
                    s[4]=x;
                    e[4]=y;
                    f[4]=1;
                }
                else if ((strcmp (a,"WA")==0)||(strcmp(a,"Hack")==0))
                {
                    w[4]++;
                    f[4]=0;
                }
                else if ((strcmp(a,"Unsuccessful Hack")==0))
                {
                    h[4]++;
                    w[4]++;
                }
                else if (strcmp (a,"Successful Hack")==0)
                    sum[4]+=100;
            }
            else if (v=='E')
            {
                if ( strcmp (a,"AC")==0)
                {
                    s[5]=x;
                    e[5]=y;
                    f[5]=1;
                }
                else if ((strcmp (a,"WA")==0)||(strcmp(a,"Hack")==0))
                {
                    w[5]++;
                    f[5]=0;
                }
                else if ((strcmp(a,"Unsuccessful Hack")==0))
                {
                    h[5]++;
                    w[5]++;
                }
                else if (strcmp (a,"Successful Hack")==0)
                    sum[5]+=100;
            }
        }
        for (i=1; i<=5; i++)
        {
            if (f[i]!=0)
            {
                sum[i]=sum[i]-(s[i]*60+e[i])*(int)pow(2.0,i*1.0)-w[i]*50;
                if (sum[i]<=150)
                    sum[i]=150;
                if (h[i]!=0)
                    sum[i]-=h[i]*50;

            }
            else
            {
                sum[i]=0;
            }
            ss+=sum[i];
        }
        printf ("%d\n",ss);
    }
    return 0;
}



建设小政政自杀之路

Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^

题目描述

王政,别名小政政,RE大神的ACM路上的第一位好友,主攻数学题。近日,王政因为感情问题欲跳稷下湖自杀。身为小政政的好基友的RE大神怎能看好友如此。
要知道,稷下湖里可是有网子的,万一跳下去被网子拦住死不了岂不是要被Soaring,Hypo,BLF2等人笑掉大牙。所以RE大神要帮王政计算一下他要从哪里开始冲刺才能成功自杀。但是最近RE大神忙着把妹子只能请你来为王政进行计算了。
已知王政要已V m/s的初速度从三体前的大道上冲刺一跳跃入湖中,加速度为a m/s2。从起跃点到湖中心的距离为L m。跳台高h m。(g=10 m/s2)

输入

多组输入。输入V,A,h,L,x。其中x为三体钱大道的长度。

输出

如果小政政可以在距离起跳点y(保留两位小数)处的地方冲刺成功自杀,输出 “Starting from y.” ;否则输出 “Doubizheng will be laughed!”。

示例输入

0 10 5 10 100

示例输出

Starting from 5.00.


这是一个物理题,当时做的时候  推公式还推了一会。。。sad。。。又因为没注意到x(当时还在想不满足的条件是什么呢),WA。。。又因为多组输入。。。


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main ()
{
    int v,a,h,l,x;
    while (~scanf("%d%d%d%d%d",&v,&a,&h,&l,&x))
    {
        double s,V;
        V=(l*l*10)*1.0/(2*h*1.0);
        s=(V-v*v)*1.0/(2*a*1.0);
        if (s <= x)
            printf ("Starting from %.2lf.\n",s);
        else printf ("Doubizheng will be laughed!\n");
    }
    return 0;
}




玲珑龟

Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^

题目描述

话说最近Soaring在宿舍养了一只玲珑的龟,名曰Leemenglin,突然有一天这只Leemenglin龟饿了,想要吃东西,在它前面有食物,食物与它的直线距离是x厘米,而且这只玲珑龟每一步最少是n厘米,最多是m厘米(意思是每步步长在n与m之间且为整数即可)。这只龟很聪明,知道两点之间直线最短,于是它毅然决定走直线去找食物。然而这只玲珑龟竟然不会后退。。。于是它必须要正好爬到有食物的地方,不能超出。假如它可以走无数步的话,那么它能否正好吃到食物呢?能吃到的话输出Yes,不能的话输出No。

输入

输入一个t,表示测试数据组数,然后后面t行,每一行代表一组测试数据,包括三个整数x, n, m;(1<=n<=m<=10^9,1<=x<=10^9);

输出

每组测试数据输出Yes或No。

示例输入

3
5 2 3
6 4 5
17 3 5

示例输出

Yes
No
Yes


这个题一开始做的时候就理解错题了,以为只有两种方式,n和m。。。后来懂了题意之后思路换不过来了。。有点乱,回到宿舍wjj和我说正确的思路时竟然一下子没反应过来,这确实有点扯了。

正确的思路:s=x/n(最少能走的距离);这是最多能走的步数,如果最大能走得距离m*s>=x的话,那就一定能到达。。

由于编译环境的问题 scanf ("%lld")输不进去,所以就改成了cin;






#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;

int main ()
{
    int t;
    long long x,n,m;
    scanf ("%d",&t);
    while (t--)
    {
        cin>>x>>n>>m;
        long long s=x/n;
        if (s*m>=x)
            printf ("Yes\n");
        else printf ("No\n");
    }
    return 0;
}




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值