abc how e
  • 板块学术版
  • 楼主Hughpig
  • 当前回复9
  • 已保存回复9
  • 发布时间2024/1/20 21:41
  • 上次更新2024/1/21 06:28:48
查看原帖
abc how e
646208
Hughpig楼主2024/1/20 21:41

RT,求调

/*
*Author: Hughpig
*made in China
*/

#include<bits/stdc++.h>
using namespace std;
int n,m,qwq[107][107];
string s,t[107];
bool flag;

int main()
{
	ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
	cin>>n;
	cout<<(n+1)/2<<endl;
	m=(n+1)/2;
	for(int i=1;i<=m;i++){
		cout<<n-m<<' ';
		for(int j=1;j<=n-m;j++)cout<<j+i-1<<' ',qwq[i][j]=j+i-1;
		cout<<endl;
	}
	for(int k=1;k<=n;k++){
		for(int i=1;i<=m;i++){
			flag=0;
			for(int j=1;j<=n-m;j++){
				if(qwq[i][j]==k)flag=1;
			}
			if(flag)t[k].push_back('1');
			else t[k].push_back('0');
		}
		//cout<<t[k]<<'\n';
	}
	cin>>s;
	for(int i=1;i<=n;i++){
		if(s==t[i])cout<<i,exit(0);
	}
	cout<<n;
	return 0;
}
2024/1/20 21:41
加载中...