제출 #22793

#제출 시각아이디문제언어결과실행 시간메모리
22793King_God_OnionPringles (#40)Unifying Values (KRIII5_UV)C++98
0 / 7
500 ms392840 KiB
#include<bits/stdc++.h> #define je 1000000007 int sum[10001]; int dp[10001][10001]; long long hap[10001]; int main(){ int n; scanf("%d",&n); for(int i=1;i<=n;i++){ long long su; scanf("%lld",&su); hap[i] = hap[i-1] + su; } for(int i=1;i<=n;i++){ for(int j=1;j<i;j++){ long long sub = hap[i] - hap[j]; long long happ = hap[j]; if(sub == 0 && happ == 0){ sum[i] = (sum[i] + sum[j]) % je; }else{ if((happ > 0 && sub < 0) || (happ < 0 && sub > 0)) continue; if(happ < 0 && sub < 0){ happ = -happ; sub = -sub;} if(happ % sub == 0 && happ / sub <= i-j){ int pls = dp[j][happ / sub]; sum[i] = (sum[i] + pls) % je; dp[i][happ / sub + 1] = (dp[i][happ / sub + 1] + pls) % je; } } } dp[i][1] = 1; sum[i] = (sum[i] + 1) % je; } printf("%d", (sum[n] + je - 1) % je); }

컴파일 시 표준 에러 (stderr) 메시지

UV.cpp: In function 'int main()':
UV.cpp:8:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
                   ^
UV.cpp:11:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld",&su);
                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...