摘要: 题目链接以前做过类似的,USACO,2.3,开始数组开小了,导致数据乱了,然后超数据范围了,。。 1 #include 2 #include 3 #include 4 using namespace std; 5 #define LL __int64 6 LL dp[101][101][101]; 7 LL c[71][71]; 8 int main() 9 {10 int i,j,n,k,u,h;11 for(i = 0; i <= 70; i ++)12 {13 c[i][0] = 1;14 }15 for(i = 1; i <... 阅读全文
posted @ 2013-10-19 20:49 Naix_x 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 题目链接java的水题,特判啊。。。依旧无法1Y。 1 import java.util.*; 2 import java.math.*; 3 4 public class Main { 5 public static void main(String[] args) { 6 Scanner cin = new Scanner(System.in); 7 int prim[] = new int[100]; 8 int i,j,n,num; 9 num = 0;10 BigInteger ans,temp... 阅读全文
posted @ 2013-10-19 15:11 Naix_x 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题目链接水题依旧无法1Y。 1 #include 2 #include 3 #include 4 using namespace std ; 5 #define LL __int64 6 LL gcd(LL a,LL b) 7 { 8 return b == 0?a:gcd(b,a%b); 9 }10 11 int main()12 {13 LL a,b,x,y,t;14 LL str,end,mid;15 scanf("%I64d%I64d%I64d%I64d",&a,&b,&x,&y);16 t = gcd(x,y);17 x = x/. 阅读全文
posted @ 2013-10-19 12:28 Naix_x 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目链接AC了。经典问题,a*x+b*y+c = 0整数点,有些忘记了扩展欧几里德,复习一下。 1 #include 2 #include 3 #include 4 using namespace std ; 5 #define LL __int64 6 LL x,y; 7 LL ext_eulid(LL a,LL b) 8 { 9 LL t,d;10 if(b == 0)11 {12 x = 1;13 y = 0;14 return a;15 }16 d = ext_eulid(b,a%b);17 ... 阅读全文
posted @ 2013-10-19 11:08 Naix_x 阅读(218) 评论(0) 推荐(0) 编辑