Codeforces Avito Code Challenge 2018 D. Bookshelves 题目连接: http://codeforces.com/contest/981/problem/D Description Mr Keks is a typical white-collar in Byteland. He has a bookshelf in his office with some books on it, each book has an integer positive…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Chouti was doing a competitive programming competition. However, after having all the problems accepted, he got bored and decided to invent s…
考挂了.. A - Definite Game 直接看代码吧. #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<set> #include<map> #include<vector> #include<cmath> #include<cctype> using namespace std;…
A. Definite Game: 题意:输入N,输出最小的结果N-x,其中x不少N的因子. 思路:N=2时,输出2:其他情况输出1:因为N>2时,N-1不会是N的因子. #include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; ; int a[maxn]; int main() { int N; cin>>N; ) puts("); "…
A. Definite Game 签. #include <bits/stdc++.h> using namespace std; int main() { int a; while (scanf("%d", &a) != EOF) { [](int x) { ; i >= ; --i) if (x % i) { printf("%d\n", x - i); return; } printf("%d\n", x); }(…
A. Definite Game 题目链接:https://codeforces.com/contest/1081/problem/A 题意: 给出一个数v,然后让你可以重复多次减去一个数d,满足v%d!=0,问最后可以得到最小的是多少. 题解: 除开v=2输出2,其余直接输出1就行了= =/ 代码如下: #include <bits/stdc++.h> using namespace std; int main(){ int v; cin>>v; cout<<(v==…
第一次打CF,很菜,A了三道水题,第四题好像是是数位DP,直接放弃了.rateing从初始的1500变成了1499,还是绿名,这就很尴尬.之后觉得后面的题目也没有想象的那么难(看通过人数)过两天吧剩下的五题给补上. http://codeforces.com/contest/981 A:给你一个字符串S,求把这个字符串中的最长不回文子序列. 思路: 如果S不回文,那就是本身 如果S回文: (1)如果S由一种字母构成,那么最长不回文子序列为空,因为无论删除多少个都是回文串. (2)如果S不是上述情…
A:n==2?2:1. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long ')) c=getchar();return c;} ?n:gcd(m,n%m);} int read() { ,…
传送门:http://codeforces.com/contest/1081/problem/E E. Missing Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Chouti is working on a strange math problem. There was a sequence of nn …
传送门:http://codeforces.com/contest/1081/problem/C C. Colorful Bricks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On his free time, Chouti likes doing some housework. He has got one new…