QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#850946#9768. A + B = C ProblemciuimWA 1ms4064kbC++203.1kb2025-01-10 13:25:452025-01-10 13:25:45

Judging History

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

  • [2025-01-10 13:25:45]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4064kb
  • [2025-01-10 13:25:45]
  • 提交

answer

bool M1;
#define look_memory cerr<<abs(&M2-&M1)/1024.0/1024<<" MB\n"
#define look_time cerr<<(clock()-Time)*1.0/CLOCKS_PER_SEC<<'\n'
#include <cstdio>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <cstring>
#include <array>
#include <algorithm>
#include <queue>
#include <vector>
#include <bitset>
#include <ctime>
#include <cstdlib>
#include <random>
#include <set>
#include <ctime>
#include <map>
#include <stack>
#include <unordered_map>
#include <assert.h>
#include <unordered_set>
#define i128 __int128
#define ll long long
#define uint unsigned
#define ull unsigned long long
#define ld long double
#define fo(a,b,c) for(ll a=b;a<=c;++a)
#define re(a,b,c) for(ll a=b;a>=c;--a)
#define pii pair<ll,ll>
#define pdd pair<db,db>
#define fi first
#define pb push_back
#define se second
#define ite set<array<ll,3>> ::iterator
#define vite vector<ll> ::iterator
#define mite map<ll,ll> ::iterator
using namespace std;
const ll mod=998244353;
inline ll gi()
{
	ll x = 0, f = 1;
	char ch = getchar();
	while(ch < '0' || ch > '9')
	{
		if (ch == '-')
			f = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9')
	{
		x = (x<<1) + (x<<3) + (ch^48);
		ch = getchar();
	}
	return x * f;
}
ll _=1;
const ll inf=2e17+5,iinf=1e9+5;
const ll N=1000005;
ll gcd(ll a,ll b)
{
	if(b==0) return a;
	return gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
	return a*b/gcd(a,b);
}
ll ota[N],otb[N],otc[N];
void gz(ll a[],ll b[],ll c[],ll lena,ll lenb,ll lenc)
{
	fo(i,1,lena)
	{
		a[i]=0;
		if(i==lena) a[i]=1;
	}
	fo(i,1,lenb)
	{
		b[i]=0;
		if(i==1) b[i]=1;
	}
	fo(i,1,lenc)
	{
		c[i]=0;
		if(i==1) c[i]^=1;
		if(i%lena==0) c[i]^=1;
	}
}
void sol()
{
	ll a=gi(),b=gi(),c=gi();
	if(lcm(a,b)%c==0&&lcm(b,c)%a==0&&lcm(a,c)%b==0) ;
	else
	{
		cout<<"NO";
		return;
	}
	ll g=gcd(a,gcd(b,c));
	ll ty1=lcm(a,b)/c,ty2=lcm(b,c)/a,ty3=lcm(a,c)/b;
	if(ty1==ty2&&ty1==ty3)
	{
		if(a==2)
		{
			cout<<"NO";
			return;
		}
		cout<<"YES\n";
		fo(i,1,a)
		{
			if(i==1)
			{
				cout<<1;
			}
			else cout<<0;
		}
		cout<<'\n';
		fo(i,1,a)
		{
			if(i==a)
			{
				cout<<1;
			}
			else cout<<0;
		}
		cout<<'\n';
		fo(i,1,a)
		{
			if(i==1||i==a)
			{
				cout<<1;
			}
			else cout<<0;
		}
		return;
	}
	ll ok=0;
	if(ty1==ty3)
	{
		ok=1;
		gz(ota,otb,otc,a,b,c);
	}
	if(ty1==ty2)
	{
		ok=1;
		gz(otb,ota,otc,b,a,c);
	}
	if(ty2==ty3)
	{
		ok=1;
		gz(otc,ota,otb,c,a,b);
	}
	if(ok)
	{
		cout<<"YES\n";
		fo(i,1,a) cout<<ota[i];
		cout<<'\n';
		fo(i,1,b) cout<<otb[i];
		cout<<'\n';
		fo(i,1,c) cout<<otc[i];
		return;
	}
	cout<<"YES\n";
	fo(i,1,a)
	{
		ll coe=0;
		if((i/g)%ty1==0) coe^=1;
		if((i/g)%ty3==0) coe^=1;
		cout<<coe;
	}
	cout<<'\n';
	fo(i,1,b)
	{
		ll coe=0;
		if((i/g)%ty1==0) coe^=1;
		if((i/g)%ty2==0) coe^=1;
		cout<<coe;
	}
	cout<<'\n';
	fo(i,1,c)
	{
		ll coe=0;
		if((i/g)%ty2==0) coe^=1;
		if((i/g)%ty3==0) coe^=1;
		cout<<coe;
	}
}
bool M2;
int main()
{
	int Time=clock();
	look_memory;
//	_=gi();
	while(_--)
	{
		sol();
		printf("\n");
	}
	look_time;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2 3 6
2 3 5

output:

NO

result:

wrong answer Jury has the answer but participant has not (test case 1)