# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
23143 | 2017-05-03T14:07:52 Z | ainta | Unifying Values (KRIII5_UV) | C++14 | 3 ms | 1232 KB |
#include<cstdio> #include<algorithm> using namespace std; int n, D[10100], Mod = 1000000007, Res; long long S[10100]; void Do(int K){ int i; long long t = S[n]/K, tp; for(i=0;i<=K;i++)D[i] = 0; D[0] = 1; for(i=1;i<=n;i++){ tp = S[i]/t; if(tp*t!=S[i])continue; if(tp<=0||tp>K)continue; D[tp] = (D[tp]+D[tp-1])%Mod; } Res = (Res + D[K])%Mod; } int main(){ int i; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%lld",&S[i]); S[i]+=S[i-1]; } if(S[n]==0){ Res = 1; for(i=1;i<n;i++){ if(S[i]==0)Res=Res*2%Mod; } Res=(Res-1)%Mod; printf("%d\n",Res); return 0; } for(i=2;i<=n;i++){ if(S[n]%i==0){ Do(i); } } printf("%d\n",Res); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 1232 KB | Output is correct |
2 | Correct | 0 ms | 1232 KB | Output is correct |
3 | Correct | 0 ms | 1232 KB | Output is correct |
4 | Correct | 3 ms | 1232 KB | Output is correct |
5 | Correct | 3 ms | 1232 KB | Output is correct |
6 | Correct | 0 ms | 1232 KB | Output is correct |
7 | Correct | 0 ms | 1232 KB | Output is correct |
8 | Incorrect | 0 ms | 1232 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 1232 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |