摘要:
该题TLE了几次,后来才发现要用奇偶剪纸,如果起点到终点的步数为偶数那么不管你怎样走,步数一定为偶数;#include<stdio.h>#include<stdlib.h>#include<string.h>char map[10][10];int flag,M,N;int d[8]={ -1,0,0,1,1,0,0,-1 };void DFS( int x,int y,int n,int T ){ // printf( "afsad" ); if( flag || n>=T ) return; for( int k=0;k< 阅读全文
摘要:
该题是一道字典树的题目,就是是要你翻译一下,如果你学了字典树就会发现这是一道水体;#include<stdio.h>#include<stdlib.h>#include<string.h>typedef struct t{ char num[12]; t *ch[26]; int flag; }tire;tire *empty(){ tire *t=( tire * )malloc( sizeof( tire ) ); for( int i=0;i<26;i++ ) t->ch[i]=NULL; memset( t->num,... 阅读全文