Love丶FFC's Blog

CCF-CSP_20191201:报数

2020-01-18 14:00:21
阅读:1324   •   评论:13
标签:,

编程语言:Python

解题思想:

1.找出报数的规律

2.注意边界,最好使用while循环,而不要使用for循环控制边界。

在实际认证的时候,笔者就是因为读题不认真,将for循环的边界定为了666,因此只拿到了60分。实际情况中n的次数并不是报数的次数,因此边界定小了。在最终提交之前使用while循环测试了几次都是正确结果,就没有修改为while循环。

时间复杂度:O(n)

IDE代码如下:

  1. People = [0 for i in range(4)] # 报数列表
  2. N = int(input()) # 输入n
  3. Count = 0
  4. i = 1
  5. while Count != N:
  6. if i % 7 == 0 or '7' in str(i):
  7. People[(i - 1) % 4] += 1
  8. else:
  9. Count += 1
  10. i += 1
  11. for i in range(4):
  12. print(People[i])
  13.  

评论板

共有 13 条评论

  1. Abupguele

    Anti RNA and anti dsDNA antibodies were reduced in MRL lpr mice treated with CGS 21680, relative to vehicle treated control mice, while anti Smith antibodies were not significantly changed Fig cialis reviews

  2. Outlils

    Experimental evidence of central adaptation to loss of baroreceptor input has been reported by Schreihofer and Sved 23 how to buy cialis Flushed out

  3. cheap jordans online

    Read reviews and was a little hesitant since I had already inputted my order. nicely but thank god, I had no issues. such as the received item in a timely matter, they are in new condition. regardless so happy I made the purchase. Will be definitely be purchasing again.
    cheap jordans online https://www.cheapjordanssneakers.com/

  4. cheap jordans

    Read reviews and was a little hesitant since I had already inputted my order. possibly but thank god, I had no issues. cherish the received item in a timely matter, they are in new condition. you decide so happy I made the purchase. Will be definitely be purchasing again.
    cheap jordans https://www.realjordansshoes.com/

  5. invoimi

    levitra definition Eating nuts in general has shown some signs of combating ovulatory issues associated with infertility

  6. invoimi

    Wt p53 includes one zinc ion as an important cofactor, which is coordinated to the side chains of three cysteine residues and one histidine residue in the DNA binding domain whats viagra used for 1016 S0939 6411 01 00206 5 Search in Google Scholar

  7. llWaUINdy

    Lymphoid hyperplasia and reactivity occur when chronic infection overwhelms the tonsillar defense mechanisms cialis tablets for sale Psychiatric effects and psychoactive drug use in anabolic androgenic steroid users

  8. Kxbrqh

    order tricor online cheap tricor us buy cheap tricor

  9. NSmhpLHYn

    Bring up any concerns you have about certain hair products, and tell them how water changes your hair for example if water makes your hair too curly or large to fit under the cap buy liquid cialis online Horace wVFzKpdJQBDfuDR 6 27 2022

  10. Rhgsfc

    tadalafil cost us pharmacy viagra buy sildenafil 50mg online cheap

  11. Wwfyiu

    order zaditor pills buy generic zaditor for sale buy tofranil medication

  12. Lnaiss

    brand minoxidil buy minoxytop sale natural pills for erectile dysfunction

  13. Zonxyf

    precose 25mg over the counter repaglinide 1mg sale buy fulvicin

--------查看该分类下最新文章--------
^
新版博客正在完善中!域名:http://www.loveffc:8080,点击跳转,完全移植后将去除端口号。

Copyright © 2018 - 2021 FFC的小站 - 滇 ICP 备 18010780 号 - 1

- Powered by WordPress & AliYun · Theme by FFC -

- Environment by Windows & XAMPP · Designed by WebStorm & VSCode -

已运行:

访问量:510431