[ABC263G] Erasing Prime Pairs】的更多相关文章

单点时限: 2.0 sec 内存限制: 512 MB 对于数组a,如果i≠j并且ai+aj是一个质数,那么我们就称(i,j)为质数对,计算数组中质数对的个数. 输入格式 第一行输入一个n,表示数组的长度,接下来n个整数,第i个数代表ai.(1≤n≤100000,0≤ai≤100) 输出格式 输出数组中质数对的个数. 样例 input 3 1 2 3 output 4 提示 样例说明:a1+a2,a2+a1,a2+a3,a3+a2都为质数,总共有四对.  题目中n的个数有很多1e5左右,但是a的值…
蒟蒻就切了四道水题,然后EF看着可写然而并不会,中间还WA了一次,我太菜了.jpg =.= A.Vasya And Password 一开始看着有点虚没敢立刻写,后来写完第二题发现可以暴力讨论,因为保证有解,没了 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; char rd[N]; int main () { int T; scanf("%d"…
做了四个题.. A. Vasya And Password 直接特判即可,,为啥泥萌都说难写,,,, 这个子串实际上是忽悠人的,因为每次改一个字符就可以 我靠我居然被hack了???? %……&*()(*&……好吧我把$0$从数字里扔了. /* */ #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<map> #in…
A. Nth power of n 单点时限: 1.0 sec 内存限制: 512 MB 求 nn 的个位数. 输入格式 多组输入,处理到文件结束.每组数据输入一个 n.(1≤n≤109) 输出格式 输出 nn 的个位数. 思路: 简单的快速幂. B. 复读机的力量 单点时限: 2.0 sec 内存限制: 512 MB Codancer: “我好菜啊!”Dicer: “我好菜啊!”Todest: “我好菜啊!”CaprYang: “我好菜啊!”…大佬们又开始装弱了,真正的菜鸡瑟瑟发抖不敢说话.…
A:Vasya And Password 代码: #include<bits/stdc++.h> using namespace std; #define Fopen freopen("_in.txt","r",stdin); freopen("_out.txt","w",stdout); #define LL long long #define ULL unsigned LL #define fi first #…
A. Vasya And Password 模拟题,将所缺的种类依次填入"出现次数$ >1 $"的位置,替换掉Ta即可. #include <iostream> #include <cstdio> #include <cstring> using namespace std; const int N = 110; char str[N]; int sum[3][N], n; int inline get(char x){ if(x <=…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=109329#problem/B    全题在文末. 题意:在a,b中(a,b<=n)(1 ≤ n ≤ 1014),有多少组(a,b)  (a<b)满足lcm(a,b)==n; 先来看个知识点: 素因子分解:n = p1 ^ e1 * p2 ^ e2 *..........*pn ^ en for i in range(1,n): ei 从0取到ei的所有组合 必能包含所有n的因子. 现…
B - Pairs Forming LCM Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1236 Description Find the result of the following code: long long pairsFormLCM( int n ) {    long long res = 0;    for( in…
Prime Distance Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12512   Accepted: 3340 Description The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number th…
http://lightoj.com/volume_showproblem.php?problem=1236 Pairs Forming LCM Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1236 Description Find the result of the following code: long long pairs…