
Codeforces
Lruihao
优快云 停止更新,博客更新在 lruihao.cn
展开
-
Educational Codeforces Round 47 (Rated for Div. 2)
那天晚上报名了没打,第二天早上打的,也只出了两题。 A. Game Shopping#include<iostream>using namespace std;int main(){ int n,m,s=0; cin>>n>>m; int i,j; int c[1000],a[1000]; for(i=0;i&原创 2018-07-21 17:37:21 · 7811 阅读 · 0 评论 -
Codeforces Round #498 (Div. 3)-A. Adjacent Replacements
A. Adjacent Replacements 第一次打cf就做出一道这样的找规律的题,打到自闭。#include<bits/stdc++.h>using namespace std;int main(){ int n,a[1001]; cin>>n; int i; int flag=0; for(i=0;i<...原创 2018-07-21 19:48:05 · 7699 阅读 · 0 评论 -
Piles-with-stones
Codeforces Round #500 (Div. 2) 题目链接:Piles With Stones 大致题意就是有n堆石头,第一天每堆有一定数目的石头,第二天石头可能被小朋友移动或者带走,求满足题意的两天的石碓; 所以第二天的石头总数不会大于第一天的,所以是sum1-sum2>=0即可。 //又只打了一道题,扣了80多分。。。#include<bits/st...原创 2018-08-10 20:50:38 · 9694 阅读 · 0 评论 -
Bear and Five Cards-Codeforces680A
题目链接:Bear and Five Cards大致题意就是小熊有5张卡片,每张卡片有对应的分数,他可以选择丢弃2张相同的或者3张相同的卡片,没有相同的就无法丢弃,问小熊剩下的分数最少是多少。没有想得那么复杂,由于分数最大才100,所以直接暴力就好了。。。#include<bits/stdc++.h>using namespace std;int main()...原创 2018-08-10 21:01:53 · 9769 阅读 · 0 评论 -
Codeforces Round 502(Div.1 + Div.2)
A. The Rank题目大意: 给出n个学生的成绩,Thomas Smith的成绩是第一行,然后要按总成绩进行排序,总分相同的按编号从小到大排; 开始看还以为要写sort的cmp函数进行多条件排序,敲完才发现其实只要按总分就可以了,因为托马斯的id是一,必然会排在前面。#include<bits/stdc++.h>using namespace std;i...原创 2018-08-22 11:18:57 · 8994 阅读 · 0 评论 -
Dreamoon and WiFi(组合数学)
题目链接题目大意就是给定两个字符串,第一个字符串由”+”,”-“组成,第二个字符串由”+”,”-“,”?”组成,“+”代表加1,”-“代表减一,“?”代表可取正也可取负,问第二个字符串的位置和第一个字符串相等的概率是多少。我一开始的想法是把(+1,-1)^n 看成和二项式定理一样的展开始式,只不过把乘法改为加法,然后得到公式 c(n,0)(n+(-1)0)+c(n,1)(n-1+...原创 2018-08-22 11:24:04 · 9144 阅读 · 0 评论 -
Dreamoon and Stairs
题目链接Dreamoon wants to climb up a stair of n steps. He can climb 1 or 2 steps at each move. Dreamoon wants the number of moves to be a multiple of an integer m.What is the minimal number of moves m...原创 2018-08-22 11:25:46 · 9027 阅读 · 0 评论