QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#611755#9415. Matrixshiqiaqiaya#WA 0ms3608kbC++171.6kb2024-10-04 22:32:542024-10-04 22:32:54

Judging History

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

  • [2024-10-04 22:32:54]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3608kb
  • [2024-10-04 22:32:54]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define int long long
using i64 = long long;
using i128 = __int128;
mt19937_64 rd(time(0));
template <class K, class C = less<>> using paring_heap = __gnu_pbds::priority_queue<K, C>;
template <class K> using rb_tree = tree<K, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T, class ... A> void debug(const T & t, const A & ... a) { cerr << "[" << t, ((cerr << ", " << a), ...), cerr << "]\n"; }
const i64 mod = [](bool n) { return n ? 998244353 : 1e9 + 7; } (1);

void QAQ() {
    int n;
    cin >> n;

    vector ans(n + 1, vector<int>(n + 1));

    if (n == 2) {
        cout << "YES\n1 2\n3 4\n";
        return;
    }

    for (int i = 2; i <= n; i += 2) {
        for (int j = 1; j <= n; j++) {
            ans[i][j] = 1;
        }
    }

    int now = 2;

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (ans[i][j] == 0) ans[i][j] = min(2 * n, now++);
        }
    }

    if (now <= 2 * n) {
        cout << "NO\n";
        return;
    }
    cout << "YES\n";

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            cout << ans[i][j] << " \n"[j == n];
        }
    }
}

signed main() {
    cin.tie(0) -> sync_with_stdio(0);
    int t = 1;
    // cin >> t;
    for (cout << fixed << setprecision(12); t--; QAQ());
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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)