fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define MP make_pair
  5. #define PB push_back
  6. #define FOR(init,num,inc) for(int i=init; i<num;i=i+inc)
  7. #define N "\n"
  8. #define VII vector<int> :: iterator
  9. #define VILLI vector<long long int> :: iterator
  10. #define my_input(n) for(int i=0,a;i<n;i++) {cin>>a; v.PB(a);}
  11. #define sz size()
  12. #define fst first
  13. #define snd second
  14. #define FV 100005
  15. #define SX 1000005
  16. #define scint(a) scanf("%d", &a)
  17. //freopen("input.txt", "r", stdin);
  18. //freopen("output.txt", "w", stdout);
  19.  
  20. typedef int I;
  21. typedef long long int llint;
  22. typedef vector<int> VI;
  23. typedef vector<long long int > VLLI;
  24. typedef vector<string> VS;
  25. typedef set<int> SI;
  26. typedef set<long long int> SLLI;
  27. typedef set<string> SS;
  28.  
  29. double rnd(double xx)
  30. {
  31.  
  32. stringstream ss;
  33. ss << fixed;
  34. ss.precision(2); // set # places after decimal
  35. ss << xx;
  36. double hi;
  37. ss>>hi;
  38. return hi;
  39. }
  40.  
  41. int main()
  42. {
  43. double p,q;
  44. cin>>p>>q;
  45. p=p;
  46. q=q;
  47. for(llint i=1; i<=1e12; i++ )
  48. {
  49. double x=((double)i*p)/100.0;
  50. x=(llint)x+1;
  51.  
  52. double xx=(x/(double)i)*100.0;
  53. xx=rnd(xx);
  54. if (xx<q)
  55. {
  56. cout<<i;
  57. return 0;
  58. }
  59. }
  60.  
  61. }
Time limit exceeded #stdin #stdout 5s 4392KB
stdin
Standard input is empty
stdout
Standard output is empty