Submission #88669

#TimeUsernameProblemLanguageResultExecution timeMemory
88669BadralEnergetic turtle (IZhO11_turtle)C++17
10 / 100
544 ms262148 KiB
#include<bits/stdc++.h> #define maxn 1005 #define mp make_pair #define pb push_back #define ff first #define ss second using namespace std; typedef long long ll; int ans; bool a[maxn][maxn]; vector<int> v[maxn][maxn]; int n, m, k1, t, z; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >>n >>m >>k1 >>t >>z; while(k1--) { int x, y; cin >>x >>y; a[x][y] = 1; } v[0][0].pb(t); for(int i = 0; i <= n; i++) { for(int j = 0; j <= m; j++) { if(i > 0) { for(int o = 0; o < v[i-1][j].size(); o++) { if(a[i][j] == 1 && v[i-1][j][o] > 0) { v[i][j].pb(v[i-1][j][o]-1); } if(a[i][j] == 0) { v[i][j].pb(v[i-1][j][o]); } } } if(j > 0) { for(int o = 0; o < v[i][j-1].size(); o++) { if(a[i][j] == 1 && v[i][j-1][o] > 0) { v[i][j].pb(v[i][j-1][o]-1); } if(a[i][j] == 0) { v[i][j].pb(v[i][j-1][o]); } } } } } cout<<v[n][m].size()%z; }

Compilation message (stderr)

turtle.cpp: In function 'int main()':
turtle.cpp:27:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int o = 0; o < v[i-1][j].size(); o++) {
                    ~~^~~~~~~~~~~~~~~~~~
turtle.cpp:37:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int o = 0; o < v[i][j-1].size(); o++) {
                    ~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...