B. Long Number time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a long decimal number aa consisting of nn digits from 11 to 99. You also have a function ff that maps every dig…
Codeforces Round #297 (Div. 2)A. Vitaliy and Pie Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/A Description After a hard day Vitaly got very hungry and he wants to eat his favorite pot…
题目链接:Codeforces Round #298 (Div. 2) A. Exam An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i + 1) always studied side…
B. Vasya and Wrestling 题目连接: http://codeforces.com/contest/493/problem/B Description Vasya has become interested in wrestling. In wrestling wrestlers use techniques for which they are awarded points by judges. The wrestler who gets the most points wi…
对没错下面的代码全部是python 3(除了E的那个multiset) 题目链接:https://codeforces.com/contest/1157 A. Reachable Numbers 按位算贡献,一位数的贡献直接算即可 n=int(input()) ans=0 while (n>=10): tmp=n%10 tmp=10-tmp ans+=tmp n+=tmp while (n>0) and (n%10==0): n//=10 ans+=9 print(ans) B. Long N…
引子: A题过于简单导致不敢提交,拖拖拉拉10多分钟还是决定交,太冲动交错了CE一发,我就知道又要错过一次涨分的机会.... B题还是过了,根据题意目测数组大小开1e5,居然蒙对,感觉用vector更好一点... C题WA第9组,GG思密达....明天起床再补C吧 - - 题目链接: http://codeforces.com/contest/835/problem/B B. The number on the board Some natural number was written on t…
链接: https://codeforces.com/contest/1215/problem/B 题意: You are given a sequence a1,a2,-,an consisting of n non-zero integers (i.e. ai≠0). You have to calculate two following values: the number of pairs of indices (l,r) (l≤r) such that al⋅al+1-ar−1⋅ar…
A. Reachable Numbers 代码: #include <bits/stdc++.h> using namespace std; ; int N; set<int> s; int main() { scanf("%d", &N); while(s.find(N) == s.end()) { s.insert(N); N += ; == ) N /= ; } printf("%d\n", (int) s.size()); ;…
A:    http://codeforces.com/contest/1157/problem/A 题意:每次加到10的整数倍之后,去掉后面的0,问最多有多少种可能. #include <iostream> #include <algorithm> #include <vector> #include <string> #include <set> using namespace std; int main() { ios::sync_with…
不得不说这场div3是真的出的好,算得上是从我开始打开始最有趣的一场div3.因为自己的号全都蓝了,然后就把不经常打比赛的dreagonm的号借来打这场,然后...比赛结束rank11(帮dreagonm上蓝果然没有食言qwq). (震惊...HA省A队CF青名...) upd:system test之后的最终排名是rank9,dreagonmTQL!!! CF1157A Reachable Numbers 水题,分析一下不难发现不超过\(10\)次就会少一位,然后\(10^9\)范围内的数可以…