QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#563194#9240. MosaicModyKachef0 71ms14288kbC++231.4kb2024-09-14 04:46:022024-09-14 04:46:03

Judging History

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

  • [2024-09-14 04:46:03]
  • 评测
  • 测评结果:0
  • 用时:71ms
  • 内存:14288kb
  • [2024-09-14 04:46:02]
  • 提交

answer

#include "mosaic.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long 
#include <vector>

int solve(int x1 , int x2 , int y1 , int y2){
  if (x1 == 0) x1++;
  if (x2 == 0) x2++;
  if (y1 == 0) y1++;
  if (y2 == 0) y2++; 

  int h = x2 - x1 + 1 , w = y2 - y1 + 1; 
  //cout << h << ' ' << w << ' ' ; 
  int ans = 0; 
  if (h % 2 == 0 && w % 2 == 0) ans =  (h * w) / 2; 
  else if (h % 2 == 0) ans =  (h/2 * w); 
  else if (w % 2 == 0) ans =  (w/2 * h); 
  else ans = (((h-1)/2 * w) + (w + (x1%2 == y1%2))/2); 
  //cout << ans << ' '; 
  //cout << '\n'; 
  return ans;
}

std::vector<long long> mosaic(std::vector<signed> X, std::vector<signed> Y, std::vector<signed> T, std::vector<signed> B , std::vector<signed> L, std::vector<signed> R) {
  int Q = T.size() , N = X.size();
  vector<int> ans(Q); 
  // int a[N][N] = {};
  // for (int j = 0 ; j < N ; j++){
  //   a[0][j] = X[j]; 
  // }
  // for (int i = 0 ; i < N ; i++){
  //   a[i][0] = Y[i]; 
  // }

  // for (int i = 1 ; i < N ; i++){
  //   for (int j = 1 ; j < N ; j++){
  //     a[i][j] = (!a[i-1][j] && !a[i][j-1]); 
  //   }
  // }

  // for (int i = 0 ; i < N ; i++){
  //   for (int j = 0 ; j < N ; j++){
  //     cout << a[i][j]; 
  //   }
  //   cout << '\n';
  // }

  for (int i = 0 ; i < Q ; i++){
    ans[i] = solve(T[i] , B[i] , L[i] , R[i]);
  }
  return ans; 
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1
0
0
10
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
1
1
1
1
1
1
1
1
1

result:

wrong answer 3rd lines differ - on the 1st token, expected: '0', found: '1'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Wrong Answer

Test #18:

score: 0
Wrong Answer
time: 53ms
memory: 14288kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1325
79295
13227
63530
27144
86545
21107
53091
14477
13924
65961
66918
13355
23912
37064
56617
69833
64955
74117
41753
50727
1394
65320
58482
24373
58365
29361
59192
39012
4948
60518
23412
60348
12851
25712
8144
17012
56203
10889
7257
30189
73628
55592
33620
44080...

result:

wrong answer 3rd lines differ - on the 1st token, expected: '1314', found: '1325'

Subtask #4:

score: 0
Skipped

Dependency #2:

0%

Subtask #5:

score: 0
Wrong Answer

Test #31:

score: 0
Wrong Answer
time: 40ms
memory: 11008kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
10
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
200000
1 7 0 4
3 4 3 4
3 6 2 5
4 5 6 7
5 7 2 8
0 6 4 7
0 5 6 7
1 3 9 9
6 9 1 7
2 9 4 6
4 4 6 7
0 1 8 8
7 7 0 3
0 4 1 7
2 2 0 9
3 9 4 6
3 9 0 9
1 8 4 6
4 5 5 7
0 6 2 3
2 3 0 6
1 9 8 8
2 4 3 4
3 6 2 9
3 9 2 7
1 3 0 3
0 8 2 4
3...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
14
2
8
2
10
12
5
2
14
12
1
0
2
14
4
10
32
12
3
6
6
4
3
16
21
5
12
6
7
11
12
3
7
3
6
15
6
4
6
8
15
24
2
5
11
8
16
3
4
12
4
9
23
1
2
5
6
4
1
4
4
3
6
4
18
32
10
2
7
7
5
12
11
7
4
4
10
6
4
16
8
13
8
3
3
8
21
1
2
3
6
14
21
14
9
2
3
2
4
16
20
7
3
5
3
15
16
8
36
7
6
7
9
...

result:

wrong answer 169th lines differ - on the 1st token, expected: '0', found: '3'

Subtask #6:

score: 0
Wrong Answer

Test #42:

score: 0
Wrong Answer
time: 71ms
memory: 14180kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 0 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
0
0
1
0
0
0
0
1
1
0
0
0
0
1
0
1
0
0
1
1
1
1
0
0
1
1
0
0
0
0
0
1
1
1
1
1
1
0
0
1
0
1
1
0
1
0
1
1
0
1
0
0
1
1
1
0
0
0
1
1
0
0
1
1
1
0
0
1
1
1
0
1
1
0
1
1
0
1
0
0
1
1
1
1
1
0
1
1
0
1
1
1
0
1
0
0
1
0
0
1
0
1
0
1
0
1
1
1
0
0
1
1
0
0
0
0
0
0
1
0
0
1
1
1
0
1
1
0
1
1
1
...

result:

wrong answer 4th lines differ - on the 1st token, expected: '1', found: '0'

Subtask #7:

score: 0
Skipped

Dependency #3:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

0%