QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#637188#6743. water235UESTC_DECAYALI#WA 1ms3648kbC++20673b2024-10-13 10:51:022024-10-13 10:51:02

Judging History

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

  • [2024-10-13 10:51:02]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3648kb
  • [2024-10-13 10:51:02]
  • 提交

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;
    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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3648kb

input:

2 1

output:

1 
1 

result:

wrong output format Unexpected end of file - int32 expected