fork download
  1. /*
  2.   ================================
  3.   Author : Adnaan 'Zohran' Ahmed
  4.   Handle: adnaan1703
  5.   Heritage Institute of Technology
  6.   ================================
  7. */
  8.  
  9. #include <bits/stdc++.h>
  10.  
  11. #define MOD 1000000007
  12. #define PI 3.1415926535897932384626433832795
  13. #define INF INT_MAX
  14. #define X first
  15. #define Y second
  16. #define pb push_back
  17.  
  18. using namespace std;
  19.  
  20. typedef vector<int> vint;
  21. typedef vector<long long int> vlint;
  22. typedef vector<vector<int> > vvint;
  23. typedef vector<vector<long long int> > vvlint;
  24. typedef long long int lint;
  25.  
  26. void solve(void);
  27.  
  28. int main(void)
  29. {
  30. ios::sync_with_stdio(false);
  31. cin.tie(NULL);
  32.  
  33. /*
  34.   #ifndef ONLINE_JUDGE
  35.   freopen("in.txt", "r", stdin);
  36.   #endif
  37.   */
  38.  
  39. int t = 1;
  40. // cin>>t;
  41. while(t--)
  42. solve();
  43. return 0;
  44. }
  45.  
  46. void solve(void) {
  47. int n,m;
  48. cin>>n>>m;
  49.  
  50. lint a = 0, b = 0;
  51. while(n!=0) {
  52. int tmp;
  53. cin>>tmp;
  54. a += (tmp * (pow(m,n-1)));
  55. n--;
  56. }
  57.  
  58. cin>>n>>m;
  59. while(n!=0) {
  60. int tmp;
  61. cin>>tmp;
  62. b += (tmp * (pow(m,n-1)));
  63. n--;
  64. }
  65. if(a == b) {
  66. cout<<'='<<endl;
  67. }
  68. else if(a>b)
  69. cout<<'>'<<endl;
  70. else
  71. cout<<'<'<<endl;
  72. }
Success #stdin #stdout 0s 3456KB
stdin
9 39
10 20 16 36 30 29 28 9 8
9 38
12 36 10 22 6 3 19 12 34
stdout
=