poj 3641 ——2016——3——15】的更多相关文章

传送门:http://poj.org/problem?id=3461 题目大意:给你两个字符串p和s,求出p在s中出现的次数. 题解:这一眼看过去就知道是KMP,作为模板来写是最好不过了.... 这道题我写了两种风格的kmp,个人感觉第2种好理解一些; #include <iostream> #include <cstring> #include <cstdio> #define inf ],p[]; ]; int lens,lenp,n; using namespac…
题目链接:POJ 3641 Description Fermat's theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise a to the pth power and divide by p, the remainder is a. Some (but not very many) non-prime values of p, know…
2016.8.15上午纪中初中部NOIP普及组比赛 链接:https://jzoj.net/junior/#contest/home/1333 这次比赛不怎么好,因为这套题目我并不是很擅长. 可同学们都说很水,于是...我在同学的教导之下AK了. 进度: 比赛:100+ 60+ 30+ 10=200 改题:100+100+100+100=AK 一.icow 链接:https://jzoj.net/junior/#contest/show/1333/0 我一看到"权值"二字,就以为会是图…
2016.9.15初中部上午NOIP普及组比赛总结 2016.09.15[初中部 NOIP普及组 ]模拟赛 又翻车了!表示时超和空超很可恨! 进度 比赛:AC+0+0+20=120 改题:AC+80+0+100=280 一.Wexley接苹果 挺水的,考试时一开始理解错了题意, 想了半天转移方程.后来才发现,贪心就行了. 题目简化: (我想到了大富翁) 苹果一个个掉下来,必须接住全部的苹果. 盘子是有长度的,只要碰得到,就能接住!(神话!) 要求最小步数. 正解: 贪心. 分三种情况 for(i…
http://poj.org/problem?id=3641 练手用,结果念题不清,以为是奇偶数WA了一发 #include<iostream> #include<cstdio> #include<cmath> using namespace std; typedef long long ll; bool judge_prime(ll k) { ll i; ll u=int(sqrt(k*1.0)); ;i<=u;i++) { ) ; } ; } ll mod_p…
题目连接 http://poj.org/problem?id=3641 Pseudoprime numbers Description Fermat's theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise a to the pth power and divide by p, the remainder is a. Some (but…
雷电3外接显卡效果还不错,但是除了akitio node 其他厂家并不会维护自己的固件来适配新机型,我自己买的mbp 2016 15''就出现了和AORUS Gaming Box 1070不兼容的问题,在引导的时候会在win徽标处转圈卡死,我联系了厂家,客服,给他们打了电话发了邮件,都快变成骚扰了,不过并没有解决问题,得到的回复是问题在解决中,不知道什么时候能解决.   后来在egpu.io上找到了解决方案并尝试成功,效果还不错 https://egpu.io/forums/implementa…
POJ的题目都是英文的,所以,,,还是直接贴代码吧 #include<stdio.h> int main(){ int x,y,z; int n,nm,max; scanf("%d",&n); while(n--){ int num[60]={0}; scanf("%d",&nm); for(x = 0;x < nm; x++){ scanf( "%d",&y); num[ y+x+1 ]=1; } fo…
题目链接 题意:题目定义了Carmichael Numbers 即 a^p % p = a.并且p不是素数.之后输入p,a问p是否为Carmichael Numbers? 坑点:先是各种RE,因为poj不能用srand()...之后各种WA..因为里面(a,p) ?= 1不一定互素,即这时Fermat定理的性质并不能直接用欧拉定理来判定..即 a^(p-1)%p = 1判断是错误的..作的 #include<iostream> #include<cstdio> #include&l…
NOIP2014 提高组模拟试题 第一试试题 题目概况: 中文题目名称 合理种植 排队 科技节 源程序文件名 plant.pas/.c/.cpp lineup.pas/.c/.cpp scifest.pas/.c/.cpp 输入文件名 plant.in lineup.in scifest.in 输出文件名 plant.out lineup.out scifest.out 每个测试点时限 1s 1s 1s 测试点数目 10 10 10 每个测试点分值 10 10 10 内存上限 128MB 128…