原创 CodeForces 166E Tetrahedron

一道比較簡單的dp吧 題目鏈接:http://codeforces.com/problemset/problem/166/E 代碼如下:#include <bits/stdc++.h> using namespace std; int d

原创 OJ系統錯誤返回提示

1.Accept                   程序運行正確. 2.WrongAnswer         程序出現錯誤. 3.Compilation  Error               編譯錯誤,

原创 Memory Limit Exceed C

#include<cstdio> using namespace std; typedef struct bus { int data; struct bus *next; }bus,*busstack; void crea

原创 用python實現一個簡單的刷瀏覽量小程序

話不多說,直接上代碼 import webbrowser as web import os import time IEPath = "C:\Program Files (x86)\Google\Chrome\Application\

原创 CCF最大的矩形

這個題目還是有點意思的,先說一下思路吧,以當前矩形開始向右遍歷,算出每一個面積,並保存最大的面積,複雜度O(n*n),上代碼吧: #include<bits/stdc++.h> using namespace std; int main(

原创 CCF201609-2火車購票

這個題目...沒法說,一開始沒想明白就開始寫,直接寫崩了,想明白了在寫吧,就一個標準,同一行的編號小的座位沒有坐人那這一行後面的座位一定也沒坐人,一個一維數組就可以了,上代碼吧,有時間再重寫一下: #include<bits/stdc++

原创 藍橋杯 楊輝三角

很簡單的題目,直接上代碼吧: #include<bits/stdc++.h> using namespace std; int main() { int a[45][45]= {0}; a[1][1]=1; a[2

原创 CCF201609-1最大波動

簡單題,直接上代碼吧: #include<bits/stdc++.h> using namespace std; int main() { int n; scanf("%d",&n); int a[10005];

原创 CCF201312-1出現次數最多的數

簡單題,直接上代碼: #include<bits/stdc++.h> using namespace std; int main() { int n,b; scanf("%d",&n); int s[10005]

原创 CCF201509-1數列分段

有點小坑,還不清楚怎麼回事,上一下正確代碼吧: #include<bits/stdc++.h> using namespace std; int main() { int n; scanf("%d",&n); i

原创 CCF201612-1中間數

排序一下就可以了,上代碼: #include<bits/stdc++.h> using namespace std; int main() { int n; scanf("%d",&n); int a[1005]

原创 CCF201403-1相反數

簡單題,直接冒泡就可以了: #include<bits/stdc++.h> using namespace std; int main() { int n; scanf("%d",&n); int a[1005];

原创 CCF201509-2日期計算

簡單題,直接上代碼吧: #include<bits/stdc++.h> using namespace std; void v1(int a) { int c[13]= {0,31,60,91,121,152,182,213,24

原创 CCF201712-2小遊戲

一道簡單的模擬,想清楚過程就好了。直接上代碼吧: #include<bits/stdc++.h> using namespace std; int main() { int n,k; scanf("%d %d",&n,&k

原创 CCF201512-1數位之和

用字符串來計算就很簡單了,代碼如下: #include<bits/stdc++.h> using namespace std; int main() { string a; cin>>a; int sum=0;