A . 问一组数能否全部被3整除 K. S1 = A, S2 = B, Si = |Si-1 - Si-2|; 一直循环问, 出现了多少不同的数: 多模拟几组数, 可以发现和辗转相除法有很大关系 #include<bits/stdc++.h> using namespace std; #define ll long long ll gcd(ll a, ll b) { ll cnt = ; // 一开始写的是 int wa 了很多次, 难受 ); cnt += a/b; cnt += gcd…
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud 下午在HDU上打了一下今年北京区域赛的重现,过了5题,看来单挑只能拿拿铜牌,呜呜. 先将这五题的题解放上来,剩余题目等搞出来再补上 A题 A Curious Matt Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others) Problem Description T…
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=5078 Osu! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 180 Accepted Submission(s): 114 Special Judge Problem Description Osu! is a very p…
Known Notation Time Limit: 2 Seconds Memory Limit: 131072 KB Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as postfix notation since every operator in an expre…
链接:https://nanti.jisuanke.com/t/A1607 题面: Consider an array AA with n elements . Each of its element is A[i]A[i] (1 \le i \le n)(1≤i≤n) . Then gives two integers QQ, KK, and QQ queries follow . Each query , give you LL, RR, you can get ZZ by the fo…