題目:http://codeforces.com/contest/237/problem/A 那么簡單的題目,還是忘了考慮n = 1時的情況了。。。 View Code 1 typedef long long ll; 2 const int N = 100001; 3 char str[N][10]; 4 int main() 5 { 6 int n; 7 int i; 8 while(~scanf("%d&
A. Taymyr is calling you 数据比较小,可以枚举每一次call的时间i*n, 然后检查 (i*n) % m 是否为0。如果为0,则答案加一。这种方法不需要想太多也不需要写太多。 数学上分析,答案为 z/lcm(n, m)。 lcm(n, m) 为n和m的最小公倍数,lcm(n, m) =
C. Bus time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A bus moves along the coordinate line Ox from the point x = 0 to the point x = a. After starting from the point x = 0,