上一页 1 ··· 8 9 10 11 12 13 下一页
摘要: 浙大PAT。。。不解释。。原来各个学校出题是这样出的,好吧。宿舍好冷,手全快冻的打不动字了/* ID:linyvxi1 TASK:dualpal LANG:C++*/#include <stdio.h>#include <string.h>#include <stdlib.h>int N,S;bool pal(int n,int b){ char str1[100]; char str2[100]; memset(str1,'\0',sizeof(str1)); memset(str2,'\0',sizeof(str2)); 阅读全文
posted @ 2011-10-29 11:24 linyvxiang 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 今天状态不好,写的代码很烂,有时间重写,思路就不清楚呢,这么简单的题,此题与浙大PAT上某题类似/* ID:linyvxi1 PROB:palsquare LANG:C++*/#include <stdio.h>#include <string.h>#include <stack>#include <stdlib.h>using namespace std;int B;char str1[100];char str2[100];char str3[100];bool check(int n){ memset(str1,'\0',s 阅读全文
posted @ 2011-10-29 10:23 linyvxiang 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 上午那道被北航改编成了研究生上机题,现在这道被清华改编成了上机题。看来usaco是个好东西~另外,测试时在结尾多输出了一行字符,居然提交上去也过了,可见后台的JUDGE不是用的linux里的differ函数/* ID:linyvxi1 TASK:namenum LANG:C++*/#include <string.h>#include <stdio.h>#include <fstream>char num_map[]={'2','2','2','3','3','3' 阅读全文
posted @ 2011-10-27 16:59 linyvxiang 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 北航复试题是此题的简化,如果不是文件操作这题早就过了/* ID:linyvxi1 LANG:C++ TASK:transform*///#include <stdio.h>//#include <iostream>#include <fstream>#include <string.h>using namespace std;int N;char mat1[11][11],mat2[11][11];char mat3[11][11];bool degree_90(){ int i,j; for(i=1;i<=N;i++){ for(j=1; 阅读全文
posted @ 2011-10-27 12:47 linyvxiang 阅读(157) 评论(0) 推荐(0) 编辑
摘要: USACO的TEXT原文,感觉写的挺好的,外国人写的东西确实比较容易读懂The IdeaSolving a problem using complete search is based on the ``Keep It Simple, Stupid'' principle. The goal of solving contest problems is to write programs that work in the time allowed, whether or not there is a faster algorithm.Complete search exploi 阅读全文
posted @ 2011-10-27 09:41 linyvxiang 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 花大力气写的模拟。。。等搜索练好了再回来做,另外把测试数据发一下。。/* ID:linyvxi1 PROG:beads LANG:C++*/#include <stdio.h>#include <string.h>int main(){ FILE* fin=fopen("beads.in","r"); FILE* fout=fopen("beads.out","w"); int n; char str[400]; fscanf(fin,"%d",&n); fsca 阅读全文
posted @ 2011-10-27 09:10 linyvxiang 阅读(220) 评论(0) 推荐(0) 编辑
摘要: /*ID:linyvxi1LANG:C++TASK:friday*/#include <stdio.h>int day_map[]={0,31,28,31,30,31,30,31,31,30,31,30,31};int final[8]={0};bool leap_year(int n){ if(n%400==0||(n%4==0&&n%100!=0)) return true; return false;}int cal(int year){ int i,days=0; for(i=1900;i<year;i++){ days+=leap_year(i)?3 阅读全文
posted @ 2011-10-22 20:12 linyvxiang 阅读(122) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2099#include <stdio.h>#include <list>using namespace std;int main(){ int a,b; while(scanf("%d%d",&a,&b)!=EOF){ if(a==0&&b==0) return 0; list<int> L; int i,j; for(i=0;i<=9;i++) for(j=0;j<=9;j++) ... 阅读全文
posted @ 2011-10-20 22:45 linyvxiang 阅读(123) 评论(0) 推荐(0) 编辑
摘要: http://pat.zju.edu.cn/contests/pat-practise/1009#include <stdio.h>#include <cmath>int N;double Poly[2][1002],sPoly[2002];int main(){ for(int i=0;i<2;i++){ scanf("%d",&N); for(int j=0;j<N;j++){ int a; double b; scanf("%d%lf",&a,&b); Poly... 阅读全文
posted @ 2011-10-17 09:55 linyvxiang 阅读(307) 评论(0) 推荐(0) 编辑
摘要: http://pat.zju.edu.cn/contests/pat-practise/1002浮点数为零的判断条件要小心。。#include <stdio.h>#include <cmath>#define MAXN 1024double num[1024];int main(){int i;int m=0;for(i=0;i<2;i++){int n;scanf("%d",&n);for(int j=0;j<n;j++){int a;double b;scanf("%d%lf",&a,&b) 阅读全文
posted @ 2011-10-16 17:11 linyvxiang 阅读(248) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 下一页