自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Codeforces 124B. Permutations

这题全排列可以下标,因为每一行的数字都得按同一规则全排列,而他们的下标都一样,再乘以相应的权值就行了!#include #include #include #include using namespace std; char s[20][20]; int a[20]; char index[20]; int t[20]; int main() { int n, k; int r

2015-03-24 00:09:21 239

原创 Codeforces 123A. Prime Permutation

看了题解找的规律之后,其实很简单,但是还是做了好久...规律就是:2到len/2和len/2之后的合数位置上的字母都必须一样,其余的补全就好了,下标从1开始会比较方便!#include #include #include #include using namespace std; bool is_prime(int x) { if(x == 1) return false; f

2015-03-24 00:02:50 233

原创 Codeforces Problem-124A. The number of positions

好简单,注意输入的a,b之和有可能大于n!#include #include using namespace std; int main() { int n; while(cin >> n) { int a, b; cin >> a >> b; if(a+b >= n) cout << n-a << endl; else cout << b+1 <

2015-03-22 23:37:21 285

原创 Codeforces Problems-122A. Lucky Division

直接从2到n枚举,能整除的就判断有无4和7就好了! #include #include using namespace std; bool f(int n) { while(n) { if(n % 10 != 4 && n % 10 != 7) return false; n /= 10; } retu

2015-03-22 23:33:02 170

空空如也

空空如也

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

TA关注的人

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