Loading...
Submission
Id When Author Problem Language CPU Memory Verdict
7793 2023-04-12 13:04:34 ashik5757 Square Reconstruction C++ 17 2118 ms 3564 kb Time Limit Exceeded - 4
Test Cases
CPU Memory Verdict
1 4 ms 3564 kb Accepted
2 5 ms 3448 kb Accepted
3 45 ms 3440 kb Accepted
4 2118 ms 656 kb Time Limit Exceeded
5 - - Skipped
6 - - Skipped
7 - - Skipped
8 - - Skipped
9 - - Skipped
10 - - Skipped
Source Code
program.cpp
Download
  1.  
  2. #include<bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. #define MAX_5 1e5
  7. #define MAX_9 1e9
  8. #define MIN_5 -1e5
  9. #define MIN_9 -1e9
  10.  
  11.  
  12. #define ll long long
  13. #define ld long double
  14. typedef vector<int> vi;
  15. typedef vector<string> vs;
  16. typedef vector<ll> vll;
  17. typedef vector<char> vc;
  18. typedef map<int,int> mii;
  19. typedef map<string,int> msi;
  20. typedef map<char,int> mci;
  21. typedef set<int> set_i;
  22. typedef set<string> set_s;
  23. typedef set<char> set_c;
  24.  
  25. typedef priority_queue<int> pqi;
  26. typedef priority_queue<char> pqc;
  27.  
  28.  
  29.  
  30. #define YES cout<<"YES"<<endl
  31. #define NO cout<<"NO"<<endl
  32. #define Yes cout<<"Yes"<<endl
  33. #define No cout<<"No"<<endl
  34. #define yes cout<<"yes"<<endl
  35. #define no cout<<"no"<<endl
  36. #define BR cout << endl
  37.  
  38. #define in_i ({int tmp; cin>>tmp; tmp;})
  39. #define in_ll ({ll tmp; cin>>tmp; tmp;})
  40. #define in_s ({string tmp; cin>>tmp; tmp;})
  41. #define in_c ({char tmp; cin>>tmp; tmp;})
  42. #define in_arr(arr,n) for(ll i=0;i<n;i++)cin>>arr[i];
  43. #define in_arr2(arr,r,c) for(ll i=0;i<r;i++)for(ll j=0;j<c;j++)cin>>arr[i][j];
  44. #define in_vi(vec,n) for(ll i=0;i<n;i++){int tmp;cin>>tmp;vec.push_back(tmp);};
  45. #define in_vs(vec,n) for(ll i=0;i<n;i++){string tmp;cin>>tmp;vec.push_back(tmp);};
  46. #define in_set_i(set,n) for(ll i=0;i<n;i++){int tmp;cin>>tmp;set.insert(tmp);};
  47. #define in_set_s(set,n) for(ll i=0;i<n;i++){string tmp;cin>>tmp;set.insert(tmp);};
  48. #define in_set_c(set,n) for(ll i=0;i<n;i++){char tmp;cin>>tmp;set.insert(tmp);};
  49.  
  50. #define toLower_str(s) transform(s.begin(),s.end(),s.begin(),::tolower);
  51. #define toUpper_str(s) transform(s.begin(),s.end(),s.begin(),::toupper);
  52. #define sort_i(arr) sort(arr,arr+n);
  53. #define sort_s(str) sort(str.begin(),str.end());
  54. #define print_arr(arr,n) for(ll i=0;i<n;i++)cout<<arr[i]<<" ";cout<<endl;
  55. #define print_arr2(arr,r,c) for(ll i=0;i<r;i++){for(ll j=0;j<c;j++){cout<<arr[i][j]<<" ";}cout<<endl;}
  56. #define it_set_print(st) for(auto it=st.begin();it!=st.end();it++)cout<<*it<< " ";cout<<endl;
  57. #define it_map_print(m) for(auto it=m.begin();it!=m.end();it++)cout<<it.first() << " " << it->second()<<endl;
  58. #define print_vec(v,n) for(ll i=0;i<n;i++)cout<<v[i]<<" ";cout<<endl;
  59. #define prln1(p) cout<<p<<endl
  60. #define prln2(p,q) cout<<p<<" "<<q<<endl
  61. #define prln3(p,q,r) cout<<p<<" "<<q<<" "<<r<<endl
  62.  
  63.  
  64.  
  65.  
  66. void solve() {
  67.  
  68. ll n;
  69. cin >>n;
  70.  
  71. for(ll i=1; i<=n; i++) {
  72. if(n%i==0){
  73. ll d = i*n;
  74. ll s = sqrt(d);
  75. if(d==(s*s)){
  76. prln1(i);
  77. return;
  78. }
  79. }
  80. }
  81. }
  82.  
  83.  
  84. int main() {
  85.  
  86. ll t = in_i;
  87. while(t--)
  88. solve();
  89.  
  90.  
  91. system("pause");
  92.  
  93. return 0;
  94.  
  95. }
  96.