# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
49504 | lcs147 | Jetpack (COCI16_jetpack) | C++98 | 18 ms | 5276 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
vector<int>res;
char tab[20][100010];
int n;
int dfs(int l,int c){
if(tab[l][c]=='X')return 0;
if(c==n-1)return 1;
// desce
tab[l][c]='X';
if(dfs(min(9,l+1),c+1) == 1) return 1;
else if(dfs(max(0,l-1),c+1) == 1){
res.push_back(c);
return 1;
}
return 0;
}
int main(){
scanf("%d",&n);
for(int i=0;i<10;i++){
scanf(" %s",tab[i]);
}
dfs(9,0);
reverse(res.begin(),res.end());
printf("%d\n",res.size());
for(int i=0;i<res.size();i++){
printf("%d %d\n",res[i],1);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |