답안 #971191

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
971191 2024-04-28T06:16:56 Z amirujuz 힘 센 거북 (IZhO11_turtle) C++14
5 / 100
2000 ms 216060 KB
#include <bits/stdc++.h>
#define allr v.rbegin(), v.rend()
#define sllr s.rbegin(), s.rend()
#define all v.begin(), s.end()
#define sll s.begin(), s.end()
#define pii pair <int, int>
#define int long long
#define pb push_back
#define pp pop_back
#define sc second
#define fr first
using namespace std;
const int N=1e3+7, INT=1e6+7, INF=1e9+7, INFF=INT64_MAX;
int dp[N][N], siu[N][N];
signed main() {
	ios_base::sync_with_stdio(false);
//	ofstream cout ("turtle.out");
//	ifstream  cin ("turtle.in");
	cout.tie(NULL);
	cin.tie(NULL);
	int n, m, k, t, z, a, b, i, j;
	cin >> n >> m >> k >> t >> z;
	map <pii, int> mp;
	for (i=0; i<k; i++) {
		cin >> a >> b;
		mp[{a+1, b+1}]=1;
	}
	dp[1][1]=1;
	for (i=1; i<=n+1; i++) {
		for (j=1; j<=m+1; j++) {
			if (mp[{i, j}]+siu[i-1][j]<=t) siu[i][j]+=siu[i-1][j]+mp[{i, j}], dp[i][j]+=dp[i-1][j];
			if (mp[{i, j}]+siu[i][j-1]<=t) siu[i][j]+=siu[i][j-1]+mp[{i, j}], dp[i][j]+=dp[i][j-1];
			dp[i][j]%=z;
		}
	}
	cout << dp[n+1][m+1];
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Incorrect 1 ms 2512 KB Output isn't correct
3 Incorrect 1 ms 4700 KB Output isn't correct
4 Incorrect 2 ms 6860 KB Output isn't correct
5 Incorrect 9 ms 8284 KB Output isn't correct
6 Incorrect 113 ms 26452 KB Output isn't correct
7 Incorrect 195 ms 40020 KB Output isn't correct
8 Incorrect 514 ms 78996 KB Output isn't correct
9 Execution timed out 2054 ms 215888 KB Time limit exceeded
10 Execution timed out 2060 ms 216060 KB Time limit exceeded
11 Execution timed out 2039 ms 200572 KB Time limit exceeded
12 Execution timed out 2041 ms 198428 KB Time limit exceeded
13 Execution timed out 2037 ms 205088 KB Time limit exceeded
14 Execution timed out 2068 ms 198616 KB Time limit exceeded
15 Execution timed out 2072 ms 199956 KB Time limit exceeded
16 Execution timed out 2052 ms 194660 KB Time limit exceeded
17 Execution timed out 2040 ms 198556 KB Time limit exceeded
18 Execution timed out 2045 ms 191392 KB Time limit exceeded
19 Execution timed out 2053 ms 201084 KB Time limit exceeded
20 Execution timed out 2040 ms 196884 KB Time limit exceeded