QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#672243#9415. Matrixconfirm14478#WA 0ms3580kbC++20988b2024-10-24 16:08:442024-10-24 16:08:46

Judging History

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

  • [2024-10-24 16:08:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3580kb
  • [2024-10-24 16:08:44]
  • 提交

answer

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define YES cout<<"YES\n"
#define NO cout<<"NO\n"
#define endl "\n"
#define debug cout<<'*'<<'\n'
#define int long long
const int N =205, M = 5e5+50;
const int mod = 1e9 + 7, inf = 2e18;
using namespace std;
using namespace __gnu_pbds;
using pii=pair<int,int>;

int a[N][N];
void solve(){
	int n;
	cin>>n;
	int t=0;
	a[1][1]=++t;
	a[1][2]=++t;
	a[2][1]=++t;
	a[2][2]=++t;
	for(int i=3;i<=n;i++)a[i][i]=++t;
	++t;
	for(int i=3;i<=n;i++)a[i][1]=a[i][2]=a[1][i]=a[2][i]=t;
	for(int i=3;i<=n;i++) {
		++t;
		for(int j=i+1;j<=n;j++) {
			a[i][j]=t;
			a[j][i]=t;
		}
	}
	YES;
	for(int i=1;i<=n;i++) {
		for(int j=1;j<=n;j++)cout<<a[i][j]<<" ";
		cout<<endl;
	}
}
signed main()
{
	//freopen("C:\\Users\\win11\\Desktop\\test.txt", "r", stdin);
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

	long long T = 1;
	//cin >> T;
	while (T--)solve();
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3580kb

input:

2

output:

YES
1 2 
3 4 

result:

wrong answer Line [name=yesno] equals to "YES", doesn't correspond to pattern "Yes|No" (test case 1)