QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#637193#6743. water235UESTC_DECAYALI#WA 0ms3572kbC++20682b2024-10-13 10:53:292024-10-13 10:53:29

Judging History

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

  • [2024-10-13 10:53:29]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3572kb
  • [2024-10-13 10:53:29]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int N = 1e6+5;
bool flag;
int ans[N], c;

signed main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int n, m; cin >> n >> m;
    if (n>m) swap(n, m), flag=true;
    for (int i=0; i<n; ++i) ans[i*m+i]=1;
    for (int i=n; i<m; ++i) if ((i-n)%2==1) ans[i]=1;
    if (n<m) ans[m-1]=1;

    if (!flag) {
        for (int i=0; i<n; ++i) {
            for (int j=0; j<m; ++j) cout << ans[i*m+j] << ' ';
            cout << '\n';
        }
    } else {
        for (int j=0; j<m; ++j) {
            for (int i=0; i<n; ++i) cout << ans[i*m+j] << ' ';
            cout << '\n';
        }
    }
    return 0;
}

詳細信息

Test #1:

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

input:

2 1

output:

1 
1 

result:

wrong output format Unexpected end of file - int32 expected