【1410 - Consistent Verdicts】+ 思维

1410 - Consistent Verdicts
PDF (English) Statistics Forum
Time Limit: 5 second(s) Memory Limit: 32 MB

In a 2D plane N persons are standing and each of them has a gun in his hand. The plane is so big that the persons can be considered as points and their locations are given as Cartesian coordinates. Each of the N persons fire the gun in his hand exactly once and no two of them fire at the same or similar time (the sound of two gun shots are never heard at the same time by anyone so no sound is missed due to concurrency). The hearing ability of all these persons is exactly same. That means if one person can hear a sound at distance R1, so can every other person and if one person cannot hear a sound at distance R2 the other N-1 persons cannot hear a sound at distance R2 as well.
这里写图片描述
The N persons are numbered from 1 to N. After all the guns are fired, all of them are asked how many gun shots they have heard (not including their own shot) and they give their verdict. It is not possible for you to determine whether their verdicts are true but it is possible for you to judge if their verdicts are consistent. For example, look at the figure above. There are five persons and their coordinates are (1, 2), (3, 1), (5, 1), (6, 3) and (1, 5) and they are numbered as 1, 2, 3, 4 and 5 respectively. After all five of them have shot their guns, you ask them how many shots each of them have heard. Now if there response is 1, 1, 1, 2 and 1 respectively then you can represent it as (1, 1, 1, 2, 1). But this is an inconsistent verdict because if person 4 hears 2 shots then he must have heard the shot fired by person 2, then obviously person 2 must have heard the shot fired by person 1, 3 and 4 (person 1 and 3 are nearer to person 2 than person 4). But their opinions show that Person 2 says that he has heard only 1 shot. On the other hand (1, 2, 2, 1, 0) is a consistent verdict for this scenario so is (2, 2, 2, 1, 1). In this scenario (5, 5, 5, 4, 4) is not a consistent verdict because a person can hear at most 4 shots.

Given the locations of N persons, your job is to find the total number of different consistent verdicts for that scenario. Two verdicts are different if opinion of at least one person is different.
Input

Input starts with an integer T (≤ 100), denoting the number of test cases.

Each case starts with a line containing a positive integer N (1 ≤ N ≤ 700). Each of the next N lines contains two integers xi yi (0 ≤ xi, yi ≤ 30000) denoting a co-ordinate of a person. Assume that all the co-ordinates are distinct.
Output

For each case, print the case number and the total number of different consistent verdicts for the given scenario.
Sample Input

Output for Sample Input

2

3

1 1

2 2

4 4

2

1 1

5 5

Case 1: 4

Case 2: 2

给出每个人的位置坐标,求听到枪声的个数的方案数~~~求出两两间距离~~~去重?(=-=)

AC代码 :

#include<bits/stdc++.h>
using namespace std;
int ma[710],mb[710],vis[710 * 710];
int main()
{
    int T,N,cut = 0;
    scanf("%d",&T);
    while(T--){
        int nl = 0,ans = 1;
        scanf("%d",&N);
        for(int i = 1 ; i <= N ; i++)
            scanf("%d %d",&ma[i],&mb[i]);
        for(int i = 1 ; i <= N ; i++)
            for(int j = i + 1 ; j <= N; j++)
                vis[++nl] = (ma[i] - ma[j]) * (ma[i] - ma[j]) + (mb[i] - mb[j]) * (mb[i] - mb[j]);
    sort(vis + 1 ,vis + 1 + nl);
    for(int i = 2 ; i <= nl; i++)
        if(vis[i] != vis[i - 1])
            ans++;
    printf("Case %d: %d\n",++cut,++ans);
    }
    return 0;
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"noisytwins: class-consistent and diverse lmage generation through stylegans" 是关于通过 StyleGANs 实现类别一致和多样化图像生成的研究。 StyleGAN 是一种生成对抗网络 (GAN) 的变种,用于生成逼真的图像。它通过学习图像的潜在空间表示来生成图像,其中每个点都对应一个唯一的图像。在这项研究中,noisytwins 提出了一种改进的 StyleGAN 模型,旨在生成类别一致且具有多样性的图像。 传统的 StyleGAN 模型通常只能生成与训练数据集类别相似的图像,而无法产生跨类别的多样性。对于一个类别,它通常只能生成该类别中的某一个具体样式的图像。然而,noisytwins 通过引入噪音向量,并通过控制这些向量的方式,将该模型扩展至能够在一个类别内生成多种样式的图像。 通过这种方式,noisytwins 的模型能够生成以同一类别为主题的图像,同时在样式上具有多样性。例如,如果我们以猫为类别,传统的 StyleGAN 模型只能生成某一种具体颜色和纹理的猫图像,而 noisytwins 的模型可以生成多种颜色和纹理的猫图像。 这项研究的意义在于扩展了现有的图像生成技术的应用范围。通过实现类别一致且具有多样性的图像生成,noisytwins 的模型可以在许多领域中有重要的应用,如计算机游戏开发、虚拟现实技术以及艺术创作等。 总之,"noisytwins: class-consistent and diverse lmage generation through stylegans" 是一篇关于利用改进的 StyleGANs 实现具有类别一致性和多样性的图像生成的研究,该研究扩展了现有的图像生成技术,并在多个领域中有广泛的应用潜力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值