HDU6292 赛题分析【水题】

赛题分析

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)
Total Submission(s): 1506 Accepted Submission(s): 637

Problem Description
著名出题人小Q每次比赛后都会写一份《赛题分析》,包含比赛概况、每题的参考算法以及一些统计数值。

对于一道题来说,小Q会统计最短的验题人代码长度(Shortest judge solution)以及赛内参赛队伍最短的AC代码长度(Shortest team solution)。

统计验题人代码长度比较容易,因为验题人最多也不会超过20个。但是统计选手代码长度就不容易了,因为大赛区动辄三四百支队伍。

请写一个程序,帮助小Q统计最短代码长度。

Input
第一行包含一个正整数T(1≤T≤13),表示赛题数量。

每道题第一行包含两个整数n,m(2≤n≤20,0≤m≤500),分别表示验题人数量以及AC了该题的队伍数量。

第二行包含n个正整数a1,a2,...,an(50≤ai≤65536),依次表示每个验题人的代码字节数。

第三行包含m个正整数b1,b2,...,bn(50≤bi≤65536),依次表示每支AC队伍的代码字节数。若m=0则该行为空行。

Output
对于第i(1≤i≤T)道题,输出三行,第一行输出Problem x:,其中x=i+1000。

第二行输出Shortest judge solution: y bytes.,其中y表示最短的验题人代码字节数。

第三行输出Shortest team solution: z bytes.,其中z表示最短的选手代码字节数,若不存在请输出N/A。

注意:间隔都是一个空格。

Sample Input
2
3 2
3627 1460 5288
2365 2671
2 0
5510 7682

Sample Output
Problem 1001:
Shortest judge solution: 1460 bytes.
Shortest team solution: 2365 bytes.
Problem 1002:
Shortest judge solution: 5510 bytes.
Shortest team solution: N/A bytes.

Source
"字节跳动杯"2018中国大学生程序设计竞赛-女生专场

问题链接HDU6292 赛题分析
问题描述:(略)
问题分析
????这是一个极值计算的简单题,不解释。
程序说明:(略)
参考链接:(略)
题记:(略)

AC的C语言程序如下:

/* HDU6292 赛题分析 */

#include <bits/stdc++.h>

using namespace std;

const int SUP = 1e6;

int main()
{
    int t;
    scanf("%d", &t);
    for(int caseno = 1; caseno <= t; caseno++) {
        printf("Problem %d:\n", 1000 + caseno);
        int n, m, a, mina = SUP;
        scanf("%d%d", &n, &m);

        for(int i = 1; i <= n; i++) {
            scanf("%d", &a);
            mina = min(mina, a);
        }
        printf("Shortest judge solution: %d bytes.\n", mina);

        if(m == 0)
            printf("Shortest team solution: N/A bytes.\n");
        else {
            mina = SUP;
            for(int i = 1; i <= m; i++) {
                scanf("%d", &a);
                mina = min(mina, a);
            }
            printf("Shortest team solution: %d bytes.\n", mina);
        }
    }

    return 0;
}

原文地址:https://www.cnblogs.com/tigerisland45/p/10161639.html

时间: 2024-07-31 23:02:54

HDU6292 赛题分析【水题】的相关文章

sdut 2413:n a^o7 !(第三届山东省省赛原题,水题,字符串处理)

n a^o7 ! Time Limit: 1000MS Memory limit: 65536K 题目描述 All brave and intelligent fighters, next you will step into a distinctive battleground which is full of sweet and happiness. If you want to win the battle, you must do warm-up according to my inst

涨姿势题2_水题_两种解法

Problem Description 涨姿势题就是所谓的优化题,在组队赛中,队伍发现了一题水题,那么应该交给谁去处理?作为处理水题的代码手,应该具备什么样的素养?1,要快,水题拼的就是速度!2,不能卡水题!水题都卡,绝对不是一个代码手的风范!3,不能出错,错一次即罚时20分钟,对于水题来讲是致命的!4,要能看出来一题是水题!没有这条,上面三条都是没有意义的! 如果你希望你成团队中一个合格的代码手,那么这套题是你最好的选择,快AC吧! 本系列即是为了提高水题代码手的素养而准备的!水题经常需要用到

HDU5742 It&#39;s All In The Mind(思维题,水题)

Problem Description Professor Zhang has a number sequence a1,a2,...,an. However, the sequence is not complete and some elements are missing. Fortunately, Professor Zhang remembers some properties of the sequence: 1. For every i∈{1,2,...,n}, 0≤ai≤100.

NOJ 2015年陕西省程序设计竞赛网络预赛(正式赛)(随机数-水题)[Hobo]

C - 随机数 Time Limit: 1000 ms        Memory Limit: 65536 KB Submit Description 开学了,ACM队的边老板想在学校中请一些妹子一起做一项问卷调查,调查妹子们对ACM的了解情况,为了实验的客观性,他先用计算机生成了N个1到1000之间的随机整数(N≤100),对于其中重复的数字,只保留一个,把其余相同的数去掉,不同的数对应着不同的妹子的编号.然后再把这些数从小到大排序,按照排好的顺序去找同学做调查.老板怎么会自己去解决这么简单

urumqi 网络赛 C Coconut 水题

题目链接: 放不出来 题目描述: 每个站点有a[i] 个 椰子, 相邻站点的距离给出, 每天需要b个椰子, 问是否能够坚持到终点. 解题思路: 水一波儿 代码: #include <iostream> #include <cstdio> #include <string> #include <vector> #include <cstring> #include <iterator> #include <cmath> #i

hdu 5038 (2014北京网络赛G 排序水题)

题意:有n个数字,带入10000 - (100 - ai) ^ 2公式得到n个数,输出n个数中频率最大的数,如果有并列就按值从小到大都输出输出,如果频率相同的数字是全部的n个数,就输出Bad....题解:统计数字个数和频率,排序后输出. Sample Input36100 100 100 99 98 1016100 100 100 99 99 1016100 100 98 99 99 97 Sample OutputCase #1:10000Case #2:Bad MushroomCase #3

课后题 3-3 水题

Digit Counting Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Submit Status Description Download as PDF Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integ

HDU2076 夹角有多大(题目已修改,注意读题)【水题】【计算几何】

夹角有多大(题目已修改,注意读题) Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10194    Accepted Submission(s): 4072 Problem Description 时间过的好快,一个学期就这么的过去了,xhd在傻傻的看着表,出于对数据的渴望,突然他想知道这个表的时针和分针的夹角是多少.现在xhd知道的

HDU 5744 Keep On Movin (思维题,水题)

Problem Description Professor Zhang has kinds of characters and the quantity of the i-th character is ai. Professor Zhang wants to use all the characters build several palindromic strings. He also wants to maximize the length of the shortest palindro

F题(水题)

给出一个有N个数的序列,编号0 - N - 1.进行Q次查询,查询编号i至j的所有数中,最大的数是多少. 例如: 1 7 6 3 1.i = 1, j = 3,对应的数为7 6 3,最大的数为7.(该问题也被称为RMQ问题) Input第1行:1个数N,表示序列的长度.(2 <= N <= 10000) 第2 - N + 1行:每行1个数,对应序列中的元素.(0 <= Sii <= 10^9) 第N + 2行:1个数Q,表示查询的数量.(2 <= Q <= 10000)