QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#829844#9768. A + B = C ProblemKevin5307WA 0ms3576kbC++231.2kb2024-12-24 14:09:272024-12-24 14:09:28

Judging History

This is the latest submission verdict.

  • [2024-12-24 14:09:28]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3576kb
  • [2024-12-24 14:09:27]
  • Submitted

answer

//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t;
	cin>>t;
	while(t--)
	{
		ll A,B,C;
		cin>>A>>B>>C;
		ll g=__gcd(A,B);
		ll M=A*B/g;
		if(M%C)
			cout<<"No\n";
		else
		{
			ll D=M/C;
			if(A%D||B%D||D>1)
				cout<<"No\n";
			else
			{
				cout<<"Yes\n";
				if(D==1)
				{
					for(int i=0;i<A;i++)
						cout<<(i==0);
					cout<<'\n';
					for(int i=0;i<B;i++)
						cout<<(i==0);
					cout<<'\n';
				}
			}
		}
	}
	return 0;
}

詳細信息

Test #1:

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

input:

2
2 3 6
2 3 5

output:

Yes
10
100
No

result:

wrong answer Token "No" doesn't correspond to pattern "[01]{1,1000000}" (test case 1)