Advertisement
Anik_Akash

AtCoder Beginner 181 C No

Nov 1st, 2020
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. //thanks God For Every Thing!
  2. //contest link:
  3.  
  4. #include<bits/stdc++.h>
  5. #include <iostream>
  6. #include <fstream>
  7. #include <string>
  8. #include <algorithm>
  9. #include <cmath>
  10. #include <cstdio>
  11.  
  12. /*
  13.  
  14.            
  15.  
  16. */
  17. #define pi           acose(-1)
  18. #define flush        cin.ignore(numeric_limits<streamsize>::max(),'\n');
  19. #define fasterio     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  20. #define NL           printf("\n")
  21. #define fin          freopen("int.txt","r",stdin);
  22. #define fout         freopen("out.txt","w",stdout);
  23.  
  24.  
  25. using namespace std;
  26.  
  27. typedef long long int ll;
  28. typedef double dl;
  29.  
  30. // ---------------------- slove---------------------------//
  31.  
  32.  
  33.  
  34. int main()
  35. {
  36.    
  37.     //fin
  38.     //fout
  39.     int n;
  40.     scanf("%d",&n);
  41.     int a, b;
  42.     int sum=0, s1=0, s2=0;
  43.     while(n--)
  44.     {
  45.       scanf("%d %d",&a, &b);
  46.        
  47.       s1=s1+a;
  48.       s2=s2+b;
  49.     }
  50.     if(s1<=s2){
  51.       printf("Yes\n");
  52.     }
  53.     else
  54.     {
  55.       printf("No\n");
  56.     }
  57.    
  58.    
  59.    
  60.    
  61. }
  62.  
  63. //author anikaksh;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement