赞
踩
- #include<bits/stdc++.h>
- using namespace std;
-
- #define N 105
- int m, n, x, y, k;
- char s;
- int arr[N][N];
-
- // U D L R
- void process() {
- int count = arr[x][y];
- arr[x][y] = arr[x][y] ? 0 : 1;
- switch(s) {
- case 'U':
- if(count == 0) {
- s = 'L';
- y--;
- }else {
- s = 'R';
- y++;
- }
- break;
- case 'D':
- if(count == 0) {
- s = 'R';
- y++;
- }else {
- s = 'L';
- y--;
- }
- break;
- case 'L':
- if(count == 0) {
- s = 'D';
- x++;
- }else {
- s = 'U';
- x--;
- }
- break;
- case 'R':
- if(count == 0) {
- s = 'U';
- x--;
- }else {
- s = 'D';
- x++;
- }
- }
- }
-
- int main() {
- cin >> m
![](https://csdnimg.cn/release/blogv2/dist/pc/img/newCodeMoreWhite.png)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。