随笔分类 -  ------【基本算法】

上一页 1 2 3

USACO 1.3-Barn Repair
摘要:/* ID: m1590291 TASK: barn1 LANG: C++ */ #include #include #include #include using namespace std; int main() { int a[205],b[205],M,S,C; ifstream fin("barn1.in"); ofstream fout("barn1.o... 阅读全文

posted @ 2016-04-04 23:03 Jstyle 阅读(118) 评论(0) 推荐(0)

USACO 1.2-Transformations
摘要:/* ID: m1590291 TASK: transform LANG: C++ */ #include #include #include #define MAX 20 using namespace std; int n; char a[MAX][MAX],b[MAX][MAX]; bool check() //检查是否相等 { bool flag=true; for... 阅读全文

posted @ 2016-04-04 23:02 Jstyle 阅读(135) 评论(0) 推荐(0)

USACO 1.2-Palindromic Squares
摘要:/* ID: m1590291 PROG: palsquare LANG: C++ */ #include #include using namespace std; char NUMBER[20] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', .. 阅读全文

posted @ 2016-04-04 23:02 Jstyle 阅读(134) 评论(0) 推荐(0)

USACO 1.2-Name That Number
摘要:/* ID: m1590291 TASK: namenum LANG: C++ */ /****************************************************************************************************************** 一个字母只对应一个数字,从字典中读入一个单词,把它转化成唯一对应的... 阅读全文

posted @ 2016-04-04 23:01 Jstyle 阅读(137) 评论(0) 推荐(0)

USACO 1.2-Milking Cows
摘要:/* ID: m1590291 TASK: milk2 LANG: C++ */ #include <iostream> #include <algorithm> #include <fstream> #define MAX 5005 using namespace std; struct Node 阅读全文

posted @ 2016-04-04 23:00 Jstyle 阅读(123) 评论(0) 推荐(0)

USACO 1.2-Dual Palindromes
摘要:/* ID: m1590291 TASK: dualpal LANG: C++ */ #include #include using namespace std; ifstream fin ("dualpal.in"); ofstream fout ("dualpal.out"); const char a[] = {'0', '1', '2', '3', '4', '5', '6', '7'... 阅读全文

posted @ 2016-04-04 22:58 Jstyle 阅读(115) 评论(0) 推荐(0)

USACO 1.1-ride
摘要:/* ID: m1590291 PROG: ride LANG: C++ */ #include #include using namespace std; int main() { string s1,s2; int sum1=1,sum2=1,i; ifstream fin ("ride.in"); ofstream fout ("ride.out"); ... 阅读全文

posted @ 2016-04-04 22:58 Jstyle 阅读(143) 评论(0) 推荐(0)

USACO 1.1-gift1
摘要:/* ID: m1590291 PROG: gift1 LANG: C++ */ #include #include using namespace std; int main() { ifstream fin ("gift1.in.txt"); ofstream fout ("gift1.out.txt"); int s,i,j,k,money=0,ou... 阅读全文

posted @ 2016-04-04 22:56 Jstyle 阅读(214) 评论(0) 推荐(0)

USACO 1.1-Friday the Thirteenth
摘要:#include #include #include #include int isleap(int y) { return y%4==0 && (y%100 != 0 || y%400 == 0); } int mtab[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; /* return length of m... 阅读全文

posted @ 2016-04-04 22:55 Jstyle 阅读(136) 评论(0) 推荐(0)

USACO 1.1-beads
摘要:/* ID: m1590291 PROG: beads LANG: C++ */ #include #include using namespace std; int main() { int num,max=0,n,i,j,k; char *p,symbol1,symbol2; ifstream fin("beads.in"); ofstream fout("beads.out... 阅读全文

posted @ 2016-04-04 22:52 Jstyle 阅读(129) 评论(0) 推荐(0)

HDU-1009 做个骑士,以梦为马
摘要:#include #include #include //c++保留几位小数所用库函数 #define MAX 1005 using namespace std; /****************************************************************************************************************... 阅读全文

posted @ 2016-02-27 13:42 Jstyle 阅读(133) 评论(0) 推荐(0)

HDU-1051 做个骑士,以梦为马
摘要:#include #include #define MAX 5010 using namespace std; /****************************************************************************************************************** 本题是一个比较简答的贪心算法题目,关键在于贪心策略... 阅读全文

posted @ 2016-02-27 12:09 Jstyle 阅读(139) 评论(0) 推荐(0)

上一页 1 2 3

导航