Ace of Aces

Ace of Aces
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu
Submit

Status
Description
There is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep universe that we humans have not discovered yet. This year, the TSAB decided to elect an outstanding member from its elite troops. The elected guy will be honored with the title of “Ace of Aces”.

After voting, the TSAB received N valid tickets. On each ticket, there is a number Ai denoting the ID of a candidate. The candidate with the most tickets nominated will be elected as the “Ace of Aces”. If there are two or more candidates have the same number of nominations, no one will win.

Please write program to help TSAB determine who will be the “Ace of Aces”.

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 an integer N (1 <= N <= 1000). The next line contains N integers Ai (1 <= Ai <= 1000).

Output
For each test case, output the ID of the candidate who will be honored with “Ace of Aces”. If no one win the election, output “Nobody” (without quotes) instead.

Sample Input
3
5
2 2 2 1 1
5
1 1 2 2 3
1
998
Sample Output
2
Nobody
998

我的代码:

#include <iostream>
#include <cstring>
using namespace std;
int main()
{
    int i,k,n,m,ma1,ma,len;
    int a[1100];
    cin >> n;
    while (n--)
    {
        memset(a,0,sizeof(a));
        cin >> m;
        ma1=0;
        for (i=0;i<m;++i)
        {
            cin >> k;
            a[k]++;
            if (ma1<a[k])
            {
                len=0;
                ma1=a[k];
                ma=k;
            }
            else if (ma1==a[k])
            {
                len=1;
            }
        }
        if (len==0)
        {
            cout << ma << endl;
        }
        else
        {
            cout << "Nobody" << endl;
        }
    }
    return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ACES(Academy Color Encoding System)是由美国学术电影艺术科学院开发的一种高动态范围(HDR)图像色彩编码系统。其目的是提供一种标准化的方法,用于在不同设备和平台之间进行色彩一致性和交互性。 ACES的一个重要组成部分是Tonemapping技术。Tonemapping是一种将高动态范围图像转换为标准动态范围(SDR)图像的过程,以便在普通显示设备上进行正确显示。ACES Tonemapping使用一种非线性算法,以保持原始图像的亮度和色彩细节,同时确保图像在SDR设备上显示出适当的亮度和对比度。 ACES Tonemapping的主要目标是在不失真地映射高动态范围数据的同时,提供适当的辐射度和对比度。它通过分析输入图像的高动态范围信息,然后应用适当的压缩和曲线变化来实现这一目标。这种算法的目的是在可视范围内保留细节,并在亮度过渡区域中提供更平滑的过渡。 ACES Tonemapping算法的应用可以在电影和电视制作,游戏开发以及摄影等领域中看到。它是一种标准化的方法,可以确保在不同设备和平台上展示的图像保持色彩一致性和艺术家意图的准确性。 总而言之,ACES Tonemapping是一种将高动态范围图像转换为标准动态范围图像的技术,旨在保持亮度和色彩细节的同时,在SDR设备上提供适当的亮度和对比度。它是ACES系统的一个重要组成部分,用于在不同设备和平台上实现色彩一致性和艺术家意图的准确展示。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值