text stringlengths 49 983k |
|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
long a, b, stones, total1 = 0, total2 = 0;
cin >> stones;
for (int i = 1; i <= stones; i++) {
cin >> a;
total1 += a;
}
for (int i = 1; i <= stones; i++) {
cin >> b;
total2 += b;
}
if (total1 - total2 >= 0)
cout << "Yes";
else
cout << "No";
}
|
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x7fffffff;
const int mod = 1e9 + 7;
const int maxn = 3030;
int n, x, suma, sumb;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &x);
suma += x;
}
for (int i = 0; i < n; i++) {
scanf("%d", &x);
sumb += x;
}
if (suma >= sumb)
printf("Yes\n");
else
printf("No\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
const int maxn = 100 + 10;
int a[1111111];
int sum1 = 0, sum2 = 0;
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum1 += a[i];
}
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum2 += a[i];
}
if (sum1 - sum2 >= 0) {
printf("Yes\n");
} else
printf("No\n");
}
|
#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Int(T &n) {
n = 0;
int f = 1;
register int ch = getchar();
for (; !isdigit(ch); ch = getchar())
if (ch == '-') f = -1;
for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
n = n * f;
}
template <typename T>
T gcd(T a, T b) {
return !b ? a : gcd(b, a % b);
}
template <typename T>
inline void umin(T &a, T b) {
a = a < b ? a : b;
}
template <typename T>
inline void umax(T &a, T b) {
a = a > b ? a : b;
}
template <typename T, typename W>
inline void Int(T &x, W &y) {
Int(x), Int(y);
}
template <typename T, typename W, typename Q>
inline void Int(T &x, W &y, Q &z) {
Int(x, y), Int(z);
}
const int N = 1e5 + 7;
const int inf = 1e9 + 7;
int a[N], b[N];
int solve() {
int n;
Int(n);
for (int i = 1; i <= n; ++i) Int(a[i]);
for (int i = 1; i <= n; ++i) Int(b[i]);
int sumA = accumulate(a + 1, a + n + 1, 0);
int sumB = accumulate(b + 1, b + n + 1, 0);
puts(sumA >= sumB ? "Yes" : "No");
return 0;
}
int main() {
int tests = 1, CaseNo = 0;
while (tests--) {
solve();
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
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) { return b ? gcd(b, a % b) : a; }
int n;
int a[1007];
int b[1007];
int sum1, sum2;
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
sum1 = sum1 + a[i];
}
for (int i = 1; i <= n; i++) {
scanf("%d", &b[i]);
sum2 = sum2 + b[i];
}
if (sum1 < sum2) {
printf("No\n");
} else {
printf("Yes\n");
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int sum1 = 0;
int sum2 = 0;
for (int i = 0; i < n; i++) {
int ai;
cin >> ai;
sum1 += ai;
}
for (int i = 0; i < n; i++) {
int bi;
cin >> bi;
sum2 += bi;
}
cout << (sum2 <= sum1 ? "Yes" : "No") << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n], i, s1 = 0, s2 = 0;
for (i = 0; i < n; i++) {
cin >> a[i];
s1 += a[i];
}
for (i = 0; i < n; i++) {
cin >> b[i];
s2 += b[i];
}
if (s1 < s2)
cout << "No";
else
cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, num, sum;
sum = 0;
cin >> n;
for (i = 0; i < n; i++) {
cin >> num;
sum += num;
}
for (i = 0; i < n; i++) {
cin >> num;
sum -= num;
}
if (sum >= 0) {
cout << "Yes" << endl;
return 0;
} else {
cout << "No" << endl;
return 0;
}
}
|
#include <bits/stdc++.h>
const int maxn = 1005;
int main() {
int n;
scanf("%d", &n);
int sumx = 0, sumy = 0;
for (int i = 0, temp; i < n; i++) {
scanf("%d", &temp);
sumx += temp;
}
for (int i = 0, temp; i < n; i++) {
scanf("%d", &temp);
sumy += temp;
}
if (sumx >= sumy)
printf("Yes\n");
else
printf("No\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n, a, s;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a;
s += a;
}
for (int i = 1; i <= n; i++) {
cin >> a;
s -= a;
}
if (s < 0) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, x;
cin >> n;
int s1 = 0, s2 = 0;
for (int i = 0; i < n; i++) {
cin >> x;
s1 += x;
}
for (int i = 0; i < n; i++) {
cin >> x;
s2 += x;
}
cout << (s2 <= s1 ? "YES" : "NO");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <class T>
using uset = unordered_set<T>;
template <class T>
using mset = multiset<T>;
template <class T>
using umset = unordered_multiset<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <class T>
using maxpq = priority_queue<T, vector<T>, less<T>>;
const int MOD = 1e9 + 7;
template <class T>
void add(T& a, const T& b) {
a += b;
if (a >= MOD) a -= MOD;
}
template <class T>
void sub(T& a, const T& b) {
a -= b;
if (a >= MOD) a -= MOD;
}
template <class T>
void mult(T& a, const T& b) {
a *= b;
if (a >= MOD) a -= MOD;
}
template <class T>
bool amin(T& a, const T& b) {
return b < a ? a = b, 1 : 0;
}
template <class T>
bool amax(T& a, const T& b) {
return a < b ? a = b, 1 : 0;
}
template <typename T>
T sqr(T x) {
return x * x;
}
template <typename T>
T cdiv(T a, T b) {
return a / b + !(a < 0 || a % b == 0);
}
template <typename T>
T lcm(T a, T b) {
return (a * b) / __gcd(a, b);
}
template <class A>
void re(complex<A>& c);
template <class A, class B>
void re(pair<A, B>& p);
template <class A>
void re(vector<A>& v);
template <class A, size_t SZ>
void re(array<A, SZ>& a);
template <class T>
void re(T& x) {
cin >> x;
}
void re(double& d) {
string t;
re(t);
d = stod(t);
}
void re(long double& d) {
string t;
re(t);
d = stold(t);
}
template <class H, class... T>
void re(H& h, T&... t) {
re(h);
re(t...);
}
template <class A>
void re(complex<A>& c) {
A a, b;
re(a, b);
c = {a, b};
}
template <class A, class B>
void re(pair<A, B>& p) {
re(p.first, p.second);
}
template <class A>
void re(vector<A>& x) {
for (auto& a : x) re(a);
}
template <class A, size_t SZ>
void re(array<A, SZ>& x) {
for (auto& a : x) re(a);
}
template <class A>
void pr(A x) {
cout << x;
}
template <class H, class... T>
void pr(const H& h, const T&... t) {
pr(h);
pr(t...);
}
void pln() { pr("\n"); }
template <class H, class... T>
void pln(const H& h, const T&... t) {
pr(h);
pln(t...);
}
void ps() { pr("\n"); }
template <class H, class... T>
void ps(const H& h, const T&... t) {
pr(h);
if (sizeof...(t)) pr(" ");
ps(t...);
}
template <class A>
void pr(vector<A> x) {
for (auto a : x) pr(a, " ");
}
template <class A>
void pln(vector<A> x) {
for (auto a : x) pr(a, " ");
pln();
}
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* s) { return (string)s; }
string to_string(string s) { return s; }
template <class A>
string to_string(complex<A> c) {
stringstream second;
second << c;
return second.str();
}
string to_string(vector<bool> v) {
string res = "{";
for (int i = (0); i < (((int)v.size())); ++i) res += char('0' + v[i]);
res += "}";
return res;
}
template <size_t SZ>
string to_string(bitset<SZ> b) {
string res = "";
for (int i = (0); i < (SZ); ++i) res += char('0' + b[i]);
return res;
}
template <class A, class B>
string to_string(pair<A, B> p);
template <class T>
string to_string(T v) {
bool fst = 1;
string res = "{";
for (const auto& x : v) {
if (!fst) res += ", ";
fst = 0;
res += to_string(x);
}
res += "}";
return res;
}
template <class A, class B>
string to_string(pair<A, B> p) {
return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
#pragma GCC diagnostic ignored "-Wunused-result"
void setIn(string s) { freopen(s.c_str(), "r", stdin); }
void setOut(string s) { freopen(s.c_str(), "w", stdout); }
void unsyncIO() {
ios_base::sync_with_stdio(0);
cin.tie(0);
}
void setIO(string s = "") {
unsyncIO();
if (((int)s.size())) {
setIn(s + ".in"), setOut(s + ".out");
}
}
template <class H>
void DBG(const char* sdbg, H h) {
cerr << sdbg << " = " << to_string(h) << "]" << endl;
}
template <class H, class... T>
void DBG(const char* sdbg, H h, T... t) {
while (*sdbg != ',') cerr << *sdbg++;
cerr << " = " << to_string(h) << ", ";
DBG(sdbg + 1, t...);
}
const double pi = acos(-1.0);
const int INF = 1e9 + 7;
const long long llINF = ((long long)1e18) + 7LL;
const int mxN = 1e5 + 7;
int main() {
setIO();
int n;
re(n);
vector<int> a(n), b(n);
re(a, b);
int sum1 = 0, sum2 = 0;
for (int i = (0); i < (n); ++i) sum1 += a[i], sum2 += b[i];
pln(sum1 >= sum2 ? "Yes" : "No");
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int n;
cin >> n;
long long int sum1 = 0, sum2 = 0;
for (long long int i = 0; i < n; i++) {
long long int k;
std::cin >> k;
sum1 += k;
}
for (long long int i = 0; i < n; i++) {
long long int k;
std::cin >> k;
sum2 += k;
}
if (sum1 >= sum2) {
cout << "Yes" << endl;
return 0;
}
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << " : " << arg1 << " | ";
__f(comma + 1, args...);
}
int main() {
int n, i, val;
cin >> n;
int x = 0, y = 0;
for (i = 0; i < n; i++) {
cin >> val;
x += val;
}
for (i = 0; i < n; i++) {
cin >> val;
y += val;
}
if (x >= y)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
void fast() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int main() {
fast();
long long n;
cin >> n;
long long arr[n], brr[n];
long long cnt = 0, cnt2 = 0;
for (long long i = 0; i < n; i++) {
cin >> arr[i];
cnt += arr[i];
}
for (long long i = 0; i < n; i++) {
cin >> brr[i];
cnt2 += brr[i];
}
if (cnt >= cnt2) {
cout << "Yes";
} else {
cout << "No";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> x(n);
vector<int> y(n);
int xSum = 0, ySum = 0;
for (int i = 0; i < n; i++) {
cin >> x[i];
xSum += x[i];
}
for (int i = 0; i < n; i++) {
cin >> y[i];
ySum += y[i];
}
if (xSum < ySum)
cout << "No";
else
cout << "Yes";
}
|
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const long long LINF = 1e18;
void solve() {}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
int a[n], b[n];
int 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";
}
|
#include <bits/stdc++.h>
using namespace std;
int n;
int a[11000], b[11000];
int sum = 0, sum1 = 0;
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
for (int i = 1; i <= n; i++) {
scanf("%d", &b[i]);
sum1 += b[i];
}
if (sum >= sum1)
printf("Yes\n");
else
printf("No\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
int fir = 0, sec = 0, a;
ios_base ::sync_with_stdio(0);
cin.tie(0);
cin >> N;
for (int i = 1; i <= N; ++i) {
cin >> a;
fir += a;
}
for (int i = 1; i <= N; ++i) {
cin >> a;
sec += a;
}
if (fir >= sec)
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
bool qo(bool x) { return (x ? 0 : qo(!x)); }
const int mnx = 2e6 + 9;
const int mod = 1e9 + 7;
long long n;
long long sa, sb;
long long a[mnx];
long long b[mnx];
int main() {
ios_base::sync_with_stdio(0), cin.tie(NULL);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
sa += a[i];
}
for (int i = 1; i <= n; i++) {
cin >> b[i];
sb += b[i];
}
if (sa >= sb) {
cout << "Yes\n";
exit(0);
;
}
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 = 0;
for (int i = 0; i < n; i++) {
cin >> x;
sum1 += x;
}
for (int i = 0; i < n; i++) {
cin >> x;
sum2 += x;
}
if (sum1 < sum2)
cout << "No";
else
cout << "Yes";
return 0;
}
|
#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 t;
cin >> t;
s1 += t;
};
for (int i = 0; i < n; i++) {
int t;
cin >> t;
s2 += t;
};
cout << (s1 >= s2 ? "Yes" : "No") << '\n';
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, sum1 = 0, sum = 0;
cin >> n;
int arr1[n], arr[n];
for (int i = 0; i < n; i++) {
cin >> arr1[i];
}
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
for (int i = 0; i < n; i++) {
sum1 = sum1 + arr1[i];
sum = sum + arr[i];
}
if (sum1 >= sum)
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int x[55], y[55];
int main(int argc, char** argv) {
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
for (int i = 1; i <= n; i++) scanf("%d", &y[i]);
int sum = 0;
for (int i = 1; i <= n; i++) {
sum += x[i] - y[i];
}
if (sum >= 0)
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long i, n, tong1 = 0, tong2 = 0;
cin >> n;
long long a[n + 2], b[n + 2];
for (i = 1; i <= n; i++) {
cin >> a[i];
tong1 += a[i];
}
for (i = 1; i <= n; i++) {
cin >> b[i];
tong2 += b[i];
}
if (tong1 >= tong2) {
cout << "YES";
return 0;
}
cout << "NO";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
const int INF = 0x3f3f3f3f;
const int _INF = (int)0x80000000;
const int MOD = 1000000000 + 7;
const double EPS = 1E-8;
int main() {
int n;
scanf("%d", &n);
int s1 = 0;
for (int i = 1; i <= n; ++i) {
int t;
scanf("%d", &t);
s1 += t;
}
int s2 = 0;
for (int i = 1; i <= n; ++i) {
int t;
scanf("%d", &t);
s2 += t;
}
puts(s1 >= s2 ? "Yes" : "No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n], i, sum = 0, sum1 = 0;
for (i = 0; i < n; i++) {
cin >> a[i];
}
for (i = 0; i < n; i++) {
cin >> b[i];
}
for (i = 0; i < n; i++) {
if (a[i] > b[i])
sum = sum + a[i] - b[i];
else
sum1 = sum1 + b[i] - a[i];
}
if (sum1 <= sum)
cout << "YES";
else
cout << "NO";
}
|
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int p[MAXN], rela[MAXN];
int T, N, M, a, b;
int main() {
scanf("%d", &N);
int temp1, temp2, ache;
temp1 = temp2 = 0;
for (int i = 1; i <= N; i++) {
scanf("%d", &ache);
temp1 += ache;
}
for (int i = 1; i <= N; i++) {
scanf("%d", &ache);
temp2 += ache;
}
if (temp1 < temp2)
printf("No\n");
else
printf("Yes\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t = 1;
while (t--) {
long long n, suma = 0, sumb = 0;
cin >> n;
long long a[n], b[n];
for (long long i = 0; i < (long long)n; i++) {
cin >> a[i];
suma = suma + a[i];
}
for (long long i = 0; i < (long long)n; i++) {
cin >> b[i];
sumb = sumb + b[i];
}
if (sumb <= suma)
cout << "yes" << endl;
else
cout << "no" << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, s1 = 0, s2 = 0;
cin >> n;
for (int i = 0; i < n; i++) cin >> x, s1 += x;
for (int i = 0; i < n; i++) cin >> x, s2 += x;
if (s1 >= s2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, a[55], b[55], flag;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (int i = 0; i < n; i++) {
scanf("%d", &b[i]);
}
for (int i = 0; i < n; i++) {
if (b[i] > a[i]) {
flag = 1;
for (int j = 0; j < n; j++) {
if (a[j] > b[j]) {
if (a[j] - b[j] >= b[i] - a[i]) {
b[j] += b[i] - a[i];
b[i] = a[i];
flag = 0;
break;
} else {
b[i] -= (a[j] - b[j]);
b[j] = a[j];
}
}
}
if (flag) {
printf("No\n");
return 0;
}
}
}
printf("Yes\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int mn = 1e1;
const int inf = 1e9;
const int mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cout << setprecision(30);
int n, tx = 0, ty = 0;
cin >> n;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
tx += x;
}
for (int i = 0; i < n; i++) {
int y;
cin >> y;
ty += y;
}
if (tx >= ty) {
cout << "Yes";
} else {
cout << "No";
}
cout << "\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
void solve() {
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") << endl;
}
int main() {
cin.tie(nullptr);
cout.tie(nullptr);
ios_base::sync_with_stdio(false);
solve();
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n, a, s;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a;
s += a;
}
for (int i = 1; i <= n; i++) {
cin >> a;
s -= a;
}
if (s < 0) {
cout << "No" << endl;
} else {
cout << "Yes" << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n];
int s1 = 0, s2 = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
s1 += a[i];
}
for (int i = 0; i < n; i++) {
cin >> b[i];
s2 += b[i];
}
if (s2 <= s1)
cout << "Yes";
else
cout << "No";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
int x;
cin >> x;
vector<int> first(x);
vector<int> second(x);
int sum_f = 0;
for (int i = 0; i < x; i++) {
cin >> first[i];
sum_f += first[i];
}
int sum_s = 0;
for (int i = 0; i < x; i++) {
cin >> second[i];
sum_s += second[i];
}
if (sum_s > sum_f) {
cout << "No";
} else
cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n;
const int MAXN = 55;
int x[MAXN], y[MAXN];
int main() {
ios::sync_with_stdio(0);
cin >> n;
for (int i = 0; i < n; i++) cin >> x[i];
int gain = 0, loss = 0;
for (int i = 0; i < n; i++) {
cin >> y[i];
if (y[i] > x[i])
gain += y[i] - x[i];
else
loss += x[i] - y[i];
}
if (gain > loss)
cout << "No\n";
else
cout << "Yes\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a = 0, b = 0;
for (int i = 1; i <= n; i++) {
int temp;
cin >> temp;
a = a + temp;
}
for (int i = 1; i <= n; i++) {
int temp;
cin >> temp;
b = b + temp;
}
if (b <= a)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
long long a = 0;
long long b = 0;
for (int i = 0; i < n; i++) {
int c;
cin >> c;
a += c;
}
for (int i = 0; i < n; i++) {
int c;
cin >> c;
b += c;
}
if (a >= b) {
cout << "Yes";
} else {
cout << "No";
}
}
|
#include <bits/stdc++.h>
int main() {
int n, i, sum1 = 0, sum2 = 0;
scanf("%d", &n);
int x[n], y[n];
for (i = 0; i < n; i++) {
scanf("%d", &x[i]);
sum1 = sum1 + x[i];
}
for (i = 0; i < n; i++) {
scanf("%d", &y[i]);
sum2 = sum2 + y[i];
}
if (sum2 <= sum1)
printf("Yes");
else
printf("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int sum1 = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
sum1 += x;
}
int sum2 = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
sum2 += x;
}
if (sum2 <= sum1) {
cout << "Yes";
} else {
cout << "No";
}
}
|
#include <bits/stdc++.h>
template <typename T>
std::istream& operator>>(std::istream& input, std::vector<T>& v) {
for (T& a : v) input >> a;
return input;
}
void answer(bool v) {
constexpr const char* s[2] = {"No", "Yes"};
std::cout << s[v] << '\n';
}
void 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];
}
answer(sums[1] <= sums[0]);
}
int main() {
size_t n;
std::cin >> n;
std::vector<size_t> x(n);
std::cin >> x;
std::vector<size_t> y(n);
std::cin >> y;
solve(x, y);
return 0;
}
|
#include <bits/stdc++.h>
int main() {
int n, s1 = 0, s2 = 0, x;
scanf("%d", &n);
for (int i = 1; i <= n; ++i) scanf("%d", &x), s1 += x;
for (int i = 1; i <= n; ++i) scanf("%d", &x), s2 += x;
if (s1 >= s2)
puts("Yes");
else
puts("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[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 << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
size_t n;
cin >> n;
uint32_t x_sum = 0;
for (auto i = 0; i < n; ++i) {
uint32_t curr;
cin >> curr;
x_sum += curr;
}
uint32_t y_sum = 0;
for (auto i = 0; i < n; ++i) {
uint32_t curr;
cin >> curr;
y_sum += curr;
}
cout << ((x_sum >= y_sum) ? "Yes" : "No") << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n];
int s1 = 0, s2 = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
s1 += a[i];
}
for (int i = 0; i < n; i++) {
cin >> b[i];
s2 += b[i];
}
int k = 0;
if (s2 <= s1) k = 1;
if (k == 1)
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
long long gcd(long long first, long long second) {
return !second ? first : gcd(second, first % second);
}
long long lcm(long long first, long long second) {
return (first / gcd(first, second)) * second;
}
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
const int M6 = 1e6 + 5, M5 = 1e5 + 5;
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, s1 = 0, s2 = 0;
cin >> n;
vector<int> v(n);
vector<int> v1(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
s1 += v[i];
};
for (int i = 0; i < n; i++) {
cin >> v1[i];
s2 += v1[i];
};
if (s2 <= s1)
cout << "Yes" << '\n';
else
cout << "NO" << '\n';
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, i, sum1 = 0, sum2 = 0;
cin >> n;
long long a[n], b[n];
for (i = 0; i < n; i++) {
cin >> a[i];
}
for (i = 0; i < n; i++) {
cin >> b[i];
}
for (i = 0; i < n; i++) {
sum1 = sum1 + a[i];
}
for (i = 0; i < n; i++) {
sum2 = sum2 + b[i];
}
if (sum2 <= sum1) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
signed main() {
long long n;
cin >> n;
long long a[n], b[n];
long long s1 = 0, s2 = 0;
for (long long i = 0; i < n; i++) {
cin >> a[i];
s1 += a[i];
}
for (long long j = 0; j < n; j++) {
cin >> b[j];
s2 += b[j];
}
if (s1 < s2) {
cout << "NO";
return 0;
} else {
cout << "YES";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int t = 1;
while (t--) {
int n;
cin >> n;
int a[n];
int b[n];
int s1 = 0, s2 = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
s1 += a[i];
}
for (int i = 0; i < n; i++) {
cin >> b[i];
s2 += b[i];
}
if (s1 >= s2)
cout << "Yes" << endl;
else {
cout << "No" << endl;
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
void printArr(long long arr[], int n) {
for (long long i = 0; i < n; i++) cout << arr[i] << " ";
cout << endl;
}
void printVector(vector<int> vect) {
for (int i = 0; i < vect.size(); i++) cout << vect[i] << " ";
cout << endl;
}
void printpq(priority_queue<int> arr) {
while (!arr.empty()) {
cout << arr.top() << " ";
arr.pop();
}
cout << endl;
}
vector<int> getPrimeNos() {
bool isPrime[1300000];
for (int i = 0; i < 1300000; i++) isPrime[i] = true;
for (int i = 2; i * i < 1300000; i++) {
if (isPrime[i] == false)
continue;
else {
for (int j = i * i; j <= 13000000; j += i) isPrime[j] = false;
}
}
vector<int> Primes;
for (int i = 0; i < 1300000; i++) {
if (isPrime[i]) Primes.push_back(i);
}
return Primes;
}
int getHCF(int a, int b) {
if (a == 0)
return b;
else if (b == 0)
return a;
if (a == b) return a;
if (a > b) return getHCF(a - b, b);
return getHCF(a, b - a);
}
long long ncr(int n, int r) {
int diff = max(r, n - r);
int foo = min(r, n - r);
long long prod = 1;
for (int i = 0; i < diff - 1; i++) {
prod *= n - i;
}
long long fact = 1;
for (int i = 1; i <= foo; i++) fact *= i;
return prod / fact;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<int> mainArr(n);
int mainSum = 0;
vector<int> secondaryArray(n);
int secondarySum = 0;
for (int i = 0; i < n; i++) {
cin >> mainArr[i];
mainSum += mainArr[i];
}
for (int i = 0; i < n; i++) {
cin >> secondaryArray[i];
secondarySum += secondaryArray[i];
}
if (mainSum >= secondarySum)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n, sm = 0, SM = 0;
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
sm += x;
}
for (int i = 0; i < n; i++) {
int x;
cin >> x;
SM += x;
}
if (sm < SM)
cout << "No";
else
cout << "Yes";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long sum1, sum2;
sum1 = sum2 = 0;
int n, v;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> v;
sum1 += v;
}
for (int i = 0; i < n; i++) {
cin >> v;
sum2 += v;
}
if (sum2 > sum1)
cout << "NO" << endl;
else
cout << "YES" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int M = 1e6 + 5;
const int INF = 0x3f3f3f3f;
int main() {
int n;
cin >> n;
int sum1 = 0, sum2 = 0;
int x;
for (int i = 1; i <= n; i++) {
cin >> x;
sum1 += x;
}
for (int i = 1; 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, *x, *y, sum1, sum2;
cin >> n;
x = new int[n];
y = new int[n];
for (int i = 0; i < n; i++) cin >> x[i];
for (int i = 0; i < n; i++) cin >> y[i];
sum1 = accumulate(x, x + n, sum1);
sum2 = accumulate(y, y + n, sum2);
cout << (sum1 >= sum2 ? "YES" : "NO");
}
|
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2")
int main() {
int n;
cin >> n;
int s1 = 0, s2 = 0;
for (int i = 0; i < (n); ++i) {
int tmp;
cin >> tmp;
s1 += tmp;
}
for (int i = 0; i < (n); ++i) {
int tmp;
cin >> tmp;
s2 += tmp;
}
if (s1 >= s2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int x[n], y[n];
for (int i = 0; i < n; i++) cin >> x[i];
for (int i = 0; i < n; i++) cin >> y[i];
int de = 0, in = 0;
for (int i = 0; i < n; i++) {
if (x[i] > y[i]) de = de + x[i] - y[i];
if (y[i] > x[i]) in = in + y[i] - x[i];
}
if (de >= in)
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, j, a, sum1 = 0, sum2 = 0, b;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &a);
sum1 += a;
}
for (i = 0; i < n; i++) {
scanf("%d", &b);
sum2 += b;
}
if (sum1 >= sum2)
printf("Yes\n");
else
printf("No\n");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const int N = 1e6 + 5;
int main() {
int n, i, x, s1 = 0, s2 = 0;
cin >> n;
for (i = 0; i < n; i++) {
cin >> x;
s1 += x;
}
for (i = 0; i < n; i++) {
cin >> x;
s2 += x;
}
if (s1 >= s2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
long long a, b, suma = 0, sumb = 0;
cin >> n;
for (long long i = 1; i <= n; i++) {
cin >> a;
suma += a;
};
for (long long i = 1; i <= n; i++) {
cin >> b;
sumb += b;
};
if (suma < sumb)
cout << "No";
else
cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int a = 0;
cin >> n;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
a += x;
}
for (int i = 0; i < n; i++) {
int x;
cin >> x;
a -= x;
}
if (a >= 0)
cout << "Yes" << endl;
else
cout << "NO" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
long long int N;
cin >> N;
vector<long long int> a(N), b(N);
for (long long int i = 0; i < (long long int)(N); ++i) cin >> a[i];
for (long long int i = 0; i < (long long int)(N); ++i) cin >> b[i];
long long int s = 0, c = 0;
for (long long int i = 0; i < (long long int)(N); ++i) {
s += a[i];
c += b[i];
}
cout << (s >= c ? "Yes" : "No") << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& num) {
num = 0;
bool f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') f = 0;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
num = num * 10 + ch - '0';
ch = getchar();
}
num = f ? num : -num;
}
template <class T>
inline void write(T x, char ch) {
int s[100];
if (x == 0) {
putchar('0');
putchar(ch);
return;
}
if (x < 0) {
putchar('-');
x = -x;
}
int num = 0;
while (x) {
s[num++] = (x % 10);
x = x / 10;
}
for (int i = (num - 1); i >= (0); i--) putchar(s[i] + '0');
putchar(ch);
}
const double pi = acos(-1);
const double eps = 1e-8;
int main() {
int n;
read(n);
int sum = 0;
for (int i = (1); i <= (n); i++) {
int x;
read(x);
sum += x;
}
for (int i = (1); i <= (n); i++) {
int x;
read(x);
sum -= x;
}
if (sum >= 0)
puts("Yes");
else
puts("No");
}
|
#include <bits/stdc++.h>
int main(void) {
int n;
while (scanf("%d", &n) != EOF) {
int day1 = 0;
int day2 = 0;
int temp;
for (int i = 0; i < n; i++) {
scanf("%d", &temp);
day1 = day1 + temp;
}
for (int i = 0; i < n; i++) {
scanf("%d", &temp);
day2 = day2 + temp;
}
if (day1 >= day2)
printf("Yes");
else
printf("No");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
int s1 = 0;
for (int i = 0; i < n; i++) {
int num;
cin >> num;
s1 = s1 + num;
}
int s2 = 0;
for (int i = 0; i < n; i++) {
int nu;
cin >> nu;
s2 = s2 + nu;
}
if (s1 >= s2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a;
long long int sum_x = 0, sum_y = 0;
for (int i = 0; i < n; i++) {
cin >> a;
sum_x += a;
}
for (int i = 0; i < n; i++) {
cin >> a;
sum_y += a;
}
if (sum_x >= sum_y)
cout << "Yes";
else {
cout << "No";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n], 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 (suma < sumb) {
cout << "No";
} else {
cout << "Yes";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int> x(n), y(n);
for (int i = 0; i < n; i++) cin >> x[i];
int s1 = accumulate(x.begin(), x.end(), 0);
for (int i = 0; i < n; i++) cin >> y[i];
int s2 = accumulate(y.begin(), y.end(), 0);
if (s2 <= s1)
cout << "Yes";
else
cout << "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, suma = 0, sumb = 0, temp;
cin >> n;
vector<int> a;
vector<int> b;
for (int i = 0; i < n; i++) {
cin >> temp;
a.push_back(temp);
suma += temp;
}
for (int i = 0; i < n; i++) {
cin >> temp;
b.push_back(temp);
sumb += temp;
}
if (sumb <= suma)
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, c = 0;
cin >> n;
int a[n], b[n], s1 = 0, s2 = 0;
for (i = 0; i < n; i++) {
cin >> a[i];
s1 += a[i];
}
for (i = 0; i < n; i++) {
cin >> b[i];
s2 += b[i];
}
if (s1 >= s2)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int a[150], b[150];
int main() {
int n, i;
scanf("%d", &n);
for (i = 1; i <= n; i++) scanf("%d", &a[i]);
for (i = 1; i <= n; i++) scanf("%d", &b[i]);
int more = 0, less = 0;
for (i = 1; i <= n; i++) {
if (b[i] > a[i]) more += (b[i] - a[i]);
if (b[i] < a[i]) less += (a[i] - b[i]);
}
if (more <= less)
printf("Yes");
else
printf("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, s1 = 0, s2 = 0;
cin >> n;
vector<long long> v1;
vector<long long> v2;
v1.resize(n);
v2.resize(n);
for (long long i = 0; i < n; i++) {
cin >> v1[i];
s1 += v1[i];
}
for (long long i = 0; i < n; i++) {
cin >> v2[i];
s2 += v2[i];
}
if (s1 >= s2) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x[51], y[51], sum1 = 0, sum2 = 0;
cin >> 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 (sum2 > sum1)
cout << "NO";
else
cout << "YES";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int i, count1 = 0, count2 = 0, x;
for (i = 0; i < n; i++) {
cin >> x;
count1 += x;
}
for (i = 0; i < n; i++) {
cin >> x;
count2 += x;
}
if (count2 <= count1)
cout << "YES";
else
cout << "NO";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
ios::sync_with_stdio(false);
int n, x = 0, y = 0;
cin >> n;
for (int i = 0; i < n; i++) {
int v;
cin >> v;
x += v;
}
for (int i = 0; i < n; i++) {
int v;
cin >> v;
y += v;
}
if (x >= y)
cout << "Yes";
else
cout << "No";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n];
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n; i++) cin >> b[i];
int s1 = 0, s2 = 0;
for (int i = 0; i < n; i++) {
s1 = s1 + a[i];
s2 = s2 + b[i];
}
if (s1 == s2) cout << "Yes";
if (s2 > s1) cout << "No";
if (s1 > s2) cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long n, x[100000], y[100000], sumx, sumy;
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x[i];
sumx += x[i];
}
for (int i = 0; i < n; i++) {
cin >> y[i];
sumy += y[i];
}
if (sumy > sumx)
cout << "No";
else
cout << "Yes";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, sum = 0;
cin >> n;
for (int i = 0; i < n; ++i) cin >> x, sum += x;
for (int i = 0; i < n; ++i) cin >> x, sum -= x;
if (sum >= 0) return cout << "Yes", 0;
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int main() {
ios::sync_with_stdio(0);
int n;
cin >> n;
int a, b, x;
a = 0, b = 0;
for (int i = 0; i < n; i++) {
cin >> x;
a += x;
}
for (int i = 0; i < n; i++) {
cin >> x;
b += x;
}
if (a >= b)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[10000], b[10000];
int 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 (sum2 <= sum1)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int n;
int falg[110], tag[110];
int sum1 = 0, sum2 = 0;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> falg[i];
sum1 += falg[i];
}
for (int i = 0; i < n; ++i) {
cin >> tag[i];
sum2 += tag[i];
}
if (sum1 >= sum2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n, sx, sy;
int main() {
ios::sync_with_stdio(false);
cin >> n;
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
sx += x;
}
for (int i = 1; i <= n; i++) {
int y;
cin >> y;
sy += y;
}
if (sx < sy)
puts("No");
else
puts("Yes");
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int ar[100];
int n, t;
int tot = 0;
cin >> n;
for (int i = 0; i < n; i++) cin >> t, tot += t;
for (int i = 0; i < n; i++) cin >> t, tot -= t;
if (tot >= 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
|
#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 a;
cin >> a;
s1 += a;
}
for (int i = 0; i < n; i++) {
int a;
cin >> a;
s2 += a;
}
if (s1 < s2)
cout << "No\n";
else
cout << "Yes\n";
}
|
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
void solve() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int> b(n);
vector<int> c(n);
priority_queue<int> q;
for (int i = 0; i < n; i++) {
cin >> b[i];
c[i] = b[i] - a[i];
if (c[i] < 0) {
q.push(-c[i]);
}
}
for (int i = 0; i < n; i++) {
if (c[i] > 0) {
while (!q.empty() && c[i] != 0) {
int t = q.top();
q.pop();
if (c[i] < t) {
t -= c[i];
c[i] = 0;
q.push(t);
} else {
c[i] -= t;
}
}
if (c[i] > 0) {
cout << "No\n";
return;
}
}
}
cout << "Yes";
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
for (int i = 0; i < t; i++) {
solve();
}
}
|
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, OO = 0x3f3f3f3f;
int main() {
int n;
cin >> n;
int cnt1 = 0, cnt2 = 0, x;
for (int i = 0; i < n; i++) {
cin >> x;
cnt1 += x;
}
for (int i = 0; i < n; i++) {
cin >> x;
cnt2 += x;
}
cnt2 <= cnt1 ? puts("YES") : puts("NO");
return 0;
}
|
#include <bits/stdc++.h>
int main() {
long long n, i, j, k = 0, t = 0, a[200], b[200];
scanf("%d", &n);
for (i = 0; i < 2; i++) {
for (j = 0; j < n; j++) {
if (i == 0) {
scanf("%lld", &a[i]);
k += a[i];
} else {
scanf("%lld", &b[i]);
t += b[i];
}
}
}
if (k >= t)
printf("Yes");
else
printf("No");
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, c = 0, x, y;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x;
c += x;
}
for (int i = 0; i < n; i++) {
cin >> y;
c -= y;
}
if (c >= 0)
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int N, x, sum;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(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\n";
else
cout << "Yes\n";
}
|
#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 20;
vector<int> v;
int cnt, sum, sum1, arr[N], has[N];
bool flag;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> arr[i];
sum += arr[i];
}
for (int i = 0; i < n; i++) {
cin >> has[i];
sum1 += has[i];
}
if (sum1 > sum)
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);
cout.precision(20);
long long int n;
cin >> n;
vector<long long int> a(n), b(n);
for (long long int i = 0; i < n; i++) cin >> a[i];
for (long long int i = 0; i < n; i++) cin >> b[i];
long long int s1 = 0, s2 = 0;
for (long long int i = 0; i < n; i++) {
s1 += a[i];
s2 += b[i];
}
if (s2 > s1)
cout << "No";
else
cout << "Yes";
;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n;
int tmp, sum1 = 0, sum2 = 0;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &tmp);
sum1 += tmp;
}
for (int i = 0; i < n; i++) {
scanf("%d", &tmp);
sum2 += tmp;
}
if (sum1 >= sum2)
puts("Yes");
else
puts("No");
}
|
#include <bits/stdc++.h>
using namespace std;
void solve() {
long long int n;
cin >> n;
long long int a, cs = 0, cb = 0;
for (long long int i = 1; i <= n; i++) {
cin >> a;
cs += a;
}
for (long long int i = 1; i <= n; i++) {
cin >> a;
cb += a;
}
cout << (cs >= cb ? "Yes\n" : "No\n");
}
int32_t main() {
long long int T = 1;
for (long long int t = 1; t <= T; t++) {
solve();
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int N;
int x[100005], y[100005];
int sx, sy;
int main() {
ios::sync_with_stdio(0);
cin >> N;
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)
puts("Yes");
else
puts("No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int n, sa, sb, x, y;
int a[100], b[100];
int Read() {
int x = 0, f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}
int main() {
n = Read();
for (int i = 1; i <= n; ++i) a[i] = Read(), sa += a[i];
for (int i = 1; i <= n; ++i) b[i] = Read(), sb += b[i];
if (sa < sb) {
puts("No");
return 0;
}
puts("Yes");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long n, fir[50], sec[50], c1, c2, b;
int main() {
cin >> n;
for (long long i = 0; i < n; i++) {
cin >> fir[i];
c1 += fir[i];
}
for (long long i = 0; i < n; i++) {
cin >> sec[i];
c2 += sec[i];
}
if (c2 > c1)
cout << "No";
else
cout << "Yes";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int sum = 0, k, t, sum1 = 0;
for (int i = 0; i < n; ++i) {
cin >> k;
sum += k;
}
for (int i = 0; i < n; ++i) {
cin >> t;
sum1 += t;
}
if (sum >= sum1)
cout << "Yes";
else
cout << "No";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
inline int input() {
int n;
cin >> n;
return n;
}
long long pw(long long a, long long b) {
return (!b ? 1 : (b & 1 ? a * pw(a * a, b / 2) : pw(a * a, b / 2)));
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
;
int n, x = 0, y = 0;
cin >> n;
for (int i = 0; i < n; i++) x += input();
for (int i = 0; i < n; i++) y += input();
cout << (x >= y ? "Yes" : "No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
void solve() {
int t, c1 = 0, c2 = 0;
cin >> t;
int arr1[t], arr2[t];
for (int i = 0; i < t; ++i) {
cin >> arr1[i];
c1 += arr1[i];
}
for (int i = 0; i < t; ++i) {
cin >> arr2[i];
c2 += arr2[i];
}
c2 > c1 ? cout << "NO\n" : cout << "YES\n";
}
int main() { solve(); }
|
#include <bits/stdc++.h>
using namespace std;
const int MN = 1e5 + 10;
const int MOD = 1e9 + 7;
using pi = pair<long long, long long>;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
long long n;
cin >> n;
long long sum = 0;
long long sum2 = 0;
for (int i = 0; i < n; i++) {
long long num;
cin >> num;
sum += num;
}
for (int i = 0; i < n; i++) {
long long num;
cin >> num;
sum2 += num;
}
if (sum >= sum2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.