Taxes time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) bur…
哥德巴赫猜想. 如果$n$是素数,答案为$1$. 如果$n$不是素数,但$n$是偶数,由哥德巴赫猜想可知答案为$2$. 如果$n$不是素数,且$n$为奇数,此时可以将$n$拆成$3+$偶数或者$2+$素数的形式,前者答案为$3$,后者答案为$2$. #include<iostream> using namespace std; bool f(long long x) { ;i*i<=x;i++) { ) ; } ; } int main() { long long n; int ans;…
题目: 题意:输入n和k,找到一个最小的数,满足末尾有至少k个0和是n的倍数. 最小的情况 ans = n,最大的情况 ans = n*pow(10,k). 令 k = pow(10,k); 我们发现所有可能的情况就是 ans = n*(k的因子). 把k的因子从小到大遍历一遍就可以了. 代码: #include <bits\stdc++.h> using namespace std; typedef long long ll; int main() { ll n,k; cin >>…
C. Maximal GCD time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given positive integer number n. You should create such strictly increasing sequence of k positive numbers a1, a2, ...…
You have number a, whose decimal representation quite luckily contains digits 1, 6, 8, 9. Rearrange the digits in its decimal representation so that the resulting number will be divisible by 7. Number a doesn't contain any leading zeroes and contains…