buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> vll; typedef map<int, int> mii; typedef vector<char> ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vi> vvi; typedef vector<vl> vvl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> vll; typedef map<int, int> mii; typedef vector<char> ...
[["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["+", 0, 11, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 0, 11, 12, 16, 31, 2, 3, 4, 0, 22], ["+", 0, 11, 12, 16, 31, 2, 3, 4, 0, 21], ["+", 0, 11, 12, 16, 31, 2, 3, 4, 0, 25]]
1
812
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define whole(x) (x).begin(), (x).end() #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) using ll = long long; using P = pair<int, int>; const int mod = 1000000007; vector<int...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define whole(x) (x).begin(), (x).end() #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) using ll = long long; using P = pair<int, int>; const int mod = 1000000007; vector<int...
[["-", 0, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
408
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 2e5 + 5; int a[N]; vector<int> g[N]; int n; int ans[N]; vector<int> d; void dfs(int k, int par) { ans[k] = d.size(); for (auto &it : g[k]) { int temp; if (it == par) continue; bool flag = 1; auto itr = upper_bo...
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 2e5 + 5; int a[N]; vector<int> g[N]; int n; int ans[N]; vector<int> d; void dfs(int k, int par) { ans[k] = d.size(); for (auto &it : g[k]) { int temp; if (it == par) continue; bool flag = 1; auto itr = lower_bo...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
348
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include ...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
4,599
#ifndef DEBUG #pragma GCC optimize("O3,unroll-loops") #pragma loop_opt(on) #endif #include <bits/stdc++.h> using namespace std; #ifdef DEBUG #define FAST ; #else #define FAST \ ios::sync_with_stdio(0); ...
#ifndef DEBUG #pragma GCC optimize("O3,unroll-loops") #pragma loop_opt(on) #endif #include <bits/stdc++.h> using namespace std; #ifdef DEBUG #define FAST ; #else #define FAST \ ios::sync_with_stdio(0); ...
[["-", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
397
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define mod 1000000007 #define inf 100000000000000001 #define PI 3.14159265 #define fastio \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define mod 1000000007 #define inf 100000000000000001 #define PI 3.14159265 #define fastio \ ios_base::sync_with_stdio(false); ...
[["+", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73]]
1
529
import sys input = sys.stdin.readline from collections import deque import bisect n = int(input()) a = list(map(int,input().split())) links = [[] for _ in range(n+1)] for _ in range(n-1): v,w = map(int, input().split()) links[v].append(w) links[w].append(v) inf = 10**10 lis = [inf] * n inf_ind = 0 parent...
import sys input = sys.stdin.readline from collections import deque import bisect n = int(input()) a = list(map(int,input().split())) links = [[] for _ in range(n+1)] for _ in range(n-1): v,w = map(int, input().split()) links[v].append(w) links[w].append(v) inf = 10**10 lis = [inf] * n inf_ind = 0 parent...
[["-", 0, 52, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
330
#include <bits/stdc++.h> #define x first #define y second #define pii pair<int, int> #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() using namespace std; typedef long long LL; const int maxn = 2e5 + 25; int n, m, u, v, cnt, head[maxn], a[maxn], c[maxn]; struct edge { int to, nxt; } e[maxn << 1]; ...
#include <bits/stdc++.h> #define x first #define y second #define pii pair<int, int> #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() using namespace std; typedef long long LL; const int maxn = 2e5 + 25; int n, m, u, v, cnt, head[maxn], a[maxn], c[maxn]; struct edge { int to, nxt; } e[maxn << 1]; ...
[["-", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
731
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPS(i, n) for (ll i = 1; i <= (ll)(n); i++) #define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--) #define FOR(i, a, b) for (ll i = (a); i <= (b); i++) #define FORD(i, a, b) for (ll i = (a); i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPS(i, n) for (ll i = 1; i <= (ll)(n); i++) #define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--) #define FOR(i, a, b) for (ll i = (a); i <= (b); i++) #define FORD(i, a, b) for (ll i = (a); i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
457
import sys import bisect sys.setrecursionlimit(10**9) INF = 2**30 N = int(input()) A = list(map(int, input().split())) E = [] for i in range(N): E.append([]) for i in range(N-1): u, v = list(map(int, input().split())) u -= 1 v -= 1 E[u].append(v) E[v].append(u) ans = [0] * N dp = [INF] * N def...
import sys import bisect sys.setrecursionlimit(10**9) INF = 2**30 N = int(input()) A = list(map(int, input().split())) E = [] for i in range(N): E.append([]) for i in range(N-1): u, v = list(map(int, input().split())) u -= 1 v -= 1 E[u].append(v) E[v].append(u) ans = [0] * N dp = [INF] * N def...
[["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
236
#include <bits/stdc++.h> using namespace std; using LL = long long int; #define incID(i, l, r) for (int i = (l); i < (r); ++i) #define decID(i, l, r) for (int i = (r)-1; i >= (l); --i) #define incII(i, l, r) for (int i = (l); i <= (r); ++i) #define decII(i, l, r) for (int i = (r); i >= (l); --i) #define inc(i, n) incID...
#include <bits/stdc++.h> using namespace std; using LL = long long int; #define incID(i, l, r) for (int i = (l); i < (r); ++i) #define decID(i, l, r) for (int i = (r)-1; i >= (l); --i) #define incII(i, l, r) for (int i = (l); i <= (r); ++i) #define decII(i, l, r) for (int i = (r); i >= (l); --i) #define inc(i, n) incID...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
1,406
// look at my code // my code is amazing #include <bits/stdc++.h> using namespace std; #define ll long long #define int long long #define mod 1000000007 // 998244353 #define fast \ ios_base::sync_with_stdio(false); ...
// look at my code // my code is amazing #include <bits/stdc++.h> using namespace std; #define ll long long #define int long long #define mod 1000000007 // 998244353 #define fast \ ios_base::sync_with_stdio(false); ...
[["-", 0, 1, 0, 2, 3, 4, 0, 66, 17, 48], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
576
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define rep2(i, s, n) for (int i = (s); i <...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define rep2(i, s, n) for (int i = (s); i <...
[["-", 0, 57, 64, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 57, 64, 9, 0, 43, 49, 50, 49, 22], ["-", 64, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 64, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9...
1
630
#define _CRT_SECURE_NO_WARNINGS #pragma comment(linker, "/stack:512000000") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <ccomplex> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #...
#define _CRT_SECURE_NO_WARNINGS #pragma comment(linker, "/stack:512000000") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <ccomplex> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
669
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; const ll mod = 1e9 + 7; // const ll mod = 998244353; #define REP(i, n) for (int i = 0; i < (int)n; ++i) // debug #define dump(x) cer...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; const ll mod = 1e9 + 7; // const ll mod = 998244353; #define REP(i, n) for (int i = 0; i < (int)n; ++i) // debug #define dump(x) cer...
[["-", 51, 16, 31, 2, 3, 4, 0, 69, 28, 22], ["-", 31, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 31, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["-", 31, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
732
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl...
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl...
[["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 49, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["-", 0, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
679
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define int long long #define double long d...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define int long long #define double long d...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
550
#include <bits/stdc++.h> using namespace std; #define int long long #define PP pair<int, pair<int, int>> const int MAX = 1000001; const int MOD = 998244353; const int INV2 = (MOD + 1) / 2; vector<int> hen[200000]; int ans[200000]; int basho[200000], basho2[200000]; bool used[200000]; template <typename T, typename E> ...
#include <bits/stdc++.h> using namespace std; #define int long long #define PP pair<int, pair<int, int>> const int MAX = 1000001; const int MOD = 998244353; const int INV2 = (MOD + 1) / 2; vector<int> hen[200000]; int ans[200000]; int basho[200000], basho2[200000]; bool used[200000]; template <typename T, typename E> ...
[["+", 0, 57, 15, 339, 51, 16, 31, 118, 17, 131], ["+", 0, 57, 15, 339, 51, 16, 31, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 12, 118, 17, 131], ["+", 0, 57, 15, 339, 51, 16, 12, 118, 119, 120]]
1
961
#include <bits/stdc++.h> using namespace std; #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define MIN(a) *min_element(all(a)) #define MAX(a) *max_element(all(a)) #define SUM(a) accumulate(all(a), 0LL) #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define RREP(i, n) for (int(i)...
#include <bits/stdc++.h> using namespace std; #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define MIN(a) *min_element(all(a)) #define MAX(a) *max_element(all(a)) #define SUM(a) accumulate(all(a), 0LL) #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define RREP(i, n) for (int(i)...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
639
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define int long long #define endl '\n' #define pb push_back #define fi first #define se second #define all(c) (c).begin(), (c).end() typedef long long ll; typedef long...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define int long long #define endl '\n' #define pb push_back #define fi first #define se second #define all(c) (c).begin(), (c).end() typedef long long ll; typedef long...
[["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]]
1
529
import java.awt.Point; import java.io.*; import java.math.*; import java.util.*; public class Main { // static final long MOD = 998244353L; // static final long INF = 1000000000000000007L; static final long MOD = 1000000007L; static final int INF = 1000000007; public static void main(String[] args) { Fa...
import java.awt.Point; import java.io.*; import java.math.*; import java.util.*; public class Main { // static final long MOD = 998244353L; // static final long INF = 1000000000000000007L; static final long MOD = 1000000007L; static final int INF = 1000000007; public static void main(String[] args) { Fa...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
950
#include <bits/stdc++.h> #define god dimasi5eks #pragma GCC optimize("O3") #define fi first #define se second #define pb push_back #define pf push_front // #define fisier 1 using namespace std; typedef long long ll; const int mod = 1000000007; const double dancila = 3.14159265359; // PI const double eps = 1e-9; in...
#include <bits/stdc++.h> #define god dimasi5eks #pragma GCC optimize("O3") #define fi first #define se second #define pb push_back #define pf push_front // #define fisier 1 using namespace std; typedef long long ll; const int mod = 1000000007; const double dancila = 3.14159265359; // PI const double eps = 1e-9; in...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
120
//#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <vector> using namespace std; ...
//#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <vector> using namespace std; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
643
#include <algorithm> #include <iostream> #include <stack> #include <vector> using namespace std; #define repl(i, l, r) for (ll i = l; i < r; i++) #define rep(i, n) repl(i, 0, n) using ll = long long; vector<int> lis(200005, 1e9), G[200005]; int ans[200005], a[200005]; void DFS(const int &v, stack<pair<int, int>> &s, in...
#include <algorithm> #include <iostream> #include <stack> #include <vector> using namespace std; #define repl(i, l, r) for (ll i = l; i < r; i++) #define rep(i, n) repl(i, 0, n) using ll = long long; vector<int> lis(200005, 1e9), G[200005]; int ans[200005], a[200005]; void DFS(const int &v, stack<pair<int, int>> &s, in...
[["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 33], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13]]
1
379
#include <bits/stdc++.h> using namespace std; using lint = long long; constexpr lint mod = 1e9 + 7; #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountl((lint)(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzl(x)) #define rep(i, n) for (int i = 0; i < i...
#include <bits/stdc++.h> using namespace std; using lint = long long; constexpr lint mod = 1e9 + 7; #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountl((lint)(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzl(x)) #define rep(i, n) for (int i = 0; i < i...
[["-", 51, 2, 3, 4, 0, 16, 31, 2, 63, 22], ["+", 51, 2, 3, 4, 0, 16, 31, 2, 63, 22]]
1
1,338
#!/usr/bin/env python3 #F import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collect...
#!/usr/bin/env python3 #F import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collect...
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
333
#include <bits/stdc++.h> using namespace std; #define modulo N #define mod(mod_x) ((((long long)mod_x + modulo)) % modulo) #define Inf 1000000005 vector<int> dp(200005, Inf); vector<int> a; vector<int> ans; void dfs(auto &E, int now, int parent, int t) { int ok = distance(dp.begin(), upper_bound(dp.begin(), dp.end(...
#include <bits/stdc++.h> using namespace std; #define modulo N #define mod(mod_x) ((((long long)mod_x + modulo)) % modulo) #define Inf 1000000005 vector<int> dp(200005, Inf); vector<int> a; vector<int> ans; void dfs(auto &E, int now, int parent, int t) { int ok = distance(dp.begin(), upper_bound(dp.begin(), dp.end(...
[["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
373
import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.util.ArrayList; import java.util.Arrays; import java.util.InputMismatchException; /** * Built using CHel...
import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.util.ArrayList; import java.util.Arrays; import java.util.InputMismatchException; /** * Built using CHel...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
977
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int nax = 2e5; vector<int> node[nax]; int ans[nax]; int a[nax]; vector<int> cur; void dfs(int p, int par) { int j = lower_bound(cur.begin(), cur.end(), a[p]) - cur.begin(); int added = (j == (int)cur.size()), cp; if (added) cur.push_b...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int nax = 2e5; vector<int> node[nax]; int ans[nax]; int a[nax]; vector<int> cur; void dfs(int p, int par) { int j = lower_bound(cur.begin(), cur.end(), a[p]) - cur.begin(); int added = (j == (int)cur.size()), cp; if (added) cur.push_b...
[["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22]]
1
325
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define pp pair<int, int> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ld long double #define al(a) (a).begin(), (a).end() #define mk make_pair #define check cout << "?" << endl; ll MOD = 1000000007; ll mod = 9...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define pp pair<int, int> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ld long double #define al(a) (a).begin(), (a).end() #define mk make_pair #define check cout << "?" << endl; ll MOD = 1000000007; ll mod = 9...
[["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22]]
1
472
#include <bits/stdc++.h> using namespace std; int main() { int64_t N; cin >> N; vector<int64_t> a(N); for (int64_t &A : a) { cin >> A; } vector<vector<int64_t>> connect(N); for (int64_t i = 0; i < N - 1; i++) { int64_t u, v; cin >> u >> v; u--; v--; connect[u].push_back(v); c...
#include <bits/stdc++.h> using namespace std; int main() { int64_t N; cin >> N; vector<int64_t> a(N); for (int64_t &A : a) { cin >> A; } vector<vector<int64_t>> connect(N); for (int64_t i = 0; i < N - 1; i++) { int64_t u, v; cin >> u >> v; u--; v--; connect[u].push_back(v); c...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
300
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i <= (b); ++i) #define per(i, a, b) for (int i = a; i >= (b); --i) #define mem(a, x) memset(a, x, sizeof(a)) #define pb push_back #define pi pair<int, int> #define mk make_pair using namespace std; typedef long long ll; ll gcd(ll a, ll b) { return b ? gcd(b,...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i <= (b); ++i) #define per(i, a, b) for (int i = a; i >= (b); --i) #define mem(a, x) memset(a, x, sizeof(a)) #define pb push_back #define pi pair<int, int> #define mk make_pair using namespace std; typedef long long ll; ll gcd(ll a, ll b) { return b ? gcd(b,...
[["-", 75, 76, 0, 9, 0, 43, 49, 50, 51, 13], ["+", 75, 76, 0, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 57, 75, 76, 0, 9, 0, 43, 0, 21], ["-", 75, 76, 0, 9, 0, 43, 49, 50, 49, 22], ["-", 75, 76, 0, 9, 0, 43, 49, 50, 0, 32]]
1
418
import bisect import sys sys.setrecursionlimit(3*10**5) INF = 10**10 N = int(input()) a = list(map(int,input().split())) T = [set() for x in range(N)] for i in range(N-1): u,v = map(int,input().split()) u -= 1 v -= 1 T[u].add(v) T[v].add(u) search = [0]*N A = [INF] ans = [-1]*N def dfs(V): ...
import bisect import sys sys.setrecursionlimit(3*10**5) INF = 10**10 N = int(input()) a = list(map(int,input().split())) T = [set() for x in range(N)] for i in range(N-1): u,v = map(int,input().split()) u -= 1 v -= 1 T[u].add(v) T[v].add(u) search = [0]*N A = [INF] ans = [-1]*N def dfs(V): ...
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 18]]
5
256
#include <algorithm> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <vector> int N; std::vector<int> edge[200005]; std::vector<int> dp(200005, 1001001001)...
#include <algorithm> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <vector> int N; std::vector<int> edge[200005]; std::vector<int> dp(200005, 1001001001)...
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
371
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define ll long long int #define f(i, n) for (ll i = 0; i < n; i++) #define ff(i, n) for (ll i = 1; i <= n; i++) #define pb push_back #define aa(s) s.begin(), s.end() // #define v() vector<ll>v #define PI 3.14159265 //#define st string // #define p 9...
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define ll long long int #define f(i, n) for (ll i = 0; i < n; i++) #define ff(i, n) for (ll i = 1; i <= n; i++) #define pb push_back #define aa(s) s.begin(), s.end() // #define v() vector<ll>v #define PI 3.14159265 //#define st string // #define p 9...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
731
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long ll; typedef pair<ll, ll> pll; const int N = 2e5 + 5; ll arr[N], ans[N]; vector<int> adj[N]; void dfs(int node, int par, vector<ll> &lis) { bool add = 0; ll val = arr[node], idx = -1, old = -1; auto it = upper_bound(li...
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long ll; typedef pair<ll, ll> pll; const int N = 2e5 + 5; ll arr[N], ans[N]; vector<int> adj[N]; void dfs(int node, int par, vector<ll> &lis) { bool add = 0; ll val = arr[node], idx = -1, old = -1; auto it = lower_bound(li...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
361
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #defin...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #defin...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
329
#include <bits/stdc++.h> using namespace std; // Shortening code typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; typedef tuple<int, int, int> ti; // Macros #define F first #define S second #define PB push_back #define MP make_pair #define MT make_tuple #define REP(i, a, b) for (int i = a; i <...
#include <bits/stdc++.h> using namespace std; // Shortening code typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; typedef tuple<int, int, int> ti; // Macros #define F first #define S second #define PB push_back #define MP make_pair #define MT make_tuple #define REP(i, a, b) for (int i = a; i <...
[["-", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 31, 27, 17, 29]]
1
391
#include <bits/stdc++.h> #define endl '\n' #define null NULL #define ls p << 1 #define rs p << 1 | 1 #define fi first #define se second #define mp make_pair #define pb push_back #define ll long long #define int long long #define vi vector<int> #define mii map<int, int> #define pii pair<int, int> #define ull unsigned lo...
#include <bits/stdc++.h> #define endl '\n' #define null NULL #define ls p << 1 #define rs p << 1 | 1 #define fi first #define se second #define mp make_pair #define pb push_back #define ll long long #define int long long #define vi vector<int> #define mii map<int, int> #define pii pair<int, int> #define ull unsigned lo...
[["-", 0, 57, 75, 76, 0, 9, 0, 43, 39, 40], ["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22]]
1
492
#include <bits/stdc++.h> #define ll unsigned long long using namespace std; const ll MAX = 2e5 + 10; ll n; ll len; ll u0, v0; ll a[MAX]; ll ans[MAX]; vector<ll> adj[MAX]; vector<stack<ll>> dp(MAX); void dfs(ll cur, ll par) { bool flag = 0; ll ind; if (a[cur] < dp[1].top()) { dp[1].push(a[cur]); ind = 1; ...
#include <bits/stdc++.h> #define ll long long using namespace std; const ll MAX = 2e5 + 10; ll n; ll len; ll u0, v0; ll a[MAX]; ll ans[MAX]; vector<ll> adj[MAX]; vector<stack<ll>> dp(MAX); void dfs(ll cur, ll par) { bool flag = 0; ll ind; if (a[cur] <= dp[1].top()) { dp[1].push(a[cur]); ind = 1; } else...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
487
/* _________________________ | LIVE FREE OR DIE | | 327 2153 | | New | |_______HAMPSHIRE________| */ #include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); ...
/* _________________________ | LIVE FREE OR DIE | | 327 2153 | | New | |_______HAMPSHIRE________| */ #include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); ...
[["-", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 29]]
1
361
#include <bits/stdc++.h> #define ll long long #define pii pair<int, int> #define mp make_pair #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fi first #define se second #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define maxn 20...
#include <bits/stdc++.h> #define ll long long #define pii pair<int, int> #define mp make_pair #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fi first #define se second #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define maxn 20...
[["-", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 2, 63, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["-", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["-", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25]]
1
447
import sys sys.setrecursionlimit(10**8) N = int(input()) A = list(map(int,input().split())) UV = [tuple(map(int,input().split())) for i in range(N-1)] es = [[] for _ in range(N)] for u,v in UV: u,v = u-1,v-1 es[u].append(v) es[v].append(u) from bisect import bisect lis = [A[0]] stack = [] ans = [1] * N def...
import sys sys.setrecursionlimit(10**8) N = int(input()) A = list(map(int,input().split())) UV = [tuple(map(int,input().split())) for i in range(N-1)] es = [[] for _ in range(N)] for u,v in UV: u,v = u-1,v-1 es[u].append(v) es[v].append(u) from bisect import bisect_left lis = [A[0]] stack = [] ans = [1] * ...
[["-", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22], ["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
280
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<long long, long long> P; struct edge { long long to, cost; }; const int inf = 1 << 27; // const long long INF = 100; const long long INF = 1LL << 60; const int COMBMAX = 1001001; const long long MOD = 1000000007; #define rep(i, n) for (i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<long long, long long> P; struct edge { long long to, cost; }; const int inf = 1 << 27; // const long long INF = 100; const long long INF = 1LL << 60; const int COMBMAX = 1001001; const long long MOD = 1000000007; #define rep(i, n) for (i...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22]]
1
775
#include <bits/stdc++.h> #define ll long long using namespace std; const int MAXN = 200010; const int MAXM = 100010; const int INF = 0x3f3f3f3f; const int mod = 1e9 + 7; int n, m, k; int tot, cnt; int a[MAXN], f[MAXN], ans[MAXN]; int head[MAXN]; struct edge { int to, next; } e[MAXN * 2]; void add_edge(int x, i...
#include <bits/stdc++.h> #define ll long long using namespace std; const int MAXN = 200010; const int MAXM = 100010; const int INF = 0x3f3f3f3f; const int mod = 1e9 + 7; int n, m, k; int tot, cnt; int a[MAXN], f[MAXN], ans[MAXN]; int head[MAXN]; struct edge { int to, next; } e[MAXN * 2]; void add_edge(int x, i...
[["-", 0, 57, 64, 1, 0, 34, 31, 11, 12, 13], ["+", 64, 1, 0, 34, 31, 11, 12, 69, 28, 22], ["+", 0, 34, 31, 11, 12, 69, 341, 342, 0, 70], ["+", 0, 34, 31, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 34, 31, 11, 12, 69, 341, 342, 0, 73]]
1
451
from collections import deque from bisect import bisect_right,bisect_left import sys sys.setrecursionlimit(10**7) n=int(input()) a=list(map(int,input().split())) edge=[[] for _ in range(n)] for _ in range(n-1): u,v=map(int,input().split()) u-=1 v-=1 edge[u].append(v) edge[v].append(u) stack=deque([]...
from collections import deque from bisect import bisect_left import sys sys.setrecursionlimit(10**7) n=int(input()) a=list(map(int,input().split())) edge=[[] for _ in range(n)] for _ in range(n-1): u,v=map(int,input().split()) u-=1 v-=1 edge[u].append(v) edge[v].append(u) stack=deque([]) inf=10**18 ...
[["-", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22], ["-", 36, 36, 36, 36, 0, 656, 0, 686, 0, 21], ["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
260
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; using namespace std; #define ff first #define ss second #define int long long #define ll long long #define pb push_back #define pii pair<int, int> #define vi vector<int> #define mii map<int, int> #define pqb priority_que...
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; using namespace std; #define ff first #define ss second #define int long long #define ll long long #define pb push_back #define pii pair<int, int> #define vi vector<int> #define mii map<int, int> #define pqb priority_que...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18]]
1
628
/* (1)for binary shift operator always use 'LL' 1LL<<63 */ #include <bits/stdc++.h> using namespace std; #define ll long long #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set_pair \ tre...
/* (1)for binary shift operator always use 'LL' 1LL<<63 */ #include <bits/stdc++.h> using namespace std; #define ll long long #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set_pair \ tre...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 39, 78], ["+", 0, 57, 64, 9, 0, 43, 49, 50, 49, 22], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
588
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; #define lp(var, start, end) for (ll var = start; var < end; ++var) #define rlp(var, start, end) for (ll var = start; var >= end; var--) #define pb push_back #define mp make_pair #define pf push_front #define ff first #defin...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; #define lp(var, start, end) for (ll var = start; var < end; ++var) #define rlp(var, start, end) for (ll var = start; var >= end; var--) #define pb push_back #define mp make_pair #define pf push_front #define ff first #defin...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
762
/* # */ #include <algorithm> #include <cassert> #include <cmath> #include <cstdint> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> //#pragma warning(disable:4996) using namespace std...
/* # */ #include <algorithm> #include <cassert> #include <cmath> #include <cstdint> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> //#pragma warning(disable:4996) using namespace std...
[["-", 3, 4, 0, 16, 31, 2, 63, 118, 119, 120], ["+", 3, 4, 0, 16, 31, 2, 63, 118, 119, 120], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
496
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; #define rep(i, a, b) for (i = (a); i <= (b); i++) #define ll int #define pll pair<ll, ll> #define pii pair<int, int> #define pb push_back #define F first #define...
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; #define rep(i, a, b) for (i = (a); i <= (b); i++) #define ll int #define pll pair<ll, ll> #define pii pair<int, int> #define pb push_back #define F first #define...
[["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
494
#include <bits/stdc++.h> #define maxn 500005 #define maxa 2000005 #define MOD 100000000 // 1000000007 //998244353 #define INF 1000000000000000000 #define ll long long using namespace std; #define pii pair<ll, ll> #define piii pair<ll, pii> #define ft first #define sd second #define pb push_back #define rep(i, n) for ...
#include <bits/stdc++.h> #define maxn 500005 #define maxa 2000005 #define MOD 100000000 // 1000000007 //998244353 #define INF 1000000000000000000 #define ll long long using namespace std; #define pii pair<ll, ll> #define piii pair<ll, pii> #define ft first #define sd second #define pb push_back #define rep(i, n) for ...
[["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
453
import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) from bisect import bisect_left N = int(input()) a = [int(i) for i in input().split()] vec = [[] for _ in range(N)] for _ in range(N - 1) : u, v = map(int, input().split()) vec[u - 1].append(v - 1) vec[v - 1].append(u - 1) lis = [a[0]] ret = [0...
import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) from bisect import bisect_left N = int(input()) a = [int(i) for i in input().split()] vec = [[] for _ in range(N)] for _ in range(N - 1) : u, v = map(int, input().split()) vec[u - 1].append(v - 1) vec[v - 1].append(u - 1) lis = [a[0]] ret = [0...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
266
A, B, C, D = map(int, input().split()) m = C // B #青木君の耐えうるターン if C % B == 0: m = m+1 n = A // D #高橋君の耐えうるターン if A % D == 0: n = n+1 if n < m : print('Yes') else: print('No')
A, B, C, D = map(int, input().split()) m = C // B # 青木君の耐えうるターン if C % B != 0: m = m + 1 n = A // D # 高橋君の耐えうるターン if A % D != 0: n = n + 1 if n >= m: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 79], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
75
A, B, C, D = map(int, input().split()) while A > 0 and C > 0: A -= D C -= B if C != 0: print('No') else: print('Yes')
A, B, C, D = map(int, input().split()) while A > 0 and C > 0: A -= D C -= B if C <= 0: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 79], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
54
#include <iostream> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int p = (a + d - 1) / d; int q = (c + b - 1) / b; if (p >= q) cout << "Yes" << endl; else cout << "NO" << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int p = (a + d - 1) / d; int q = (c + b - 1) / b; if (p >= q) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
83
# 164 # 高橋君モンスター体力A/攻撃力B # 青木君モンスター体力C/攻撃力D # 高橋→青木→高橋→青木の順番 # 相手のモンスターの体力を自分のモンスターの攻撃分減らせる。C=C-B/A=A-D # どちらかの体力が0以下になるまで戦い続ける。 A<0 B<0 # 先に自分のモンスターの体力が0になった方が負け。 # 高橋君が勝つなら”YES”負けるなら”NO”を出力 A,B,C,D = map(int,input().split()) while A>0 and C>0: C = C-B A = A-D if C <= 0: print("YES") else: print("NO...
# 164 # 高橋君モンスター体力A/攻撃力B # 青木君モンスター体力C/攻撃力D # 高橋→青木→高橋→青木の順番 # 相手のモンスターの体力を自分のモンスターの攻撃分減らせる。C=C-B/A=A-D # どちらかの体力が0以下になるまで戦い続ける。 A<0 B<0 # 先に自分のモンスターの体力が0になった方が負け。 # 高橋君が勝つなら”Yes”負けるなら”No”を出力 A,B,C,D = map(int,input().split()) while A>0 and C>0: C = C-B A = A-D if C <= 0: print("Yes") else: print("No...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
66
A,B,C,D = map(int,input().split()) while True: C -= B A -= D if C <= 0: result = "YES" break if A <= 0: result = "NO" break print(result)
A,B,C,D = map(int,input().split()) while True: C-=B A-=D if C<=0: result="Yes" break if A<=0: result="No" break print(result)
[["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
55
A,B,C,D=map(int,input().split()) while A>0 and C>0: A-=D C-=B if A<=0: print("No") else: print("Yes")
A,B,C,D=map(int,input().split()) while A>0 and C>0: A-=D C-=B if C<=0: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
54
a, b, c, d = map(int, input().split()) while c or a >= 0: c -= b a -= b if c <= 0: print("Yes") break if a <= 0: print("No")
a, b, c, d = map(int, input().split()) while c or a >= 0: c -= b a -= d if c <= 0: print("Yes") break if a <= 0: print("No") break
[["-", 0, 52, 8, 196, 0, 1, 0, 677, 12, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 22], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
56
# abc164B # https://atcoder.jp/contests/abc164/tasks/abc164_b # 高橋君モンスターの体力はA、攻撃力はB # 青木君モンスターの体力はC、攻撃力はD # 高橋君が勝ったら"Yes"、負けたら"No" # 入力 a, b, c, d = map(int, input().split()) # 処理 # 必殺技を受けた残りの体力 while a > 0 and c > 0: a -= d c -= b if a <= 0: print("No") else: print("Yes")
# abc164B # https://atcoder.jp/contests/abc164/tasks/abc164_b # 高橋君モンスターの体力はA、攻撃力はB # 青木君モンスターの体力はC、攻撃力はD # 高橋君が勝ったら"Yes"、負けたら"No" # 入力 a, b, c, d = map(int, input().split()) # 処理 # 必殺技を受けた残りの体力 while a > 0 and c > 0: a -= d c -= b if c <= 0: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
62
a,b,c,d = map(int,input().split()) while a>0 and b>0: a-=d c-=b print(a,c) if a <= 0 and c<=0: print('Yes') elif c <= 0: print('Yes') else: print('No')
a,b,c,d = map(int,input().split()) while a>0 and b>0: a-=d c-=b if a <= 0 and c<=0: print('Yes') elif c <= 0: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
75
a, b, c, d = map(int, input().split()) i = 0 i1 = 0 while a > 0: a -= b i += 1 while c > 0: c -= d i1 += 1 if i <= i1: print('Yes') else: print('No')
a, b, c, d = map(int, input().split()) i = 0 i1 = 0 while a > 0: a -= d i += 1 while c > 0: c -= b i1 += 1 if i >= i1: print('Yes') else: print('No')
[["-", 0, 52, 8, 196, 0, 1, 0, 677, 12, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
67
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int a, b, c, d; cin >> a >> b >> c >> d; while (true) { a -= b; if (a <= 0) { cout << "Yes" << endl; return 0; } c -= d; if (c <= 0) { cout << "No...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int a, b, c, d; cin >> a >> b >> c >> d; while (true) { c -= b; if (c <= 0) { cout << "Yes" << endl; return 0; } a -= d; if (a <= 0) { cout << "No...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]]
1
97
import math A,B,C,D=map(int,input().split()) print("Yes" if math.ceil(A/D) >= math.ceil(B/C) else "No")
import math A,B,C,D=map(int,input().split()) print("Yes" if math.ceil(A/D) >= math.ceil(C/B) else "No")
[["-", 0, 666, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 666, 0, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 666, 0, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 666, 0, 652, 3, 4, 0, 657, 12, 22]]
5
50
A, B, C, D = map(int, input().split()) T_HP = A T_AT = B A_HP = C A_AT = D T_count = 0 A_count = 0 while T_HP > 0: T_HP -= A_AT T_count += 1 while A_HP > 0: A_HP -= T_AT A_count += 1 if T_count > A_count: print('Yes') if T_count == A_count: print('Yes') else: print('No')
A, B, C, D = map(int, input().split()) T_HP = A T_AT = B A_HP = C A_AT = D T_count = 0 A_count = 0 while T_HP > 0: T_HP -= A_AT T_count += 1 while A_HP > 0: A_HP -= T_AT A_count += 1 if T_count > A_count: print('Yes') elif T_count == A_count: print('Yes') else: print('No')
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
90
a, b, c, d = map(int,input().split()) while True: c = c - b a = a - d if c <= 0: print('No') break elif a <= 0: print('Yes') break else: pass
a, b, c, d = map(int,input().split()) while True: c = c - b a = a - d if c <= 0: print('Yes') break elif a <= 0: print('No') break else: pass
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
60
A, B, C, D=map(int,input().split()) while C or A >= 0: C -= B A -= D if C <= 0: print("Yes") if A <= 0: print("No") break
A, B, C, D=map(int,input().split()) while C or A >= 0: C -= B A -= D if C <= 0: print("Yes") break if A <= 0: print("No") break
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
56
a,b,c,d = map(int,input().split()) print('Yes' if (c+b-1)/b <= (a+d-1)/d else 'No')
a,b,c,d = map(int,input().split()) print('Yes' if (c+b-1)//b <= (a+d-1)//d else 'No')
[["-", 3, 4, 0, 41, 0, 666, 0, 657, 17, 85], ["+", 3, 4, 0, 41, 0, 666, 0, 657, 17, 676]]
5
50
def resolve(): a,b,c,d = map(int,input().split()) A = math.ceil(c/b) B = math.ceil(a/d) print('Yes' if A <= B else 'No') resolve()
import math def resolve(): a,b,c,d = map(int,input().split()) A = math.ceil(c/b) B = math.ceil(a/d) print('Yes' if A <= B else 'No') resolve()
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
62
A, B, C, D = map(int, input().split()) print('Yes' if -A // D > -C // B else 'No')
A, B, C, D = map(int, input().split()) print('No' if -A // D > -C // B else 'Yes')
[["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
40
a,b,c,d = map(int,input().split()) if -(-a//c) >= -(-d//b): print("Yes") else: print("No")
a,b,c,d = map(int,input().split()) if -(-a//d) >= -(-c//b): print("Yes") else: print("No")
[["-", 15, 666, 0, 664, 28, 23, 0, 657, 12, 22], ["+", 15, 666, 0, 664, 28, 23, 0, 657, 12, 22], ["-", 0, 664, 28, 23, 0, 657, 31, 664, 28, 22], ["+", 0, 664, 28, 23, 0, 657, 31, 664, 28, 22]]
5
51
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; using namespace std; int main(void) { // Your code here! int a, b, c, d; cin >> a >> b >> c >> d; while (a > 0 and c > 0) { c -= b; if (c <= 0) { break; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; using namespace std; int main(void) { // Your code here! int a, b, c, d; cin >> a >> b >> c >> d; while (a > 0 and c > 0) { c -= b; if (c <= 0) { break; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
117
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define all(x) (x).begin(), (x).end() #define PI 3.14159265358979323846264338327950L using namespace std; typedef long long ll; typedef long double ld; int main() {...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define all(x) (x).begin(), (x).end() #define PI 3.14159265358979323846264338327950L using namespace std; typedef long long ll; typedef long double ld; int main() {...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
124
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int x = (a + d - 1) / d; int y = (c + b - 1) / b; x >= y ? (cout << "YES\n") : (cout << "NO\n"); }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int x = (a + d - 1) / d; int y = (c + b - 1) / b; x >= y ? (cout << "Yes\n") : (cout << "No\n"); }
[["-", 0, 41, 64, 23, 0, 16, 12, 5, 0, 6], ["+", 0, 41, 64, 23, 0, 16, 12, 5, 0, 6], ["-", 0, 41, 75, 23, 0, 16, 12, 5, 0, 6], ["+", 0, 41, 75, 23, 0, 16, 12, 5, 0, 6]]
1
79
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define PI 3.1415 int main() { int a, b, c, d; cin >> a >> b >> c >> d; while (true) { c -= b; if (c <= 0) { cout << "No" << endl; break; } a -= d; if (a <= 0) { cout << "Yes" << endl...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 #define PI 3.1415 int main() { int a, b, c, d; cin >> a >> b >> c >> d; while (true) { c -= b; if (c <= 0) { cout << "Yes" << endl; break; } a -= d; if (a <= 0) { cout << "No" << endl...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
90
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { uint32_t A, B, C, D; cin >> A >> B >> C >> D; cout << ((uint32_t)((C + B - 1) / B) <= (uint32_t)((A + D - 1) / D) ? "YES\n" : "NO\n...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { uint32_t A, B, C, D; cin >> A >> B >> C >> D; cout << ((uint32_t)((C + B - 1) / B) <= (uint32_t)((A + D - 1) / D) ? "Yes\n" : "No\n...
[["-", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
84
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <memory> #include <queue> #inc...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <memory> #include <queue> #inc...
[["-", 12, 23, 0, 41, 15, 16, 12, 16, 12, 22], ["+", 12, 23, 0, 41, 15, 16, 12, 16, 12, 22]]
1
1,611
import math a,b,c,d=map(int,input().split()) print("Yes") if math.ceil(c/a)<=math.ceil(a/d) else print("No")
import math a,b,c,d=map(int,input().split()) print("Yes") if math.ceil(c/b)<=math.ceil(a/d) else print("No")
[["-", 0, 666, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 666, 0, 652, 3, 4, 0, 657, 12, 22]]
5
53
#include <bits/stdc++.h> using namespace std; int main() { int th, ts, xh, xs; cin >> th >> ts >> xh >> xs; while (1) { xh -= ts; if (th <= 0) break; th -= xs; if (xh <= 0) break; } if (th >= xh) puts("Yes"); else puts("No"); }
#include <bits/stdc++.h> using namespace std; int main() { int th, ts, xh, xs; cin >> th >> ts >> xh >> xs; while (1) { xh -= ts; if (xh <= 0) break; th -= xs; if (th <= 0) break; } if (th >= xh) puts("Yes"); else puts("No"); }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]]
1
82
import sys a,b,c,d=map(int,input().split()) while a>0 or c>0: c-=b if c<1: print("Yes") sys.exit() a-=d print("No")
import sys a,b,c,d=map(int,input().split()) while a>0: c-=b if c<1: print("Yes") sys.exit() a-=d print("No")
[["-", 36, 36, 0, 656, 0, 52, 15, 679, 17, 354], ["-", 0, 656, 0, 52, 15, 679, 12, 666, 0, 22], ["-", 0, 656, 0, 52, 15, 679, 12, 666, 667, 47], ["-", 0, 656, 0, 52, 15, 679, 12, 666, 0, 612]]
5
59
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <queue> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int A, B,...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iostream> #include <map> #include <queue> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int A, B,...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
139
package main import "fmt" func main() { var a, b, c, d int fmt.Scan(&a, &b, &c, &d) if (a+d-1)/d <= (c+b-1)/b { fmt.Println("Yes") } else { fmt.Println("No") } }
package main import "fmt" func main() { var a, b, c, d int fmt.Scan(&a, &b, &c, &d) if (a+d-1)/d >= (c+b-1)/b { fmt.Println("Yes") } else { fmt.Println("No") } }
[["-", 0, 435, 8, 196, 0, 57, 15, 16, 17, 19], ["+", 0, 435, 8, 196, 0, 57, 15, 16, 17, 20]]
7
86
a, b, c, d = map(int, input().split()) while a > 0: c -= b a -= d if c <= 0: print('Yes') break if a <= 0: print('No')
a, b, c, d = map(int, input().split()) while a > 0: c -= b a -= d if c <= 0: print('Yes') break if c > 0: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
54
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); if (Math.ceil(a / d) <= Math.ceil(c / b)) { System.out.println("Yes"); ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a = sc.nextInt(); double b = sc.nextInt(); double c = sc.nextInt(); double d = sc.nextInt(); if (Math.ceil(a / d) >= Math.ceil(c / b)) { System.out.printl...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
124
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MM = 1000000000; const int MOD = MM + 7; const int MAX = 510000; #define rep(i, n) for (ll i = 0; i < n; i++) #define Rep(i, j, n) for (ll i = j; i < n; i++) #define all(vec) vec.begin(), vec.end() template <class T> inline bool chmin(T &a, T...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MM = 1000000000; const int MOD = MM + 7; const int MAX = 510000; #define rep(i, n) for (ll i = 0; i < n; i++) #define Rep(i, j, n) for (ll i = j; i < n; i++) #define all(vec) vec.begin(), vec.end() template <class T> inline bool chmin(T &a, T...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
211
import math A,B,C,D = map(int,input().split()) if (math.ceil(C/B) < math.ceil(A/D)): print('Yes') else: print('No')
import math A,B,C,D = map(int,input().split()) if (math.ceil(C/B) <= math.ceil(A/D)): print('Yes') else: print('No')
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 18], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 19]]
5
57
A,B,C,D = map(int,input().split()) while True: C = C - B if C <= 0: break A = A - D if A <= 0: break print('Yes' if A > 0 else 'no')
A,B,C,D = map(int,input().split()) while True: C = C - B if C <= 0: break A = A - D if A <= 0: break print('Yes' if A > 0 else 'No')
[["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
59
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) //#define PI 3.141592653589793 // vector < vector<int>>a(0, vector<int>(0));二次元配列宣言 int main() { int a, b, c, d; cin >> a >> b >> c >> d; int i = 0; while (a > 0 && c > 0) { if (i % 2 == 0) { c -= b; ...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) //#define PI 3.141592653589793 // vector < vector<int>>a(0, vector<int>(0));二次元配列宣言 int main() { int a, b, c, d; cin >> a >> b >> c >> d; int i = 0; while (a > 0 && c > 0) { if (i % 2 == 0) { c -= b; ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
111
#include <stdio.h> int main() { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); int judge = 1; while (a > 0 && c > 0) { if (judge == 1) { c -= b; } else { a -= d; } a *= -1; } if (a > 0) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
#include <stdio.h> int main() { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); int judge = 1; while (a > 0 && c > 0) { if (judge > 0) { c -= b; } else { a -= d; } judge *= -1; } if (a > 0) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
0
106
from math import ceil a, b, c, d = map(int, input().split()) x = ceil(c/b) y = ceil(a/d) if x <= y+1: print('Yes') else: print('No')
from math import ceil a, b, c, d = map(int, input().split()) x = ceil(c/b) y = ceil(a/d) if x <= y: print('Yes') else: print('No')
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
61
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; while (1) { if (b >= c) { cout << "Yes\n"; return 0; } c -= b; if (d >= a) { cout << "No\n"; return 0; } d -= a; } }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; while (1) { if (b >= c) { cout << "Yes\n"; return 0; } c -= b; if (d >= a) { cout << "No\n"; return 0; } a -= d; } }
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22]]
1
81
// #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; // for loop関係 #define rep(i, a, n) for (int i = (a); i < (n); ++i) #define repe(i, a, n) fo...
// #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; // for loop関係 #define rep(i, a, n) for (int i = (a); i < (n); ++i) #define repe(i, a, n) fo...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 57, 64, 1, 0, 35], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29]]
1
376
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define rep(i...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define rep(i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
279
/********include********/ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #...
/********include********/ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #...
[["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
1,207
#include <iostream> #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int A, B, C, D; std::cin >> A >> B >> C >> D; int A_turn = 0; if (C % B == 0) { A_turn = C / B; } else { A_turn...
#include <iostream> #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int A, B, C, D; std::cin >> A >> B >> C >> D; int A_turn = 0; if (C % B == 0) { A_turn = C / B; } else { A_tur...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
143
A, B, C, D = map(int, input().split()) print("Yes" if (A+D)//D >= (C+B)//B else "No")
A, B, C, D = map(int, input().split()) print("Yes" if (A+D-1)//D >= (C+B-1)//B else "No")
[["+", 0, 666, 0, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 666, 0, 657, 31, 23, 0, 657, 12, 612]]
5
46
#include <stdbool.h> #include <stdio.h> #include <string.h> int main() { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); while (a > 0 && c > 0) { c -= b; if (c < 0) break; a -= d; } if (c == 0) printf("Yes\n"); else printf("No\n"); }
#include <stdbool.h> #include <stdio.h> #include <string.h> int main() { int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); while (a > 0 && c > 0) { c -= b; if (c < 0) break; a -= d; } if (c <= 0) printf("Yes\n"); else printf("No\n"); }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
0
91
a,b,c,d = map(int,input().split()) for i in range(200): if i % 2 == 0: c -= b else: a -= d if a<=0: print("No") break elif b <= 0: print("Yes") break
a,b,c,d = map(int,input().split()) for i in range(200): if i % 2 == 0: c -= b else: a -= d if a<=0: print("No") break elif c <= 0: print("Yes") break
[["-", 8, 196, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 0, 22]]
5
67
a,b,c,d = map(int,input().split()) while a >= 0: c -= b if c <= 0: print("Yes") break a -= d if a <= 0:print("No")
a,b,c,d = map(int,input().split()) while True: c -= b if c <= 0: print("Yes") break a -= d if a <= 0: print("No") break
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 0, 22], ["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20], ["-", 36, 36, 0, 656, 0, 52, 15, 666, 0, 612], ["+", 36, 36, 36, 36, 0, 656, 0, 52, 15, 146], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
54