Advertisement
erfanul007

UVa 10193

Mar 12th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef unsigned long long int ull;
  5. typedef long long int ll;
  6. typedef vector<int> vi;
  7. typedef vector<ll> vll;
  8. typedef vector<vi> vvi;
  9. typedef pair<int,int > pii;
  10. typedef vector< pii > vpii;
  11. typedef set<int> sti;
  12.  
  13. #define sc scanf
  14. #define pf printf
  15. #define sci(n) scanf("%d",&n)
  16. #define scl(n) scanf("%lld",&n)
  17. #define scd(n) scanf("%lf",&n)
  18. #define scs(s) scanf("%s",s)
  19. #define pfi(n) printf("%d",n)
  20. #define pfl(n) printf("%lld",n)
  21. #define pff(n) cout<<n
  22. #define line printf("\n")
  23. #define spc printf(" ")
  24. #define loop(i,x,y) for(int i=int(x); i<=int(y); i++)
  25. #define rloop(i,y,x) for(int i=int(y); i>=int(x); i--)
  26. #define cspf(i) printf("Pair #%d: ", i)
  27. #define pb push_back
  28. #define mp make_pair
  29. #define ff first
  30. #define ss second
  31. #define all(v) v.begin(),v.end()
  32. #define rall(v) v.rbegin(),v.rend()
  33. #define read() freopen("input.txt", "r", stdin)
  34. #define write() freopen("output.txt", "w", stdout)
  35. /// Constants
  36. #define eps 1e-9
  37. #define inf (1e6)+9
  38. #define PI acos(-1.0) // 3.1415926535897932
  39. #define MAX 1000009
  40.  
  41. int sq2[35];
  42.  
  43. void sqr()
  44. {
  45. sq2[0]=1;
  46. for(int i=1;i<=30;i++){
  47. sq2[i]=sq2[i-1]*2;
  48. }
  49. }
  50.  
  51. int des(string s)
  52. {
  53. reverse(all(s));
  54. int ans=0;
  55. for(int i=0;i<s.size();i++){
  56. ans+=((s[i]-48)*sq2[i]);
  57. }
  58. return ans;
  59. }
  60.  
  61. int main()
  62. {
  63. sqr();
  64. int tc;
  65. cin>>tc;
  66. loop(cs,1,tc){
  67. string s,r;
  68. cin>>s>>r;
  69. cspf(cs);
  70. if(__gcd(des(s),des(r))==1)
  71. cout<<"Love is not all you need!"<<endl;
  72. else
  73. cout<<"All you need is love!"<<endl;
  74. }
  75. return 0;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement