text
stringlengths
10
22.5k
status
stringclasses
2 values
name
stringlengths
9
26
#include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int,int>; #define fi first #define se second #define rep(i,a,b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() using ll = long long; typedef vector<int> vi; #define pb push_back vector<pa...
passed
104_std.cpp
#include <bits/stdc++.h> using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; using u128 = unsigned __int128; constexpr int N = 1E6; std::vector<int> primes; i64 f[N + 1][10]; i64 ans[N + 1]; int minp[N + 1]; int fp[20][10][10]; void solve() { i64 n; std::cin >> n; i64 s = st...
passed
64_std.cpp
#include<bits/stdc++.h> #define int long long using namespace std; typedef long long ll; typedef pair<int,int> pii; const int mod = 1e9 + 7; const int N = 1e6 + 7; int a[N]; void solve() { int n; cin >> n; for(int i = 1;i <= n;i++) cin >> a[i]; set<int> s; for(int i = 2;i <= n;i++) { s.insert(a[...
passed
6_std.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; const double EPS = 1e-10; template <class T> int sgn(T x) { return (x > 0) - (x < 0);...
passed
96_std.cpp
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <ranges> #include <utility> #include <set> #include <vector> using i64 = long long; constexpr i64 M = 1e9 + 7; struct pvec { int x, y; friend std::istream &operator>>(std::istream &is, pvec &a) { return is >> a.x >> a.y...
passed
38_std.cpp
#include "bits/stdc++.h" using namespace std; #define all(x) x.begin(),x.end() template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << " " << p.second; } template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename...
passed
92_std.cpp
#include <cassert> #include <cmath> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #incl...
passed
109_std.cpp
#include<bits/stdc++.h> #define int long long using namespace std; typedef long long ll; typedef pair<int,int> pii; const int mod = 1e9 + 7; const int N = 1e6 + 7; // int a[N]; void solve() { int a , b , c; cin >> a >> b >> c; vector<int> v; for(int i = 1;i <= 50;i++) v.push_back(a); for(int i = 50 + 1;...
passed
11_std.cpp
#include <bits/stdc++.h> #define T \ int TT; \ cin >> TT; \ while (TT--) #define ll long long #define endl '\n...
passed
87_std.cpp
#include <cstdio> #include <algorithm> using namespace std; const int max1 = 5e5; const int inf = 0x3f3f3f3f; int T, n, L[max1 + 5], R[max1 + 5]; int f[max1 + 5][2], ans; void Work () { scanf("%d", &n); for ( int i = 1; i <= n; i ++ ) scanf("%d%d", &L[i], &R[i]); for ( int i = 1; i <= n; i ...
passed
19_std.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; // if you end up using long double, you need to set the floating point notation // to fixed, and set the percision to be very high typedef long double ld; #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) #define pb push_...
passed
97_std.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int mod = 998244353; using COST_T = long long; struct mfmc_edge { int from, to; long long mx; long long cost; // for 1 flow }; void max_flow_min_cost(vector<vector<pair<int, pair<ll, COST_T>>>> g_main, int s, int t, ll k = -1) {...
passed
76_std.cpp
#include <bits/stdc++.h> #ifdef LOCAL #include "dd/debug.h" #else #define dbg(...) 42 #define dbg_proj(...) 420 #define dbg_rproj(...) 420420 void nline() {} void bar() {} void start_clock() {} void end_clock() {} #endif namespace rs = std::ranges; namespace rv = std::views; using u32 = unsigned int; using i64 = lon...
passed
88_std.cpp
#include <vector> #include <iostream> #include <algorithm> #define F for #define W while #define fi first #define se second #define fv inline void #define eb emplace_back #define fn inline static #define mset __builtin_memset #define mcpy __builtin_memcpy #define U(i, a, b) F(int i = (a); i < (int)(b); ++i) #define L(...
passed
117_std.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; char find(vector<char>& v, char x) { return v[(ll)x] == x ? x : v[(ll)x] = find(v, v[(ll)x]); } bool ck(string x1, string x2, string y, ll& n) { vector<char> v(1000); for (char c = 'a'; c <= 'z'; ++c) { v[(ll)c] = c; } for...
passed
24_std.cpp
#include <bits/stdc++.h> //#define int int64_t #define int int128 #define int128 __int128 using namespace std; const int128 MM10=int128(1e13)*int128(1e14); const int128 inf = int128(1e15)*int128(1e15); const int128 mod = 998244353; string s; int128 xotr(int128 x, int o) { if(x>MM10 || x<0) return inf; int128 ans=...
passed
100_std.cpp
#include <bits/stdc++.h> #define int long long #define debug(x) std::cerr<<"The "<<#x<<" = "<<x<<'\n'; using i128 = __int128; using i64 = long long; using u64 = unsigned long long; constexpr int N = 2e5 + 5; constexpr int mod = 998244353; constexpr i64 INF = 0x7fffffffffffffffLL; void solve() { int n, q, num = ...
passed
8_std.cpp
#include<bits/stdc++.h> #define N 2000007 #define mod 998244353 #define ll long long using namespace std; int n,m; string str[N]; #define def(x,y) vector<vector<y> > x(n+7,vector<y>(m+7)) void mian(){ scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) cin>>str[i]; def(s,char); for(int i=1;i<=n;i++) for(int j=1;j<=m;j++)...
passed
14_std.cpp
#include <bits/stdc++.h> #define int long long using namespace std; typedef long long ll; typedef pair<int, int> pii; const int mod = 1e9 + 7; const int N = 1e6 + 7; int a[N]; void solve() { string s; cin >> s; int n = s.length(); s = " " + s; vector<pii> v, bac; for (int i = 1; i <= n - 3; i++) { if (s...
passed
1_std.cpp
#include <bitset> #include <cstdio> #define ll long long using namespace std; const int B = 300; const int D = 5e5 / B + 1; int N, M; int Read() { int x = 0; char c = getchar(); while (c < '0' || c > '9') c = getchar(); while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + (c ^ 48), c = getchar(); ...
failed
23_1_wrong.cpp
#include <cstring> #include <iostream> #include <vector> using namespace std; using LL = long long; int main() { #ifdef LOCAL freopen("data.in", "r", stdin); freopen("data.out", "w", stdout); #endif cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); int T; cin >> T; while (T--) { int n; cin ...
failed
17_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef long double ld; int main() { cin.tie(NULL)->sync_with_stdio(false); int...
failed
59_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef long double ld; int main() { cin.tie(NULL)->sync_with_stdio(false); ll ...
failed
110_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; #define rep3(i, a, b, c) for (ll i = (a); i < (b); i += (c)) #define rep2(i, a, b) rep3(i, a, b, 1) #define rep1(i, n) rep2(i, 0, n) #define rep0(n) re...
failed
97_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, a, b) for(int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; bool check(int a, int b){ string s = to_string(a); strin...
failed
92_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #ifdef LOCAL #include <bits/debug.h> #else #define dbg(...) #endif int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; vector<pair<string, string>> ans; unordered_map<string, vector<string>> mp; for ...
failed
91_1_wrong.cpp
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e5 + 5; const int M = 1e5 + 5; const int mod = 998244353; int t, n, q, u, v, p, cnt, to[M], nxt[M], h[N], dep[N], fa[N][25], f[N], g[N]; void clear() { cnt = 0; for (int i = 1; i <= n; i++) h[i] = f[i] = g[i] = 0; for (int i = ...
failed
4_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int l, r; cin >> l >> r; int lcm = l / __gcd(l, r); lcm = lcm * r; if (lcm <= r) { cout << "Alice" << "\n"; return; } else { if ((r - l) % 2 == 0) { cout << "Alice" << "\n"; return; } else { c...
failed
68_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; #define fi first #define se second #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() using ll = long long; typedef vector<int> vi; #define pb push_back void t...
failed
45_1_wrong.cpp
#include "bits/stdc++.h" using namespace std; #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define int long long const int mxn = 2e5 + 5; int n, k, p[mxn], f[mxn], fl[mxn]; vector<array<int, 6>> ord; inline int get(int ind, const array<int, 6> &a) { if (a[0] == ind) return a[1]; if (a[2] == ...
failed
3_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; long long p; cin >> n >> p; vector<long long> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } auto okay = [&](int b) -> bool { vector<long long> get(a.begin(), a.begin() + b)...
failed
107_2_wrong.cpp
#pragma GCC optimize(3) #include "ext/pb_ds/assoc_container.hpp" #include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define pii pair<int, int> #define vi vector<int> #define hmap unordered_map #define hset unordered_set #define test cout << "test" << endl #define all(x) (x).begin(), (x).end()...
failed
77_1_wrong.cpp
#include <bits/stdc++.h> #define int int64_t using pii = std::pair<int, int>; const int kMaxN = 4e5 + 5; struct Node { int t, id, op; Node(int _t = 0, int _id = 0, int _op = 0) : t(_t), id(_id), op(_op) {} friend bool operator<(const Node &n1, const Node &n2) { if (n1.t != n2.t) return n1.t < n2.t; ...
failed
88_3_wrong.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while (T--) { int n, m; cin >> n >> m; vector<int> c(n); for (int i = 0; i < n; ++i) { cin >> c[i]; } vector<v...
failed
81_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; #define fi first #define se second #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() using ll = long long; typedef vector<int> vi; #define pb push_back bool u...
failed
93_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const ld EPS = 1e-9; struct Point { ll x, y, z; Point(ll x = 0, ll y = 0, ll z = 0) : x(x), y(y), z(z) {} }; // Calculate squared distance from point (x,y) to (cx,cy) ll dist2_to_center(ll x, ll y, ll cx, ll cy) { ll dx...
failed
78_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int p = 998244353; int po(int a, int b) { if (b == 0) return 1; if (b == 1) return a; if (b % 2 == 0) { int u = po(a, b / 2); return (u * 1LL * u) % p; } else { int u = po(a, b - 1); return (a * 1LL * u) % p; } ...
failed
16_3_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define PII pair<int, int> #define ai4 array<int, 4> #define ai3 array<int, 3> const int N = 50010, mod = 1e9 + 7, inf = 1e9; void solve() { int n; cin >> n; vector<int> a(n + 1); int ans = 0; set<int> S; for (int i = 1; i <= n; i++) { ...
failed
6_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define eb emplace_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) ...
failed
114_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; struct Mountain { int x, y; bool active; double left_start, left_end; double right_start, right_end; double b, c; Mountain(int x, int y, int w) : x(x), y(y), active(false) { left_start = max(0.0, x - y + 0.0); left_end = min(static_cast<double>(x), stat...
failed
106_3_wrong.cpp
#include "bits/stdc++.h" using namespace std; #define ll long long #define pb push_back #define eb emplace_back #define mp make_pair #define F first #define S second #define V vector #define vi vector<int> #define vl vector<long long> #define vb vector<bool> #define vs vector<string> #define vd vector<double> #define...
failed
85_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; const int P = 1e9 + 7; long long pw[20], inv[4] = {0, 1, (P + 1) / 2, (P + 1) / 3}; long long sum(long long l, long long r) { return (__int128)(l + r) * (r - l + 1) / 2 % P; } void get(long long x, vector<array<long long, 3>> &o, long long &l, long long &r) ...
failed
7_2_wrong.cpp
#include <cstring> #include <iostream> #include <vector> using namespace std; using LL = long long; LL exgcd(LL a, LL b, LL &x, LL &y) { if (!b) { x = 1, y = 0; return a; } LL r = exgcd(b, a % b, y, x); y -= a / b * x; return r; } int main() { #ifdef LOCAL freopen("data.in", "r", stdin); freop...
failed
18_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e3; int a[MAXN][MAXN]; void apply(int x, int y, const vector<vector<int>> &b, int &cur) { int mx = -1; for (int i = 0; i < (int)b.size(); ++i) { for (int j = 0; j < (int)b[i].size(); ++j) { if (b[i][j] == -1) continue; a[x + i...
failed
73_3_wrong.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<pii, int> ppi; typedef pair<int, pii> pip; typedef pair<pii, pii> ppp; typedef pair<ll, ll> pll; typedef long double ld; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pii> vpp; typedef vector<p...
failed
27_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; long long getDotProduct(const vector<int> &A, const vector<int> &B) { long long sum = 0; for (size_t i = 0; i < A.size(); i++) { sum += (long long)A[i] * B[i]; } return sum; } long long getMaxDotProduct(const vector<int> &A, const vector<int> &B) { vector<in...
failed
82_3_wrong.cpp
#include <bits/stdc++.h> using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; using u128 = unsigned __int128; using F = __float128; std::istream &operator>>(std::istream &is, F &a) { int x; is >> x; a = x; return is; } std::ostream &operator<<(std::ostream &is, F a) { return is << doub...
failed
12_2_wrong.cpp
// #undef LOCAL #ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define app push_back #define int long long #ifdef LOCAL #define debug(...) \ [](auto... a) { ((cout << a << ' '), ...) << endl; }(#__VA_A...
failed
15_3_wrong.cpp
#include <bits/stdc++.h> using namespace std; int read() { int x = 0, f = 1; char c = getchar(); while (c > '9' || c < '0') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = x * 10 + c - '0'; c = getchar(); } return x * f; } const int N = 2055; int n, w[N], ...
failed
86_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #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 pii pair<int, int> #define fi first #define se second #define mkp make_pair const int maxn = 1e6 + 5; int n, m, a[maxn], c[maxn], s[...
failed
81_3_wrong.cpp
#include <array> #include <cstring> #include <iostream> #include <set> #include <vector> using i64 = long long; using Index = std::array<int, 10>; int feats[3][3][3][3][3][3][3][3][3]; std::vector<Index> P; int prefix[100005][10], v[100005]; int &get(Index &p) { return feats[p[0]][p[1]][p[2]][p[3]][p[4]][p[5]][p[6]...
failed
41_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; void solve() { int n, m, k; cin >> n >> m >> k; int nm = n * m; vector<int> p(nm); for (int i = 0; i < nm; ++i) { cin >> p[i]; } vector<int> pos(nm + 1); // pos[x] gives the 1-based position of cell x for (int i = 0; i < nm; ++i) { pos[p[i]] = i + 1...
failed
31_3_wrong.cpp
#include <bits/stdc++.h> #define int long long #define debug(x) std::cerr << "The " << #x << " = " << x << '\n'; using i128 = __int128; using i64 = long long; using u64 = unsigned long long; constexpr int N = 1e6 + 5; constexpr int mod = 998244353; constexpr i64 INF = 0x7fffffffffffffffLL; void solve() { std::str...
failed
48_2_wrong.cpp
#include <bits/stdc++.h> #define int int64_t #define int128 __int128 using namespace std; const int128 inf = int128(1e15) * int128(1e15); const int128 mod = 998244353; string s; int128 xotr(int128 x, int o) { int128 ans = o; int128 m10 = 1; int128 nd10 = 1; while (m10 * 10 <= x) { ans += 9 * m10 * nd10; ...
failed
100_2_wrong.cpp
#include <iostream> // #include <vector> using i64 = long long; constexpr int N = 1e5 + 5; int a[N], s[N][9], c[9]; bool eval(int *cnt) { int ans = 0; for (int i = 1; i <= 8; i++) { if (cnt[i] >= 3) cnt[i] %= 3; // pong if (cnt[i] > 0 && i <= 6) { // chow if (cnt[i + 1] < cnt[i]) ...
failed
41_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second typedef pair<int, int> ii; typedef pair<ii, int> iii; const int oo = 1e18 + 7; const int N = 2e6 + 5; int n, m, q; bool vis[N][2], ck[N]; int num[N][2]; vector<ii> Adj[N]; vector<int> visited; bool final[N]; ...
failed
89_1_wrong.cpp
#include <iostream> #include <string> #include <tuple> #include <vector> using namespace std; typedef tuple<string, string, string> State; State apply_c1(const State &s) { string u = get<0>(s); string ll = get<1>(s); string lr = get<2>(s); string new_u = ll.substr(0, 3) + u.substr(3); string new_ll = lr.s...
failed
104_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; const int LEN = 1e6 + 10; int n, K; char str[LEN]; int stk[LEN], tp; struct Opt { int a, j, b, k; bool operator<(const Opt &that) const { if (a != that.a) return a < that.a; if (j != that.j) return j < that.j; if (b != that.b) return b < ...
failed
101_1_wrong.cpp
#include <algorithm> #include <array> #include <cstring> #include <iostream> #include <queue> #include <vector> using namespace std; using LL = long long; int main() { #ifdef LOCAL freopen("data.in", "r", stdin); freopen("data.out", "w", stdout); #endif cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); ...
failed
13_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL, LL> PII; const int N = 1e5 + 10, M = 2 * N; // const int mod=998244353; const LL mod = 1e9 + 7; const LL INF = 1e9; LL h[N], e[M], ne[M], w[M], idx; int T = 1; void solve() { int n; cin >> n; vector<LL> a(n); LL res = 0; f...
failed
60_2_wrong.cpp
#include <bits/stdc++.h> #define int long long using namespace std; void solve() { int n, m; cin >> n >> m; vector<int> a(n), pos(n); for (int i = 0; i < n; ++i) { cin >> a[i]; --a[i]; pos[a[i]] = i; } vector<int> b(m); for (int i = 0; i < m; ++i) { cin >> b[i]; --b[i]; b[i] = po...
failed
102_1_wrong.cpp
#include <bits/stdc++.h> #define ll long long #define pb push_back #define f first #define s second #define sz(x) (int)(x).size() #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define ios \ ios_base::sync_with_stdio(false); ...
failed
20_2_wrong.cpp
#include <bits/stdc++.h> #define N 1001 using namespace std; int n, q, ans; int X, Y; char T; char m[N][N]; int vis[N][N][4]; int tag[N][N][4]; int xx[4] = {0, -1, 0, 1}; int yy[4] = {1, 0, -1, 0}; map<char, int> o; char s[5] = {'R', 'U', 'L', 'D'}; struct node { int x, y, offset; }; queue<node> que; int dfs(int x, i...
failed
98_1_wrong.cpp
#include <bits/stdc++.h> // #define int long long using namespace std; const int N = 20; const int INF = 1e9; int a1, a2, a3, a4; int dp[N][N]; struct edge { int to, val; } e[10]; void init() { e[1] = {1, a1}; e[2] = {2, a1}; e[3] = {4, a1}; e[4] = {8, a1}; e[5] = {3, a2}; e[6] = {12, a2}; e[7] = {5, a...
failed
83_2_wrong.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #include <iomani...
failed
7_3_wrong.cpp
#include <bits/stdc++.h> using namespace std; using ull = unsigned long long; constexpr int N = 4000100; constexpr ull ALL = -1ull; int n, q; struct Tag { ull x; Tag() : x(ALL) {} Tag(ull x_) : x(x_) {} void apply(Tag o) { x &= o.x; } } tag[N]; struct Info { ull x, hot[3]; int l, r; Info() {} Info(ul...
failed
25_1_wrong.cpp
#include <bits/stdc++.h> #include <vector> using namespace std; using i64 = long long; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); // easy dp problem ? int n; cin >> n; std::vector<int> p(n); for (int i = 0; i < n; i++) cin >> p[i]; int s = accumulate(p.begin(), p.end(), 0); st...
failed
60_3_wrong.cpp
#include <algorithm> #include <cstdio> #include <ctime> #include <iostream> #include <random> #include <vector> using namespace std; const int MX = 1000010; int T, N, M; int ar[MX], br[MX]; bool vis[MX]; vector<int> va, vb; int read() { int r = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { i...
failed
80_3_wrong.cpp
#include <algorithm> #include <cstdio> using namespace std; const int max1 = 1000; const int mod = 998244353; int T, n, m; char Map[max1 + 5][max1 + 5], tmp[max1 + 5][max1 + 5]; int ans; int Nsum[max1 + 5][max1 + 5], Ssum[max1 + 5][max1 + 5], Wsum[max1 + 5][max1 + 5], Esum[max1 + 5][max1 + 5]; int NW[max1 + 5]...
failed
14_2_wrong.cpp
#include <bits/stdc++.h> // #include<bits/stdc--.h> using i64 = long long; #define all(x) std::begin(x), std::end(x) void solve() { int n; std::cin >> n; if (n == 1) { std::cout << ".\n"; return; } else if (n == 2) { std::cout << R"( . . . )"; return; } else if (n == 3) { std::cou...
failed
73_1_wrong.cpp
#include "bits/stdc++.h" using namespace std; #define int long long #define double long double const int MAXN = 4e5 + 10, MOD = 1e9 + 7, HASHMOD = 1734232211; int fac[MAXN], invfac[MAXN]; mt19937_64 rng((int)std::chrono::steady_clock::now().time_since_epoch().count()); int rnd(int x, int y) { return uniform_int_dis...
failed
83_3_wrong.cpp
#include <bits/stdc++.h> using namespace std; struct man { int id; int points = 0; }; void slove() { int n, m, q; cin >> n >> m >> q; int x = 0, level = 0, nid = 0, nlevel = 0, npoints = m; man a[m + 1]; vector<set<int>> judge(n + 1); for (int i = 1; i <= m; i++) a[i].id = i; for (int i = 1; i <...
failed
9_1_wrong.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count()); struct DSU { std::vector<int> f, siz; DSU() {} DSU(int n) { init(n); } void init(int n) { f.resize(n); std::iota(f.begin(), f.end(), 0); siz.assign(n,...
failed
85_3_wrong.cpp
#include <bits/stdc++.h> #define F(i, l, r) for (int i = (l), i##end = (r); i <= i##end; ++i) #define G(i, l, r) for (int i = (l), i##end = (r); i >= i##end; --i) #define pii pair<int, int> #define x first #define y second #define mp(x, y) make_pair(x, y) #define ep emplace_back using namespace std; typedef long long l...
failed
79_3_wrong.cpp
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <ranges> #include <utility> #include <vector> using i64 = long long; constexpr i64 M = 1e9 + 7; struct pvec { int x, y; friend std::istream &operator>>(std::istream &is, pvec &a) { return is >> a.x >> a.y; } friend std::o...
failed
38_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 100010, mod = 998244353; int qmi(int a, int b) { int res = 1; while (b) { if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } void solve() { int n, q; cin >> n >> q; vector<vector<int>...
failed
4_1_wrong.cpp
#include <bits/stdc++.h> #define N 1000005 #define ll long long #define pii pair<int, int> #define fi first #define se second #define mp make_pair using namespace std; ll read() { ll sum = 0, f = 1; char st = getchar(); while (st < '0' || st > '9') { if (st == '-') f = -1; st = getchar(); } whil...
failed
93_2_wrong.cpp
#include <cassert> #include <iostream> #include <vector> using namespace std; const int N = 5000 + 5; const int mod = 998244353; struct EDGE { int to, nxt; } edge[N << 1]; int n, cnt, sz[N], f[N], g[N], p[N], dep[N], fac[N], head[N], invfac[N], h[N][N]; void addedge(int u, int v) { edge[++cnt].to = v; edge[c...
failed
49_1_wrong.cpp
#include <bits/stdc++.h> using i64 = long long; void sol() { int n, m; std::cin >> n >> m; std::vector<int> a(n); std::vector<int> b(m); bool ok = false; ; if (n == 1 && m == 1) { std::cout << "Yes\n"; std::cout << "1\n"; return; } if (n < m) { std::iota(a.begin(), a.end(), 1); } ...
failed
80_1_wrong.cpp
#include <iostream> #include <string> #include <vector> using namespace std; class Solution { private: // Check if tiles count matches bool checkTilesCount(const vector<string> &start, const vector<string> &target, int h, int w) { vector<int> count1(26, 0), count2(26, 0); for (int i...
failed
115_2_wrong.cpp
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iostream> #include <vector> typedef long long ll; // typedef long double ld; typedef double ld; typedef std::vector<int> Vint; typedef std::vector<ll> Vll; typedef std::vector<ld> Vld; const ld INF = 1...
failed
109_3_wrong.cpp
#include <bits/stdc++.h> // #define int long long using namespace std; const double pi = acos(-1.0); const double eps = 1e-8; const int N = 1e6 + 7; const int mod = 1e9 + 7; const int MX = 2147483647; typedef pair<int, int> pii; int a[N], b[N]; int n, m, k; bool check(int x) { for (int i = 1; i <= n; i++) b[i] = ...
failed
31_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() #define make_unique(x) sort(all(x)), x.erase(unique(all(x)), x.end()) mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); mt19937_64 Rng(chrono::steady_clock::n...
failed
54_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; const int MAXN = 1e3 + 5; const int dx[] = {0, -1, 0, 1}; const int dy[] = {1, 0, -1, 0}; int n; char s[MAXN][MAXN]; int res[MAXN][MAXN][4]; bool isin(int x, int y) { return 1 <= x && x <= n && 1 <= y && y <= n; } int get...
failed
98_3_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define PII pair<int, int> #define ai4 array<int, 4> #define ai3 array<int, 3> const int N = 50010, mod = 1e9 + 7, inf = 1e9; int dp[310][310][3]; void solve() { int n, q; cin >> n >> q; string s; cin >> s; s = ' ' + s + ' '; int cnt = 0;...
failed
2_1_wrong.cpp
#include <iostream> #include <string> #include <vector> using namespace std; // Remove pairs of '00' or '11' until no more removals possible string removePairs(string s) { bool changed; do { changed = false; string newS; for (int i = 0; i < s.length(); i++) { if (i + 1 < s.length() && s[i] == s[i...
failed
48_3_wrong.cpp
#ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define app push_back #define int long long #ifdef LOCAL #define debug(...) \ [](auto... a) { ((cout << a << ' '), ...) << endl; }(#__VA_ARGS__, ":", ...
failed
15_2_wrong.cpp
#include<iostream> #include<algorithm> #include<vector> #include<cmath> using namespace std; typedef long long ll; typedef pair<string,int> pll; const int N=3e5+10; int main(){ vector<pll> v1; v1.push_back({"123",0}); for(int i=1;i<=8;i++){ string s;int a; cin>>s>>a; v1.push_ba...
failed
87_2_wrong.cpp
#include <iostream> #include <vector> using namespace std; const int MOD = 998244353; vector<long long> solve(int n) { // dp[i] represents the number of ways to get sum i vector<long long> dp(n + 1, 0); dp[0] = 1; // Process each weight from n down to 1 for (int weight = n; weight >= 1; weight--) { vec...
failed
21_1_wrong.cpp
#include <bits/stdc++.h> #define int long long #define F first #define S second #define MP make_pair #define PB push_back using namespace std; const int N = 2e5 + 100; vector<int> v[N]; int h[N], ans[N]; void dfs(int x, int px = -1) { if (px == -1) { h[x] = 0; } else { h[x] = h[px] + 1; } for (int...
failed
20_1_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double using pii = pair<int, int>; #define fi first #define se second #define rep(i, a, b) for (int i = a; i < (b); ++i) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() using ll = long long; typedef vector<int> vi; #...
failed
96_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define int long long #define lson (pos << 1) #define rson (pos << 1 | 1) #define pii pair<int, int> #define fr first #define sc second #define mk make_pair #define pb push_back #define yjbakioi true #define inx(u) ...
failed
77_3_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define pb push_back int main() { int tt; cin >> tt; while (tt--) { string s; cin >> s; int n = (int)s.size(); vector<int> vec, nw; for (int i = 0, num; i < n; i++) { num = s[i] - '0'; if ((int)vec.size() > 0 && vec.back() == num && num...
failed
48_1_wrong.cpp
#include <bits/stdc++.h> using i64 = long long; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int a, b, c; std::cin >> a >> b >> c; std::cout << c + 1 << "\n"; for (int i = 1; i <= c + 1; i++) { std::cout << i << " "; } return 0; }
failed
11_3_wrong.cpp
#include <algorithm> #include <cstdio> #include <cstring> #include <set> #include <vector> using namespace std; const int max1 = 3e5; int T, n; struct Data { int a, b, id; } A[max1 + 5], B[max1 + 5]; set<pair<int, int>> Set; bool Cmp1(const Data &A, const Data &B) { return A.a < B.a; } bool Cmp2(const Data &A...
failed
13_3_wrong.cpp
#include <bits/stdc++.h> #ifdef LOCAL #include "dd/debug.h" #else #define dbg(...) 42 #define dbg_proj(...) 420 #define dbg_rproj(...) 420420 void nline() {} void bar() {} void start_clock() {} void end_clock() {} #endif namespace rs = std::ranges; namespace rv = std::views; using u32 = unsigned int; using i64 = lon...
failed
3_2_wrong.cpp
#include <algorithm> #include <iostream> #include <vector> using namespace std; long long minCrossingTime(int n, int c, vector<long long> &times) { sort(times.begin(), times.end()); long long totalTime = 0; int i = n - 1; // Start from the slowest walker while (i >= 0) { if (i + 1 <= c) { // All re...
failed
117_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; #define forr(i, a, b) for (ll i = (ll)a; i < (ll)b; i++) #define forn(i, n) forr(i, 0, n) #define dforr(i, a, b) for (int i = int(b) - 1; i >= int(a); --i) #define dforn(i, n) for (int i = n - 1; i >= 0; i--) #define pb push_back #define fst first #define snd second #defin...
failed
62_2_wrong.cpp
#pragma GCC optimize("Ofast") #pragma GCC target("popcnt", "sse3", "sse2", "sse", "avx", "sse4", "sse4.1", \ "sse4.2", "ssse3", "f16c", "fma", "avx2", "xop", "fma4") #pragma GCC optimize("inline", "fast-math", "unroll-loops", \ "no-stack-protector") #include...
failed
21_2_wrong.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; #define lll __int128_t #define uint uint32_t // 注意叉乘是否会爆ll // 注意凸包的最后一个点都是第一个点 // 注意凸包都是逆时针的 // 注意每次选凸包基准点都是x最小然后y最大 // 先按x小排序再按y大排序,后面第二关键字是不能省的因为x相同时y最小/最大的点有可能会被叉积=0pop掉 template <class T> struct vec { T x, y; vec(T _x = 0, T _y = 0) : x(_x), y(...
failed
38_1_wrong.cpp