QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#854904#9240. Mosaic275307894a#0 212ms331296kbC++201.9kb2025-01-12 10:49:452025-01-12 10:49:52

Judging History

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

  • [2025-01-12 10:49:52]
  • 评测
  • 测评结果:0
  • 用时:212ms
  • 内存:331296kb
  • [2025-01-12 10:49:45]
  • 提交

answer

#include "mosaic.h"

#include<bits/stdc++.h>
#define Gc() getchar()
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define eb emplace_back
#define all(x) x.begin(),x.end()
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;
const int N=2e5+5,M=(1<<28)+5,K=1000+5,mod=998244353,Mod=mod-1;const db eps=1e-9;const int INF=1e9+7;mt19937 rnd(28382);
#define Tp template<typename T>
#define Ts template<typename T,typename... Ar>
namespace Debug{
	Tp void _debug(char* f,T t){cerr<<f<<'='<<t<<endl;}
	Ts void _debug(char* f,T x,Ar... y){while(*f!=',') cerr<<*f++;cerr<<'='<<x<<",";_debug(f+1,y...);}
	#ifdef LOCAL
	#define gdb(...) _debug((char*)#__VA_ARGS__,__VA_ARGS__)
	#else 
	#define gdb(...) void()
	#endif
}using namespace Debug;
int c1[205][N],c2[N][205];
int n,q;
vector<long long> mosaic(vector<int> X,vector<int> Y,vector<int> T,vector<int> B,vector<int> L,vector<int> R) {
	n=X.size();q=T.size();
	for(int i=0;i<n;i++) c1[0][i]=X[i],c2[i][0]=Y[i];
	for(int i=0;i<=200&&i<n;i++) c1[i][0]=Y[i],c2[0][i]=X[i];
	for(int i=1;i<=200;i++) for(int j=1;j<=n;j++) c1[i][j]=(!c1[i-1][j]&&!c1[i][j-1]);
	for(int i=1;i<=n;i++) for(int j=1;j<=200;j++) c2[i][j]=(!c2[i-1][j]&&!c2[i][j-1]);
	int k=24;
	for(int i=1;i<=200;i++) for(int j=1;j<=n;j++) if(i>=50+k&&j>=50+k) assert(c1[i][j]==c1[i-k][j-k]);
	// for(int i=1;i<=70;i++) for(int j=1;j<=70;j++) printf("%d%c",c2[i][j]," \n"[j==70]);return {};
	vector<ll> ans(q);
	for(int i=0;i<q;i++){
		// for(int j=T[i];j<=B[i];j++) for(int h=L[i];h<=R[i];h++) ans[i]+=c2[j][h];
		if(T[i]<=50) ans[i]=c1[T[i]][L[i]];
		else if(L[i]<=50) ans[i]=c2[T[i]][L[i]];
		else ans[i]=c1[(T[i]-50)%k+50][(L[i]-50)%k+50];
	}
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 5
Accepted
time: 0ms
memory: 69844kb

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
0
0
0
0
0
0
0
0
0
0

result:

ok 

Test #2:

score: 5
Accepted
time: 0ms
memory: 67800kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1
1
1
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:

ok 

Test #3:

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

input:

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

output:

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

result:

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

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Wrong Answer

Test #18:

score: 0
Wrong Answer
time: 211ms
memory: 331296kb

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
1
0
1
1
1
0
1
0
1
0
0
1
0
1
0
1
1
1
1
0
0
1
0
0
0
1
0
0
1
0
1
0
1
1
0
1
0
1
1
0
0
0
1
0
1
0
0
1
0
0
1
1
0
0
0
0
0
1
1
1
0
0
1
0
1
0
0
0
0
0
1
1
1
0
0
0
1
0
0
1
1
1
0
1
0
1
0
1
1
1
1
0
1
1
1
0
1
1
0
1
0
1
1
0
1
0
0
1
1
0
1
0
1
0
0
1
0
1
1
0
0
1
1
1
1
0
0
0
1
0
1
0
...

result:

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

Subtask #4:

score: 0
Skipped

Dependency #2:

0%

Subtask #5:

score: 0
Wrong Answer

Test #31:

score: 0
Wrong Answer
time: 34ms
memory: 79156kb

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
0
1
0
1
0
0
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
1
0
1
0
0
0
1
1
1
0
1
0
0
0
0
1
0
1
0
1
0
0
0
1
0
1
1
0
0
1
1
1
0
0
0
0
1
1
0
0
1
0
0
0
1
0
1
0
1
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
...

result:

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

Subtask #6:

score: 0
Wrong Answer

Test #42:

score: 0
Wrong Answer
time: 212ms
memory: 331200kb

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
1
1
1
0
1
1
1
1
0
0
1
1
1
1
0
1
0
1
1
0
0
0
0
1
1
0
0
1
1
0
1
1
1
0
0
0
0
0
1
1
0
1
0
0
1
0
1
0
0
1
0
1
1
0
0
0
1
1
1
0
0
1
1
0
0
0
1
1
0
0
0
1
0
0
1
0
0
1
0
1
1
1
0
0
0
0
1
0
0
1
0
0
0
1
0
1
1
0
1
1
0
1
1
1
0
1
0
0
0
1
0
0
1
1
1
1
1
0
1
0
1
0
0
0
0
1
0
0
1
0
0
0
...

result:

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

Subtask #7:

score: 0
Skipped

Dependency #3:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

0%