Submission #527176

#TimeUsernameProblemLanguageResultExecution timeMemory
527176Hydroxic_AcidCalvinball championship (CEOI15_teams)C++17
0 / 100
1 ms204 KiB
#include <iostream> using namespace std; int N; int arr[10005]; int memo[10005][10005]; int dp(int idx, int num){ if(idx >= N) return 0; if(idx == N - 1) return 1; if(num > N) return 0; int summ = 0; for(int i = 1; i <= min(arr[idx + 1], num + 1); i++){ if(i == num + 1) summ += dp(idx + 1, num + 1); else summ += dp(idx + 1, num); summ %= 1000007; } return summ; } int main(){ freopen("test.txt", "r", stdin); cin >> N; for(int i = 0; i < N; i++) cin >> arr[i]; cout << dp(0, 1); }

Compilation message (stderr)

teams.cpp: In function 'int main()':
teams.cpp:22:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |     freopen("test.txt", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...