Fafa has an array A of n positive integers, the function f(A) is defined as ∑ i = 1 n − 1 ∣ a i − a i + 1 ∣ \displaystyle\sum_{i=1}^{n-1} |a_{i}-a_{i+1}| i=1∑n−1∣ai−ai+1∣. He wants to do q queries
V - Fafa and his Company #include <iostream>#include <cstdlib>using namespace std;int main(){int n;cin>>n;int m=0;for(int i=1;i<n;i++){if((n-i)%i==0)//剩下的人能平均分给这i个人m++;}cout<<m;return 0;}
原题链接:http://codeforces.com/problemset/problem/935/E Fafa and Ancient Mathematics Ancient Egyptians are known to have understood difficult concepts in mathematics. The ancient Egyptian mathematician A
题目: D. Fafa and Ancient Alphabet time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ancient Egyptians are known to have u