KYOCERA Programming Contest 2021(AtCoder Beginner Contest 200) C - Ringo‘s Favorite Numbers 2

news/2024/12/22 15:29:08/

总结:

下次组合数 只用求那种 C[2,n]这种 不需要用板子

code:

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long LL;
map<LL,LL> mp;
int n;
const int N1 = 2e5+10;
int a[N1];
inline void read(int &sum)
{char ch = getchar();int tf = 0;sum = 0;while((ch < '0' || ch > '9') && (ch != '-')) ch = getchar();tf = ((ch == '-') && (ch = getchar()));while(ch >= '0' && ch <= '9') sum = sum * 10+ (ch - 48), ch = getchar();(tf) && (sum =- sum);
}signed  main()
{cin>>n;for(int i=1; i<=n; i++){read(a[i]);mp[a[i]%200]++;}LL sum = 0;map<LL ,LL>::iterator it;for(it=mp.begin(); it!=mp.end(); it++){if(it->second >=2)sum+=((it->second*(it->second-1))/2);}cout<<sum;return 0;
}

http://www.ppmy.cn/news/913627.html

相关文章

KYOCERA Programming Contest 2021(AtCoder Beginner Contest 200)D - Happy Birthday! 2

传送门 我们可以看出&#xff0c;B©序列的所有情况一共有2^n - 1种(就是每个数取或者不取)&#xff0c;直接枚举肯定是不行。 再继续观察题目给出的条件&#xff0c;求和后要对200取模&#xff0c;也就是说取模后的结果有200种情况。我们所有序列的情况一共2^n - 1种&am…

KYOCERA Programming Contest 2023(AtCoder Beginner Contest 305)(A、B、C、D、E、F)[施工中]

文章目录 A - Water Station(模拟)B - ABCDEFG&#xff08;模拟&#xff09;C - Snuke the Cookie Picker(模拟、暴力)D - Sleep Log&#xff08;二分&#xff0c;前缀&#xff09;E - Art Gallery on Graph&#xff08;dijkstra变种&#xff0c;BFS优先队列&#xff09;F - Du…

京瓷Kyocera Mita LS-C8026N 一体机驱动

京瓷Kyocera Mita LS-C8026N 一体机驱动是官方提供的一款一体机(打印、扫描)驱动&#xff0c;本站收集提供高速下载&#xff0c;用于解决一体机与电脑连接不了&#xff0c;无法正常使用的问题&#xff0c;本动适用于&#xff1a;Windows XP / Windows 7 / Windows 8 / Windows …

Kyocera6.2寸工业液晶屏TCG062HVLQAVNN-GN20

京瓷 (Kyocera) 推出的TCG062HVLQAVNN-GN20是一款采用a-Si TFT-LCD技术的6.2英寸液晶模组产品&#xff0c;它装配有WLED背光&#xff0c;含LED驱动器背光驱动&#xff0c;无触摸。 总结它的典型特征为: 白光LED背光&#xff0c;含LED驱动器&#xff0c;超宽屏&#xff0c;180度…

KYOCERA Programming Contest 2021(AtCoder Beginner Contest 200) E - Patisserie ABC 2

KYOCERA Programming Contest 2021&#xff08;AtCoder Beginner Contest 200&#xff09; E - Patisserie ABC 2 题意 将 n 3 n^3 n3个三元组 ( i , j , k ) , 1 ≤ i , j , k ≤ n (i,j,k),1\le i,j,k\le n (i,j,k),1≤i,j,k≤n进行排序&#xff0c;问第 k k k个三元组是什么…

KYOCERA Programming Contest 2021 (AtCoder Beginner Contest 200) A~E 题解

ABC200/KYOCERA2021 A~E [A - Century](https://atcoder.jp/contests/abc200/tasks/abc200_a)题目大意输入格式输出格式样例分析代码 [B - 200th ABC-200](https://atcoder.jp/contests/abc200/tasks/abc200_b)题目大意输入格式输出格式样例分析代码 [C - Ringos Favorite Numb…

KYOCERA Programming Contest 2021(AtCoder Beginner Contest 200)题解

文章目录 A - CenturyB - 200th ABC-200C - Ringos Favorite Numbers 2D - Happy Birthday! 2E - Patisserie ABC 2F - Minflip Summation KYOCERA Programming Contest 2021&#xff08;AtCoder Beginner Contest 200&#xff09; A - Century 简单的除以 200 200 200向上取…

KYOCERA Programming Contest 2022(AtCoder Beginner Contest 271)G.Access Counter(概率+矩阵快速幂优化dp)

题目 Takahashi布置了一个网页&#xff0c; 给定一个长为24的仅由A和T构成的字符串&#xff0c;表示每天整点能登进这个网页的概率 第i个字母如果是T&#xff0c;表示第i个整点的时候Takahashi有X(1<X<99)%的概率能登进去一次&#xff0c; 如果是A&#xff0c;表示第…