QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#439894#6743. water235suibian_xiaozhao#WA 0ms3600kbC++231.5kb2024-06-12 20:21:132024-06-12 20:21:14

Judging History

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

  • [2024-06-12 20:21:14]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3600kb
  • [2024-06-12 20:21:13]
  • 提交

answer

//
// Created by DELLPC on 24-5-19.
//

#include "bits/stdc++.h"

using namespace std;


using i64 = long long;
using i32 = unsigned int;
#define  endl '\n'
i64 mod = 998244353;

i64 qpow(i64 a, i64 b, i64 mods = 1e9 + 7) {
    i64 ans = 1;
    while (b) {
        if (b & 1) {
            ans = ans * a % mods;
        }
        a = a * a % mods;
        b >>= 1;
    }
    return ans;
}

//求逆元
i64 inv(i64 a, i64 mods = 1e9 + 7) {
    return qpow(a, mods - 2, mods);
}


void solve() {
    int n, m;
    cin >> n >> m;
//    cerr << n << m << endl;
    vector<vector<int>> arr(n + 1, vector<int>(n + 1));

    if (n % 2 == 0 && m % 2 == 0) {
        for (int i = 1; i <= n; i += 2) {
            arr[i][1] = 1;
        }
        for (int i = 2; i <= m; i += 2){
            arr[n][i] = 1;
        }
    } else {
        for (int i = 1; i <= n; i += 2) {
            arr[i][1] = 1;
        }

        if (n % 2 == 0) {
            arr[n][1] = 1;
        }
        for (int i = 1; i <= m; i += 2) {
            arr[1][i] = 1;
        }

        if (m % 2 == 0) {
            arr[1][m] = 1;
        }
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            cout << arr[i][j] << " ";
        }
        cout << endl;
    }
}

int main() {
//    cerr    << 1996488708ll * 2ll %mod<<endl;
    ios::sync_with_stdio(0), cin.tie(0);
    int t = 1;
//    cin >> t;
    while (t--) {
        solve();
    }


}


详细

Test #1:

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

input:

2 1

output:

1 
1 

result:

wrong output format Unexpected end of file - int32 expected