QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#120911#4327. ŠeširiLaurie#0 72ms37688kbC++142.8kb2023-07-07 12:31:432024-07-04 00:28:24

Judging History

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

  • [2024-07-04 00:28:24]
  • 评测
  • 测评结果:0
  • 用时:72ms
  • 内存:37688kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-07 12:31:43]
  • 提交

answer

//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <complex>
#include <random>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define itn int
#define nit int
#define ll long long
#define ms multiset
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define re register
#define ri re int
#define il inline
#define pii pair<int,int>
#define cp complex<double>
#define vi vector<int>
#define ull unsigned long long
#define mem0(x) memset(x,0,sizeof(x))
#define mem0x3f(x) memset(x,0x3f,sizeof(x))
using namespace std;
using std::bitset;
//using namespace __gnu_pbds;
const double Pi=acos(-1);
namespace fastIO {
	template<class T>
	inline void read(T &x) {
		x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		if(fu)x=-x;
	}
	inline int read() {
		int x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		return fu?-x:x;
	}
	template<class T,class... Args>
	inline void read(T& t,Args&... args) {
		read(t);
		read(args...);
	}
	char _n_u_m_[40];
	template<class T>
	inline void write(T x) {
		if(x==0){
			putchar('0');
			return;
		}
		T tmp = x > 0 ? x : -x ;
		if( x < 0 ) putchar('-') ;
		register int cnt = 0 ;
		while( tmp > 0 ) {
			_n_u_m_[ cnt ++ ] = tmp % 10 + '0' ;
			tmp /= 10 ;
		}
		while( cnt > 0 ) putchar(_n_u_m_[ -- cnt ]) ;
	}
	template<class T>
	inline void write(T x ,char ch) {
		write(x);
		putchar(ch);
	}
}
using namespace fastIO;
int n;
inline pair<vector<int>,vector<vector<int>>> solve(int n){
	if(n==2){
		return make_pair(vector<int>{0,1,-1,0},vector<vector<int>>{vector<int>{false,true},vector<int>{false,false},vector<int>{true,true},vector<int>{true,false}});
	}
	auto t1=solve(n-2),t2=solve(2);
	pair<vector<int>,vector<vector<int>>>ans;
	F(j,0,3)F(i,0,(1<<(n-2))-1){
		vector<int>temp;
		for(auto &k:t1.second[i])temp.push_back(k^(t2.first[j]==1));
		for(auto &k:t2.second[j])temp.push_back(k^(t1.first[i]==-1));
		ans.first.push_back(t1.first[i]*(t2.first[j]==1?-1:1)+t2.first[j]*(t1.first[i]==-1?-1:1));
		ans.second.push_back(temp);
	}
	return ans;
}
int main() {
	cin>>n;
	auto ans=solve(n).second;
	F(i,0,n-1){
		F(j,0,(1<<n)-1)if(j>>i&1){
			putchar(ans[j][i]?'C':'B');
		}
		putchar('\n');
	}
	return 0;
}


詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

4

output:

BCCBBCBC
CBBCCBCB
BBCBCCBC
CCBCBBCB

result:

wrong answer your plan fails on CCCC

Subtask #2:

score: 0
Memory Limit Exceeded

Test #2:

score: 0
Memory Limit Exceeded

input:

5

output:


result:


Subtask #3:

score: 0
Wrong Answer

Test #3:

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

input:

6

output:

BCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBC
CBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCB
BBCBCCBCCCBCBBCBBBCBCCBCBBCBCCBC
CCBCBBCBBBCBCCBCCCBCBBCBCCBCBBCB
BBCBBBBBCBBCBBCBCCBCCCCCBCCBCCBC
CCBCCCCCBCCBCCBCBBCBBBBBCBBCBBCB

result:

wrong answer your plan fails on CCCCBB

Subtask #4:

score: 0
Memory Limit Exceeded

Test #4:

score: 0
Memory Limit Exceeded

input:

7

output:


result:


Subtask #5:

score: 0
Wrong Answer

Test #5:

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

input:

8

output:

BCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBC
CBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCB
BBCBCCBCCCBCBBCBBBCBCCBCBBCBCCBCCCBCBBCBBB...

result:

wrong answer your plan fails on CCCBBBBB

Subtask #6:

score: 0
Memory Limit Exceeded

Test #6:

score: 0
Memory Limit Exceeded

input:

9

output:


result:


Subtask #7:

score: 0
Wrong Answer

Test #7:

score: 0
Wrong Answer
time: 1ms
memory: 3828kb

input:

10

output:

BCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCB...

result:

wrong answer your plan fails on CCCBBBBBBB

Subtask #8:

score: 0
Memory Limit Exceeded

Test #8:

score: 0
Memory Limit Exceeded

input:

11

output:


result:


Subtask #9:

score: 0
Wrong Answer

Test #9:

score: 0
Wrong Answer
time: 1ms
memory: 4004kb

input:

12

output:

BCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCB...

result:

wrong answer your plan fails on CCCBBBBBBBBB

Subtask #10:

score: 0
Memory Limit Exceeded

Test #10:

score: 0
Memory Limit Exceeded

input:

13

output:


result:


Subtask #11:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 2ms
memory: 5040kb

input:

14

output:

BCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCB...

result:

wrong answer your plan fails on CCCBBBBBBBBBBB

Subtask #12:

score: 0
Memory Limit Exceeded

Test #12:

score: 0
Memory Limit Exceeded

input:

15

output:


result:


Subtask #13:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 18ms
memory: 11428kb

input:

16

output:

BCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCB...

result:

wrong answer your plan fails on CCCBBBBBBBBBBBBB

Subtask #14:

score: 0
Memory Limit Exceeded

Test #14:

score: 0
Memory Limit Exceeded

input:

17

output:


result:


Subtask #15:

score: 0
Wrong Answer

Test #15:

score: 0
Wrong Answer
time: 72ms
memory: 37688kb

input:

18

output:

BCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBCBBCCBCBBCCBBCBCCBBCCBCBBCCBBCBCBCCBBCBCCBBCCBCBBCCB...

result:

wrong answer your plan fails on CCCBBBBBBBBBBBBBBB