fork download
  1. //Utkarsh.25dec
  2. #include <bits/stdc++.h>
  3. #include <chrono>
  4. #include <random>
  5. #define ll long long int
  6. #define ull unsigned long long int
  7. #define pb push_back
  8. #define mp make_pair
  9. #define mod 1000000007
  10. #define rep(i,n) for(ll i=0;i<n;i++)
  11. #define loop(i,a,b) for(ll i=a;i<=b;i++)
  12. #define vi vector <int>
  13. #define vs vector <string>
  14. #define vc vector <char>
  15. #define vl vector <ll>
  16. #define all(c) (c).begin(),(c).end()
  17. #define max3(a,b,c) max(max(a,b),c)
  18. #define min3(a,b,c) min(min(a,b),c)
  19. #define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
  20. using namespace std;
  21. #include <ext/pb_ds/assoc_container.hpp>
  22. #include <ext/pb_ds/tree_policy.hpp>
  23. using namespace __gnu_pbds;
  24. #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
  25. // ordered_set s ; s.order_of_key(val) no. of elements strictly less than val
  26. // s.find_by_order(i) itertor to ith element (0 indexed)
  27. typedef vector<vector<ll>> matrix;
  28. ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
  29. ll modInverse(ll a){return power(a,mod-2);}
  30. const int N=500023;
  31. bool vis[N];
  32. vector <int> adj[N];
  33. ll q=0;
  34. int mark[2100][2100];
  35. int query(int i,int j)
  36. {
  37. q++;
  38. assert(q<4265);
  39. cout<<'?'<<' '<<i<<' '<<j<<endl;
  40. ll res;
  41. cin>>res;
  42. assert(res!=-1);
  43. return res;
  44. }
  45. void solve()
  46. {
  47. srand(time(0));
  48. for (int it = 0; it < 100; it++) {
  49. ll n = 1 << 11;
  50. int myfirst=0;
  51. int num = 0;
  52. while(true)
  53. {
  54. num++;
  55. int res= (rand() % n) | (rand() % n);
  56. int set=(__builtin_popcount(res));
  57. if(set<=5)
  58. {
  59. break;
  60. }
  61. }
  62. cout << num << "\n";
  63. }
  64. }
  65. int main()
  66. {
  67. ios_base::sync_with_stdio(false);
  68. cin.tie(NULL);
  69. int T=1;
  70. // cin>>T;
  71. int t=0;
  72. while(t++<T)
  73. {
  74. //cout<<"Case #"<<t<<":"<<' ';
  75. solve();
  76. //cout<<'\n';
  77. }
  78. cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
  79. }
  80.  
Success #stdin #stdout #stderr 0s 15468KB
stdin
Standard input is empty
stdout
44
161
20
39
37
24
9
47
53
12
17
11
2
26
44
26
17
20
57
10
4
11
32
71
13
85
57
17
33
12
13
37
12
23
13
14
11
15
10
48
15
24
27
2
22
6
59
18
134
66
42
6
14
46
11
120
27
35
3
102
38
1
11
8
15
6
39
6
68
84
10
67
1
5
5
78
66
14
27
31
3
6
6
2
3
32
89
94
48
27
13
23
13
18
49
16
36
12
14
16
stderr
Time : 6.108ms