QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#563193#9240. MosaicModyKachef0 39ms11232kbC++231.3kb2024-09-14 04:35:142024-09-14 04:35:14

Judging History

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

  • [2024-09-14 04:35:14]
  • 评测
  • 测评结果:0
  • 用时:39ms
  • 内存:11232kb
  • [2024-09-14 04:35:14]
  • 提交

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)/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
Runtime Error

Test #18:

score: 0
Runtime Error

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:


result:


Subtask #4:

score: 0
Skipped

Dependency #2:

0%

Subtask #5:

score: 0
Wrong Answer

Test #31:

score: 0
Wrong Answer
time: 39ms
memory: 11232kb

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
11
12
5
2
14
12
1
1
2
14
4
11
32
12
3
6
6
5
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
5
12
4
9
23
1
2
5
6
5
1
4
3
4
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
2
5
3
15
16
8
36
7
6
7
9
...

result:

wrong answer 7th lines differ - on the 1st token, expected: '10', found: '11'

Subtask #6:

score: 0
Runtime Error

Test #42:

score: 0
Runtime Error

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:


result:


Subtask #7:

score: 0
Skipped

Dependency #3:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

0%