#include <iostream> #include <vector> using namespace std; int main(){ ; cin >> n >>k; ; i < n ; ++ i ){ int a; vector<,); cin >> a; while(a){ <=k) goodNum[a%]++; a/=; } ; ; j < k+; ++ j) if(!goodNum[j]) break; )…
引子: 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…
D. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one of s…
E - Bus Number 最近感觉打CF各种车祸.....感觉要反思一下, 上次读错题,这次想当然地以为18!肯定暴了longlong 而没有去实践, 这个题我看到就感觉是枚举每个数字的个数,但是我觉得算得时候会爆longlong 就想用大数,但是我去看别人交的全部都是C++,就感觉是不是有别的方法, 想了半天感觉时间来不及了就强行上了个java,结果时间来不及... 以后写题首先要读清楚题目,其次不要想当然,要去实践!!!!!!!!!!! 真的很烦. import java.math.Bi…
B. Perfect Number time limit per test2 seconds memory limit per test256 megabytes Problem Description We consider a positive integer perfect, if and only if the sum of its digits is exactly 10. Given a positive integer k, your task is to find the k-t…
传送门 题意 给出n个数及x,求 \[\frac{\sum _{i=1}^n x^{a_1+a_2+...+a_{i-1}+a_{i+1}+...a_n}}{\prod_{i=1}^n x^{a_i}}\] 分析 结果必然为\(x^{sum}\),sum的值首先取所有数的和减去最大值 然后暴力合并,具体原因我不太懂,只能附上CF的标准题解 Obviously, the answer is \(x^v\). Let \(sum = a1 + a2 + ... + an\). Also let $s…
链接: https://codeforces.com/contest/1271/problem/E 题意: At first, let's define function f(x) as follows: f(x)={x2x−1if x is evenotherwise We can see that if we choose some value v and will apply function f to it, then apply f to f(v), and so on, we'll…
题目传送门 B. Perfect Number time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output We consider a positive integer perfect, if and only if the sum of its digits is exactly 1010. Given a positive integ…
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…