QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#378464#3696. Easy Mathucup-team1251AC ✓7ms5784kbC++17894b2024-04-06 13:06:292024-04-06 13:06:30

Judging History

This is the latest submission verdict.

  • [2024-04-06 13:06:30]
  • Judged
  • Verdict: AC
  • Time: 7ms
  • Memory: 5784kb
  • [2024-04-06 13:06:29]
  • Submitted

answer

#include<bits/stdc++.h>
#define lowbit(x) (x&(-x))
#define rep(x,a,b) for(int x=a;x<=b;x++)
#define pre(x,a,b) for(int x=a;x>=b;x--)
#define endl "\n"
#define pb push_back
#define ll long long
#define pii pair<ll,ll>
#define psi pair<string, ll>
#define de cout<<1;
#define mem(a,x) memset(a,x,sizeof a)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
const int mod1=998244353;
const int mod2=1e9+7;
const int N = 1e6 + 60;
int number;
int n, m;
int a[N], b[N];
void solve()
{
    while(cin >> n)
    {
        rep(i, 1, n) cin >> a[i];
        int f = 0;
        rep(i, 1, n)
        {
            int w = sqrt(a[i]);
            if((w * w) != a[i]) f = 1;
        }
        if(f) cout << "No" << endl;
        else cout << "Yes" << endl;   
    }
}
int main()
{
	IOS;
	int _;
	//cin >> _;
	_ = 1;
	while(_ -- )
	{
		number++;
		solve();;
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 5784kb

input:

2
1 4

output:

Yes

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 1ms
memory: 5688kb

input:

2
2 3

output:

No

result:

ok answer is NO

Test #3:

score: 0
Accepted
time: 0ms
memory: 5640kb

input:

1
0

output:

Yes

result:

ok answer is YES

Test #4:

score: 0
Accepted
time: 1ms
memory: 5696kb

input:

1
1000000000

output:

No

result:

ok answer is NO

Test #5:

score: 0
Accepted
time: 6ms
memory: 5760kb

input:

100000
999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999950884 999...

output:

Yes

result:

ok answer is YES

Test #6:

score: 0
Accepted
time: 6ms
memory: 5708kb

input:

100000
953734031 567281742 228826991 915510535 679746752 462574882 237106022 130513150 654148937 144280910 927010670 368419540 683160989 285892894 562014208 438775186 515439164 4360865 335463621 555126524 890697785 459347151 252168902 416691408 436602696 537683168 676724604 980202851 192058561 43835...

output:

No

result:

ok answer is NO

Test #7:

score: 0
Accepted
time: 7ms
memory: 5716kb

input:

100000
386021210 197755551 541311557 940853877 502216633 599806957 165458303 978750936 898018983 945825235 336395997 666255477 91511459 534686667 850580155 326363073 423092927 872130774 126966089 342745480 75234927 361313703 831946599 467848578 102815406 835992038 279847016 427787048 208236959 92963...

output:

No

result:

ok answer is NO

Test #8:

score: 0
Accepted
time: 7ms
memory: 5764kb

input:

100000
523341097 196825579 263861538 629760729 398315443 515700669 93810584 532021428 141889028 747369558 409344835 259058704 573490858 152076659 139146101 877514473 552085053 149966098 623501266 466800926 333400998 599716744 821789711 813973040 769028117 134300906 956598358 833902048 519382648 4209...

output:

No

result:

ok answer is NO

Test #9:

score: 0
Accepted
time: 7ms
memory: 5668kb

input:

100000
14341369 820879801 263867536 386436964 860600896 330294276 920697649 794112400 522396736 183142089 928481841 197824225 410265025 221057424 3594816 653415844 762532996 126337600 131560900 44528929 661158369 115605504 444113476 124456336 279825984 107267449 208918116 269156836 665382025 9954025...

output:

Yes

result:

ok answer is YES

Test #10:

score: 0
Accepted
time: 7ms
memory: 5768kb

input:

100000
283787716 8714304 172239376 730296576 203404644 477204025 147938569 746546329 897122304 457446544 10471696 893232769 557573769 777294400 552673081 54228496 349465636 66814276 302168689 896283844 840478081 153586449 108347281 5688225 111894084 23843689 590538601 86918329 482109849 50708641 898...

output:

Yes

result:

ok answer is YES

Test #11:

score: 0
Accepted
time: 3ms
memory: 5664kb

input:

100000
220730449 497423809 809004249 117649 13564489 268337161 774787225 565964100 61355889 243984400 538147204 44970436 878114689 3767481 22118209 25593481 165585424 521939716 345402225 717436225 182331009 96000804 14538969 53824 316875601 19600 196840900 684554896 656025769 12830724 905769216 8374...

output:

Yes

result:

ok answer is YES

Test #12:

score: 0
Accepted
time: 3ms
memory: 5672kb

input:

100000
322202500 100620961 147379600 107474689 12271009 719473329 1557504 654131776 144432324 230159241 133102369 96628900 637764516 173712400 306915361 61371556 798966756 125731369 400920529 175085824 878411044 51883209 553284484 594579456 626200576 36397089 918150601 271030369 573698304 694217104 ...

output:

Yes

result:

ok answer is YES

Test #13:

score: 0
Accepted
time: 6ms
memory: 5648kb

input:

100000
254753521 360316324 767123809 234365481 590976100 257345764 134606404 735711376 720331921 88416409 977250121 167832025 978063076 355850496 920212225 261307225 503553600 973627209 450500625 22667121 369792900 21242881 140327716 286049569 121528576 43678881 401200900 783272169 496844100 1540081...

output:

Yes

result:

ok answer is YES

Test #14:

score: 0
Accepted
time: 7ms
memory: 5688kb

input:

100000
74891716 1937664 129800449 223024356 188540361 30217009 743871076 556582464 22268961 75986089 384160000 457831609 723394816 906190609 283787716 358723600 38638656 382984900 513656896 779079744 14002564 50339025 27562500 217857600 332953009 3481956 21883684 557148816 673194916 891500164 412171...

output:

Yes

result:

ok answer is YES

Test #15:

score: 0
Accepted
time: 6ms
memory: 5708kb

input:

100000
44435556 245298244 166464 622851849 8491396 441840400 471969 643992129 79299025 68359824 6869641 876278404 1671849 17338896 879834244 276723225 152100 6859161 352876225 613008081 395095129 20250000 622951681 53129521 947900944 5958481 677560900 77827684 9369721 441042001 228191236 347859801 3...

output:

Yes

result:

ok answer is YES