Submission #200098

#TimeUsernameProblemLanguageResultExecution timeMemory
200098SaboonMobitel (COCI19_mobitel)C++14
130 / 130
4324 ms11872 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const int mod = 1e9 + 7; int t[300 + 10]; int nex[300 + 10][3000 + 200], dp[300 + 10][3000 + 200], pos[1000000 + 10]; int main(){ ios_base::sync_with_stdio(false); int n, m, k; cin >> n >> m >> k; k --; vector<int> a; for (int i = 1; i <= k + 1; i++) a.push_back(k / i); sort(a.begin(), a.end()); a.resize(unique(a.begin(), a.end()) - a.begin()); for (int i = 0; i < a.size(); i++) pos[a[i]] = i; int c = a.size(); dp[0][c - 1] = 1; for (int i = 0; i < n; i++){ for (int j = 0; j < m; j++) cin >> t[j]; for (int j = 0; j < m; j++) for (int x = 0; x < c; x++) nex[j][pos[a[x] / t[j]]] = (nex[j][pos[a[x] / t[j]]] + dp[j][x]) % mod; for (int j = 1; j < m; j++) for (int x = 0; x < c; x++) nex[j][pos[a[x] / t[j]]] = (nex[j][pos[a[x] / t[j]]] + nex[j - 1][x]) % mod; for (int j = 0; j < m; j++) for (int x = 0; x < c; x++) dp[j][x] = nex[j][x], nex[j][x] = 0; } cout << dp[m - 1][0] << '\n'; }

Compilation message (stderr)

mobitel.cpp: In function 'int main()':
mobitel.cpp:22:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < a.size(); i++)
                  ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...