自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(30)
  • 收藏
  • 关注

原创 The Blocks Problem

模拟题型Background Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and robotics (STRIPS) u

2015-01-31 17:41:34 433

原创 Sicily 4835. Numbersrebmun

水题,练习下map函数和传递引用,忘了把测试的注释掉WA好久不知道哪里错= =#include #include #include using namespace std;void toup(string &str){ int len=str.length(); for(int i=0; i < len; i++) if(str[i]>='a'&&str[i]<='z')

2015-01-28 17:07:16 419

原创 天梯 蛇形矩阵

#include using namespace std;int arr[100][100];int main(){ int n,num=2; cin >> n; int d=n/2,f=n/2; arr[f][d]=1; d++; for(int i=2; i <= n-1 ; i+=2){ int k=i;

2015-01-28 16:03:43 368

原创 Sicily 1438. Shopaholic

#include #include #include using namespace std;int arr[200000];int main(){ int test; cin >> test; while(test--){ int n; cin >> n; for(int i=0; i < n; i++) cin >> arr[i]; sort

2015-01-28 16:01:54 305

原创 Sicily 1395. Rounders

坑爹的0害我WA好几次#include #include using namespace std;int arr[100];int num_dig(long long n){ int k=0; while(n!=0){ arr[k++]=n%10; n /= 10; } for(int i=0; i < k-1; i++){ if(arr[i]>=5)

2015-01-26 22:05:07 307

原创 Sicily 1036. Crypto Columns

#include #include #include using namespace std;char ch[11][11];int arr[100];char ch1[11][11];int main(){ string str; while(cin >> str&&str!="THEEND"){ int len=str.length(); string st;

2015-01-26 13:17:47 292

原创 Sicily 2369. Nim-B Sum

很简单的题,但WA了好多次,因为我用字符串转来转去,后来注意到可以是1000进制,就直接用数组储存每一位,然后就AC了,这题其实就是没有进位的加法而已代码如下:#include #include #include using namespace std;int j,k,l;int arr1[1000],arr2[1000],res[1000]; void to1(int

2015-01-19 22:39:41 458

原创 Sicily 1119. Factstone Benchmark

大概题意:找出最大的n,其阶乘思路:考虑到会爆表,所以取对数,将乘法换成加法#include #include #include using namespace std;int main(){ int n; while(cin >> n&&n!=0){ long long bit_n=(n-1960)/10+2; long long bit=p

2015-01-19 16:00:48 337

原创 Sicily 4495. Print permutations

#include #include #include using namespace std;int len;char ch[100];void allsort(int n,int m){ if(n >= len){ for(int i=0; i < len; i++) cout << ch[i]; cout << endl; } else{ for(i

2015-01-17 20:38:35 336

原创 Sicily 1890 BallsAgain

#include #include using namespace std;struct bottle{ int num; int cap;};bottle arr[1000];bool reduce1(bottle a,bottle b){ if(a.cap!=b.cap) return a.cap > b.cap; return a.num > b.num;}bo

2015-01-17 20:25:25 278

原创 Sicily 1814日期计算问题

#include #include #include using namespace std;int main(){ int test; cin >> test; while(test--){ string str1,str2; cin >> str1 >> str2; int year1=0,year2=0,mon1=0,mon2=0,day1=0,day2=0;

2015-01-17 19:21:02 302

转载 Sicily 2499 平方数

这道题一开始做的时候也是超时,后来去网上查了下发现用动归是可以做,而且避免很多没必要的操作。先定义一个足够大的数组,初始化为0,然后先把一个平方数的情况全部求出来,这些数的数组就赋值为1,接着用1个循环,从1扫到60000,找出2和3的情况,剩下就是4的情况,不必管他们。代码是借鉴网上的,如下#include#includeusing namespace std;int arr[70

2015-01-13 22:09:17 585

原创 Sicily 4422. Boat Game

#include using namespace std;int main(){ int test; cin >> test; while(test--){ int l=1,r,num; cin >> num >> r; int n,count=0;; cin >> n; while(n--){ int a; cin >> a; if(a>r)

2015-01-13 21:12:15 297

原创 Star and Matrix

Star has an n×m matrix, consisting of integers. Let's index the matrix rows from 1 to n from top to bottom and let's index the columns from 1 to m from left to right. Let's represent the matrix el

2015-01-12 18:07:39 315

转载 Sicily 1344数列

这道题一开始没什么思路,去网上搜了下,发现原来很有规律,同样是进制转换而已把n转成二进制,再把二进制的那个转成k进制的就行,看下面的例子能更好理解。1, 3,  4,9 , 10 , 12 , 13.....30,31,30+31,32,30+32,31+32,30+31+321, 10, 11, 100, 101, 110 , 111,#include#includeus

2015-01-12 01:56:23 348

原创 Sicily 1381. a*b

#includeusing namespace std;int digit[1000];void mul(string str,int a){ int jinwei=0,n=0; int len=str.length(); for(int i=len-1; i >= 0; i--){ digit[n++]=((str[i]-'0')*a+jinw

2015-01-11 12:21:55 363

原创 Sicily 2005. Lovely Number

#include#includeusing namespace std;int a[1000000];int main(){ int n; while(cin >> n){ memset(a,0,sizeof(a)); while(n--){ int b; cin >> b;

2015-01-10 18:30:06 283

原创 Sicily 1134. 积木分发

#include #include using namespace std;struct jimu{ int have; int need;};jimu arr[100001];bool check(jimu a,jimu b){ return a.need < b.need;}int main(){ int n,num; while(cin >>

2015-01-10 15:14:40 338

原创 Sicily 1753. 解码

#include#includeusing namespace std;int main(){ string str; while(cin >> str){ if(str=="XXX") break; else{ int len=str.length(); for(int i=0; i <

2015-01-10 12:55:12 358

原创 Sicily 1813. M进制数问题

#include#include#includeusing namespace std;int arr[10000];string tentom(int n,int m){ if(n==0) return "0"; string str; int i=0; while(n!=0){ arr[i++]=n%m; n /=

2015-01-10 12:51:57 406

原创 Sicily 4315. Digit Count

#include#include#includeusing namespace std;string inttostr(int n){ string str; while(n!=0){ str+=char(n%10+48); n /= 10; } return str;}int num[11];int main(

2015-01-10 12:51:33 395

原创 Sicily 7144. Different Triangles

#includeusing namespace std;bool istriangle(int a, int b, int c){ if(a+b>c&&a+c>b&&b+c>a&&a-b<c&&a-c<b&&b-c<a) return true; return false;}int arry[10001];int main() { int n;

2015-01-10 12:50:45 471

原创 Sicily 3712. Matrix multiplication

#includeusing namespace std;int max1[1001][1001];int max2[1002][1001];int sum[1001][1001];int main(){ int n; while(cin >> n){ for(int i=0; i < n; i++) for(int j=0; j < n;

2015-01-10 12:49:55 298

原创 Sicily 4312. A + B

#includeusing namespace std;int reserve(int a){ int hehe=0; while(a!=0){ hehe=hehe*10+a%10; a /= 10; } return hehe;}int main(){ int n; cin >> n; whi

2015-01-10 12:48:40 442

原创 Sicily 1201. 01000001

#include#includeusing namespace std;char lala[100000];int main(){ int n; cin >> n; for(int i=1; i <= n; i++){ string str1,str2; int num=0; cin >> str1 >> st

2015-01-10 12:44:14 354

原创 Sicily 1294. 高级机密

#include using namespace std; int main(){ int a,b,p; cin>>a>>b>>p; int c = 1 ; while(b!=0) { if(b%2==1) { b = b-1 ; c = (c*a)%p

2015-01-10 12:43:07 468

原创 Sicily 3913 阶乘之和

#include using namespace std;int main(){ int n ,s=1, all=0; cin >> n; n=(n>=30)?30:n; int i=1; while(i <= n){ s*=i; s%=1000000; all+=s; i++; }

2015-01-10 12:41:19 310

转载 找零方案

/* 小李是超市的收银员,每当顾客来结账时,他们给的钱往往都多余他们所购物品的实际价格,这时,小李就需要找零给他们。 小李是一个很爱思考的人,他想知道在目前的纸币面额情况下(1角、5角、1元、5元、10元、20元、50元、100元),如果每 种面额的纸币的数量都是无限的,他要给一个顾客找零N(0 小李很苦恼这个问题,聪明的你能帮助他吗?Input 输入包括多组测

2015-01-09 15:15:29 3538 2

原创 Candy Sharing Game

DescriptionA number of students sit in a circle facing their teacher in the center. Each student initially has an even number of pieces of candy. When the teacher blows a whistle, each student s

2015-01-09 13:38:33 285

原创 How many tiles

#include#include#includeusing namespace std;char maxr[21][21];int count=0;void check(int w,int h,int f,int g){ if((maxr[f][g]=='.'||maxr[f][g]=='@')&&f>=0&&f=0&&g<w){ count+

2015-01-09 12:31:28 352

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除