Fayne's Blog

成为自己想成为的人永远不会太迟


  • 首页

  • 标签

  • 归档

  • 留言板

  • 搜索

安徽省2016“京胜杯”程序设计大赛_D_梯田AGAIN

发表于 2016-09-25 | 分类于 二分法 , 省赛 , 算法学习 | 评论数: | 阅读次数:

梯田AGAIN












Time Limit: 5000 MSMemory Limit: 65536 KB
Total Submissions: 95Accepted: 21

Description

大家还记得去年的梯田吗?土豪YZK在一块小岛上有着一大片nm的梯田,每块11的田地都有它的高度。奴隶们不甘被YZK剥削,他们联合起来决定发动一场海啸淹掉YZK的部分梯田。

奴隶们去年尝试了一下,结果发现,由于土质太过松软,水能够透过土地渗入到相邻的梯田,即对于海啸高度h,梯田中所有小于等于h的土地都会由于土质松软而被被淹没。

现在给你一个n*m的矩阵,代表梯田中每块田地的高度。然后给定q个询问,每个询问给定一个海啸高度h,问在此高度下,不被淹没的梯田数量是多少。

Input

第一行一个整数T,表示测试数据组数。

对于每组测试数据:

第一行三个数字n,m,q,表示梯田的行数,列数和询问数。

之后n行,每行m个数字,表示每块田地的高度,梯田高度不大于1000000。

之后q行,每行给出一个海啸高度h,问大于这个高度的梯田有多少块。
阅读全文 »

安徽省2016“京胜杯”程序设计大赛_C_箭无虚发

发表于 2016-09-25 | 分类于 省赛 , 算法学习 | 评论数: | 阅读次数:

#
箭无虚发












Time Limit: 1000 MSMemory Limit: 65536 KB
Total Submissions: 128Accepted: 21

Description

       JH苦练10年,终于成为了一个神箭手,在下山之前,大师兄YZ不放心,想考验他,只给他一定时间t,同时给他n支箭,最终根据他的表现,考虑他是否能下山。
       对于每发一次箭,YZ给他4种成绩(优、良、中、差),JH有三种拉弓以及瞄准时间a ,b,c(a>=b>=c)分别能拿优,良,中等级,如果不拉弓不瞄(直接射),只能拿差(不能中靶)了。

       现在JH想知道,在保证自己弹无虚发(不获得差)的情况下,最多能拿多少个优。

       如果JH不能做到弹无虚发,输出Oh,my god! 


阅读全文 »

安徽省2016“京胜杯”程序设计大赛_B_阵前第一功

发表于 2016-09-25 | 分类于 基础 , 省赛 , 算法学习 | 评论数: | 阅读次数:

#
阵前第一功












Time Limit: 1000 MSMemory Limit: 65536 KB
Total Submissions: 63Accepted: 29



##

## Description





A国每个国民都有一定战斗力,每年国家都要对人民的战斗力进行一次排序统计,他们的排序规矩是相同战斗力的排名一样,而且只占一个排序名额。比如,有5个人:100,100,90,90,70. 两个100的并列第一,称为第一战斗力,两个90的并列第二,称为第二战斗力,依次类推。。。现在你想查询第K战斗力是多少

阅读全文 »

安徽省2016“京胜杯”程序设计大赛_A_砝码称重

发表于 2016-09-25 | 分类于 基础 , 省赛 , 算法学习 | 评论数: | 阅读次数:

#
砝码称重












Time Limit: 1000 MSMemory Limit: 65536 KB
Total Submissions: 61Accepted: 37


## Description


小明非常喜爱物理,有一天,他对物理实验室中常用的弹簧拉力计产生了兴趣。实验室中有两种质量不同的砝码,小明分别用a个第一种砝码放在弹簧拉力计上和b个第二种砝码放在弹簧拉力计上,假设每增加单位重量的砝码,弹簧拉力计的长度增加1,那么两次称量弹簧拉力计的长度差是多少呢?(假设拉力计不发生非弹性形变)
阅读全文 »

NYOJ_23_取石子(一)

发表于 2016-09-22 | 分类于 NYOJ , 博弈论 , 算法学习 | 评论数: | 阅读次数:


##
取石子(一)

时间限制:3000 ms  |  内存限制:65535 KB

难度:2



描述

一天,TT在寝室闲着无聊,和同寝的人玩起了取石子游戏,而由于条件有限,他/她们是用旺仔小馒头当作石子。游戏的规则是这样的。设有一堆石子,数量为N(1<=N<=1000000),两个人轮番取出其中的若干个,每次最多取M个(1<=M<=1000000),最先把石子取完者胜利。我们知道,TT和他/她的室友都十分的聪明,那么如果是TT先取,他/她会取得游戏的胜利么?



输入

第一行是一个正整数n表示有n组测试数据
阅读全文 »

akoj-1369 贪吃蛇

发表于 2016-04-27 | 分类于 AKOJ , 基础 , 算法学习 | 评论数: | 阅读次数:

贪吃蛇

Time Limit:1000MS Memory Limit:65536K
Total Submit:9 Accepted:2

Description

有童年的孩子都玩过这个经典游戏,不过这里的规则又有点不同,现在有一个N*M(N,M<=100)的方形矩形,在这个矩形的每一个方格上都放有若干个樱桃,一条可爱的小蛇从矩形的
左上角开始出发,每次移动都只能移动一格,向右或向下,而每到达一格贪吃的小蛇都会吧该位置上的樱桃吃个一干二净,直到到达右下角时停止。而贪吃的小蛇不怕撑死,它只想吃到最多
的樱桃,请你告诉它他最多能吃到多少樱桃以及具体路线吧。(数据保证最优路线只有一条)

Input

每个输入包含多个测试用例,每个测试用例第一行给出N,M,接下来N行M列数据代表每个位置上的樱桃个数。(矩阵坐标从(1,1)开始)。

Output

对于每个测试用例输出第一行为能吃到的最大樱桃个数,接下来为小蛇所需要走的路线的坐标,每个坐标占一行。

阅读全文 »

2016 "Bird Cup" ICPC7th@ahstu--“波导杯”安徽科技学院第七届程序设计大赛

发表于 2016-04-24 | 分类于 AKOJ , 校赛 , 算法学习 | 评论数: | 阅读次数:

“波导杯”安徽科技学院第七届程序设计大赛

关于举办“波导杯”安徽科技学院第七届程序设计大赛通知

ACM 国际大学生程序设计竞赛 (International Collegiate Programming Contest)是由美国计算机协会(ACM)主办的一项旨在展示大学生创新能力、团队精神和在压力下编写程序、分析和解决问题能力的著名竞赛。2010年以来,我校参与了历届安徽省 ACM 程序设计竞赛,并取得了优异的成绩。为选拔校 ACM 参赛队员,将举办“波导杯” 安徽科技学院第七届计算机程序设计大赛,热忱欢迎广大程序设计爱好者踊跃参加。

主办方:安徽科技学院教务处、信息与网络工程学院

承办方:信息与网络工程学院

赞助方:宁波波导软件有限公司(独家赞助)

一、 比赛时间:2016 年 4 月23(周六)上午 8:00~12:00

二、比赛地点:计算机与网络实验中心(力行楼六楼)

三、比赛设奖:设一等奖8%、二等奖12%、三等奖15%。

阅读全文 »

NYOJ-56 阶乘因式分解(一)

发表于 2015-11-28 | 分类于 NYOJ , 算法学习 | 评论数: | 阅读次数:


##
阶乘因式分解(一)

时间限制:3000 ms  |  内存限制:65535 KB

难度:2




描述


给定两个数m,n,其中m是一个素数。



将n(0<=n<=10000)的阶乘分解质因数,求其中有多少个m。
阅读全文 »

Section 1.1 Greedy Gift Givers

发表于 2015-10-06 | 分类于 算法学习 | 评论数: | 阅读次数:

Greedy Gift Givers


A group of NP (2 ≤ NP ≤ 10) uniquely named friends hasdecided to exchange gifts of money. Each of these friends might ormight not give some money to any or all of the other friends.Likewise, each friend might or might not receive money from any orall of
the other friends. Your goal in this problem is to deduce how much more money each person gives than they receive.

The rules for gift-giving are potentially different than youmight expect. Each person sets aside a certain amount of money togive and divides this money evenly among all those to whom he orshe is giving a gift. No fractional money is available, so dividing3
among 2 friends would be 1 each for the friends with 1 left over– that 1 left over stays in the giver’s “account”.

In any group of friends, some people are more giving than others(or at least may have more acquaintances) and some people have moremoney than others.

Given a group of friends, no one of whom has a name longer than14 characters, the money each person in the group spends on gifts,and a (sub)list of friends to whom each person gives gifts, determinehow much more (or less) each person in the group gives than
theyreceive.

IMPORTANT NOTE

The grader machine is a Linux machine that uses standard Unixconventions: end of line is a single character often known as ‘\n’.This differs from Windows, which ends lines with two charcters,’\n’ and ‘\r’. Do not let your program get trapped by this!

PROGRAM NAME: gift1

阅读全文 »

Section 1.1 Your Ride Is Here

发表于 2015-10-06 | 分类于 算法学习 | 评论数: | 阅读次数:

Your Ride Is Here


It is a well-known fact that behind every good comet is a UFO. TheseUFOs often come to collect loyal supporters from here on Earth.Unfortunately, they only have room to pick up one group of followers oneach trip. They do, however, let the groups know ahead
of time whichwill be picked up for each comet by a clever scheme: they pick a namefor the comet which, along with the name of the group, can be used todetermine if it is a particular group’s turn to go (who do you thinknames the comets?). The details of the
matching scheme are given below;your job is to write a program which takes the names of a group and acomet and then determines whether the group should go with the UFO behindthat comet.

Both the name of the group and the name of the comet are converted intoa number in the following manner: the final number is just the product ofall the letters in the name, where “A” is 1 and “Z” is26. For instance, the group “USACO” would be 21 19 1

  • 3 *15 = 17955. If the group’s number mod 47 is the same as the comet’s numbermod 47, then you need to tell the group to get ready! (Remember that”a mod b” is the remainder left over after dividing a by b; 34mod 10 is 4.)

Write a program which reads in the name of the comet and the name ofthe group and figures out whether according to the above scheme the namesare a match, printing “GO” if they match and “STAY” ifnot. The names of the groups and the comets will be a string
of capitalletters with no spaces or punctuation, up to 6 characters long.

Examples:
















InputOutput

COMETQ
HVNGAT

GO

ABSTAR
USACO

STAY

PROGRAM NAME: ride

This means that you fill in your header with:

PROG: ride

WARNING: You must have ‘ride’ in this field or thewrong test data (or no test data) will be used.

INPUT FORMAT

阅读全文 »
1…567…10
Fayne

Fayne

成为自己想成为的人永远不会太迟

93 日志
70 分类
57 标签
GitHub CSDN E-Mail
© 2025 Fayne
蜀ICP备2025157491号