fork(2) download
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int main(){
  5. int a,b,c,d=0;
  6. unsigned long long sum1=0,sum2=0;
  7. cin>> a >> b;
  8. for(int i=1;i<=a;i++){
  9. cin >> c;
  10. sum1+=(c *pow(b,a-i));
  11. }
  12. cin>> a >> b;
  13. for(int i=1;i<=a;i++){
  14. cin >> c;
  15. sum2+=(c *pow(b,a-i));
  16. }
  17. if(sum1>sum2) cout <<">"<<endl;
  18. if(sum1<sum2) cout <<"<"<<endl;
  19. if(sum1==sum2) cout <<"="<<endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3416KB
stdin
9 39

10 20 16 36 30 29 28 9 8

9 38

12 36 10 22 6 3 19 12 34
stdout
=