当前位置:网站首页>[PTA] get rid of singles
[PTA] get rid of singles
2022-04-23 20:22:00 【Maybe】
subject
Their thinking
Imitation Division
1. Accumulate first 1, Until it's bigger than the divisor ( Now you can divide by the divisor )
2. Get the result of division and the remainder of division , Output the result of dividing by
3. Move backward , Fill a
4. repeat 2、3, until 2 The remainder is 0 Stop when
ac Code
#include<iostream>
using namespace std;
int main() {
int n, k = 1, cnt = 1;
cin >> n;
while(k < n) {
k = k * 10 + 1;
cnt++;
}
while(1) {
if(k % n == 0) {
cout << k / n << cnt;
break;
} else {
cout << k / n;
k %= n;
k = k * 10 + 1;
cnt++;
}
}
return 0;
}
版权声明
本文为[Maybe]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232020000426.html
边栏推荐
- Es keyword sorting error reason = fielddata is disabled on text fields by default Set fielddata = true on keyword in order
- 三十一. `prototype`显示原型属性和`__proto__`隐式原型属性
- R language ggplot2 visual facet_wrap, and use the lineheight parameter to customize the height of the facet icon tab (gray label bar)
- Unity 模型整体更改材质
- Paper writing 19: the difference between conference papers and journal papers
- 【问题解决】‘ascii‘ codec can‘t encode characters in position xx-xx: ordinal not in range(128)
- 中金财富公司怎么样,开户安全吗
- Why does ES6 need to introduce map when JS already has object type
- R language survival package coxph function to build Cox regression model, ggrisk package ggrisk function and two_ Scatter function visualizes the risk score map of Cox regression, interprets the risk
- 2022DASCTF Apr X FATE 防疫挑战赛 CRYPTO easy_real
猜你喜欢
Click an EL checkbox to select all questions
Automatically fill in body temperature and win10 task plan
Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
[talkative cloud native] load balancing - the passenger flow of small restaurants has increased
Installation and use of NVM
[target tracking] pedestrian attitude recognition based on frame difference method combined with Kalman filter, with matlab code
Zdns was invited to attend the annual conference of Tencent cloud basic resources and share the 2020 domain name industry development report
Some basic knowledge of devexpress report development
堡垒机、跳板机JumpServer的搭建,以及使用,图文详细
Identification of bolt points in aerial photography based on perception
随机推荐
An error is reported when sqoop imports data from Mysql to HDFS: sqlexception in nextkeyvalue
Installation and use of NVM
R language uses econocrats package to create microeconomic or macroeconomic map, visualize indifference function indifference curve, customize calculation intersection, and customize the parameters of
How does onlyoffice solve no route to host
Experience of mathematical modeling in 18 year research competition
DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
R语言使用timeROC包计算无竞争风险情况下的生存资料多时间AUC值、使用confint函数计算无竞争风险情况下的生存资料多时间AUC指标的置信区间值
Scrapy教程 - (2)寫一個簡單爬蟲
Cadence Orcad Capture 批量更改元件封装功能介绍图文教程及视频演示
Confusion about thread blocking after calling the read () method of wrapper flow
Five minutes to show you what JWT is
Matlab analytic hierarchy process to quickly calculate the weight
Livego + ffmpeg + RTMP + flvjs to realize live video
LeetCode动态规划训练营(1~5天)
Identification of bolt points in aerial photography based on perception
R language uses timeroc package to calculate the multi time AUC value of survival data under competitive risk, uses Cox model and adds covariates, and R language uses the plotauccurve function of time
Numpy mathematical function & logical function
Actual measurement of automatic ticket grabbing script of barley network based on selenium (the first part of the new year)
Local call feign interface message 404
Computing the intersection of two planes in PCL point cloud processing (51)