C. Terse princess time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output «Next please», - the princess called and cast an estimating glance at the next groom. The princess intends to choose the mo…
题目传送门 /* 水题:这题唯一要注意的是要用double,princess可能在一个小时之内被dragon赶上 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <vector> #include <map> using namespace std; ; const int INF = 0x3f3f3f3f;…
A. Insomnia cure 哎 只能说英语太差,一眼题我看了三分钟. 题意:给5个数k, l, m, n 和 d,求1~d中能被k, l, m, n 至少一个整除的数的个数. 题解:…… 代码: #include <iostream> using namespace std; int main() { int a, b, c, d, n; cin >> a >> b >> c >> d >> n; ; ; i <= n;…
题目链接: http://codeforces.com/problemset/problem/148/D D. Bag of mice time limit per test2 secondsmemory limit per test256 megabytes 问题描述 The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the…
题目链接:http://codeforces.com/problemset/problem/148/E E. Porcelain time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output During her tantrums the princess usually smashes some collectable porcelain.…
题目链接:http://www.codeforces.com/problemset/problem/148/A题意:求1到d中有多少个数能被k,l,m,n中的至少一个数整出.C++代码: #include <iostream> using namespace std; int k, l, m, n, d, ans; int main() { cin >> k >>l >> m >> n >> d; ; i <= d; i ++)…
C. Harmony Analysis time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output The semester is already ending, so Danil made an effort and decided to visit a lesson on harmony analysis to know how do…
Codeforces Round #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little beaver is a beginner programmer, so informatics is his favorite subject. Soon his info…
Codeforces Round #383 (Div. 2) A. Arpa's hard exam and Mehrdad's naive cheat 题意 求1378^n mod 10 题解 直接快速幂 代码 #include<bits/stdc++.h> using namespace std; long long quickpow(long long m,long long n,long long k) { long long b = 1; while (n > 0) { if…
Codeforces Round #182 (Div. 1)题解 A题:Yaroslav and Sequence1 题意: 给你\(2*n+1\)个元素,你每次可以进行无数种操作,每次操作必须选择其中n个元素改变符号,你的目的是使得最后所有数的和尽量大,问你答案是多少 题解: 感觉上就是构造题,手动玩一玩就知道,当n为奇数的时候,你可以通过三次操作,使得只会改变一个负数的符号.同理n为偶数的时候,每次要改变两个负数的符号. 所以答案如下: 当n为奇数的时候,答案为所有数的绝对值和 当n为偶数的…