随笔分类 - ACM--模拟
摘要:链接发个长长的模拟 这题要注意的地方挺多 -的个数 以及对齐的情况 全都注意好了 大数的加减乘就可以了 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 #define N 510 11 char s1[N],s2[N]; 12 int s[N][N*2],o[N]; 13 int main() 14 { 15 int t,i,j,k1,k2,len; 16 char c,tc; 1...
        阅读全文
            
摘要:模拟着算写完 挂在第7组上 之后乱七八糟的改。。终于刷完了第二章 刷了好久了。。偶尔想起来刷刷View Code 1 /* 2 ID: shangca2 3 LANG: C++ 4 TASK: fracdec 5 */ 6 #include <iostream> 7 #include<cstdio> 8 #include<cstring> 9 #include<stdlib.h>10 #include<algorithm>11 using namespace std;12 int d,di[100000],v[1000001],g,f
        阅读全文
            
摘要:刚开始输出0的时候想错了一地方 想着标记来着 看CZ的 数不大 直接大于多少时退出就好了View Code 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: ttwo 5 */ 6 #include <iostream> 7 #include<cstdio> 8 #include<cstring> 9 #include<algorithm> 10 #include<stdlib.h> 11 using namespace std; 12 char str[12][12]; 13 int s1,s2,s3,s4
        阅读全文
            
摘要:http://poj.org/problem?id=3087一道模拟题折腾了好久View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 #include<map> 6 using namespace std; 7 map<string,int>ff; 8 int main() 9 {10 int i,j,k,n;11 char s1[110],s2[110],s[300],ss[300];1
        阅读全文
            
摘要:之前做的一道题,忘记发了,纠结了好久,把题意想复杂了,就是直接枚举*号位置上的数。View Code 1 /* 2 ID: your_id_here 3 PROG: crypt1 4 LANG: C++ 5 */ 6 #include <iostream> 7 #include<cstdio> 8 #include<string.h> 9 using namespace std;10 int count,f[100];11 int judge(int s)12 {13 int i,flag = 1,m = s;14 while(s)15 {16 ...
        阅读全文
            
摘要:做了几天,bfs一直超内存,dfs一直死循环,最后直接枚举过了,每个操作最多用3次,9重循环枚举每个操作的次数。View Code 1 /* 2 ID: your_id_here 3 PROG: clocks 4 LANG: C++ 5 */ 6 #include <iostream> 7 #include<cstdio> 8 #include<cstring> 9 using namespace std; 10 int pjudge(int *x,int *a) 11 { 12 int i,j,k; 13 int flag = 1; 14 ...
        阅读全文
            
摘要:TransformationsA square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been applied to the original pattern given the following list of possible transformation
        阅读全文
            
摘要:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1135好繁琐的一道模拟题 细节很重要 编译错误一次 把字符串结尾写错WA一次 多了getchar()WA一次 多了以空格PE一次 最后AC...3个多小时用了一下map map还是很方便的View Code 1 #include <iostream> 2 #include<map> 3 #include<stdio.h> 4 #include&l
        阅读全文
            
摘要:http://poj.org/problem?id=2632好繁琐的一道模拟题 对着测试数据改了将近三个小时才过View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int i,j,t,n,m,a,b,c[101],f[101][101],x[101],y[101],xi,yi,cs1,cs2,crash; 6 char ci,c1; 7 scanf("%d",&t); 8 while(t--) 9 { 10 scanf("%d%d"..
        阅读全文
            
摘要:http://poj.org/problem?id=1068View Code 1 #include<stdio.h> 2 #include<string.h> 3 int stack[20001],top,b[10001]; 4 void inst(int x,int y) 5 { 6 int i; 7 for(i = top+1 ; i <= top+(x-y) ; i++) 8 stack[i] = 1; 9 top = top+x-y+1;10 stack[i] = 0;11 b[x] = top;12 }13 int main()14...
        阅读全文
            
 
                     
                    
                 
                    
                
 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号