
————入门————
西瓜不甜不甜不甜
这个作者很懒,什么都没留下…
展开
-
【CodeForces】622C - Not Equal on a Segment
http://codeforces.com/problemset/problem/622/C找出[l,r]中不等于x的任意位置输出#include <bits/stdc++.h>using namespace std;int n,m;int a[1000005];int b[1000005];int l,r,x;int main(){ cin >> n >> m; a[0]=0原创 2017-08-17 00:20:51 · 238 阅读 · 0 评论 -
【CodeForces】616D - Longest k-Good Segment
http://codeforces.com/problemset/problem/616/Dn个数,找出一个连续区间,使该区间不同的数的个数小于等于k且尽可能长。使用Tow points解决#include <bits/stdc++.h>using namespace std;int n,k;int a[500005];int f[1000005];int cnt;int ansL,ans原创 2017-08-14 20:14:53 · 228 阅读 · 0 评论 -
【CodeForces】616G - Alice, Bob, Two Teams
http://codeforces.com/problemset/problem/632/Bn个物品,每个物品有一个值且一个物品属于A或属于B。 现在选择一个前缀或者后缀,将A改成B,将B改成A。 求属于B的物品的值最多是多少?#include <bits/stdc++.h>using namespace std;const int maxn=5e5+5;int n;int a[maxn]原创 2017-08-14 20:18:13 · 374 阅读 · 0 评论 -
【CodeForces】834A The Useless Toy 水
http://codeforces.com/problemset/problem/834/A#include <bits/stdc++.h>using namespace std;int main(){ int a[5]; a[0]=118; a[1]=60; a[2]=94; a[3]=62; char ch1,ch2; int k,kk;原创 2017-10-21 09:42:22 · 250 阅读 · 0 评论 -
codeforces 940 b.Our Tanya is Crying Out Loud 暴力
http://codeforces.com/contest/940/problem/B一个数n,每次可以花费b代价把它除以k(如果k|n),或者花费a的代价把它减一。问把这个数变成1的最少代价。这种记得暴力直接算,不要想到bfs去了#include <iostream>#include <cstdio>#include <cmath>#incl...原创 2018-03-04 19:09:34 · 220 阅读 · 0 评论