# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
200098 | Saboon | Mobitel (COCI19_mobitel) | C++14 | 4324 ms | 11872 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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';
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |