随笔分类 -  其他OJ

SGU 107
摘要:1 #include 2 #include 3 //#define suf 987654321 4 5 int main(){ 6 //测试使用,暴力解出n=9时的8个解,平方后缀是否为suf只与其后9位有关 7 /*for(long long i=sqrt(suf*1.... 阅读全文

posted @ 2013-09-04 23:01 Stomach_ache 阅读(125) 评论(0) 推荐(0) 编辑

NYoj 155最短路
摘要:1 //dij 2 #include 3 4 #include 5 #include 6 using namespace std; 7 #define inf 0x3f3f3f3f 8 #define min(x,y) (x<y?x:y) 9 10 int N,M,P,Q;11 int city... 阅读全文

posted @ 2013-08-31 22:24 Stomach_ache 阅读(115) 评论(0) 推荐(0) 编辑

Hamming Codes
摘要:/*ID: weitong4LANG: C++TASK: hamming*/#include#include#define max 64int ans[max+5];int N,B,D;bool ham_dis(int x,int y){ int cnt=0; for(int i=0;i>=1; ... 阅读全文

posted @ 2013-07-25 21:05 Stomach_ache 阅读(187) 评论(0) 推荐(0) 编辑

USACO 2.1.4
摘要:1 /* 2 ID: weitong4 3 LANG: C++ 4 TASK: holstein 5 */ 6 #include 7 #include 8 #define v_max 25+5 9 #define g_max 15+510 11 int v,g;12 int a[v_max],b[... 阅读全文

posted @ 2013-07-25 13:50 Stomach_ache 阅读(116) 评论(0) 推荐(0) 编辑

UVa 10131
摘要:1 /* 2 3 * 类似于最长递减子序列 4 */ 5 #include 6 7 #include 8 #include 9 using namespace std;10 #define Max(x,y) (x>y?x:y)11 #define max 1000+512 struct nod... 阅读全文

posted @ 2013-07-18 19:43 Stomach_ache 阅读(120) 评论(0) 推荐(0) 编辑

UVa 562
摘要:1 /* 2 3 * 泥马,WA了一天,这题应该是很简单的DP,不过就是做不出来,只好改用母函数。。。。。 4 */ 5 #include 6 7 #include 8 #include 9 #include10 using namespace std;11 #define max 100+5... 阅读全文

posted @ 2013-07-18 19:42 Stomach_ache 阅读(139) 评论(0) 推荐(0) 编辑

zoj 1001 python起步
摘要:1 /*赶角还是挺好的。。。。*/2 import sys3 4 for line in sys.stdin:5 a=line.split()6 print int(a[0])+int(a[1]) 阅读全文

posted @ 2013-07-12 21:05 Stomach_ache 阅读(188) 评论(0) 推荐(0) 编辑

zoj2562 反素数
摘要:/*这题1 =a2>=a3>=............an.另外,如何求p的正约数个数呢,答案就是(a1+1)*(a2+1)*(a3+1)*..........(an=1)如:p=6=2^1*3^1,故6的约束个数为(1+1)*(1+1)=4 ......等等然后就是按照素因子递增的顺序逐个搜索,然... 阅读全文

posted @ 2013-07-11 15:30 Stomach_ache 阅读(220) 评论(0) 推荐(0) 编辑

NYoj536 矩阵链乘
摘要:经典问题没啥说的#include#include#define max 100+1#define min(a,b) (a<b?a:b)typedef long long LL;LL dp[max][max];int p[max];int main(){ int n; while(~scanf("%d... 阅读全文

posted @ 2013-07-01 14:50 Stomach_ache 阅读(117) 评论(0) 推荐(0) 编辑

NYoj 613 免费馅饼
摘要:#include#include#define Max(a,b) (a>b?a:b)#define max 100000+5int dp[max][11]; //dp[i][j]表示在i秒时站在j点处可得到的馅饼个数的最大值int map[max][11]; //把每秒钟每个坐标的馅饼个数存储在m... 阅读全文

posted @ 2013-06-23 17:22 Stomach_ache 阅读(102) 评论(0) 推荐(0) 编辑

UVA11549
摘要:在UVA刷的第一题,floyd判圈。。。。。。。#include#includetypedef long long LL;int next(int n,int k){if(!k) return 0;long long k3=(long long)k*k;int a[15],l=0;while(k3>... 阅读全文

posted @ 2013-06-12 22:55 Stomach_ache 阅读(133) 评论(0) 推荐(0) 编辑

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

导航

统计

点击右上角即可分享
微信分享提示