链接:https://codeforces.com/contest/1141/problem/A 题意: 给n和m,有两种操作:将n×2 或 n×3,求最少的乘法次数由n得到m. 不能得到时为-1. 思路: 先判断是否为整数倍. 再将倍数不断除以2和3. 最后剩下1则可以达到否则-1. 代码: #include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { int n, m; cin >&g…
E. Superhero Battle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A superhero fights with a monster. The battle consists of rounds, each of which lasts exactly nn minutes. After a round…
链接:https://codeforces.com/contest/1141/problem/B 题意: 给n个数,0代表工作,1代表休息,求能连续最大的休息长度. 可以连接首尾. 思路: 求普通连续,当第一个时间和最后一个时间都休息的时候加上去判断一下. 代码: #include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAXN = 2e5; int r[MAXN]; int main() {…
---恢复内容开始--- Codeforces Round #324 (Div. 2) Problem A 题目大意:给二个数n.t,求一个n位数能够被t整除,存在多组解时输出任意一组,不存在时输出“-1”. 数据范围: 1 ≤ n ≤ 100, 2 ≤ t ≤ 10 so easy!首先考虑无解的时候,只有当n==1,t==10是无解,其他情况都存在解.很容易想到最简单的n位数能被t整除的数是,t个n组成的数. 参考代码: By Royecode, contest: Codeforces Ro…
Codeforces Round #296 (Div. 1)C. Data Center Drama Time Limit: 2 Sec Memory Limit: 256 MBSubmit: xxx Solved: 2xx 题目连接 http://codeforces.com/contest/528/problem/C Description The project of a data center of a Big Software Company consists of n compu…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/output 1 s, 256 MB x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB x1462 C Vasya and String standard input/output 1 s, 256 MB x1393…
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... 其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems # Name A Team Olympiad standard input/output 1 s, 256 MB x2377 B Queue standard input/output 2 s, 256 MB x1250 C Hacking Cypher standard input/output 1 s, 256 MB x740 D Chocolate standard in…
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…