题目: You are given an integer nn. You can perform any of the following operations with this number an arbitrary (possibly, zero) number of times: Replace nn with n2n2 if nn is divisible by 22; Replace nn with 2n32n3 if nn is divisible by 33; Replace n…
题目链接:http://codeforces.com/problemset/problem/1176/A 思路:贪心,对第二个操作进行俩次等于将n变成n/3,第三个操作同理,我们将n不断除以2,再除以3,最后除以5,判断最后是否等于1即可. AC代码: #include<iostream> using namespace std; long long n,ans; int main(){ int T; cin >> T; while(T--){ cin >> n; an…
You are given an integer nn. You can perform any of the following operations with this number an arbitrary (possibly, zero) number of times: Replace nn with n2n2 if nn is divisible by 22; Replace nn with 2n32n3 if nn is divisible by 33; Replace nn wi…
Arkady and his friends love playing checkers on an n×nn×n field. The rows and the columns of the field are enumerated from 11 to nn. The friends have recently won a championship, so Arkady wants to please them with some candies. Remembering an old pa…
Polycarp likes to play with numbers. He takes some integer number xx, writes it down on the board, and then performs with it n−1n−1 operations of the two kinds: divide the number xx by 33 (xx must be divisible by 33); multiply the number xx by 22. Af…
地址:http://codeforces.com/contest/768/problem/D 题目: D. Jon and Orbs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jon Snow is on the lookout for some orbs required to defeat the white wal…
地址:http://codeforces.com/contest/768/problem/C 题目: C. Jon Snow and his Favourite Number time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Jon Snow now has to fight with White Walkers. He has…
地址:http://codeforces.com/contest/768/problem/B 题目: B. Code For 1 time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Jon fought bravely to rescue the wildlings who were attacked by the white-w…