답안 #100299

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
100299 2019-03-10T10:01:27 Z Shtef Mobitel (COCI19_mobitel) C++14
26 / 130
201 ms 3712 KB
#include <iostream>

using namespace std;

typedef long long ll;

ll n, m, k, a[305][305], dp[2][305][305];
const ll mod = (ll)1e9 + 7;

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m >> k;
for(int i = 1 ; i <= n ; ++i){
	for(int j = 1 ; j <= m ; ++j){
		cin >> a[i][j];
	}
}
dp[0][1][1] = 1;
for(int i = 1 ; i <= n ; ++i){
	for(int j = 1 ; j <= m ; ++j){
		for(int v = 1 ; v <= k ; ++v){
			dp[i & 1][j][v] = 0;
		}
	}
	for(int j = 1 ; j <= m ; ++j){
		for(int v = k ; v >= 1 ; --v){
			dp[i & 1][j][min(v * a[i][j], k)] = (dp[i & 1][j][min(v * a[i][j], k)] + dp[(i & 1) ^ 1][j][v]) % mod;
			dp[i & 1][j][min(v * a[i][j], k)] = (dp[i & 1][j][min(v * a[i][j], k)] + dp[i & 1][j - 1][v]) % mod;
		}
	}
}
cout << dp[n & 1][m][k] << endl;

return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 201 ms 2732 KB Output is correct
2 Correct 173 ms 2760 KB Output is correct
3 Runtime error 6 ms 3456 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 7 ms 3456 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 9 ms 3480 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 7 ms 3456 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 6 ms 3456 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 9 ms 3456 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 11 ms 3712 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 12 ms 3712 KB Execution killed with signal 11 (could be triggered by violating memory limits)