Submission #959898

# Submission time Handle Problem Language Result Execution time Memory
959898 2024-04-09T09:46:17 Z pcc Mensza (COI22_mensza) C++17
34 / 100
3079 ms 151516 KB
#include <bits/stdc++.h>
using namespace std;

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,popcnt,sse4")

#define pii pair<int,int>
#define fs first
#define sc second
#define ll long long

int L;

namespace SA{
	vector<int> v;
	void GO(int n){
		v.clear();
		for(int i = 0;i<10;i++){
			if(n&(1<<i)){
				for(int j = 0;j<i*2+1;j++)v.push_back(i*2+1);
			}
		}
		cout<<v.size()<<' ';for(auto &i:v)cout<<i<<' ';cout<<'\n';
		return;
	}
}
namespace SB{
	vector<int> v;
	void GO(int n){
		v.clear();
		for(int i = 0;i<10;i++){
			if(n&(1<<i)){
				for(int j = 0;j<i*2+2;j++)v.push_back(i*2+2);
			}
		}
		cout<<v.size()<<' ';for(auto &i:v)cout<<i<<' ';cout<<'\n';
		return;
	}
}

namespace SC{
	void GO(int n){
		int a = 0,b = 0;
		for(int i = 0;i<n;i++){
			int k;
			cin>>k;
			if(k&1)a^=1<<(k/2);
			else b ^= 1<<(k/2-1);
		}
		cout<<(a>b?"A\n":"B\n");
		return;
	}
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>L;
	int t;
	cin>>t;
	while(t--){
		string s;
		int n;
		cin>>s>>n;
		if(s[0] == 'a')SA::GO(n);
		else if(s[0] == 'b')SB::GO(n);
		else SC::GO(n);
	}
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 556 ms 3448 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 3079 ms 151516 KB Integer parameter [name=l_46] equals to 22, violates the range [0, 20]
2 Halted 0 ms 0 KB -