LINK ĐỀ
using namespace std; long long n,a[100000+7]; int main() { cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++) for(int j=1;j<=n/i;j++) if(ij<=n and a[ij]!=a[i]*a[j]) { cout<<"NO"; return 0; } cout<<"YES"; }
gấu trúc làm code dở quá
panda
Comments
include <bits/stdc++.h>
using namespace std; long long n,a[100000+7]; int main() {
cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++) for(int j=1;j<=n/i;j++) if(ij<=n and a[ij]!=a[i]*a[j]) { cout<<"NO"; return 0; } cout<<"YES"; }
gấu trúc làm code dở quá
panda