Codeforces Round #590 (Div. 3) C. Pipes

题目链接

 

Codeforces Round #590 (Div. 3) C. Pipes_第1张图片Types of pipes

 

Codeforces Round #590 (Div. 3) C. Pipes_第2张图片Examples of connected pipes

Let's describe the problem using some example:

Codeforces Round #590 (Div. 3) C. Pipes_第3张图片The first example input

And its solution is below:

Codeforces Round #590 (Div. 3) C. Pipes_第4张图片

题意:

从左上角入,从右下角出,每一个图形可以无数次旋转90度。

思路:

每个图形都只有一个入口和一个出口,所以从左上角到右下角最多只有一条路。

#include
#define ll long long
using namespace std;
char a[2][200010];
int main(){
	int T;
	scanf("%d",&T);
	while(T--){
		int n,f=0,g=0;  //f=0是在上层,f=1是在下层;
		scanf("%d",&n);
		scanf("%s",a[0]);
		scanf("%s",a[1]);
		n--;
		for(int i=0;i

 

你可能感兴趣的:(思维)