Advertisement
momo2345

FalseOrdering

May 5th, 2021
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define suni ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
  4. #define endl "\n"
  5. #define ll long long
  6. #define pb push_back
  7.  
  8.  
  9. int nod[1002];
  10.  
  11.  
  12. int main()
  13. {
  14. for(int i=1;i<=1000;i++){
  15. for(int j=i;j<=1000;j+=i) nod[j]++;
  16. }
  17.  
  18. vector<pair<int, int>> v;
  19.  
  20. for ( int i = 1; i <= 1000; i++ ) {
  21. v.pb ( { nod[i], -i } );
  22. }
  23.  
  24. sort ( v.begin(), v.end() );
  25.  
  26. int t;
  27. cin >> t;
  28. for ( int i = 1; i <= t; i++ ) {
  29. int n;
  30. cin >> n;
  31.  
  32. cout << "Case " << i << ": " << v[n-1].second * -1 << endl;
  33. }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement