zoukankan      html  css  js  c++  java
  • 有趣的思维题

    2017 ACM-ICPC 亚洲区(西安赛区)网络赛   C题

    题目连接 : https://nanti.jisuanke.com/t/A1269

    Define the function S(x)S(x) for xx is a positive integer. S(x)S(x) equals to the sum of all digit of the decimal expression of xx. Please find a positive integer kk that S(k*x)\%233=0S(kx)%233=0.

    Input Format

    First line an integer TT, indicates the number of test cases (T le 100T100). Then Each line has a single integer x(1 le x le 1000000)x(1x1000000)indicates i-th test case.

    Output Format

    For each test case, print an integer in a single line indicates the answer. The length of the answer should not exceed 20002000. If there are more than one answer, output anyone is ok.

    本题答案不唯一,符合要求的答案均正确

    样例输入

    1
    1

    样例输出

    89999999999999999999999999



    题目大意为 : 给你一个数x,找一个k使得x*k的各个位数上数字之和要求对233取模为0

    思路 : 首先想到233个1,发现小于十成立,大于十因为进位的原因不成立了,然后就想如何才能不进位呢,想到17*101=1717
    177*1001=177177,这样的规律,如此来233个不就一定满足加和取模233为0了。


    代码就不上了,很简单的一个模拟,可以想一想的。
  • 相关阅读:
    linux内存不足导致java进程被kill掉
    记一次centos服务器DNS引起的网络问题
    记consul集群和spring cloud集成遇到的问题。
    记一次url未encode遇到的问题
    十六周总结
    十五周总结
    计算最长英语单词链
    大道至简阅读笔记02
    大道至简阅读笔记01
    用户体验评价之搜狗输入法
  • 原文地址:https://www.cnblogs.com/fzw1523/p/10429100.html
Copyright © 2011-2022 走看看