Submission #3553

#TimeUsernameProblemLanguageResultExecution timeMemory
3553wurikijiInherited disease (kriii1_I)C++98
0 / 1
0 ms1672 KiB
#include <cstdio> #include <cstring> #include <cstdlib> #include <string> #include <vector> #include <sstream> #include <iostream> #include <algorithm> using namespace std; const long long divv = 1000000007; int main(void){ int d; scanf("%d",&d); long long sum = 0; int prev=0; for(int i = 1 ;i <= d;i++) { int k; scanf("%d", &k); sum = 0; for(int j = 1 ;j < i;j++) { if( j == 1 )sum =1; else sum = (sum %divv + (j * (j-1)) %divv) %divv; } long long dap = sum; for(int i = 0 ;i < prev - 1;i++) { sum = (sum + sum) %divv; } sum = (sum + k) %divv; printf("%lld\n",sum); prev = k; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...