04 2013 档案
摘要:人生中的第一个并查集!!建树的时候虽然什么优化都没用。。。。 结果1S就过了Wireless NetworkTime Limit: 10000MSMemory Limit: 65536KTotal Submissions: 13429Accepted: 5687DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia...
阅读全文
摘要:来自 http://blog.csdn.net/dm_vincent/article/details/7655764本文主要介绍解决动态连通性一类问题的一种算法,使用到了一种叫做并查集的数据结构,称为Union-Find。更多的信息可以参考Algorithms 一书的Section 1.5,实际上本文也就是基于它的一篇读后感吧。原文中更多的是给出一些结论,我尝试给出一些思路上的过程,即为什么要使用...
阅读全文
摘要:人生中的第一个并查集!!建树的时候虽然什么优化都没用。。。。 结果1S就过了 Wireless NetworkTime Limit:10000MSMemory Limit:65536KTotal Submissions:13429Accepted:5687DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers,...
阅读全文
摘要:盐水的故事Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10284 Accepted Submission(s): 2457Problem Description挂盐水的时候,如果滴起来有规律,先是滴一滴,停一下;然后滴二滴,停一下...
阅读全文
摘要:神奇的3分法,求单峰函数极值的利器!!!公式可以画图推导如下:x1=cos(a)*x+sin(a)*y;y1=cos(a)*y-sin(a)*x; Texas TripTime Limit:1000MSMemory Limit:65536KTotal Submissions:3429Accepted:1018DescriptionAfter a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. ...
阅读全文
摘要:C. Main Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs you know, Vova has recently become a new shaman in the city of Ultima Thule. So...
阅读全文
摘要:#include #include #include using namespace std;int main(){map word_count;string word;while(cin>>word){pair::iterator,bool> ret;ret=word_count.insert(make_pair(word,1));if(!ret.second){++ret.first->sec...
阅读全文
摘要:枚举在每个湖结束钓鱼的情况,去掉移动的时间。这样在各个湖之间的移动就可以看成瞬移的了,贪心可以很容易的求出最大解。Gone FishingTime Limit : 4000/2000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : Accepted Submission(s) : P...
阅读全文
摘要:Gone FishingTime Limit : 4000/2000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : Accepted Submission(s) :Problem DescriptionJohn is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n <= 25) all reachab
阅读全文
摘要:Tian Ji -- The Horse RacingTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : Accepted Submission(s) :Problem DescriptionHere is a famous story in ...
阅读全文
摘要:题目意思很难得懂,给N个2次函数,求最大值中的最小值3分法 (用黄金分割比例可以省去一次计算使速度更快)用CIN COUT会超时Error CurvesTime Limit : 4000/2000ms (Java/Other) Memory Limit : 65536/65536K (Java/Other)Total Submission(s) : Accepted Submissio...
阅读全文
摘要:题目意思很难得懂,给N个2次函数,求最大值中的最小值3分法 (用黄金分割比例可以省去一次计算使速度更快)用CIN COUT会超时Error CurvesTime Limit : 4000/2000ms (Java/Other)Memory Limit : 65536/65536K (Java/Other)Total Submission(s) : Accepted Submission(s) :Problem DescriptionJosephina is a clever girl and addicted to Machine Learning recently. Shepays muc.
阅读全文
摘要:男人8题:第8题二分+贪心判断答案Elevator Stopping PlanTime Limit:1000MSMemory Limit:30000KTotal Submissions:1839Accepted:614DescriptionZSoft Corp. is a software company in GaoKe Hall. And the workers in the hall are very hard-working. But the elevator in that hall always drives them crazy. Why? Because there is on
阅读全文
摘要:#include #include using namespace std;int is_run(int year){ if(year%100!=0&&year%4==0) return 1; if(year%400==0) return 1; else return 0;}int main(){ int k; cin>>k;...
阅读全文
摘要:用字符形式输出数字必WA。#include #include using namespace std;int main(){ int n; string s; cin>>n;for(int i=0;i>s; char c=s[0]; int len=s.length(); for(int j=1;j<=len;j++) { if(s[j]==...
阅读全文
摘要:充满各种PE的垃圾题#include using namespace std;int n,m;static int c=0;int round;int main(){cin>>round;for(int l=0;l>n>>m){ if(n==0&&m==0) break; int tot=0; int ans; for(int i=1;i<n;i++) fo...
阅读全文
摘要:可以说,中央处理器(CPU)是现代社会飞速运转的动力源泉,在任何电子设备上都可以找到微芯片的身影,不过也有人不屑一顾,认为处理器这东西没什么技术含量,不过是一堆沙子的聚合而已。是么?Intel今天就公布了大量图文资料,详细展示了从沙子到芯片的全过程,简单与否一看便知。 简单地说,处理器的制造过程可以大致分为沙子原料(石英)、硅锭、晶圆、光刻(平版印刷)、蚀刻、离子注入、金属沉积、金属...
阅读全文
摘要:Binary Tree TraversalsTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2019Accepted Submission(s): 906Problem DescriptionA binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the
阅读全文
摘要:利用BITSET+STRING就可以了:例如 1 #include <iostream> 2 #include <bitset> 3 #include <string> 4 5 using namespace std; 6 7 int main() 8 { 9 string str="1101001010";10 bitset<32> b(str);11 int n;12 n=b.to_ulong();13 14 cout<<n;15 16 return 0;17 }
阅读全文
摘要:应注意以下两点:1:no push_front on vector but we can insert before begin();2:任何 insert 或 push 操作都可能导致迭代器失效。当编写循环将元素插入到 vector 或 deque 容器中时,程序必须确保迭代器在每次循环后都得到更新 1 #include <iostream> 2 #include <vector> 3 4 using namespace std; 5 6 int main() 7 { 8 vector<int> v(2,99); 9 vector<int>::
阅读全文
摘要:纠结了好一阵子:2分(向大的方向)+精度 PieTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7983Accepted: 2928Special JudgeDescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie,...
阅读全文
摘要:二分搜索,找小的值Monthly ExpenseTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 10057Accepted: 4114DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money...
阅读全文
摘要:A. Snow Footprintstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a straight snowy road, divided into n blocks. The blocks are numbered fr...
阅读全文
摘要:一个简单的DFS,但需要根据奇偶性进行剪枝Tempter of the BoneTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : Accepted Submission(s) : Problem DescriptionThe doggie ...
阅读全文
摘要:反向BFS+二进制记录Alice’s CubeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1393 Accepted Submission(s): 407Problem DescriptionAlice has received ...
阅读全文
摘要:参考了:poj 1324 简化的贪吃蛇在周同学的帮助下,加了个优化,总算过了,先说一下做法:1、宽搜是必要的,那么如何记录蛇当前的状态,以避免以后重复的访问变成了关键,在这里我们将蛇的状态描述为如下三元组(x,y,state),其中(x,y)是蛇头的坐标,state记录的是尾巴的状态,由于尾巴最长为七段,每一段相对于前一段只有上下左右四种状态,仅需要两位表示,则尾巴状态最多需要7×2=14位二进制...
阅读全文
摘要:昨天课太多,晚上写了这题其中的两个函数,今天给补全了:有一点很不一样,判重的时候用的是头结点的位置与身体的相对位置。建一个三维组vis[22][22][16400](除了头以外最多还有7节,每一节相对上一节有上,下,左,右四种位置,可用两位二进制表示 一个14位的二进制)。判重的时候看蛇的形状有没有一样的就行了。进行BFS的时候应该把 图 和 蛇 合并到一起判断可以向那个方向走。Holedox M...
阅读全文
摘要:Flip GameTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 23368Accepted: 10062DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. ...
阅读全文
摘要:继8皇后问题后又一大突破8数码问题EightTime Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 8 Accepted Submission(s) : 4Special JudgeProblem DescriptionThe 15-puzzle...
阅读全文
摘要:EightTime Limit : 2000/1000ms (Java/Other)Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : Accepted Submission(s) :Special JudgeProblem DescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15
阅读全文
摘要:康托展开的公式把一个整数X展开成如下形式:X=a[n]*(n-1)!+a[n-1]*(n-2)!+...+a*(i-1)!+...+a[2]*1!+a[1]*0!其中,a为整数,并且0#include using namespace std;int main(){ string s; cin>>s; int len=s.length(); int sum=0; for...
阅读全文
摘要:容器 C++ set和map set, multisetset和multiset会根据特定的排序准则自动将元素排序,set中元素不允许重复,multiset可以重复。因为是排序的,所以set中的元素不能被修改,只能删除后再添加。向set中添加的元素类型必须重载 class FunObj { public: FunObj():status(true){} FunObj(int):status(fa...
阅读全文
摘要:康托展开的公式把一个整数X展开成如下形式:X=a[n]*(n-1)!+a[n-1]*(n-2)!+...+a[i]*(i-1)!+...+a[2]*1!+a[1]*0!其中,a为整数,并且0<=a[i]<i(1<=i<=n)康托展开的应用实例{1,2,3,4,...,n}表示1,2,3,...,n的排列如{1,2,3}按从小到大排列一共6个。123132213231312321。代表的数字123456也就是把10进制数与一个排列对应起来。他们间的对应关系可由康托展开来找到。如我想知道321是{1,2,3}中第几个大的数可以这样考虑:第一位是3,当第一位的数小于3时,那排
阅读全文
摘要:Rightmost DigitTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23619 Accepted Submission(s): 8998Problem DescriptionGiven a positive integer ...
阅读全文
摘要:八数码问题不是一天能搞出来的。。。。完数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13716 Accepted Submission(s): 4900Problem Description完数的定义:如果一个大于1的正整数的所有...
阅读全文
摘要:1 int dp[N]; 2 void OneZeroPack( int v , int c , int w ){//01背包 3 for( int i = v ; i >= c ; i-- ) 4 dp[i] = max( dp[i] , dp[i-c] +w ) ; 5 } 6 void CompletePack( int v , int c , int w ){//完全背包 7 for( int i = c ; i <= v ; i++ ) 8 dp[i] = max( dp[i] , dp[i-c] +w ) ;...
阅读全文
摘要:动态规划 的 代表作:其实,DP就是把递归写的程序 改成带备忘记录的,或者至底而上的来避免重复计算同一子问题而已。。。。。 1 #include <iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 int a[9]={9999,1,0,0,1,0,1,0,1}; 8 int b[10]={-9999,0,1,0,1,1,0,1,1,0}; 9 10 int i,j;11 12 char s[9][10];//记录移动方向13 int c[9][10];//记录从a[i]b[j]的最长子串的...
阅读全文
摘要:计算组合数最大的困难在于数据的溢出,对于大于150的整数n求阶乘很容易超出double类型的范围,那么当C(n,m)中的n=200时,直接用组合公式计算基本就无望了。另外一个难点就是效率。 对于第一个数据溢出的问题,可以这样解决。因为组合数公式为: C(n,m) = n!/(m!(n-m)!) 为了避免直接计算n的阶乘,对公式两边取对数,于是得到: ln(C(n,m)) = ln(n!)-ln(m!)-ln((n-m)!) 进一步化简得到:这样我们就把连乘转换为了连加,因为ln(n)总是很小的,所以上式很难出现数据溢出。 为了解决第二个效率的问题,我们对上式再做一步化简。上式已经把连乘法变成.
阅读全文
摘要:1 #include <iostream> 2 #include <string.h> 3 //#include <fstream> 4 5 using namespace std; 6 7 static int ans=0; 8 9 void swap(int& a,int& b) 10 { 11 int t; 12 t=a; 13 a=b; 14 b=t; 15 } 16 17 void swap(char*a ,char*b ) 18 { 19 char s[55]; 20 strcpy(s,a); 21 ...
阅读全文
摘要:next_permutationprev_permutation在标准库算法中,next_permutation应用在数列操作上比较广泛.这个函数可以计算一组数据的全排列.但是怎么用,原理如何,我做了简单的剖析.首先查看stl中相关信息.函数原型:template<class BidirectionalIterator> bool next_permutation( BidirectionalIterator_First, BidirectionalIterator_Last );template<class BidirectionalIterator, class Bina
阅读全文
摘要:若某数x分别被d1、、…、dn除得的余数为r1、r2、…、rn,则可表示为下式:x=R1r1+R2r2+…+Rnrn+RD其中R1是d2、d3、…、dn的公倍数,而且被d1除,余数为1;R1 、R2…、Rn是d1、d2、…、dn-1的公倍数,而且被dn除,余数为1;D是d1、d2、…、的最小公倍数;R是任意整数,可根据实际需要决定;且d1、、…、必须互质,以保证每个Ri(i=1,2,…,n)都能求得.该问题可以用初等数论中的同余方程组的求解问题。利用同余的符号,可以将上述问题转化为下面的同余方程组:x≡2(mod 3);x≡3(mod 5);x≡2(mod 7);不难看出上述同余方程组的解并不
阅读全文
摘要:1 //最终版 2 #include <iostream> 3 #include <cmath> 4 using namespace std; 5 double ans2(char* c) 6 { 7 double a,b; 8 double sum; 9 char t; 10 a=c[2]-48;b=c[4]-48; 11 t=c[3]; 12 // cout<<"a: "<<a<<"b: "<<b<<"t: "<<t<<en
阅读全文
摘要:1 int** func(int w,int h) 2 { 3 int** p=new int *[w]; 4 for(int i=0;i<w;i++) 5 { 6 p[i]=new int[h]; 7 } 8 return p; 9 }10 11 //记得要DELETE
阅读全文
摘要:1 #include<stdio.h>2 #define N 6003 int main(void)4 {5 int a[N][N];6 printf("\nthe array is %d\n",N);7 return 0;8 }当N不是太大时还可以,一旦N大于600,就会出现警告,甚至错误,错误如下:Compiling...test.cD:\test.c(5):warningC4101:'a':unreferencedlocalvariableLinking...错误大概就是说,可能是数组建的太大了???开到main函数外面,开在里面会因为数组
阅读全文
摘要:找规律的题,对每一个数字对应一个三维坐标(X,Y,Z)X::表示在第几层Y:从左边的边数在第几个Z::从右边的边数在第几个对倒三角要特殊处理(Z减一)如:1(1,1,1) 2(2,2,1) 3(2,1,1)距离就是坐标差点绝对值。 1 #include <iostream> 2 #include <cmath> 3 4 using namespace std; 5 6 struct Note 7 { 8 int x; 9 int y;10 int z;11 };12 13 int main()14 {15 Note a,b;16 int m,n;...
阅读全文
摘要:1 #include <iostream> 2 #include <algorithm> 3 4 using namespace std; 5 6 int cmp(const void *a,const void *b) 7 { 8 return *(int*)a-*(int*)b; 9 }10 11 int cn(int x)12 {13 int c=0;14 for(;x;x=x>>1)15 {16 if(x&1)17 c++;18 }19 return c;20 }21 22 int a[110];23 int b...
阅读全文
摘要:MatrixTime Limit:2000MSMemory Limit:30000KTotal Submissions:3096Accepted:1612DescriptionGiven an n*n matrix A, whose entries Ai,j are integer numbers ( 0 <= i < n, 0 <= j < n ). An operation SHIFT at row i ( 0 <= i < n ) will move the integers in the row one position ri...
阅读全文
摘要:教课书一样的代码,一遍AC:Fire NetTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 15Accepted Submission(s) : 6Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each represen
阅读全文
摘要:非常经典的搜索题,很多剪枝技巧在里面!! 4 #include <iostream> 5 #include <algorithm> 6 #include <string.h> 7 8 using namespace std; 9 10 int cmp(const void *a ,const void *b)11 {12 return *(int*)b-*(int*)a;13 }14 15 int a[70];16 int n;17 int vis[70];18 int sum;19 20 int ko(int unused,int left, int ta
阅读全文
摘要:1 #include <iostream> 2 3 using namespace std; 4 5 int n,k; 6 char m[9][9]; 7 int a[9]; 8 9 void dfs(int cur,int k,int& tot)10 {11 if(k<0) return;12 if(cur==n)13 {14 if(k==0)15 tot++;16 return ;17 }18 for(int i=0;i<n;i++)19 {20 if(m[cu...
阅读全文
摘要:找规律的: 1 #include <iostream> 2 #include <cmath> 3 4 using namespace std; 5 6 int main() 7 { 8 int a,b; 9 while(cin>>a>>b)10 {11 b=b%4;//最多就4种情况12 a=a%10;13 switch(b)14 {15 case 1:16 cout<<a%10; break;17 case 2:18 cout<<a*a%10; break;19...
阅读全文
摘要:Problem Description猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随机产生一个四位数,然后玩家猜这个四位数是什么。每猜一个数,计算机都会告诉玩家猜对几个数字,其中有几个数字在正确的位置上。比如计算机随机产生的数字为1122。如果玩家猜1234,因为1,2这两个数字同时存在于这两个数中,而且1在这两个数中的位置是相同的,所以计算机会告诉玩家猜对了2个数字,其中一个在正确的位置。如果玩家猜1111,那么计算机会告诉他猜对2个数字,有2个在正确的位置。现在给你一段gameboy与计算机的对话过程,你的任务是根据这段对话确定这个四位数是什么。Input输入数据
阅读全文
摘要:最基本的DFSLake CountingTime Limit : 2000/1000ms (Java/Other)Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 10Accepted Submission(s) : 3Problem DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 &
阅读全文
摘要:Prime PathTime Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 7 Accepted Submission(s) : 3Problem DescriptionThe ministers of the cabinet were quit...
阅读全文
摘要:c++ stack,queue,vector用法分别包含在文件,,定义:stack s;queue q;vector v;stack的方法:push()的向容器顶部里插入元素;pop()是删除容器顶部的元素;top()返回容器顶部的元素;size()返回容器的元素个数;begin()是返回一个位于容器的第一个元素的迭代器;end()当然是最后了;empty()是检查是否为空的方法 queue的方法...
阅读全文
摘要:正式入驻博客园了!!因为QQ空间的局限性,现在正式入驻博客园!原有文章搬家中......一起来见证我能堆多少的题解吧!原QQ空间:码代码的猿猿http://1756942789.qzone.qq.com(版权所有)
阅读全文
摘要:经典搜索题!!送给自己的生日礼物!!!生日蛋糕Time Limit : 2000/1000ms (Java/Other)Memory Limit : 20000/10000K (Java/Other)Total Submission(s) : 7Accepted Submission(s) : 2Problem Description7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i < M时,要求Ri > Ri+1且Hi >
阅读全文
摘要:Prime PathTime Limit : 2000/1000ms (Java/Other)Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 7Accepted Submission(s) : 3Problem DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digi
阅读全文
摘要:最基本的DFSLake CountingTime Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 10 Accepted Submission(s) : 3Problem DescriptionDue to recent rains, water ...
阅读全文
摘要:母牛们不但创建了他们自己的政府而且选择了建立了自己的货币系统。[In their own rebellious way],,他们对货币的数值感到好奇。传统地,一个货币系统是由1,5,10,20 或 25,50, 和 100的单位面值组成的。母牛想知道有多少种不同的方法来用货币系统中的货币来构造一个确定的数值。 边界条件设f[0]等于1,什么累加的方法数是一,累加得0. f[0]←1; ...
阅读全文
摘要:#include #include using namespace std;int a[102];int b[102];int main(){ int n; while(cin>>n&&n) { for(int i=0;i>a; } for(int i=0;i>b; } sort(a,a+n); sort(b,b+n); int sa=0...
阅读全文
摘要:注意应该判断字符串" no good"(NO前有空格)#include #include #include #include using namespace std;int main(){ char a[20],b[20]; int n; while(cin>>n&&n) { memset(a,'-',sizeof(a)); memset(b,'...
阅读全文
摘要:#include using namespace std;int gcd(int a,int b){ if(a>a>>b) { int c=gcd(a,b); cout<<a*b/c<<endl; } return 0;}
阅读全文
摘要:注意结尾处补上个5,很简单的水题#include #include #include using namespace std;int nth=0;void function(char* s,int& a,int wei){ a=0; for(int i=0;i>str) { int len=strlen(str); str[len]='5'; ...
阅读全文
摘要:不知道为什么过不了???#include #include #include using namespace std;struct Milk{ string name; double price; int vlm; int ok; double GDG; int day;}M[103];int main(){ int n; cin>>n; fo...
阅读全文
摘要:砝码称重问题:设有1g、2g、3g、5g、10g、20g的砝码各若干枚(其质量#include using namespace std;int w[6]={1,2,3,5,10,20};int a[6]={0};int sum=0;int dp[1005];int main(){ for(int i=0;i>a; sum+=a*w; } memset(dp,0,si...
阅读全文
摘要:派生类对象也“是”基类对象,但两者不同。派生类对象可以当做基类对象,这是因为派生类包含基类的所有成员。但是基类对象无法被当做成派生类对象,因为派生类可能具有只有派生类才有的成员。所以,将派生类指针指向基类对象的时候要进行显示的强制转换,否则会使基类对象中的派生类成员成为未定义的。总结:基类指针和派生类指针指向基类对象和派生类对象的4中方法:1. 基类指针指向基类对象,简单。只需要通过基类指针简单...
阅读全文
摘要:大家在学习C++编程时,一般在输入方面都是使用的cin.而cin是使用空白(空格,制表符和换行符)来定字符串的界的。这就导致了对于带有空格的字符串,比如”I Love www.CppLeyuan.com”只能读入”I”,后面的都无法读入。这时怎么办?(论坛:www.cppleyuan.com) 一.对于字符数组:方法一:getline()读入整行数据,它使用回车键输入的换行符来确定输入结尾。调用方...
阅读全文
摘要:无聊题。。。。#include #include using namespace std;int V;int f[10000];void Cpake(int cost){ for(int i=cost;i>n; int t[3]={150,200,350}; for(int k=0;k>V; for(int i=0;i<3;i++) { ...
阅读全文
摘要:A题,1~40界美国总统名字:A. Mysterious stringstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputInputThe input contains a single integer a (1≤a≤40).OutputOutp...
阅读全文

浙公网安备 33010602011771号