text
stringlengths
49
983k
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; long long sum1 = 0; long long sum2 = 0; for (int i = 0; i < n; i++) { long long x; cin >> x; sum1 += x; } for (int i = 0; i < n; i++) { long long x; cin >> x; sum2 += x; } cout << ((sum1 >= sum2) ? "Yes" : "No") << endl; return; } int main() { int t = 1; for (int i = 1; i <= t; i++) { solve(); } return 0; }
#include <bits/stdc++.h> using namespace std; bool ch[100000]; stack<long long> s; vector<long long> a[100000]; map<pair<long long, long long>, long long> fr; bool isPrime(int n) { if (n <= 1) return false; if (n <= 3) return true; if (n % 2 == 0 || n % 3 == 0) return false; for (int i = 5; i * i <= n; i = i + 6) { if (n % i == 0 || n % (i + 2) == 0) return false; } return true; } void swap(char a, char b) { char t; t = a; a = b; b = t; } int main() { int n, i, s = 0, p = 0; cin >> n; int x[n], y[n]; for (i = 0; i < n; i++) { cin >> x[i]; s += x[i]; } for (i = 0; i < n; i++) { cin >> y[i]; p += y[i]; } if (s >= p) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; inline long long nxt() { long long _x = 0, _tmp = 1; char _tc = getchar(); while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar(); if (_tc == '-') _tc = getchar(), _tmp = -1; while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar(); return _x * _tmp; } int main() { ::ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int sum[2]; sum[1] = 0, sum[0] = 0; int a[55], b[55]; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) cin >> b[i]; for (int i = 0; i < n; ++i) { sum[1] += b[i]; sum[0] += a[i]; } if (sum[0] < sum[1]) { cout << "No"; } else cout << "Yes"; }
#include <bits/stdc++.h> using namespace std; void comparearr(int A[], int B[], int n) { int sumA = 0, sumB = 0; for (int i = 0; i < n; i++) sumA = sumA + A[i]; for (int i = 0; i < n; i++) sumB = sumB + B[i]; if (sumA >= sumB) cout << "Yes"; else cout << "No"; } int main() { int n; cin >> n; int A[50], B[50]; for (int i = 0; i < n; i++) cin >> A[i]; for (int i = 0; i < n; i++) cin >> B[i]; comparearr(A, B, n); }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int sum1 = 0, sum2 = 0; for (int i = 1; i <= n; i++) { int x; cin >> x; sum1 += x; } for (int i = 1; i <= n; i++) { int x; cin >> x; sum2 += x; } cout << (sum2 <= sum1 ? "Yes" : "No"); }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x[n], y[n]; int s1 = 0; int s2 = 0; for (int i = 0; i < n; i++) { cin >> x[i]; s1 += x[i]; } for (int i = 0; i < n; i++) { cin >> y[i]; s2 += y[i]; } if (s1 >= s2) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> const long long mxn = 1e5 + 7; using namespace std; int main() { long long n, x[mxn], y[mxn]; cin >> n; int sum1 = 0, sum2 = 0; for (int i = 1; i <= n; i++) { cin >> x[i]; sum1 += x[i]; } for (int i = 1; i <= n; i++) { cin >> y[i]; sum2 += y[i]; } if (sum2 > sum1) { cout << "No"; } else { cout << "Yes"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int Sumx = 0; int Sumy = 0; for (int i = 0; i < n; i++) { int x; scanf("%d", &x); Sumx += x; } for (int i = 0; i < n; i++) { int y; scanf("%d", &y); Sumy += y; } if (Sumx >= Sumy) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); int ar[1001], ar2[1001], sum = 0, sum2 = 0; for (int i = 0; i < n; i++) { scanf("%d", &ar[i]); sum += ar[i]; } for (int i = 0; i < n; i++) { scanf("%d", &ar2[i]); sum2 += ar2[i]; } if (sum == sum2) { printf("Yes\n"); return 0; } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (ar[i] == ar[j] && sum > sum2) { printf("Yes\n"); return 0; } } } printf("No\n"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, i, a, b, k; cin >> n; for (i = a = 0; i < n; i++, a += k) cin >> k; for (i = b = 0; i < n; i++, b += k) cin >> k; (a >= b) ? cout << "YES" : cout << "NO"; return 0; }
#include <bits/stdc++.h> using namespace std; const int MAXN = 100100; int n; int main() { ios::sync_with_stdio(0); while (cin >> n) { long long a, s1 = 0, s2 = 0; for (int i = (0); i < (n); i++) { cin >> a; s1 += a; } for (int i = (0); i < (n); i++) { cin >> a; s2 += a; } cout << (s1 >= s2 ? "Yes" : "No") << endl; } return 0; }
#include <bits/stdc++.h> const int M = 1005; using namespace std; inline int read() { char c = getchar(); int x = 0, w = 1; while (c > '9' || c < '0') { if (c == '-') w = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); } return x * w; } int n, fsum, ssum; int x[M], y[M]; int main() { n = read(); for (int i = 1; i <= n; i++) x[i] = read(), fsum += x[i]; for (int i = 1; i <= n; i++) { y[i] = read(), ssum += y[i]; } if (fsum >= ssum) cout << "Yes\n"; else cout << "No\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int n; int t[60], v[60]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &t[i]); for (int i = 1; i <= n; i++) scanf("%d", &v[i]); int nrOfStonesTakenAway = 0; for (int i = 1; i <= n; i++) { if (t[i] > v[i]) nrOfStonesTakenAway += (t[i] - v[i]); } for (int i = 1; i <= n; i++) if (t[i] < v[i]) { nrOfStonesTakenAway -= (v[i] - t[i]); } if (nrOfStonesTakenAway < 0) puts("No"); else puts("Yes"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, a, a1 = 0, b1 = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> a; a1 += a; } for (int i = 0; i < n; i++) { cin >> a; b1 += a; } if (b1 <= a1) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, sum[2] = {0}; cin >> n; for (int i = 0; i < 2; i++) for (int j = 0; j < n; j++) { int in; cin >> in; sum[i] += in; } if (sum[0] >= sum[1]) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> int main() { int suma = 0, sumb = 0; int a, b; int n; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &a); suma += a; } for (int i = 1; i <= n; i++) { scanf("%d", &b); sumb += b; } if (suma >= sumb) puts("Yes"); else puts("No"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, sum = 0, x; cin >> n; bool flg = 0; for (int i = 0; i < 2; i++) { for (int j = 0; j < n; j++) { cin >> x; if (flg == 0) { sum = sum + x; } else { sum = sum - x; } } flg = 1; } if (sum < 0) { cout << "No"; } else { cout << "Yes"; } return 0; }
#include <bits/stdc++.h> using namespace std; const int maxn = 55; int n; int xi[maxn], yi[maxn]; int ans1 = 0, ans2 = 0; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &xi[i]), ans1 += xi[i]; for (int i = 1; i <= n; i++) scanf("%d", &yi[i]), ans2 += yi[i]; if (ans1 < ans2) printf("No\n"); else printf("Yes\n"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, x, sum1 = 0, sum2 = 0; cin >> n; for (int i = 0; i < n; i++) cin >> x, sum1 += x; for (int i = 0; i < n; i++) cin >> x, sum2 += x; if (sum2 > sum1) cout << "No" << endl; else cout << "Yes" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, i, x, sum_x = 0, y, sum_y = 0; cin >> n; for (i = 1; i <= n; i++) { cin >> x; sum_x += x; } for (i = 1; i <= n; i++) { cin >> y; sum_y += y; } if (sum_y > sum_x) cout << "No"; else cout << "Yes"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t, sum1 = 0, sum2 = 0; cin >> t; for (int i = 0; i < t; i++) { int a; cin >> a; sum1 = sum1 + a; } for (int i = 0; i < t; i++) { int a; cin >> a; sum2 = sum2 + a; } if (sum2 <= sum1) { cout << "Yes" << endl; } else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int s1, s2, n, a, b; int main() { cin >> n; for (int i = 1; i <= n; ++i, s1 += a) cin >> a; for (int i = 1; i <= n; ++i, s2 += b) cin >> b; if (s2 > s1) cout << "No"; else cout << "Yes"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int sum1 = 0; int sum2 = 0; int n; cin >> n; int a[n], b[n]; for (int i = 0; i < n; i++) { cin >> a[i]; sum1 += a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; sum2 += b[i]; } if (sum1 >= sum2) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, sum1 = 0, sum2 = 0, tmp; cin >> n; for (int i = 0; i < n; i++) { cin >> tmp; sum1 += tmp; } for (int i = 0; i < n; i++) { cin >> tmp; sum2 += tmp; } if (sum1 >= sum2) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> using namespace std; int x[55], y[55], cnt1[1005], cnt2[1005]; int main() { int n, i, ans, sum1, sum2; bool flag = false; ans = sum1 = sum2 = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &x[i]); cnt1[x[i]]++; sum1 += x[i]; } for (i = 0; i < n; i++) { scanf("%d", &y[i]); cnt2[y[i]]++; sum2 += y[i]; } if (sum1 >= sum2) { printf("Yes\n"); return 0; } printf("No\n"); return 0; }
#include <bits/stdc++.h> using namespace std; long long MOD = 1000000007; void FASTIO() { ios_base::sync_with_stdio(false); cin.tie(0); } long long LongestCommonSubsequnce(string a, string b, long long i, long long j) { if (i == a.length() || j == b.length()) { return 0; } else if (a[i] == b[j]) { return 1 + LongestCommonSubsequnce(a, b, i + 1, j + 1); } else { return max(LongestCommonSubsequnce(a, b, i + 1, j), LongestCommonSubsequnce(a, b, i, j + 1)); } } long long gcd(long long a, long long b) { if (a == 0) return b; return gcd(b % a, a); } long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); } long long sumofdigits(long long n) { long long out = 0; while (n) { out += (n % 10); n /= 10; } return out; } bool isPrime(long long n) { if (n <= 1) return false; if (n <= 3) return true; if (n % 2 == 0 || n % 3 == 0) return false; for (long long i = 5; i * i <= n; i = i + 6) if (n % i == 0 || n % (i + 2) == 0) return false; return true; } long long modpow(long long x, long long y, long long p) { long long res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res * x) % p; y = y >> 1; x = (x * x) % p; } return res; } long long EuclidGCD(long long a, long long b, long long *x, long long *y) { if (a == 0) { *x = 0, *y = 1; return b; } long long x1, y1; long long gcd = EuclidGCD(b % a, a, &x1, &y1); *x = y1 - (b / a) * x1; *y = x1; return gcd; } long long modInverse(long long a, long long m) { long long x, y; long long res; long long g = EuclidGCD(a, m, &x, &y); if (g != 1) res = -1; else res = (x % m + m) % m; return res; } long long moddiv(long long a, long long b, long long c) { long long res = ((modpow(a, b, MOD)) * (modInverse(c, MOD))) % MOD; return res; } bool isPerfectSquare(long long x) { long long s = sqrt(x); return (s * s == x); } bool isFibonacci(long long n) { return isPerfectSquare(5 * n * n + 4) || isPerfectSquare(5 * n * n - 4); } double my_sqrt(double n, double s = 0, double e = -1) { if (e == -1) e = n; double mid = (s + e) / 2; double temp = mid * mid; if (abs(n - temp) < 0.00001) return mid; if (temp > n) return my_sqrt(n, s, mid); return my_sqrt(n, mid, e); } long long power(long long a, long long b) { if (b == 0) return 1; if (b & 1) return a * power(a, b - 1); long long res = power(a, b / 2); return res * res; } void buildTree(long long a[], long long tree[], long long s, long long e, long long ind) { if (s == e) { tree[ind] = a[s]; return; } long long m = (s + e) / 2; buildTree(a, tree, s, m, 2 * ind); buildTree(a, tree, m + 1, e, 2 * ind + 1); tree[ind] = max(tree[2 * ind], tree[2 * ind + 1]); return; } long long queryTree(long long tree[], long long n_s, long long n_e, long long q_s, long long q_e, long long ind) { if (n_s >= q_s && n_e <= q_e) { return tree[ind]; } if (q_e < n_s || q_s > n_e) { return LONG_MIN; } long long m = (n_s + n_e) / 2; long long pos1 = 0, pos2 = 0; pos1 = queryTree(tree, n_s, m, q_s, q_e, 2 * ind); pos2 = queryTree(tree, m + 1, n_e, q_s, q_e, 2 * ind + 1); return max(pos1, pos2); } void updateNode(long long tree[], long long n_s, long long n_e, long long i, long long change, long long ind) { if (i < n_s || i > n_e) { return; } if (n_s == n_e) { tree[ind] = change; return; } long long m = (n_s + n_e) / 2; updateNode(tree, n_s, m, i, change, 2 * ind); updateNode(tree, m + 1, n_e, i, change, 2 * ind + 1); tree[ind] = max(tree[2 * ind], tree[2 * ind + 1]); return; } bool isPalin(string a) { long long s = 0; long long e = a.length() - 1; while (s <= e) { if (a[s] != a[e]) { return false; } s++; e--; } return true; } bool solve(long long t) { if (t == 0) return false; return true; } int32_t main() { FASTIO(); long long n; cin >> n; long long sum1 = 0, sum2 = 0; for (long long i = 0; i < n; i++) { long long temp; cin >> temp; sum1 += (temp); } for (long long i = 0; i < n; i++) { long long temp; cin >> temp; sum2 += (temp); } if (sum2 > sum1) { cout << "No" << "\n"; } else { cout << "Yes" << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; long long Arr[1000005]; void set22(long long n) { for (long long i = 1; i < n + 1; i++) Arr[i] = i; } long long root(long long i) { while (Arr[i] != i) { Arr[i] = Arr[Arr[i]]; i = Arr[i]; } return i; } void union1(long long A, long long B) { long long root_A = root(A); long long root_B = root(B); Arr[root_A] = root_B; } bool find(long long A, long long B) { if (root(A) == root(B)) return true; else return false; } int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); cout << fixed; cout << setprecision(12); long long n; cin >> n; long long a[n], b[n]; bool flag = true; long long suma = 0, sumb = 0; for (long long i = 0; i < n; i++) { cin >> a[i]; suma += a[i]; } for (long long i = 0; i < n; i++) { cin >> b[i]; sumb += b[i]; } if (suma < sumb) flag = false; if (flag) cout << "YES"; else cout << "NO"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, i, j, k, s = 0; cin >> n; for (i = 0; i < n; i++) { cin >> k; s += k; } for (i = 0; i < n; i++) { cin >> k; s -= k; } if (s >= 0) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
#include <bits/stdc++.h> int main() { int n; scanf("%d", &n); int sB = 0; for (int i = 0; i < n; i++) { int x; scanf("%d", &x); sB += x; } int sA = 0; for (int i = 0; i < n; i++) { int x; scanf("%d", &x); sA += x; } if (sB >= sA) { printf("Yes"); } else { printf("No"); } return 0; }
#include <bits/stdc++.h> int n, m = 0, k = 0, l, a = 0, b = 0, c, x, y, tag1[1010], tag2[1010], tag[10000]; using namespace std; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> x, a += x; for (int i = 1; i <= n; i++) cin >> y, b += y; if (b <= a) { cout << "Yes" << endl; return 0; } cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x, stone = 0; for (int i = 0; i < n; ++i) cin >> x, stone += x; for (int i = 0; i < n; ++i) cin >> x, stone -= x; cout << ((stone >= 0) ? "YES" : "NO"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n, a, s1 = 0, s2 = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> a; s1 += a; } for (int i = 0; i < n; i++) { cin >> a; s2 += a; } cout << (s1 >= s2 ? "Yes" : "No"); }
#include <bits/stdc++.h> using namespace std; int main() { int n, s1 = 0, s2 = 0; cin >> n; for (int i = 0; i < n; i++) { int t; cin >> t; s1 += t; } for (int i = 0; i < n; i++) { int t; cin >> t; s2 += t; } if (s1 >= s2) cout << "YES"; else cout << "NO"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long n, f = 0; cin >> n; long long ar[n], br[n], s1 = 0, s2 = 0, s = 0; for (long long i = 0; i < n; i++) { cin >> ar[i]; s1 += ar[i]; } for (long long i = 0; i < n; i++) { cin >> br[i]; s2 += br[i]; } for (long long i = 0; i < n; i++) { s += ar[i] - br[i]; } if (s2 > s1) { cout << "No"; } else if (s < 0) cout << "No"; else { cout << "Yes"; } }
#include <bits/stdc++.h> using namespace std; int solve() { int n, x, s = 0, s1 = 0; cin >> n; vector<int> a, b; for (int i = 0; i < n; i++) { cin >> x; a.push_back(x); s += x; } for (int i = 0; i < n; i++) { cin >> x; b.push_back(x); s1 += x; } if (s1 <= s) cout << "Yes"; else cout << "No"; return 0; } signed main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t = 1; while (t--) { solve(); } return 0; }
#include <bits/stdc++.h> #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; long long int mod = 1e9 + 9; long long int power(long long int a, long long int b) { if (b == 0) return 1; else if (b % 2 == 0) return power(a * a % mod, b / 2) % mod; else return (a % mod * power(a * a % mod, b / 2)) % mod; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int a[n], b[n]; int sum = 0; for (int i = 0; i < n; ++i) cin >> a[i], sum += a[i]; int sum1 = 0; for (int i = 0; i < n; ++i) cin >> b[i], sum1 += b[i]; if (sum < sum1) { cout << "No"; } else { cout << "Yes"; } return 0; }
#include <bits/stdc++.h> int main() { int n, i; scanf("%d", &n); int a[n], b[n]; int sum1 = 0; for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum1 = sum1 + a[i]; } int sum2 = 0; for (i = 0; i < n; i++) { scanf("%d", &b[i]); sum2 = sum2 + b[i]; } if (sum2 <= sum1) { printf("YES"); } else { printf("NO"); } return 0; }
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int MAXN = 2e5 + 10; long long powmod(long long a, long long b) { long long res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } return res; } long long gcd(long long a, long long b) { long long c; while (a != 0) { c = a; a = b % a; b = c; } return b; }; long long lcm(long long a, long long b) { return a / gcd(a, b) * b; } int main() { int n; cin >> n; int sum1 = 0; int sum2 = 0; for (int i = 0; i < n; ++i) { int x; cin >> x; sum1 += x; } for (int i = 0; i < n; ++i) { int x; cin >> x; sum2 += x; } if (sum2 > sum1) { cout << "No" << endl; } else { cout << "Yes" << endl; } }
#include <bits/stdc++.h> using namespace std; map<long long int, long long int> mp; int main() { long long int n, sum1 = 0, sum2 = 0, x; cin >> n; vector<long long int> v1, v2; for (long long int i = 0; i < n; i++) { cin >> x; sum1 += x; } for (long long int i = 0; i < n; i++) { cin >> x; sum2 += x; } if (sum1 >= sum2) { cout << "Yes"; } else { cout << "No"; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n], b[n], sum1 = 0, sum2 = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum1 += a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; sum2 += b[i]; } if (sum1 >= sum2) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> int main() { int n, i = 0, s = 0, s1 = 0; scanf("%d", &n); int a[n], a1[n]; while (i != n) { scanf("%d", &a[i]); s += a[i]; i++; } i = 0; while (i != n) { scanf("%d", &a1[i]); s1 += a1[i]; i++; } if (s1 > s) printf("NO\n"); else printf("YES\n"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, s = 0, s1 = 0; cin >> n; int a[n], b[n]; for (int i = 0; i < n; i++) { cin >> a[i]; s = s + a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; s1 = s1 + b[i]; } if (s >= s1) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> using namespace std; int a[1005], b[1005], n; int main() { int k = 0, v = 0; std::cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; k += a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; v += b[i]; } if (k >= v) std::cout << "YES" << std::endl; else std::cout << "NO" << std::endl; }
#include <bits/stdc++.h> using namespace std; int n; int main() { ios_base::sync_with_stdio(false), cin.tie(), cout.tie(); long long sum = 0; cin >> n; for (int i = 0; i < n; i++) { int t; cin >> t; sum += t; } long long ans = 0; for (int i = 0; i < n; i++) { int k; cin >> k; ans += k; } sum >= ans ? cout << "Yes" : cout << "No"; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; int b[n]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; sum -= b[i]; } if (sum < 0) cout << "No"; else cout << "Yes"; }
#include <bits/stdc++.h> using namespace std; const long long INF = 1e9 + 7; const int N = 5e3 + 10; int main() { int n; cin >> n; int sum1 = 0; int sum2 = 0; for (int i = 1; i <= n; i++) { int x; cin >> x; sum1 += x; } for (int i = 1; i <= n; i++) { int x; cin >> x; sum2 += x; } if (sum1 >= sum2) puts("Yes"); else puts("No"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, q = 1; cin >> n; int x[n], y[n], a = 0, b = 0; for (int i = 0; i < n; i++) { cin >> x[i]; a += x[i]; } for (int i = 0; i < n; i++) { cin >> y[i]; b += y[i]; } if (a >= b) { cout << "Yes"; } else { cout << "No"; } }
#include <bits/stdc++.h> using namespace std; const int inf = 1001; int main() { cin.clear(); ios_base ::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> v(n, 0); for (int i = 0; i < n; i++) { cin >> v[i]; } int z = 0; for (int i = 0; i < n; i++) { int x; cin >> x; v[i] = v[i] - x; } int s = 0; for (int i = 0; i < n; i++) { s += v[i]; } if (s >= 0) { cout << "Yes"; return 0; } cout << "No"; return 0; }
#include <bits/stdc++.h> using namespace std; char _; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; int a[n], b[n]; long long sum1 = 0, sum2 = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; sum1 += a[i]; } for (int i = 0; i < n; ++i) { cin >> b[i]; sum2 += b[i]; } (sum2 <= sum1) ? cout << "Yes" : cout << "No"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<int> v1(n); vector<int> v2(n); int sum1 = 0, sum2 = 0; for (int i = 0; i < n; i++) { cin >> v1[i]; sum1 += v1[i]; } for (int i = 0; i < n; i++) { cin >> v2[i]; sum2 += v2[i]; } if (sum1 < sum2) cout << "No" << '\n'; else cout << "Yes" << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; const int INF = INT_MAX; const long long INFLL = (long long)1e18; const double PI = acos(-1.0); template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } template <class T> T lcm(T a, T b) { return a / gcd(a, b) * b; } const int N = (int)1e5 + 5; const int P = 1 << 18; int n; int main() { ios::sync_with_stdio(false); cout.setf(ios::fixed | ios::showpoint); cout.precision(8); cin >> n; int a = 0, b = 0; for (int i = 0; i < n; i++) { int x; cin >> x; a += x; } for (int i = 0; i < n; i++) { int x; cin >> x; b += x; } if (a >= b) cout << "Yes\n"; else cout << "No\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sum1 = 0, sum2 = 0; int x[n], y[n]; for (int i = 0; i < n; i++) { cin >> x[i]; sum1 += x[i]; } for (int i = 0; i < n; i++) { cin >> y[i]; sum2 += y[i]; } if (sum1 >= sum2) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> int main() { int a, b[1005], c[10005], x, w, i; scanf("%d", &a); x = 0; w = 0; for (i = 0; i < a; i++) { scanf("%d", &b[i]); w = b[i] + w; } for (i = 0; i < a; i++) { scanf("%d", &c[i]); x = x + c[i]; } if (x <= w) printf("Yes"); else printf("No"); return 0; }
#include <bits/stdc++.h> using namespace std; int A, B; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int x; cin >> x; A += x; } for (int i = 1; i <= n; i++) { int x; cin >> x; B += x; } if (A >= B) { cout << "YES"; } else { cout << "NO"; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n], b[n]; int as = 0, bs = 0; for (int i = 0; i < n; i++) { cin >> a[i]; as += a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; bs += b[i]; } if (as >= bs) cout << "YES" << '\n'; else cout << "NO" << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; template <class T> ostream &operator<<(ostream &os, const pair<T, T> &p) { return os << "(" << p.first << "," << p.second << ")"; } template <class T> ostream &operator<<(ostream &os, const pair<const T, T> &p) { return os << "(" << p.first << "," << p.second << ")"; } template <class T> ostream &operator<<(ostream &os, const array<T, 3> &p) { return os << "(" << p[0] << "," << p[1] << "," << p[2] << ")"; } template <class T> ostream &operator<<(ostream &os, const vector<T> &p) { os << "{ "; for (auto x : p) os << x << ' '; return os << '}'; } const double EPS = 1e-9; const double PI = acos(-1); const int INF = 0x3f3f3f3f; const long long int LINF = 0x3f3f3f3f3f3f3f3f; const int SZ = 1e5 + 10; const long long int mod = 1e9 + 7; int main() { int n; scanf(" %d", &n); int soma1 = 0, soma2 = 0; for (int i = 0; i < n; i++) { int x; cin >> x; soma1 += x; } for (int i = 0; i < n; i++) { int x; cin >> x; soma2 += x; } if (soma2 > soma1) cout << "No" << "\n"; else cout << "Yes" << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) { int sum1 = 0, sum2 = 0; int a; for (int i = 0; i < n; i++) { cin >> a; sum1 = sum1 + a; } for (int i = 0; i < n; i++) { cin >> a; sum2 = sum2 + a; } if (sum2 <= sum1) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int s = 0, a[n], b[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; } for (int i = 0; i < n; i++) { s += b[i] - a[i]; } if (s <= 0) cout << "Yes"; else cout << "No"; return 0; }
#include <bits/stdc++.h> int main() { int n; scanf("%d", &n); int sum1 = 0, x; for (int i = 0; i < n; ++i) { scanf("%d", &x); sum1 += x; } int sum2 = 0; for (int i = 0; i < n; ++i) { scanf("%d", &x); sum2 += x; } printf("%s\n", sum1 >= sum2 ? "Yes" : "No"); return 0; }
#include <bits/stdc++.h> using namespace std; vector<int> x(1035); vector<int> y(1035); bool ok2(int n) { int sum0 = 0, sum1 = 0; for (int i = 0; i < n; i++) { sum0 += x[i]; sum1 += y[i]; } if (sum0 >= sum1) return true; return false; } int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> x[i]; } for (int i = 0; i < n; i++) { cin >> y[i]; } if (!ok2(n)) { puts("No"); return 0; } puts("Yes"); return 0; }
#include <bits/stdc++.h> using namespace std; const int inf = 1000000000; int main() { long long int n, s1 = 0, s2 = 0; cin >> n; for (int i = 0; i < n; i++) { int a; cin >> a; s1 += a; } for (int i = 0; i < n; i++) { int a; cin >> a; s2 += a; } if (s2 > s1) cout << "No"; else cout << "Yes"; }
#include <bits/stdc++.h> using namespace std; int main() { int n, sum1 = 0, sum2 = 0; int x[52], y[52]; cin >> n; for (int i = 0; i < n; i++) { cin >> x[i]; sum1 = sum1 + x[i]; } for (int i = 0; i < n; i++) { cin >> y[i]; sum2 = sum2 + y[i]; } if (sum1 >= sum2) cout << "Yes" << endl; if (sum1 < sum2) cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; signed main() { unsigned long long n; cin >> n; vector<unsigned long long> a(n), b(n); for (auto &it : a) cin >> it; for (auto &it : b) cin >> it; unsigned long long sum1 = accumulate(a.begin(), a.end(), 0); unsigned long long sum2 = accumulate(b.begin(), b.end(), 0); if (sum1 < sum2) cout << "No"; else cout << "Yes"; return 0; }
#include <bits/stdc++.h> using namespace std; int n, x; int main() { cin.tie(NULL); ios_base::sync_with_stdio(false); cin >> n; int sum1 = 0, sum2 = 0; for (int i = 0; i < n; ++i) { cin >> x; sum1 += x; } for (int i = 0; i < n; ++i) { cin >> x; sum2 += x; } if (sum2 > sum1) cout << "No\n"; else cout << "Yes\n"; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> x(n), y(n); int sum_x = 0, sum_y = 0; for (int i = 0; i < n; i++) { cin >> x[i]; sum_x += x[i]; } for (int i = 0; i < n; i++) { cin >> y[i]; sum_y += y[i]; } if (sum_y > sum_x) cout << "No"; else cout << "Yes"; return 0; }
#include <bits/stdc++.h> using namespace std; int x[1000005], y[10005], m, m1; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) cin >> x[i], m += x[i]; for (int i = 1; i <= n; i++) cin >> y[i], m1 += y[i]; cout << (m >= m1 ? "Yes" : "No"); }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; long long int a, b, c = 0, d, sum1 = 0, sum2 = 0; cin >> a; for (b = 0; b < a; b++) cin >> c, sum1 = sum1 + c; for (b = 0; b < a; b++) cin >> c, sum2 = sum2 + c; if (sum1 >= sum2) cout << "Yes" << endl; else cout << "No" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin >> n; int s1 = 0, s2 = 0; for (int i = 0; i < n; ++i) { int x; cin >> x; s1 += x; } for (int i = 0; i < n; ++i) { int x; cin >> x; s2 += x; } cout << (s1 >= s2 ? "Yes" : "No") << "\n"; }
#include <bits/stdc++.h> using namespace std; const int maxa = 100; int a[maxa]; int b[maxa]; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int n; int i, j; cin >> n; int sum1 = 0; int sum2 = 0; for (i = 0; i < n; i++) { cin >> a[i]; sum1 += a[i]; } for (i = 0; i < n; i++) { cin >> b[i]; sum2 += b[i]; } if (sum1 < sum2) cout << "No\n"; else cout << "Yes\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x[n], y[n], i; long sx, sy; sx = sy = 0; for (i = 0; i < n; i++) { cin >> x[i]; sx += x[i]; } for (i = 0; i < n; i++) { cin >> y[i]; sy += y[i]; } if (sx >= sy) cout << "Yes\n"; else cout << "No\n"; }
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int N = 1e5 + 7; const double PI = acos(-1.0); const double eps = 1e-8; const int inf = 0x3f3f3f3f; inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; } inline double Euler(int n) { return log(n) + 1.0 / (2 * n) + 0.57721566490153286060651209; } long long fpow_mod(long long a, long long b) { long long res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; } inline long long inverse_feima(long long n) { return fpow_mod(n, mod - 2); } long long n, m, k, t, ans = 0, o = 0; bool flag, tag; int main() { ios::sync_with_stdio(0); cin >> n; for (int i = 0; i < n; ++i) { cin >> m; ans += m; } for (int i = 0; i < n; ++i) { cin >> t; ans -= t; } if (ans >= 0) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, x = 0, y = 0, a, b; cin >> n; for (int i = 0; i < n; i++) { cin >> a; x = x + a; } for (int i = 0; i < n; i++) { cin >> b; y = y + b; } if (x >= y) cout << "Yes\n"; else cout << "No\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, sumx = 0, x, y; cin >> n; for (int i = 1; i <= n; ++i) { cin >> x; sumx += x; } for (int i = 1; i <= n; ++i) { cin >> y; sumx -= y; } if (sumx >= 0) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; int main() { int n; while (~scanf("%d", &n)) { int sum1 = 0, sum2 = 0; int x; for (int i = 0; i < n; i++) { scanf("%d", &x); sum1 += x; } for (int i = 0; i < n; i++) { scanf("%d", &x); sum2 += x; } if (sum1 >= sum2) puts("Yes"); else puts("No"); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int sum1 = 0, sum2 = 0; vector<int> arr1(n), arr2(n); for (int i = 0; i < n; i++) { cin >> arr1[i]; sum1 += arr1[i]; } for (int i = 0; i < n; i++) { cin >> arr2[i]; sum2 += arr2[i]; } if (sum2 > sum1) cout << "No"; else cout << "Yes"; return 0; }
#include <bits/stdc++.h> using namespace std; long long int gcd(long long int a, long long int b) { if (a == 0) return b; return gcd(b % a, a); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int i, n, x[55], y[55], a, b; cin >> n; for (i = 0; i < n; i++) { cin >> x[i]; } for (i = 0; i < n; i++) { cin >> y[i]; } a = b = 0; for (i = 0; i < n; i++) { if (x[i] > y[i]) a += (x[i] - y[i]); else b += (y[i] - x[i]); } if (a >= b) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> bool solve(const std::vector<size_t>& x, const std::vector<size_t>& y) { const size_t n = x.size(); size_t sums[2] = {}; for (size_t i = 0; i < n; ++i) { sums[0] += x[i]; sums[1] += y[i]; } return sums[1] <= sums[0]; } int main() { size_t n; std::cin >> n; std::vector<size_t> x(n); for (size_t i = 0; i < n; ++i) std::cin >> x[i]; std::vector<size_t> y(n); for (size_t i = 0; i < n; ++i) std::cin >> y[i]; std::cout << (solve(x, y) ? "Yes" : "No") << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); int n; long long sm1 = 0, sm2 = 0, first; cin >> n; for (int i = 0; i < n; ++i) { cin >> first; sm1 += first; } for (int i = 0; i < n; ++i) { cin >> first; sm2 += first; } if (sm2 <= sm1) { cout << "Yes\n"; } else { cout << "No\n"; } }
#include <bits/stdc++.h> using namespace std; long long sum, a; int n; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout.precision(15); while (cin >> n) { sum = 0; a = 0; for (int i = int(0); i < int(n); i++) cin >> a, sum += a; for (int i = int(0); i < int(n); i++) cin >> a, sum -= a; if (sum >= 0) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; const double pi = acos(-1.); const long long mod = 1e9 + 7; const long long INF = 0x3f3f3f3f; int n; void init() {} void solve() {} int main() { scanf("%d", &n); int cnt1 = 0, cnt2 = 0; for (int i = 0; i < n; i++) { int num; scanf("%d", &num); cnt1 += num; } for (int i = 0; i < n; i++) { int num; scanf("%d", &num); cnt2 += num; } if (cnt1 < cnt2) puts("No"); else puts("Yes"); return 0; }
#include <bits/stdc++.h> using namespace std; vector<long long> second; long long build() { long long w = 1; for (int i = 0; i <= 31; i++) { second.push_back(w); w *= 2; } return w; } using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n, x, sum = 0; cin >> n; for (int i = 1; i <= n; i++) { cin >> x; sum += x; } for (int i = 1; i <= n; i++) { cin >> x; sum -= x; } if (sum < 0) { cout << "No"; } else cout << "Yes"; }
#include <bits/stdc++.h> using namespace std; int main() { int n, a, b, sum1 = 0, sum2 = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> a; sum1 += a; } for (int i = 0; i < n; i++) { cin >> b; sum2 += b; } if (sum1 >= sum2) cout << "YES"; else cout << "NO"; return 0; }
#include <bits/stdc++.h> using namespace std; const long long init = 1e9 + 7; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n, s1 = 0, s2 = 0, temp; cin >> n; for (int i = 0; i < n; ++i) { cin >> temp; s1 += temp; } for (int i = 0; i < n; ++i) { cin >> temp; s2 += temp; } if (s1 < s2) cout << "No" << endl; else cout << "Yes" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; const long long N = 100005; long long p = 1e9 + 7; int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; long long n; cin >> n; long long sum = 0; for (long long i = 1; i <= n; i++) { long long a; cin >> a; sum += a; } for (long long i = 1; i <= n; i++) { long long a; cin >> a; sum -= a; } if (sum < 0) cout << "No"; else cout << "Yes"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long int n, x, sum = 0, sum2 = 0; cin >> n; for (int i = 1; i <= n; i++) cin >> x, sum += x; for (int i = 1; i <= n; i++) cin >> x, sum2 += x; if (sum2 <= sum) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false), cin.tie(0); int n; cin >> n; int sx = 0; int sy = 0; for (int i = 0; i < n; i++) { int x; cin >> x; sx += x; } for (int i = 0; i < n; i++) { int x; cin >> x; sy += x; } if (sy <= sx) { cout << "Yes" << '\n'; } else { cout << "No" << '\n'; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int s1 = 0, s2 = 0; for (int i = 0; i < n; i++) { int x; cin >> x; s1 += x; } bool ok = 1; for (int i = 0; i < n; i++) { int x; cin >> x; s2 += x; } if (s1 >= s2) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> using namespace std; int main() { int n, i, j, count_1 = 0, count_2 = 0; int a[1000], b[1000]; cin >> n; for (i = 0; i < n; i++) { cin >> a[i]; count_1 += a[i]; } for (i = 0; i < n; i++) { cin >> b[i]; count_2 += b[i]; } if (count_1 >= count_2) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <bits/stdc++.h> using namespace std; inline int read() { int x = 0, f = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); } return x * f; } inline long long readl() { long long x = 0, f = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); } return x * f; } inline int power(int a, int b) { int ans = 1; while (b) { if (b & 1) { ans = ans * a; --b; } b >>= 1; a = a * a; } return ans; } inline int power_mod(int a, int b, int mod) { a %= mod; int ans = 1; while (b) { if (b & 1) { ans = ans * a % mod; --b; } b >>= 1, a = a * a % mod; } return ans; } long long gcdl(long long a, long long b) { return b == 0 ? a : gcdl(b, a % b); } long long abssl(long long a) { return a > 0 ? a : -a; } int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } int abss(int a) { return a > 0 ? a : -a; } inline int read(); inline long long readl(); inline int power(int a, int b); inline int power_mod(int a, int b, int mod); long long gcdl(long long a, long long b); long long abssl(long long a); int gcd(int a, int b); int abssl(int a); int n, sumx, sumy; int main() { scanf("%d", &n); for (int xi, i = 1; i <= n; i++) cin >> xi, sumx += xi; for (int yi, i = 1; i <= n; i++) cin >> yi, sumy += yi; if (sumx >= sumy) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a[55], b[55]; int n, i, j, sum = 0, sum1 = 0, s = 0, s1 = 0, count = 0, count1 = 0, k = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &a[i]); sum += a[i]; } for (i = 0; i < n; i++) { scanf("%d", &b[i]); sum1 += b[i]; } if (sum < sum1) { printf("No\n"); } else { printf("Yes\n"); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, sum1 = 0, sum2 = 0; vector<int> v1, v2; cin >> n; for (int i = 0; i < n; i++) { int x; cin >> x; sum1 += x; v1.push_back(x); } for (int i = 0; i < n; i++) { int x; cin >> x; sum2 += x; v2.push_back(x); } if (sum1 >= sum2) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <bits/stdc++.h> using namespace std; int n; int a[51], b[51]; int main() { cin >> n; int suma = 0, sumb = 0; for (int i = 0; i < n; i++) { cin >> a[i]; suma += a[i]; } for (int i = 0; i < n; i++) { cin >> b[i]; sumb += b[i]; } if (sumb > suma) cout << "No" << endl; else cout << "Yes" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sa = 0, sb = 0; for (int i = 1; i <= n; i++) { int t; cin >> t; sa += t; } for (int i = 1; i <= n; i++) { int t; cin >> t; sb += t; } cout << (sa >= sb ? "Yes" : "No") << '\n'; }
#include <bits/stdc++.h> using namespace std; int n, sum, a, i; int main() { scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%d", &a); sum += a; } for (i = 1; i <= n; i++) { scanf("%d", &a); sum -= a; } if (sum >= 0) { puts("Yes"); } else { puts("No"); } }
#include <bits/stdc++.h> using namespace std; const double pi = acos(-1.0); const double eps = 1e-8; const int mxn = 100033; const int mod = 1e9 + 7; inline int read() { int x = 0, f = 1; char c = getchar(); while (!isdigit(c)) f = c == '-' ? -1 : 1, c = getchar(); while (isdigit(c)) x = x * 10 + c - '0', c = getchar(); return x * f; } inline long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); } long long ksm(long long a, long long b, long long mod) { int ans = 1; while (b) { if (b & 1) ans = (ans * a) % mod; a = (a * a) % mod; b >>= 1; } return ans; } long long inv2(long long a, long long mod) { return ksm(a, mod - 2, mod); } void exgcd(long long a, long long b, long long &x, long long &y, long long &d) { if (!b) { d = a; x = 1; y = 0; } else { exgcd(b, a % b, y, x, d); y -= x * (a / b); } } int dx[] = {0, 1, 0, -1}; int dy[] = {1, 0, -1, 0}; int n, x[60], y[60]; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); ; cin >> n; int sx = 0, sy = 0; for (int i = 1; i <= n; ++i) cin >> x[i], sx += x[i]; for (int i = 1; i <= n; ++i) cin >> y[i], sy += y[i]; if (sx >= sy) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, a[110], b[110], i, num, sum1, sum2; cin >> n; sum1 = 0; sum2 = 0; for (i = 0; i < n; i++) { cin >> num; sum1 += num; } for (i = 0; i < n; i++) { cin >> num; sum2 += num; } if (sum2 <= sum1) cout << "Yes\n"; else cout << "No\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, i, x = 0, y = 0; cin >> n; int a[n], b[n]; for (i = 0; i < n; i++) { cin >> a[i]; x = x + a[i]; } for (i = 0; i < n; i++) { cin >> b[i]; y = y + b[i]; } if (y <= x) { cout << "YES" << endl; } else { cout << "NO" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { long long int n, a[100005], b[100005], res = 0, sum = 0; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i]; for (int i = 1; i <= n; i++) cin >> b[i], res += b[i]; if (res <= sum) cout << "Yes"; else cout << "No"; }
#include <bits/stdc++.h> using namespace std; const int N = 55; int n, a[N], b[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; int s1 = 0, s2 = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; s1 += a[i]; } for (int i = 1; i <= n; i++) { cin >> b[i]; s2 += b[i]; } if (s2 > s1) { cout << "No"; } else { cout << "Yes"; } }
#include <bits/stdc++.h> using namespace std; int main() { int s1 = 0, s2 = 0, n; cin >> n; vector<int> first(n); vector<int> second(n); for (int i = 0; i < n; i++) { cin >> first[i]; s1 += first[i]; } for (int i = 0; i < n; i++) { cin >> second[i]; s2 += second[i]; } if (s1 >= s2) cout << "Yes"; else cout << "No"; return 0; }