题目链接:Codeforces Round #275 (Div. 2) C - Diverse Permutation 题意:一串排列1~n.求一个序列当中相邻两项差的绝对值的个数(指绝对值不同的个数)为k个.求序列. 思路:1~k+1.构造序列前段,之后直接输出剩下的数.前面的构造能够依据,两项差的绝对值为1~k构造. AC代码: #include <stdio.h> #include <string.h> int ans[200010]; bool vis[100010]; i…
D. Finals in arithmetic 题目连接: http://www.codeforces.com/contest/625/problem/D Description Vitya is studying in the third grade. During the last math lesson all the pupils wrote on arithmetic quiz. Vitya is a clever boy, so he managed to finish all th…
C. K-special Tables 题目连接: http://www.codeforces.com/contest/625/problem/C Description People do many crazy things to stand out in a crowd. Some of them dance, some learn by heart rules of Russian language, some try to become an outstanding competitiv…
传送门 Description People do many crazy things to stand out in a crowd. Some of them dance, some learn by heart rules of Russian language, some try to become an outstanding competitive programmers, while others collect funny math objects. Alis is among…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just…
贪心 A - Guest From the Past 先买塑料和先买玻璃两者取最大值 #include <bits/stdc++.h> typedef long long ll; int main(void) { ll n, a, b, c; std::cin >> n >> a >> b >> c; ll ans = 0; if (n >= a) { ll cnt1 = n / a; ll res = n % a; if (res >…
B. War of the Corporations 题目连接: http://www.codeforces.com/contest/625/problem/B Description A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just around the…
A. Guest From the Past 题目连接: http://www.codeforces.com/contest/625/problem/A Description Kolya Gerasimov loves kefir very much. He lives in year 1984 and knows all the details of buying this delicious drink. One day, as you probably know, he found hi…
C. K-special Tables time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output People do many crazy things to stand out in a crowd. Some of them dance, some learn by heart rules of Russian language,…
E. Frog Fights 题目连接: http://www.codeforces.com/contest/625/problem/E Description stap Bender recently visited frog farm and was inspired to create his own frog game. Number of frogs are places on a cyclic gameboard, divided into m cells. Cells are nu…