Submission
# | When | Author | Problem | Language | CPU | Memory | |
---|---|---|---|---|---|---|---|
7787 | 2023-04-12 08:56:26 | Dr_KeK | Square Reconstruction | C++ 17 | 2114 ms | 3584 kb | Time Limit Exceeded - 4 |
Source Code
#include <bits/stdc++.h> using namespace std; #define ll long long int #define endl "\n" #define pb push_back #define ppb pop_back #define NOO printf("NO\n") #define YESS printf("YES\n") #define mp make_pair #define all(x) (x).begin(), (x).end() int read() { int s = 1, x = 0; if (c == '-') s = -1; } return s * x; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); ll t=read(); while(t--){ ll n=read(); bool flag=false; if(!flag){ for(ll i=1;i<=n;i++){ if(i*i<=n) if(n%i ==0 and n/i==i){ cout<<1<<endl; flag=true; break; } cout<<i<<endl; break; } } } } }