QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#609250#9415. MatrixITC_TL#WA 0ms3648kbC++201.3kb2024-10-04 11:35:362024-10-04 11:35:36

Judging History

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

  • [2024-10-04 11:35:36]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3648kb
  • [2024-10-04 11:35:36]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fore(i, l, r) for (ll i = (int)l; i <= (int)r; i++)
#define ford(i, r, l) for (ll i = (int)r; i >= (int)l; i--)
const int MAXN = 2123456LL;
ll T, n, a[52][52];
ll cnt = 0;
ll nxt()
{
    if (cnt == 2 * n)
        return cnt;
    return ++cnt;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    fore(i, n - 1, n)
    {
        fore(j, 1, 2)
        {
            a[i][j] = nxt();
        }
    }
    ll tmp = nxt();
    fore(i, 1, n - 2)
    {
        fore(j, 1, 2)
        {
            a[i][j] = tmp;
        }
    }
    fore(i, n - 1, n)
    {
        fore(j, 3, n)
        {
            a[i][j] = tmp;
        }
    }
    tmp = nxt();
    ll tot = 0;
    fore(i, 1, n - 2)
    {
        fore(j, 3, n)
        {

            if ((i % 2 == 1 && j % 2 == 1) || (i % 2 == 0 && j % 2 == 0))
                a[i][j] = tmp;
            else
                a[i][j] = nxt();
        }
    }

    if (cnt == 2 * n)
    {
        cout << "Yes" << endl;
        fore(i, 1, n)
        {
            fore(j, 1, n)
            {
                cout << a[i][j] << " ";
            }
            cout << endl;
        }
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3648kb

input:

2

output:

Yes
1 2 
3 4 

result:

ok Correct. (1 test case)

Test #2:

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

input:

3

output:

Yes
5 5 6 
1 2 5 
3 4 5 

result:

ok Correct. (1 test case)

Test #3:

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

input:

4

output:

Yes
5 5 6 7 
5 5 8 6 
1 2 5 5 
3 4 5 5 

result:

ok Correct. (1 test case)

Test #4:

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

input:

5

output:

Yes
5 5 6 7 6 
5 5 8 6 9 
5 5 6 10 6 
1 2 5 5 5 
3 4 5 5 5 

result:

ok Correct. (1 test case)

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3588kb

input:

6

output:

Yes
5 5 6 7 6 8 
5 5 9 6 10 6 
5 5 6 11 6 12 
5 5 12 6 12 6 
1 2 5 5 5 5 
3 4 5 5 5 5 

result:

wrong answer The number of quadruples 2 is invalid. (test case 1)