QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#112460#6309. AqreFHQYWA 2ms3332kbC++201.5kb2023-06-11 20:40:212023-06-11 20:40:23

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-11 20:40:23]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3332kb
  • [2023-06-11 20:40:21]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define FOR(i,begin,end,delta) for(int i=begin;i<=end;i+=delta)
#define For(i,x) for(auto i:x)
#define fastios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define endl '\n'
#define rd(x) scanf("%lld",&x)
#define wc(x) putchar(x)
#define ws(x) printf("%s",x)
#define el puts("")
#define udm unordered_map<int,int>
#define inf 0x3f3f3f3f
#define set_inf(a) memset(&a,0x3f,sizeof(a))
#define set_0(a) memset(&a,0,sizeof(a))
#define set_unint(a) memset(&a,-1,sizeof(a))
using namespace std;
//define_var
const int M=2e5+9;
int mp[1009][1009];
//define_var
//function_begin
int read()
{
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
	while(c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
	return x*f;
}
void write(int x)
{
	if(x<0) putchar('-'),x=-x;
	if(x>9) write(x/10);
	putchar(x%10+'0');
}
//function_end
//solve_begin
void solve()
{
	int n,m;
	cin>>n>>m;
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			mp[i][j]=0;
		}
	}
	for(int i=1;i<=n;i++)
	{
		int cnt=0;
		for(int j=i;j<i+m;j++)
		{
			int now=(j-1)%m+1;
			if(cnt==3)
				cnt=0;
			else
			{
				cnt++;
				mp[i][now]=1;
				ans++;
			}
		}
	}
	cout<<ans<<endl;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			cout<<mp[i][j];
		}
		cout<<endl;
	}
}
//solve_end
//main_begin
signed main()
{
	fastios
	int T=1;
	cin>>T;
	while(T--)
		solve();
}
//main_end

详细

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3332kb

input:

3
2 2
3 4
3 8

output:

4
11
11
9
1110
0111
1011
18
11101110
01110111
10111011

result:

wrong answer 1s are not connected. (test case 2)