QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#399788 | #6743. water235 | ericmegalovania# | WA | 1ms | 3800kb | C++20 | 1.1kb | 2024-04-26 17:50:15 | 2024-04-26 17:50:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
//#define ONLINE
#ifndef ONLINE
#define debug(...) fprintf(stderr,##__VA_ARGS__)
#else
#define debug(...) ;
#endif
using LL=long long;
using PII=pair<int,int>;
template<typename T>
inline T READ(){
T x=0; bool f=0; char c=getchar();
while(c<'0' || c>'9') f|=(c=='-'),c=getchar();
while(c>='0' && c<='9') x=x*10+c-'0',c=getchar();
return f?-x:x;
}
inline int read(){return READ<int>();}
inline LL readLL(){return READ<LL>();}
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
int main(){
int n=read(),m=read();
vector a(n,vector<int>(m));
for(int i=0;i<min(n,m);i++) a[i][i]=1;
for(int i=n;i<m;i++) a[n-1][i]=1;
for(int i=m;i<n;i++) a[i][m-1]=1;
printf("%d\n",max(n,m));
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
printf("%d ",a[i][j]);
}
printf("\n");
}
return 0;
}
/* stuff you should look for
* int overflow, array bounds
* special cases (n=1?)
* do smth instead of nothing and stay organized
* WRITE STUFF DOWN
* DON'T GET STUCK ON ONE APPROACH
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3800kb
input:
2 1
output:
2 1 1
result:
ok The answer is correct.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
3 3
output:
3 1 0 0 0 1 0 0 0 1
result:
ok The answer is correct.
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3800kb
input:
1 4
output:
4 1 1 1 1
result:
wrong answer The answer is wrong: expected = 3, found = 4