A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has a non-negative integer n. He wants to round it to nearest integer, which ends up with 0. If n already ends up with 0, V…
A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has a non-negative integer n. He wants to round it to nearest integer, which ends up with 0. If n already ends up with 0, V…
Codeforces Round #451 (Div. 2) A Rounding 题目链接: http://codeforces.com/contest/898/problem/A 思路: 小于等于5向下,大于补上差值输出 代码: #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; scanf("%I64d",&n); int r=n%10;…
PROBLEM D. Alarm Clock 题 OvO http://codeforces.com/contest/898/problem/D codeforces 898d 解 从前往后枚举,放进去后不合法就拿出来,记录拿出来的次数 中途每放进去一个数,会影响到一个区间,标记这个区间的首位(做差分,首+1,尾-1),同时维护这些标记的前缀和 #include <iostream> #include <cstring> #include <cmath> #includ…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟 [代码] /* 1.Shoud it use long long ? 2.Have you ever test several sample(at least therr) yourself? 3.Can you promise that the solution is right? At least,the main ideal 4.use the puts("") or putchar() or printf…
水题场.... 结果因为D题看错题意,B题手贱写残了...现场只出了A,C,E A:水题.. #include<bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back #define pi acos(-1.0) #define ll long long #define mod 1000000007 #define C 0.5772156649 #define ls l…
B. Proper Nutrition time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n burles. One bottle of Ber-Cola costs a burles and one Bars bar costs b burles. He can buy any non-negative in…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 可以直接一层循环枚举. 也可以像我这样用一个数组来存y*b有哪些. 当然.感觉这样做写麻烦了.. [代码] /* 1.Shoud it use long long ? 2.Have you ever test several sample(at least therr) yourself? 3.Can you promise that the solution is right? At least,the main ideal…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 用map<string,vector > dic;模拟就好. 后缀.翻转一下就变成前缀了. 两重循环剔除这种情况不输出就好. [代码] /* 1.Shoud it use long long ? 2.Have you ever test several sample(at least therr) yourself? 3.Can you promise that the solution is right? At least,…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 尺取法+二分. 类似滑动窗口. 即左端点为l,右端点为r. 维护a[r]-a[l]+1总是小于等于m的就好. (大于m就右移左端点) 然后看看里面的数字个数是不是小于k; 不是的话让l..r中最右边那个数字删掉就好. ->链表优化一下即可. [代码] /* 1.Shoud it use long long ? 2.Have you ever test several sample(at least therr) yourself…