QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#392008#6743. water235Kir1sameWA 1ms3736kbC++201.2kb2024-04-17 01:51:132024-04-17 01:51:14

Judging History

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

  • [2024-04-17 01:51:14]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3736kb
  • [2024-04-17 01:51:13]
  • 提交

answer

#include<bits/stdc++.h>
//#pragma GCC optimize(3,"Ofast","inline")
using namespace std;
typedef long long ll;
typedef double db;
typedef unsigned long long  ull;
typedef pair<int,int> pii;
typedef pair<db,db> pdd;
typedef pair<ll,ll> pll;
void init();
void debug();
#define Clear(a)  memset(a,0,sizeof(a))
#define pb(x) push_back(x)
 
#define INF 1e9+10
const int N = 1e6+10;
const int M = 13210;
const int maxn = 3e5 +10;
const ll mod = 1e9+7;

const bool IN_TEST = 1;
int v[N];



int main()
{
    int n,m;
    cin>>n>>m;

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

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

    int res=0;
    for (int i=0;i<n*m;i++) res+=v[i];

    cout<<res<<endl;
    for (int i=0; i<n*m;i++)
    {
        cout<<v[i]<<' ';
        if (i%m == m-1) cout<<endl;
    }
        

    return 0;
}

详细

Test #1:

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

input:

2 1

output:

2
1 
1 

result:

ok The answer is correct.

Test #2:

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

input:

3 3

output:

3
1 0 0 
0 1 0 
0 0 1 

result:

ok The answer is correct.

Test #3:

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

input:

1 4

output:

3
1 0 1 1 

result:

ok The answer is correct.

Test #4:

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

input:

2 2

output:

2
1 0 
0 1 

result:

ok The answer is correct.

Test #5:

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

input:

2 4

output:

3
1 0 0 1 
0 1 0 0 

result:

ok The answer is correct.

Test #6:

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

input:

4 3

output:

4
1 0 0 
0 1 0 
0 0 1 
1 0 0 

result:

ok The answer is correct.

Test #7:

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

input:

4 4

output:

4
1 0 0 0 
0 1 0 0 
0 0 1 0 
0 0 0 1 

result:

ok The answer is correct.

Test #8:

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

input:

1 789

output:

395
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

result:

ok The answer is correct.

Test #9:

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

input:

2 444

output:

223
1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...

result:

ok The answer is correct.

Test #10:

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

input:

2 445

output:

224
1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ...

result:

ok The answer is correct.

Test #11:

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

input:

3 333

output:

168
1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

result:

ok The answer is correct.

Test #12:

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

input:

3 332

output:

168
1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ...

result:

ok The answer is correct.

Test #13:

score: -100
Wrong Answer
time: 1ms
memory: 3652kb

input:

224 4

output:

268
1 0 0 0 
0 1 0 0 
0 0 1 0 
0 0 0 1 
0 0 0 0 
1 0 0 0 
0 1 0 0 
1 0 1 0 
0 0 0 1 
1 0 0 0 
1 0 0 0 
1 1 0 0 
0 0 1 0 
1 0 0 1 
0 0 0 0 
1 0 0 0 
0 1 0 0 
1 0 1 0 
0 0 0 1 
1 0 0 0 
1 0 0 0 
1 1 0 0 
0 0 1 0 
1 0 0 1 
0 0 0 0 
1 0 0 0 
0 1 0 0 
1 0 1 0 
0 0 0 1 
1 0 0 0 
1 0 0 0 
1 1 0 0 
0 0 1 0 ...

result:

wrong answer The answer is wrong: expected = 114, found = 268