# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
225011 |
2020-04-19T08:00:40 Z |
kartel |
Mobitel (COCI19_mobitel) |
C++14 |
|
174 ms |
3456 KB |
#include <bits/stdc++.h>
#define in(x) freopen(x,"r",stdin)
#define out(x) freopen(x,"w",stdout)
#define F first
#define S second
#define pb push_back
#define M ll(1e9 + 7)
#define inf ll(2e9+7)
#define N ll(301)
#define sz(x) x.size()
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
#define el '\n'
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree <ll, null_type, less_equal <ll>, rb_tree_tag, tree_order_statistics_node_update> os;
int n, m, x, i, j, f[3][N][N], a[N][N], k;
int sm(int x, int y) {return (0ll + x + y) % M;}
int main()
{
// in("input.txt");
// out("output.txt");
ios_base::sync_with_stdio(false);
iostream::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> m >> x;
for (i = 1; i <= n; i++)
for (j = 1; j <= m; j++) cin >> a[i][j];
f[1][1][min(x, a[1][1])] = 1;
for (i = 1; i <= n; i++)
for (j = 1; j <= m; j++)
for (k = 1; k <= x; k++)
{
f[(i + 1) % 2][j][min(1ll * x, k * 1ll * a[i + 1][j])] = sm(f[(i + 1) % 2][j][min(1ll * x, k * 1ll * a[i + 1][j])], f[i % 2][j][k]);
f[i % 2][j + 1][min(1ll * x, k * 1ll * a[i][j + 1])] = sm(f[i % 2][j + 1][min(1ll * x, k * 1ll * a[i][j + 1])], f[i % 2][j][k]);
}
cout << f[n % 2][m][x];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
160 ms |
1448 KB |
Output isn't correct |
2 |
Incorrect |
174 ms |
1408 KB |
Output isn't correct |
3 |
Runtime error |
8 ms |
2944 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Runtime error |
8 ms |
2816 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
5 |
Runtime error |
8 ms |
2816 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
6 |
Runtime error |
8 ms |
2816 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
7 |
Runtime error |
8 ms |
2816 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
8 |
Runtime error |
11 ms |
3200 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
9 |
Runtime error |
16 ms |
3456 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
10 |
Runtime error |
14 ms |
3328 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |