QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#782139#9415. MatrixrdcamelotWA 0ms3640kbC++201.1kb2024-11-25 19:02:442024-11-25 19:02:44

Judging History

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

  • [2024-11-25 19:02:44]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2024-11-25 19:02:44]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using i64=long long;
using u64=unsigned long long;
#define ll long long
const int inf=1e9;
const ll inff=1e18;
using i128=__int128;

void solve(){
    int n;
    cin>>n;
    //1..2n
    if(n==1){
        cout<<"NO"<<'\n';
        return;
    }
    /*4*4  8
    1  5  6   2
    7  5  6   7
    8  5  6   8
    3  5  6   4
    */
    cout<<"YES"<<'\n';
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(i==1 && j==1){
                cout<<1<<' ';
            }else if(i==1 && j==n){
                cout<<2<<' ';
            }else if(i==n && j==1){
                cout<<3<<' ';
            }else if(i==n && j==n){
                cout<<4<<' ';
            }else{
                if(j==1 || j==n){
                    cout<<(4+n-2+i-1)<<' ';
                }else{
                    cout<<(4+j-1)<<' ';
                }
            }
        }
        cout<<'\n';
    }
}

int main(){
    ios::sync_with_stdio(0);cin.tie(0);
    int t=1;
    // cin>>t; 
    while(t--){
        solve();
    }
    return 0;
}



詳細信息

Test #1:

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

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)