统计1~n之间有多少数字只由0,1构成 1≤ n ≤ 1e9 用深度搜索解决这种问题; 代码如下: #include <iostream>#include<map>usingnamespacestd; map<int,int>vis;longlongans =0;intn;//深度搜索,模仿voiddfs(intx) {if(x >n)return;if(vis[x])return; vis[x]=1; ans++; dfs(x*10); dfs(x*10+1); }intmain() { cin>>n; dfs...
用深度搜索解决这种问题; 代码如下: #include <iostream>#includeusingnamespacestd; map<int,int>vis;longlongans =0;intn;//深度搜索,模仿voiddfs(intx) {if(x >n)return;if(vis[x])return; vis[x]=1; ans++; dfs(x*10); dfs(x*10+1); }intmain() { cin>>n; dfs(1); cout<< ans <...
The first line of input contains two integers nn and kk (1≤k≤n≤4⋅1051≤k≤n≤4⋅105) — the length of the string and the number of letters Polycarp will remove. The second line contains the string ss consisting of nn lowercase Latin letters. Output Print the string that will b...
#include <bits/stdc++.h> using namespace std; char s[400005]; int a[1000]; // a用来标记每个字母出现的次数 int main() { int n, k; while(~scanf("%d %d",&n, &k)) { getchar(); memset(a, 0,sizeof(a)); for(int i = 0; i < n; i ++) { scanf("%c",&s[i]); a...
I've already figured out some of the reasons for this (I think it's better now). However, it would be helpful if, in such cases, you could leave a comment here in the format: "URL : Ray ID : description of the action." For example: "https://codeforces.com/contest/2001/submit ...
This branch is 3439 commits behind DionysiosB/CodeForces:master.Folders and files Latest commit Cannot retrieve latest commit at this time. History854 Commits 101A-Homework.cpp 102A-Clothes.cpp 102B-SumOfDigits.cpp 103A-TestingPantsForSadness.cpp 103B-Cthulhu.cpp 104A-Blackjack.cpp 105...
↵- [InputReader.java](https://gist.github.com/o-panda-o/32ce63499c05192827294eb529cc4fd0)↵- [OutputWriter.java](https://gist.github.com/o-panda-o/47719946dd8df4149616ef1b1e6f918d)↵↵Happy to help Compare Revisions History ...
The offline & original crx file ofCodeforces Toolkit v1.0.3was fully archived from the web store server and is for home or personal use only. You could learn more about theCodeforces Toolkitor proceed to install it to your web browser. ...
Toggle navigation Search or jump to... Sign in Sign up Reseting focus Boss-Li12/codeforces-goPublic forked fromEndlessCheng/codeforces-go Notifications Fork0 Star0 Code Pull requests Actions Projects Security Insights
#P509C. Sums of Digits ID: 5616 远端评测题 2000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: root 标签> Description Vasya had a strictly increasing sequence of positive integers a1, ..., an. Vasya used it to build a new sequence b1, ..., bn, where bi is the sum of ...