QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#399788#6743. water235ericmegalovania#WA 1ms3800kbC++201.1kb2024-04-26 17:50:152024-04-26 17:50:17

Judging History

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

  • [2024-04-26 17:50:17]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3800kb
  • [2024-04-26 17:50:15]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

//#define ONLINE
#ifndef ONLINE
#define debug(...) fprintf(stderr,##__VA_ARGS__)
#else
#define debug(...) ;
#endif

using LL=long long;
using PII=pair<int,int>;

template<typename T>
inline T READ(){
	T x=0; bool f=0; char c=getchar();
	while(c<'0' || c>'9') f|=(c=='-'),c=getchar();
	while(c>='0' && c<='9') x=x*10+c-'0',c=getchar();
	return f?-x:x;
}
inline int read(){return READ<int>();}
inline LL readLL(){return READ<LL>();}
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int main(){
	int n=read(),m=read();
	vector a(n,vector<int>(m));
	for(int i=0;i<min(n,m);i++) a[i][i]=1;
	for(int i=n;i<m;i++) a[n-1][i]=1;
	for(int i=m;i<n;i++) a[i][m-1]=1;
	printf("%d\n",max(n,m));
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			printf("%d ",a[i][j]);
		}
		printf("\n");
	}
	return 0;
}

/* stuff you should look for
* int overflow, array bounds
* special cases (n=1?)
* do smth instead of nothing and stay organized
* WRITE STUFF DOWN
* DON'T GET STUCK ON ONE APPROACH
*/

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3800kb

input:

2 1

output:

2
1 
1 

result:

ok The answer is correct.

Test #2:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

3 3

output:

3
1 0 0 
0 1 0 
0 0 1 

result:

ok The answer is correct.

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3800kb

input:

1 4

output:

4
1 1 1 1 

result:

wrong answer The answer is wrong: expected = 3, found = 4