id
int64
251M
307M
language
stringclasses
11 values
verdict
stringclasses
119 values
source
stringlengths
0
60.3k
problem_id
stringclasses
500 values
type
stringclasses
2 values
difficulty
stringclasses
4 values
291,549,350
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include <cstdio> #include <algorithm> #include <initializer_list> using ll=long long; constexpr int N=200010,V=2010; constexpr ll INF=0x3fffffffffffffff; int T,Ch,n,m,Q,i,j,x,a[N]; ll c[N],f[V][V],ans[V]; char op; template<typename T> inline void r(T&x){ while((Ch=getchar())<48); x=Ch&15; while((Ch=getchar())>47)x=...
2029G
wrong_submission
easy
293,147,123
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#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...
2029G
wrong_submission
easy
290,882,780
C++20 (GCC 13-64)
TIME_LIMIT_EXCEEDED on test 2
#include<bits/stdc++.h> #define lowbit(x) (x&(-x)) using namespace std; typedef long long ll; const ll N = 2e5+10,M = 4010,INF = 1e18; template<typename T>void tomin(T& x,T y){x = min(x,y);} template<typename T>void tomax(T& x,T y){x = max(x,y);} // int T,n,m,V,c[N],a[N],L,R; ll va[M],vc[M],cnt,ans[M]; ll dp[M][M];...
2029G
wrong_submission
easy
297,705,225
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 2
N = int(2e5 + 2) M = 4002 def upd(x, y, z, v): x += 1 y += 1 for i in range(x, v + 2): for j in range(y, v + 2): t[i][j] = max(t[i][j], z) def qry(x, y, v): x += 1 y += 1 z = 0 for i in range(x, 0, -1): for j in range(y, 0, -1): z = max(z, t[i][j])...
2029G
wrong_submission
easy
297,704,669
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 2
N = int(2e5 + 2) M = 4002 def upd(x, y, z): x += 1 y += 1 for i in range(x, v + 2): for j in range(y, v + 2): t[i][j] = max(t[i][j], z) def qry(x, y): x += 1 y += 1 z = 0 for i in range(x, 0, -1): for j in range(y, 0, -1): z = max(z, t[i][j]) r...
2029G
wrong_submission
easy
291,792,634
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> #define For(i,x,y) for (int i=(x);i<=(y);i++) #define FOR(i,x,y) for (int i=(x);i<(y);i++) #define Dow(i,x,y) for (int i=(x);i>=(y);i--) #define mp make_pair #define fi first #define se second #define pb push_back #define ep emplace_back #define siz(x) ((int)x.size()) #define all(x) x.begin(),x....
2029G
wrong_submission
easy
290,820,171
C++20 (GCC 13-64)
TIME_LIMIT_EXCEEDED on test 2
#include<bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define pb push_back #define fr first #define se second #define ford(i,n) for(int i=n-1;i>=0;i--) #define forn(i,a,n) for(int i=a;i<n;i++) #define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++) #define pii pair<int,...
2029G
wrong_submission
easy
290,757,812
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
//��_G #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef double DB; const int N = 222222; const int V = 6666; const LL inf = 1e18; int n,m,v,a[N],b[N]; LL c[N],f[V][V],g[V][V],h[V][V],ans[V]; char ch[111]; void cmax(LL&x,LL y){ if(x<y) x=y; } void modify(LL*t,int i,LL x){ while(i<=v+1){ c...
2029G
wrong_submission
easy
290,771,211
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> #define f first #define s second #define int li using namespace std; using li = long long; using ld = long double; const int N = 4005; const int INF = 1e18; int t1[N][N], t2[N][N]; int get(int t[N][N], int j, int r) { int ans = -INF; for(; r >= 0; r = (r & r + 1) - 1) an...
2029G
wrong_submission
medium
295,498,306
C++23 (GCC 14-64, msys2)
TIME_LIMIT_EXCEEDED on test 2
#include<bits/stdc++.h> using std::cin; using std::cout; using std::string; typedef long long lli; const int N=2e5,M=5e3; int n,m,V,rc[N+5]; int cf[N+5]; int va[N+5];lli vc[N+5];int vt; struct FTree { lli mx[M+5]; inline void ins(int x,lli z) { for(;x<=V;x+=x&-x)mx[x]=std::max(mx[x],z); } inline lli qry(int...
2029G
wrong_submission
medium
297,703,675
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 2
import sys from collections import defaultdict input = sys.stdin.read N = int(2e5 + 2) M = 4002 def upd(x, y, z): x += 1 y += 1 for i in range(x, v + 2): for j in range(y, v + 2): t[i][j] = max(t[i][j], z) def qry(x, y): x += 1 y += 1 z = 0 for i in range(x, 0, -1):...
2029G
wrong_submission
medium
293,146,973
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#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...
2029G
wrong_submission
medium
290,748,519
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
//��_G #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef double DB; const int N = 222222; const int V = 6666; const LL inf = 1e18; int n,m,v,a[N],b[N]; LL c[N],f[V][V],g[V][V],h[V][V],ans[V]; char ch[111]; void cmax(LL&x,LL y){ if(x<y) x=y; } void modify(LL*t,int i,LL x){ while(i<=v+1){ c...
2029G
wrong_submission
medium
290,795,371
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> #define ll long long using namespace std; const int maxn=200010,maxv=2010; int i,j,k,n,m,v,a[maxn]; ll val[maxn],len[maxn]; int tmp[maxn],cnt; int det[maxn]; ll dp[maxv*2][maxv],Max[maxv*2]; ll tMax[maxv][maxv],tS[maxv][2*maxv]; ll tree[2][maxv][maxv*2]; int lb(int x){return x&(-x);} void change...
2029G
wrong_submission
medium
293,148,745
C++23 (GCC 14-64, msys2)
RUNTIME_ERROR on test 6
#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...
2029G
wrong_submission
hard
291,518,806
C++17 (GCC 7-32)
WRONG_ANSWER on test 8
#include<bits/stdc++.h> #define int long long using namespace std; int n,m,v,test,c[200010],a[200010],tmpa[200010],tmpc[200010],f[5010][5010]; struct fenwick{ int tr[5010]; void add(int x,int y) { for(;x<=5000;x+=(x&(-x))) tr[x]=max(tr[x],y); } int ask(int x) { int maxv=-2147483647; for(;x;x-=(x&(-x))) ...
2029G
wrong_submission
hard
291,520,822
C++17 (GCC 7-32)
WRONG_ANSWER on test 8
#include<bits/stdc++.h> #define int long long using namespace std; int n,m,v,test,c[200010],a[200010],tmpa[200010],tmpc[200010],f[5010][5010]; struct fenwick{ int tr[5010],maxn; void add(int x,int y) { for(;x<=maxn;x+=(x&(-x))) tr[x]=max(tr[x],y); } int ask(int x) { int maxv=-2147483647; for(;x;x-=(x&(-x...
2029G
wrong_submission
hard
291,549,644
C++17 (GCC 7-32)
WRONG_ANSWER on test 8
#include<bits/stdc++.h> #define int long long using namespace std; int n,m,v,test,c[200010],a[200010],tmpa[200010],tmpc[200010],f[5010][5010]; struct fenwick{ int tr[5010],maxn; void add(int x,int y) { for(;x<=maxn;x+=(x&(-x))) tr[x]=max(tr[x],y); } int ask(int x) { int maxv=-2147483647; for(;x;x-=(x&(-x...
2029G
wrong_submission
hard
293,497,086
C++20 (GCC 13-64)
WRONG_ANSWER on test 8
#include<bits/stdc++.h> #define pi pair<int,int> #define pb push_back #define vec vector<int> #define M 998244353 #define int long long using namespace std; void in(int &x){ int f=1;x=0; char c=getchar(); while(!isdigit(c)&&c!='-')c=getchar(); if(c=='-')f=-1,c=getchar(); while(isdigit(c))x=x*10+c-'0...
2029G
wrong_submission
hard
290,762,841
C++20 (GCC 13-64)
TIME_LIMIT_EXCEEDED on test 8
#pragma GCC optimize("Ofast","unroll-all-loops","fast-math","no-stack-protector") #include <bits/stdc++.h> using namespace std; #define fi first #define se second #if 1 void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __...
2029G
wrong_submission
hard
274,741,514
C++20 (GCC 13-64)
OK
/** * author: tourist * created: 06.08.2024 10:44:10 **/ #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) 42 #endif template <typename T> T inverse(T a, T m) { T u = 0, v = 1; while (a != 0) { T t = m / a; m -= t * a; swap(a, m); ...
1999F
right_submission
none
275,901,445
C++17 (GCC 7-32)
OK
#include <bits/stdc++.h> using namespace std; using i64 = long long; constexpr int MAX_N = 200000; constexpr int MOD = 1000000007; vector<i64> f(MAX_N + 1, 1); vector<i64> inv_f(MAX_N + 1, 1); i64 power(i64 x, i64 n) { i64 ans = 1; while (n > 0) { if (n % 2 == 1) { ans *= x; ans %= MOD; ...
1999F
right_submission
none
299,333,617
C++17 (GCC 7-32)
OK
#ifdef ONPC #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #define char unsigned char #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() #define eb emplace_back #define mp make_pair #define mt make_tuple #define fi first #define se second #define p...
1999F
right_submission
none
275,183,262
C++14 (GCC 6-32)
WRONG_ANSWER on test 2
// Problem: F. Expected Median // Contest: Codeforces - Codeforces Round 964 (Div. 4) // URL: https://codeforces.com/contest/1999/problem/F // Memory Limit: 256 MB // Time Limit: 3000 ms // // Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_cont...
1999F
wrong_submission
easy
274,923,901
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
// time-limit: 3000 // problem-url: https://codeforces.com/contest/1999/problem/F #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define ar array #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename ...
1999F
wrong_submission
easy
274,923,561
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; #define int long long #define ll long long #define endl "\n" #define INF 0x3f3f3f3f3f3f3f3f #define cy cout<<"Yes"<<endl #define cn cout<<"No"<<endl #define debug(x) std::cout<<#x<<" = "<<x<<endl; #define x first #define y second typedef pair<int,int> PII; typedef pair<int...
1999F
wrong_submission
easy
275,369,620
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 2
def comb(fact, Mod, n, r): if n < r: return 0 num = fact[n] den = (fact[n-r] * fact[r]) % Mod den = pow(den, Mod-2, Mod) return (num * den) % Mod t = int(input()) while t: t -= 1 n, k = map(int, input().split()) l = [] s = input() count_0=0 count_1=0 for i in ...
1999F
wrong_submission
easy
275,220,426
PyPy 3-64
WRONG_ANSWER on test 2
""" 思路:对于这种 在长度为 n 的数组里 选 m 个子序列,一般要用到组合数 我们首先可以得出一个结论,即这个数组是一个二进制数组,也就是说里面的元素无非就是1和0,然后题意说取中位数就是说排序之 的第 (数组长度+1) / 2位元素就是中位数,但是这个是二进制数组,只需要保证1的数量大于0,这个数组的中位数就是1,这里就 省略证明了 然后我们可以先求出组合数,然后 - 那些配对的不合法的1和0的数量 f = C(1的数量,m // 2) * C(0的数量,向上取整(m/2)) ans = C(n,m) - f """ import math def invC(n,m,MOD): def exgcd(a,b): ...
1999F
wrong_submission
easy
275,013,789
PyPy 3-64
WRONG_ANSWER on test 2
from math import perm, factorial, comb mod = pow(10, 9) + 7 for _ in range(int(input())): n, k = map(int, input().split()) a = list(map(int, input().split())) zeros = a.count(0) ones = a.count(1) m = comb(n, k) m1 = comb(zeros, k // 2 + 1) m2 = comb(ones, k // 2) if ones > 0 else 1 pri...
1999F
wrong_submission
easy
274,944,026
Java 8
WRONG_ANSWER on test 2
import java.io.*; import java.util.*; public class Main { static int mod = (int) (1e9 + 7); static long[] jc; public static void main(String[] args) { Kattio sc = new Kattio(); int t = sc.nextInt(); jc = new long[(int) (3e5 + 1)]; jc[0] = 1; for (int i = 1; i ...
1999F
wrong_submission
easy
275,056,133
Java 21
WRONG_ANSWER on test 2
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.text.DecimalFormat; import java.util.*; import java.util.stream.Collectors; import javax.net.ssl.HandshakeCompletedEvent; import javax.xml.transform.Source; public class problem { ...
1999F
wrong_submission
easy
274,908,172
C++17 (GCC 7-32)
WRONG_ANSWER on test 3
#include <bits/stdc++.h> #define problem "test" #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define fi first #define se second #define ALL(v) (v).begin(),(v).end() #define UNIQUE(v) (v).resize(unique(ALL(v)) - (v).begin()) #define BIT(x,i) (((x) >> (i)) & 1) #define MASK(i) (1LL << (i)) using...
1999F
wrong_submission
medium
274,981,487
C++20 (GCC 13-64)
WRONG_ANSWER on test 3
#include <iostream> #include <cmath> #include <algorithm> using namespace std; long long mod = 1e9+7; // Returns factorial of n double fact(int n) { if(n==0) return 1; double res = 1; for (int i = 2; i <= n; i++) res = res * i; return res; } double nCR(int n, int r) { return fact...
1999F
wrong_submission
medium
280,467,961
PyPy 3-64
WRONG_ANSWER on test 3
import sys input = sys.stdin.readline M = 10**9+7 N = 2*10**5 d = [1] for i in range(1, N+1): d.append(d[-1]*i%M) def comb(k, n): return d[n] * pow((d[k]*d[n-k]), -1, M) % M for _ in range(int(input())): n, k = map(int, input().split()) w = input() a = w.count('1') b = n-a c = 0 ...
1999F
wrong_submission
medium
274,978,949
Python 3
TIME_LIMIT_EXCEEDED on test 3
import os import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode or "r" not in file.mode self.write = self.buffer.write if self...
1999F
wrong_submission
medium
276,321,698
Java 21
WRONG_ANSWER on test 3
import java.io.*; import java.util.*; public class Main { static long MOD = (long) 1e9 + 7; static int MAXN = (int) 2e5; static long[] invFact = new long[MAXN + 1]; static long[] fact = new long[MAXN + 1]; public static void main(String[] args) throws IOException { FastIO io = new Fast...
1999F
wrong_submission
medium
274,882,185
Java 21
WRONG_ANSWER on test 3
import java.util.Arrays; import java.util.Scanner; public class F{ static int mod=(int)1e9+7; private static long combi(int n,int k){ long ans=1; k=k>n-k?n-k:k; int j=1; for(;j<=k;j++,n--) { if(n%j==0) { ans*=n/j; }els...
1999F
wrong_submission
medium
278,944,813
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 4
import sys import math from itertools import combinations from functools import lru_cache MOD = 1000000007 # Returns factorial of n using memoization for efficiency @lru_cache(None) def fact(n): if n == 0: return 1 res = 1 for i in range(2, n + 1): res = res * i return res # Return...
1999F
wrong_submission
hard
274,852,014
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 4
import sys from collections import defaultdict,deque,Counter from heapq import heappush,heappop,heapify from math import inf,comb from functools import cache from itertools import accumulate,combinations,permutations input=lambda:sys.stdin.readline().rstrip() inp=lambda:map(int,input().split()) t=int(input()) mod=10**9...
1999F
wrong_submission
hard
275,062,972
Java 21
TIME_LIMIT_EXCEEDED on test 5
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.text.DecimalFormat; import java.util.*; import java.util.stream.Collectors; import javax.net.ssl.HandshakeCompletedEvent; import javax.xml.transform.Source; public class problem { ...
1999F
wrong_submission
hard
274,936,530
C++17 (GCC 7-32)
TIME_LIMIT_EXCEEDED on test 6
#include <iostream> #include <vector> using namespace std; const int mod = 1000000007; long long factorial(long long n, long long mod) { long long result = 1; for (long long i = 2; i <= n; ++i) { result = (result * i) % mod; } return result; } long long mod_inverse(long long x, long long m...
1999F
wrong_submission
hard
274,816,873
C++17 (GCC 7-32)
TIME_LIMIT_EXCEEDED on test 6
#include <bits/stdc++.h> #define ll long long #define int ll #define ull unsigned long long #define ld long double #define eb emplace_back #define pii pair<int, int> #define tpl tuple<int, int, int> #define OO LLONG_MAX / 2 #define oo INT_MAX / 2 using namespace std; const int MOD=1e9+7; int lgpow(int x,int y) { ...
1999F
wrong_submission
hard
296,260,176
Java 8
TIME_LIMIT_EXCEEDED on test 6
import java.io.*; import java.util.*; public class Main { public static final int MOD = 1_000_000_007; static PrintWriter out; static FastReader in; public static void main(String[] args) { in = new FastReader(); out = new PrintWriter(System.out); int t = in.nextInt(); ...
1999F
wrong_submission
hard
263,946,858
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using i64 = long long; void solve() { int n, m, k; std::cin >> n >> m >> k; std::vector<std::array<int, 3>> f(k); for (int i = 0; i < k; i++) { int r, c; std::cin >> r >> c; c--; f[i] = {c, r, i}; } std::sort(f.begin(), f.end()); ...
1980F2
right_submission
none
264,059,120
C++17 (GCC 7-32)
OK
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, m, k; cin >> n >> m >> k; map <int, map <int, int>> index; vector <pair <int, int>> a(k); for (int i = 0; i < k; ++i) { auto &[x, y] = a[i]; scanf("%d %d", &x, &y); index[x][y...
1980F2
right_submission
none
272,997,049
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define ll long long int t, n, m, k; ll ans[200005]; void solve() { cin >> n >> m >> k; vector<tuple<int, int, int>> a; vector<int> v; vector<pair<int, int> > b, c; vector<int> vt, vitri; vector<ll> s; for (int i = 1; i <= k; i+...
1980F2
right_submission
none
270,822,414
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 200000; pair<int, int> arrpii[maxn]; map<int, vector<int>> mii; bitset<maxn> bs; signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); int tests; cin >> tests; while (tests--) { int n, m, k; cin...
1980F2
wrong_submission
easy
267,830,731
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
/** * https://codeforces.com/contest/1980/submission/267827508 * * Copyright (c) 2024 Diego Sogari */ #include <bits/stdc++.h> using namespace std; using filesystem::path; using i64 = int64_t; using f64 = double; void solve(int t) { int n, m, k; cin >> n >> m >> k; if (t == 16) { cout << n << ',' << m...
1980F2
wrong_submission
easy
266,450,426
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = int64_t; using pi32 = pair<i32, i32>; using pi64 = pair<i64, i64>; #define MP make_pair #define MT make_tuple #define F first #define S second using vi32 = vector<i32>; using vi64 = vector<i64>; using vpi32 = vector<pi32>; using vp...
1980F2
wrong_submission
easy
281,118,299
PyPy 3-64
WRONG_ANSWER on test 2
import sys from collections import defaultdict,deque,Counter from heapq import heappush,heappop,heapify from math import inf,comb,ceil,log,gcd from functools import cache from itertools import accumulate,combinations,permutations from bisect import bisect_left,bisect_right,insort_left from random import randint xor=ran...
1980F2
wrong_submission
easy
266,192,208
Python 3
TIME_LIMIT_EXCEEDED on test 2
# import numpy as np # def getComponent(coor,mat): # tmp = mat # succ = getSuccessors(coor,tmp) # for s in succ: # tmp[s]='-' # getComponent(s,tmp) # componentLength = np.count_nonzero(tmp == '-') # return 1 if not componentLength else componentLength # def getMaxComponent(matrix,l...
1980F2
wrong_submission
easy
264,599,753
PyPy 3-64
WRONG_ANSWER on test 2
import math,random from collections import defaultdict from bisect import bisect_left, bisect_right import random rd = random.randint(10**8,10**9) class mydict: def __init__(self, func=lambda: 0): self.random = random.randint(0, 1 << 32) self.default = func self.dict = {} def __getite...
1980F2
wrong_submission
easy
264,631,202
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> // #define LOOP_TEST_ABFS #define FROM_FILE_IO #if (defined XqAiyee) && (!defined LOOP_TEST_ABFS) #include <cur.hpp> #include <chronos.hpp> #define debug(...) (XQ::out_s(XQ::Not_Char{'\0'}, XQ::Not_Str{#__VA_ARGS__ }, XQ::Not_Str{":"}, __VA_ARGS__) << std::endl) #else #define debug(...) (NULL...
1980F2
wrong_submission
easy
264,099,526
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define int long long struct node { int x, y, id; } a[200005]; int mx[200005]; bool cmp(node a, node b) { if (a.x != b.x) return a.x < b.x; return a.y < b.y; } int val[200005]; signed main() { int t; cin >> t; while (t--) { int n, m, k; ...
1980F2
wrong_submission
easy
276,417,524
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; #define ll long long int t, n, m, q; int pos[200005]; ll ans[200005]; struct node { int x, y, id; bool operator<(const node& p)const { if (x == p.x) return y > p.y; return x < p.x; } }a[200005]; void test() { cin >> n >> m >> q; for (int i = 1; i <= q; i++) { cin ...
1980F2
wrong_submission
medium
264,205,512
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count()); typedef long long LL; typedef unsigned long long ULL; typedef pair<int,int> PII; const int _MAX = 0x3f3f3f3f; const int N = 2e5 + 10,mod = 1e9 + 7; struct node{ int x, y; }point[N]; void solve() { ...
1980F2
wrong_submission
medium
281,115,538
PyPy 3-64
WRONG_ANSWER on test 2
import sys from collections import defaultdict,deque,Counter from heapq import heappush,heappop,heapify from math import inf,comb,ceil,log,gcd from functools import cache from itertools import accumulate,combinations,permutations from bisect import bisect_left,bisect_right,insort_left from random import randint xor=ran...
1980F2
wrong_submission
medium
264,600,913
PyPy 3-64
WRONG_ANSWER on test 2
import math,random from collections import defaultdict from bisect import bisect_left, bisect_right import random rd = random.randint(10**8,10**9) class mydict: def __init__(self, func=lambda: 0): self.random = random.randint(0, 1 << 32) self.default = func self.dict = {} def __getite...
1980F2
wrong_submission
medium
265,925,918
Java 21
WRONG_ANSWER on test 2
// Source: https://usaco.guide/general/io import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); for(int ii = 1; ii <= T; ii++){ ...
1980F2
wrong_submission
medium
265,925,713
Java 21
WRONG_ANSWER on test 2
// Source: https://usaco.guide/general/io import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); for(int ii = 1; ii <= T; ii++){ ...
1980F2
wrong_submission
medium
264,046,337
C++20 (GCC 13-64)
WRONG_ANSWER on test 3
#include<iostream> #include<algorithm> #include<vector> #include<array> #define SZ(X) ((int)(X).size()) using namespace std; void solve() { int n, m, k; cin >> n >> m >> k; vector<array<int, 3>> p; vector<int> val(k + 2), an(k + 1); for(int i = 1; i <= k; i++) { int r, c; cin >> r >>...
1980F2
wrong_submission
hard
264,259,990
C++20 (GCC 13-64)
WRONG_ANSWER on test 3
/* === INCLUDES === ---------------------------------------------------------- */ #include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordere...
1980F2
wrong_submission
hard
266,191,902
Python 3
MEMORY_LIMIT_EXCEEDED on test 3
# import numpy as np # def getComponent(coor,mat): # tmp = mat # succ = getSuccessors(coor,tmp) # for s in succ: # tmp[s]='-' # getComponent(s,tmp) # componentLength = np.count_nonzero(tmp == '-') # return 1 if not componentLength else componentLength # def getMaxComponent(matrix,l...
1980F2
wrong_submission
hard
266,191,418
Python 3
MEMORY_LIMIT_EXCEEDED on test 3
# import numpy as np # def getComponent(coor,mat): # tmp = mat # succ = getSuccessors(coor,tmp) # for s in succ: # tmp[s]='-' # getComponent(s,tmp) # componentLength = np.count_nonzero(tmp == '-') # return 1 if not componentLength else componentLength # def getMaxComponent(matrix,l...
1980F2
wrong_submission
hard
265,871,346
Java 21
MEMORY_LIMIT_EXCEEDED on test 3
import java.io.*; import java.util.*; import static java.lang.Math.min; public class F_1980 { private static final int MAX = 200005; public static void main(String[] args) throws IOException { final var cin = new Reader(); final var sb = new StringBuilder(); int t = cin.nextInt(); while (t--...
1980F2
wrong_submission
hard
264,089,421
Java 21
WRONG_ANSWER on test 3
import java.io.*; import java.util.Arrays; import java.util.Comparator; import java.util.StringTokenizer; public class Pro7 { public static void solve() throws IOException{ int n = in.nextInt(); int m = in.nextInt(); int k = in.nextInt(); int[][] points = new int[k][3]; f...
1980F2
wrong_submission
hard
279,354,115
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; void solve() { int a, b; std::cin >> a >> b; if (a % 2 == 0 && (a > 0 || b % 2 == 0)) { std::cout << "YES\n"; } else { std::cout << "NO\n"; } } int main() { std::ios::...
2008A
right_submission
none
279,069,108
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { int a, b; cin >> a >> b; if(a % 2 == 1) { cout << "NO\n"; } else if(a == 0 && b % 2 == 1) { cout << "NO\n"; } else { cout << "YES\n"; } } int main() { ios_base::sync_w...
2008A
right_submission
none
279,449,371
C++17 (GCC 7-32)
OK
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define yes "YES" #define no "NO" #define FOR(i, a, b) for (int i=(a); i<(b); i++) // #define F0R(i, a) for (int i=0; i<(a); i++) #define FORr(i,a,b) for (int i = (b)-1; i >= (a); i--) // #define F0Rr(i,a) for (int i = (a)-1; i >= 0; i--) #define mp m...
2008A
right_submission
none
279,089,308
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define int long long #define optimize() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) int32_t main() { optimize(); int t; cin>>t; while(t--) { int a,b,p=0; cin>>a>>b; if(a>0 && b==0) ...
2008A
wrong_submission
easy
287,529,457
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; int l; int main(){ cin.tie(0)->sync_with_stdio(0); cin >> l; while (l--){ int a, b; cin >> a >> b; if ((a == 0 && b == 1) || (a == 1 && b == 0)) cout << "No" << "\n"; else if (a % 2 == 0 && b % 2 == 0) cout << "Yes" << "\n"; else if (a == (b / 2 *...
2008A
wrong_submission
easy
279,072,530
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
// Online C++ compiler to run C++ program online #include <iostream> using namespace std; #include <algorithm> #include <map> #include <climits> #include <vector> #include <cmath> #include <stack> #include <deque> #include <queue> #include <set> #include <list> #include <iomanip> #define mod 1000000007 struct ing{ ...
2008A
wrong_submission
easy
288,069,809
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): a,b = map(int, input().split()) if (a==0 and b%2 ==0) or (a%2==0 and b==0): print("YES") elif a%2==0 and abs(((a/2)-b))%2==0: print("YES") else: print("NO")
2008A
wrong_submission
easy
279,463,288
Python 3
WRONG_ANSWER on test 2
n = int(input()) for _ in range(n): a,b = map(int,input().split()) if a%2==1 : # a is odd print("NO") else: # a is even if (a//2+b)%2==0 or b==0: print("YES") else: print("NO")
2008A
wrong_submission
easy
280,898,847
Python 3
WRONG_ANSWER on test 2
a = int(input()) for _ in range(a): b, c = map(int,input().split()) if b % 2 != 0: print('NO') elif b == 0 and c == 1: print('NO') elif b % 2 == 0 and b // 2 <= c and (b // 2 + c) % 2 == 0: print('YES') elif b % 2 == 0 and b // 2 > c and (b - c * 2) % 2 == 0: print('Y...
2008A
wrong_submission
easy
279,089,160
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++){ int a=sc.nextInt(); int b=sc.nextInt(); int target = a + 2 * b; if (target % 2 == 0) { int x = tar...
2008A
wrong_submission
easy
279,105,601
Java 8
WRONG_ANSWER on test 2
import java.util.*; public class main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int one = sc.nextInt(); int two = sc.nextInt(); int sum1=1*one; int sum2=2*two; ...
2008A
wrong_submission
easy
279,219,234
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--){ int a,b; cin>>a>>b; if(a%2!=0) cout<<"NO\n"; else if(a%2==0 && b%2==0) cout<<"YES\n"; else if(a==0 && b%2==0) cout<<...
2008A
wrong_submission
medium
279,078,972
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> #define ll long long int using namespace std; const int P = 239017; const int MOD_X = 1e9 + 7; const int MOD_Y = 1e9 + 9; struct H { int x, y; H() = default; H(int _x): x(_x), y(_x) {} H(int _x, int _y): x(_x), y(_y) {} inline H operator+(const H& h) const { re...
2008A
wrong_submission
medium
281,460,300
Python 3
WRONG_ANSWER on test 2
import sys lines = sys.stdin.readlines() lines.remove(lines[0]) for line in lines: t = [int(p) for p in line.split(" ")] if (((t[0]/2 + t[1]) % 2 == 0) or t[1] % 2 == 0) and (t[0]%2 == 0) and (t[1] + t[0] != 1): print("YES") else: print("NO")
2008A
wrong_submission
medium
279,288,833
Python 3
WRONG_ANSWER on test 2
for test in range(int(input())): a,b=map(int,input().split()) if a!=0 and a%2==0 : print("YES") else: print("NO")
2008A
wrong_submission
medium
279,098,167
Java 21
WRONG_ANSWER on test 2
import java.util.Scanner; public class GS { public static String func(int a,int b){ if(a*2==b )return "YES"; if((a==0 && b%2==0) || (b==0 && a%2==0) )return "YES"; if( b%2==1 && a==2)return "YES"; return "NO"; } public static void main(String[] args) { Scanner sc=...
2008A
wrong_submission
medium
279,430,014
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class mine { public static void main(String[] args) { Scanner s=new Scanner(System.in); int t=s.nextInt(); for(int i=1;i<=t;i++) { int a=s.nextInt(); int b=s.nextInt(); if((a>0 && a%2==0) && (b%2==0 || (a+(2*b))%2==0))...
2008A
wrong_submission
medium
281,882,462
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; int main() { int N; cin >> N; for(int i=0; i<N; i++) { int a, b; cin >> a >> b; if (a > 2 * b) { a = a - 2 *b; b = 0; }else{ b = b - a / 2; a = a % 2; } a = a % 2; ...
2008A
wrong_submission
hard
279,100,830
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; #define forn(iter,size) for(int iter = 0; iter < int(size); ++iter) typedef long long ll; typedef double du; const int INF = (int)1e9 + 7, MOD = (int)1e9 + 7; void solve(){ int a,b;cin >> a >> b; if(b * 2 >= a){ b -= a / 2; if(b % 2 != ...
2008A
wrong_submission
hard
279,099,293
Python 3
WRONG_ANSWER on test 2
t = int(input()) for i in range(t): a, b = map(int, input().split()) array = [1 for i in range(a)] + [2 for j in range(b)] if a==0 and b%2!=0 or a%2!=0 and b==0: print('NO') elif a==0 and b%2==0 or a%2==0 and b==0: print('YES') elif a%2==0 and (b-a//2)%2==0: print('YES') ...
2008A
wrong_submission
hard
279,215,465
PyPy 3-64
WRONG_ANSWER on test 2
x=int(input()) mylist=[] for _ in range(x): y = input() (a,b) = tuple(y.split()) a = int(a) b = int(b) if a%2 == 1: print('NO') else: if b%2 == 0: print('YES') else: if a%4 == 2: print('YES') else: pr...
2008A
wrong_submission
hard
279,116,592
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class A_Sakurako_s_Exam { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int tc=sc.nextInt(); for(int io=0;io<tc;io++){ int n=sc.nextInt(),m=sc.nextInt(); if(n%2!=0){ System.out.println("NO"); ...
2008A
wrong_submission
hard
279,126,934
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while (t-- > 0) { int ones = in.nextInt(); int twos = in.nextInt(); if (twos == 0 && ones % 2 == 0) { System.out.println("Yes");...
2008A
wrong_submission
hard
264,887,262
C++20 (GCC 13-64)
OK
/** * author: tourist * created: 09.06.2024 10:44:44 **/ #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) 42 #endif template <typename T> T inverse(T a, T m) { T u = 0, v = 1; while (a != 0) { T t = m / a; m -= t * a; swap(a, m); ...
1984C2
right_submission
none
264,878,053
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using i64 = long long; template<class T> constexpr T power(T a, i64 b) { T res {1}; for (; b; b /= 2, a *= a) { if (b % 2) { res *= a; } } return res; } constexpr i64 mul(i64 a, i64 b, i64 p) { i64 res = a * b - i64(1.L * a * b / p) * p; r...
1984C2
right_submission
none
265,624,707
C++17 (GCC 7-32)
OK
#include <iostream> #include <vector> using namespace std; using ll = long long; using str = string; using vll = vector<ll>; #define MOD 998244353 // Hàm tính (base^exp) % mod bằng lũy thừa nhanh ll powerMod(ll base, ll exp, ll mod) { ll result = 1; base = base % mod; while (exp > 0) { if (exp % 2 =...
1984C2
right_submission
none
269,166,266
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> #define ll long long #define ull unsigned long long #define db double #define ldb long double #define max(A,B) (A>B? A:B) #define min(A,B) (A<B? A:B) #define yes cout<<"Yes\n" #define no cout<<"No\n" #define pir pair<ll,ll> #define mpr(A,B) make_pair(A,B) using namespace std; const int N=2e5+1...
1984C2
wrong_submission
easy
264,904,227
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <iostream> #include <vector> using namespace std; #include <iostream> #include <vector> using namespace std; void solve(){ int n; cin>>n; vector<long long> v; int a; cin>>a; v.push_back(a); for(int i=1;i<n;i++){ long long b; cin>>b; v.push_back(b); } ...
1984C2
wrong_submission
easy
264,957,382
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define int long long int #define yes cout << "YES" << endl; #define no cout << "NO" << endl; #define neg cout << -1 << endl; #define pb push_back #define ss second #define ff first const int md=998244353; const int N = 2e5+5; const int INF=1e18; void solve() { int ...
1984C2
wrong_submission
easy
264,908,887
PyPy 3-64
WRONG_ANSWER on test 2
import sys input = lambda: sys.stdin.readline().rstrip() def get_number(): return int(input()) def get_numbers(): return list(map(int, input().split())) def get_word(): return input() def solve(): n = get_number() a = get_numbers() positives = [0] * n running_sum = [0] ...
1984C2
wrong_submission
easy
264,942,175
PyPy 3-64
WRONG_ANSWER on test 2
import sys import math import copy from collections import deque from collections import defaultdict as ddic #from atcoder import fenwicktree class UndirectedGraph: def __init__(self, vertices): self.vertices = vertices self.adj = {i: [] for i in range(self.vertices)} def addEdge(self, u, v)...
1984C2
wrong_submission
easy
284,041,097
PyPy 3-64
WRONG_ANSWER on test 2
MOD = 998244353 tot = int(input()) for _ in range(tot): n = int(input()) nums = list(map(int, input().split(' '))) mx = 0 mn = 0 s = 0 for x in nums: mx = abs(mx + x) s += x mn = min(mn, s) if mn >= 0: print(1 << n) continue ans = 0 s = 0 l...
1984C2
wrong_submission
easy
264,939,454
Java 21
TIME_LIMIT_EXCEEDED on test 2
import java.lang.*; // imports everything import java.util.*; public class C_2_Magnitude_Hard_Version { //static ArrayList<Integer> a=new ArrayList<>(); //static int max; static HashMap<Long,Long> map=new HashMap<>(); static long a[]; static long k=998244353; static long max=Long.MIN_VALUE; ...
1984C2
wrong_submission
easy
264,941,595
Java 21
WRONG_ANSWER on test 2
import java.util.Scanner; public class C { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int tes = scanner.nextInt(); for(int t = 0; t < tes; t++){ int n = scanner.nextInt(); long[] a = new long[n]; long[] b = new l...
1984C2
wrong_submission
easy