- 博客(12)
- 收藏
- 关注
原创 Codeforces Round #313 (Div. 2) D Equivalent Strings
题意 划分字符串 a1 b1 a2 b2 若a1=b2&&a2=b1 || a1=b1&&a2=b2 输出YES若为偶数则不断划分 到奇数的时候则判断 两个字符串每一位是否相等 不能用strcmp#include #include #include #include using namespace std;const int MAX = 200100;char str1[M
2015-07-25 22:05:45 387
原创 Codeforces Round #313 (Div. 2) A B C
这三题 都挺水的 考读题。。A题意 给定n种面值的钱 输出所不能表示的最小价值 若都能表示则输出-1#include #include #include using namespace std;int main(){ int n; int ary[1010]; while(cin>>n) { for(int i = 0;i <
2015-07-25 20:35:20 392
原创 CF 558C Amr and Chemistry
#include #include #include #include using namespace std;const int MAX = 100100;int n,data;int gt[MAX],sum[MAX];/** 分析 两个数组 gt[t]把ary中的数转化为t所需要的最小操作数 sum[t] 能到达t的数个数 要注意 奇数/2*2的情况**/
2015-07-23 16:01:04 399
原创 CF 558B Amr and The Large Array
#include #include #include #include #define INF 2139062143using namespace std;const int MAX = 1001000;int n;int l[MAX],r[MAX],sum[MAX];int main(){ while(cin>>n) { memset(sum,
2015-07-22 22:52:49 379
原创 CF 558A Lala Land and Apple Trees
军训 好久没有A题了这阵时间心好烦 有好多事情困扰我 唉~#include #include #include using namespace std;struct tree{ int pos,sum;}data_z[110],data_f[110];int cmp_z(const tree&a,const tree&b){ return a.pos <
2015-07-22 19:53:50 489
原创 临时占坑 大一实习 学生信息管理系统
#include #include #include #include #include using namespace std;struct STU{ int id; char name[20]; char sex; double score[5]; double ave,sum; int _rank;}data[100];int
2015-07-13 23:01:32 456
原创 CF 18B Platforms
模拟题细节处理好就可以啦 >_#include #include using namespace std;typedef long long LL;const int MAX = 1e6 + 100;struct ax{ LL left,right;}data[MAX];int n,d,m,l;int main(){ // (k-1)m,(k-1)m +
2015-07-11 23:20:57 392
原创 CF 17A Noldbach problem
题意 给定n k 求小于等于n 的数能拆成两个相邻的素数和1的和 这样的数的个数是否大于等于k#include #include #include using namespace std;bool isprime[1010];int prime[1010],sum_prime;void get_prime(){ sum_prime = 0; memset(isp
2015-07-11 20:16:08 523
原创 CF 7C Line
裸拓展欧几里得#include #include #include #include using namespace std;typedef long long LL;LL gcd(LL a,LL b){ return b ? gcd(b,a%b):a;}void ex_gcd(LL a,LL b,LL &x,LL &y){ if(b == 0)
2015-07-10 19:15:58 534
原创 CF 3C Tic-tac-toe
此题只要考虑全面就可以额愁死了#include #include #include using namespace std;char data[5][5];int _win[2][10];// 行123 列123 \/int judgement(char c){ int judge = 0; for(int i = 0; i < 3; i ++) {
2015-07-09 16:07:21 556
原创 CF 3B Lorry
sort + greedy 为了满足各种判断条件 这样做应该是比较优的全都用1的 全都用2的 1 2混合使用的#include #include #include using namespace std;typedef long long LL;const int MAX = 1e5 + 1000;struct bb{ int t,p,num;} kay[MA
2015-07-09 11:18:21 521
原创 CF 554B Ohana Cleans Up
想清楚 看有多少一样的行#include #include #include using namespace std;char data[110][110];int num_same[110];/** 0101 1000 1111 0101*/int main(){ int n; while(cin>>n) {
2015-07-07 10:13:12 426
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人