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,446,115
C++17 (GCC 7-32)
WRONG_ANSWER on test 3
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 3e3; const int mod = 998244353; int add(int x, int y) { return (x += y) >= mod ? x - mod : x; } int sub(int x, int y) { return (x -= y) < 0 ? x + mod : x; } int ksm(ll x, int tp, int s = 1) { for (; tp; x = x * x % mod, tp >>= 1) ...
2035G1
wrong_submission
hard
288,345,518
C++20 (GCC 13-64)
WRONG_ANSWER on test 3
#include<bits/stdc++.h> using namespace std; #define fi first #define se second typedef long long ll; const ll mod=998244353; const int N=3005; int n,m; ll guy[N]; int d[N]; ll dp[N]; ll ways[N]; ll pn[N][N]; int filled[N]; void dfs(int l,int r,int frog){ if(l==r){ d[l]+=frog;//d[l] = number of elements that is f...
2035G1
wrong_submission
hard
296,009,555
Python 3
TIME_LIMIT_EXCEEDED on test 5
from collections import defaultdict from math import prod P = 998244353 def solve(): n, m = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(m)] def bsearch(x): l, h = 1, n while l < h: m = l + h >> 1 yield m if m < x: l = m + ...
2035G1
wrong_submission
hard
288,359,686
C++17 (GCC 7-32)
WRONG_ANSWER on test 5
#include <bits/stdc++.h> #define rep(i,n) for(int i=0,del##i##verme=int(n);i<del##i##verme;++i) #define rep1(i,n) for(int i=1,parano##i##a=int(n);i<=parano##i##a;++i) #define per(i,n) for(int i=int(n)-1;i>=0;--i) #define per1(i,n) for(int i=int(n);i>=1;--i) #define pb push_back #define mp make_pair #define fi first #de...
2035G1
wrong_submission
hard
288,383,189
C++17 (GCC 7-32)
TIME_LIMIT_EXCEEDED on test 5
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #inclu...
2035G1
wrong_submission
hard
290,755,435
C++17 (GCC 7-32)
WRONG_ANSWER on test 5
#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll N = 3e5; const ll mod = 998244353; ll n, m; struct dpnode{ ll nr, nr2; }dp[N]; void add(dpnode &a, dpnode b){ if(b.nr2 == 0)return; if(a.nr < b.nr){ a = b; }else if(a.nr == b.nr){ a.nr2 = (a.nr2 + b.nr2)%mod; ...
2035G1
wrong_submission
hard
275,803,261
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using u32 = unsigned; using i64 = long long; using u64 = unsigned long long; constexpr int N = 2E7; std::vector<int> minp, primes; void sieve(int n) { minp.assign(n + 1, 0); primes.clear(); for (int i = 2; i <= n; i++) { if (minp[i] == 0) { minp[i] = i...
2002F2
right_submission
none
275,836,055
C++20 (GCC 13-64)
OK
/** * date : 2024-08-12 02:01:44 * author : Nyaan */ #define NDEBUG using namespace std; // intrinstic #include <immintrin.h> #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cfenv> #include <cfloat> #include <chrono> #include <cinttypes> #include <clim...
2002F2
right_submission
none
275,980,791
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e7 + 5; bool ntp[N]; bool bad[405][405]; int pos[N]; int prime[2000005], mn[N], cnt; void sieve(int n) { int i, j; for (i = 2; i <= n; i++) { if (!ntp[i]) prime[++cnt] = i, mn[i] = i; for (j = ...
2002F2
right_submission
none
275,960,266
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, x, y) for(int i = x; i <= y; ++ i) #define mid ((l + r) >> 1) #define pb push_back #define i64 long long const int N = 1e6 + 20; const long long inf = 2e18; const int M = 1e9 + 7; vector <int> pr; int n, vis[N * 20]; void sieve()...
2002F2
wrong_submission
easy
300,223,880
C++20 (GCC 13-64)
TIME_LIMIT_EXCEEDED on test 2
bool M1; #include<bits/stdc++.h> #define look_memory cerr<<abs(&M2-&M1)/1024.0/1024<<'\n' #define look_time cerr<<(clock()-Time)*1.0/CLOCKS_PER_SEC<<'\n' using namespace std; #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 pb push_back #define mk make_pair #define fi fi...
2002F2
wrong_submission
easy
277,742,343
C++20 (GCC 13-64)
MEMORY_LIMIT_EXCEEDED on test 2
//cpp //#define __filed_ //#define __fasIO_ //#define __subit_ #define __moret_ #ifndef __wht_pre_ #define __wht_pre_ #include <bits/stdc++.h> using namespace std; #ifdef ONLINE_JUDGE #define __subit_ #undef __filed_ #endif #ifndef __w_IO__ #define __w_IO__ namespace IO { #ifdef __fasIO_ const int m...
2002F2
wrong_submission
easy
296,936,953
Python 3
MEMORY_LIMIT_EXCEEDED on test 2
import math def gcd(a, b): while b: a, b = b, a % b return a def initialize_dp_table(n, m, l, f): dp = [[0] * (m + 1) for _ in range(n + 1)] dp[1][0] = l dp[0][1] = f return dp def update_dp_value(dp, i, j, l, f): if i > 0: dp[i][j] = max(dp[i][j], dp[i-1][j] + l) i...
2002F2
wrong_submission
easy
275,830,833
Python 3
TIME_LIMIT_EXCEEDED on test 2
import math gcd=math.gcd x=int(input()) def score(wl,wf,l,f): return (l*wl+f*wf) for i in range(x): s=input() p=s.split() n=int(p[0]) m=int(p[1]) l=int(p[2]) f=int(p[3]) c=[[0,0],[0,1],[1,0]] d=[] for i in range(1,n+1): for j in range(1,m+1): if gcd(i,j)==0 or...
2002F2
wrong_submission
easy
275,828,917
Python 3
RUNTIME_ERROR on test 2
def gcd(num1, num2): if num1 == 0 or num2 == 0: return num1 + num2 if num1 == num2: return num1 if num1 > num2: return gcd(num1 - num2, num2) else: return gcd(num1, num2 - num1) x=int(input()) def score(wl,wf,l,f): return (l*wl+f*wf) for i in range(x): s=input() ...
2002F2
wrong_submission
easy
277,504,204
Java 21
WRONG_ANSWER on test 2
import java.util.*; import java.io.*; public class Main { private static BufferedReader br; private static StringTokenizer tokenizer; private static String next() throws IOException{ if (br == null) br = new BufferedReader(new InputStreamReader(System.in)); if (tokenizer == null) tokenizer...
2002F2
wrong_submission
easy
277,502,443
Java 21
RUNTIME_ERROR on test 2
import java.util.*; import java.io.*; public class Main { private static BufferedReader br; private static StringTokenizer tokenizer; private static String next() throws IOException{ if (br == null) br = new BufferedReader(new InputStreamReader(System.in)); if (tokenizer == null) tokenizer...
2002F2
wrong_submission
easy
275,827,478
C++20 (GCC 13-64)
WRONG_ANSWER on test 9
#include<bits/stdc++.h> using namespace std; using ll=long long; const int N=2e7+5; bool isp[N]; vector<int> p={1}; auto init=[](){ for(int i=2;i<N;i++){ if(!isp[i]) p.push_back(i); for(auto v:p){ if(v==1) continue; if(i*v>=N) break; isp[i*v]=true; if(i%v==0) break; } } return 0; }(); auto solve(in...
2002F2
wrong_submission
medium
279,781,422
C++17 (GCC 7-32)
WRONG_ANSWER on test 9
#include<bits/stdc++.h> using namespace std; const int N = 2e7 + 1000; int fl[N + 10], p[N], tot; long long ans; int G[1100][1100], FL, L, F; void calc(int x, int y, int Lx, int Rx, int Ly, int Ry) { // if(Ly > R)return; if(__gcd(x, y) > 1)return; if(G[x - Lx][y - Ly] == FL)return; G[x - Lx][y - Ly] = FL; ans = ma...
2002F2
wrong_submission
medium
277,500,075
Java 21
WRONG_ANSWER on test 9
import java.util.*; import java.io.*; public class Main { private static BufferedReader br; private static StringTokenizer tokenizer; private static String next() throws IOException{ if (br == null) br = new BufferedReader(new InputStreamReader(System.in)); if (tokenizer == null) tokenizer...
2002F2
wrong_submission
medium
275,863,887
Java 8
WRONG_ANSWER on test 9
import java.io.*; import java.util.*; public class F { static IOHandler sc = new IOHandler(); static PrintWriter out = new PrintWriter(System.out); static TreeSet<Integer> set; static List<Integer> [] factors; static long [][] memo; static boolean [][] visited; public static void main(String[] args) ...
2002F2
wrong_submission
medium
275,901,758
C++17 (GCC 7-32)
WRONG_ANSWER on test 9
#include<bits/stdc++.h> #define endl '\n' using namespace std; bool zadr[20000007]={1, 1}; int dp[105][105]; vector<int> primes; int queries[4][3005]; int bst[20000007]; queue<pair<int, int>> pos; bool slzh[3005][3005]; void dfs(int a, int b, int c, int d) { int kr=a, kr2=b; pos.push({a, b}); for(...
2002F2
wrong_submission
medium
275,833,098
C++20 (GCC 13-64)
WRONG_ANSWER on test 9
#include<bits/stdc++.h> #define ll long long #define pii pair<int,int> #define lowbit(x) (x&-x) #define log(x) (31^__builtin_clz(x)) using namespace std; const int maxn=2e7+5; bool notpri[maxn]; vector<int>pri; void init(){ for(int i=2;i<=2e7;i++){ if(!notpri[i]){ pri.push_back(i); } for(int num:pri){ if((...
2002F2
wrong_submission
medium
275,841,361
C++20 (GCC 13-64)
TIME_LIMIT_EXCEEDED on test 12
#include <bits/stdc++.h> #define rep(i,j,k) for(int i=j;i<=(k);++i) #define drp(i,j,k) for(int i=j;i>=(k);--i) #define isdigit(ch) (ch>=48&&ch<=57) #define mp std::make_pair #define mod 1000000007 #define MAXN 20000005 typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef std::pair<int,i...
2002F2
wrong_submission
hard
275,823,928
C++20 (GCC 13-64)
WRONG_ANSWER on test 12
#include <bits/stdc++.h> using namespace std; //#define int long long typedef long long ll; typedef long double ld; #define pb push_back #define ar(x) array<int, x> #define all(x) begin(x),end(x) #define rall(x) rbegin(x),rend(x) const ll MAGIC[7] = {2ll, 325ll, 9375ll, 28178ll, 450775ll, 9780504ll, 1795265022ll}; ...
2002F2
wrong_submission
hard
277,610,137
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 12
#https://codeforces.com/contest/2002/problem/F2?locale=en primes = [1] def sieve_of_eratosthenes(n): global primes a = [True] * (n + 1) i = 2 while i * i <= n: if a[i] == True: primes.append(i) for j in range(i, n+1, i): a[j] = False i += 1 ...
2002F2
wrong_submission
hard
277,497,564
Java 21
TIME_LIMIT_EXCEEDED on test 12
import java.util.*; import java.io.*; public class Main { private static BufferedReader br; private static StringTokenizer tokenizer; private static String next() throws IOException{ if (br == null) br = new BufferedReader(new InputStreamReader(System.in)); if (tokenizer == null) tokenizer...
2002F2
wrong_submission
hard
277,493,280
Java 21
TIME_LIMIT_EXCEEDED on test 12
import java.util.*; import java.io.*; public class Main { private static BufferedReader br; private static StringTokenizer tokenizer; private static String next() throws IOException{ if (br == null) br = new BufferedReader(new InputStreamReader(System.in)); if (tokenizer == null) tokenizer...
2002F2
wrong_submission
hard
277,529,112
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 15
#https://codeforces.com/contest/2002/problem/F2?locale=en primes = [1] def sieve_of_eratosthenes(n): global primes a = [True] * (n + 1) i = 2 while i * i <= n: if a[i] == True: primes.append(i) for j in range(i, n+1, i): a[j] = False i += 1 ...
2002F2
wrong_submission
hard
296,756,078
PyPy 3-64
OK
import sys import random r32 = random.getrandbits(32) r64 = random.getrandbits(64) def input(): return sys.stdin.readline().rstrip("\r\n") def rint(): return int(input()) def rf(): return float(input()) def rs(): return input().split() def rmap(): return map(int, input().split()) def rmapf(): return map(float, inpu...
2044H
right_submission
none
304,880,081
PyPy 3-64
OK
from sys import stdin read_line = stdin.readline parse_ints = lambda: map(int, read_line().split()) print_result = print for _ in range(int(read_line())): n, q = parse_ints() matrix = [[*parse_ints()] for _ in range(n)] prefix_sum = [[[0]*3 for _ in range(n+1)] for _ in range(n+1)] for ...
2044H
right_submission
none
299,483,344
PyPy 3-64
OK
standard_input, packages, output_together = 1, 1, 1 dfs, hashing, read_from_file = 1, 1, 0 de = 1 if 1: if standard_input: import io, os, sys input = lambda: sys.stdin.readline().strip() import math inf = math.inf def I(): return input() def...
2044H
right_submission
none
306,268,884
Java 21
OK
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); int t = Integer.parseInt(br...
2044H
right_submission
none
299,971,031
Java 21
OK
import java.io.*; import java.util.*; public class Main { public static int INF = 0x3f3f3f3f, mod = 1000000007, mod9 = 998244353; public static void main(String args[]){ try { PrintWriter o = new PrintWriter(System.out); boolean multiTest = true; // init ...
2044H
right_submission
none
299,315,886
Java 21
OK
//package com.example.practice.codeforces.below2000; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.StringTokenizer; //H. Hard Demon Problem public class Solution499 { public static void main(S...
2044H
right_submission
none
297,588,441
C++17 (GCC 7-32)
OK
#include <algorithm> #include <cassert> #include <array> #include <bitset> #include <cstdint> #include <map> #include <iostream> #include <optional> #include <random> #include <set> #include <stdio.h> #include <string.h> #include <utility> #include <vector> using namespace std; using ll = int64_t; using ull = uint64_...
2044H
right_submission
none
301,694,464
C++17 (GCC 7-32)
OK
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using pllll = pair<ll, ll>; using vpllll = vector<pllll>; void solveTestCase() { ll matrixSize, queryCount; cin >> matrixSize >> queryCount; vector<vll> matrix(matrixSize, vll(matrixSize)); for (vll &rowVector:...
2044H
right_submission
none
296,635,934
C++20 (GCC 13-64)
OK
/** * author: tourist * created: 15.12.2024 06:51:20 **/ #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) 42 #endif int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int tt; cin >> tt; while (tt--) { int n, q; cin >> n...
2044H
right_submission
none
296,833,046
C++23 (GCC 14-64, msys2)
OK
#include <bits/stdc++.h> using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; using u128 = unsigned __int128; void solve() { int n, q; std::cin >> n >> q; std::vector S(n + 1, std::vector<i64>(n + 1)); std::vector Si(n + 1, std::vector<i64>(n + 1)); std::vector Sj(n ...
2044H
right_submission
none
296,865,321
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> // #include <fmt/ranges.h> // WARN: remove before submission using namespace std; using ll = long long; int tc, n, q; int main() { cin.tie(nullptr)->sync_with_stdio(false); cin >> tc; while (tc--) { cin >> n >> q; vector g(n+1, vector(n+1, 0LL)); for (int i = 1...
2044H
right_submission
none
298,075,683
C++17 (GCC 7-32)
TIME_LIMIT_EXCEEDED on test 2
#include<bits/stdc++.h> using namespace std; #define ll long long void solve(ll m, ll n,vector<vector<ll>>&vec, ll x1, ll y1, ll x2, ll y2){ // cout<<"---"<<x1<<x2<<y1<<y2; vector<vector<ll>>dp(x2,vector<ll>(y2,0)); vector<vector<ll>>mulpi(x2,vector<ll>(y2,0)); //set mulpi 1,2,3 ... n...
2044H
wrong_submission
easy
296,735,133
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> #define FAST ios::sync_with_stdio(0), cin.tie(0) //, cout.tie(0) #define ll long long #define ld long double #define pb push_back #define pi pair<ll,ll> #define F first #define S second #define all(x) (x).begin(), (x).end() #define alll(x) ((x).begin()+1), (x).end() #define yes cout<<"Yes"<<endl...
2044H
wrong_submission
easy
296,747,035
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <iostream> #include <algorithm> #include <vector> #include <array> #include <set> #include <map> #include <queue> #include <stack> #include <list> #include <chrono> #include <random> #include <cstdlib> #include <cmath> #include <ctime> #include <cstring> #include <iomanip> #include <bitset> #include <cassert> ...
2044H
wrong_submission
easy
296,697,131
Python 3
TIME_LIMIT_EXCEEDED on test 2
def process_queries(t, test_cases): results = [] for n, q, matrix, queries in test_cases: for x1, y1, x2, y2 in queries: # Convert to 0-based indexing x1 -= 1 y1 -= 1 x2 -= 1 y2 -= 1 # Flatten the submatrix ...
2044H
wrong_submission
easy
296,743,509
Python 3
TIME_LIMIT_EXCEEDED on test 2
MAX_N = 2000 prefix_sum = [[0] * (MAX_N + 1) for _ in range(MAX_N + 1)] def compute_prefix(n, grid): for row in range(1, n + 1): for col in range(1, n + 1): prefix_sum[row][col] = ( grid[row][col] + (prefix_sum[row - 1][col] if row > 1 else 0) ...
2044H
wrong_submission
easy
296,715,231
Python 2
TIME_LIMIT_EXCEEDED on test 2
def process_pancake_factory(t, test_cases): results = [] for n, q, matrix, queries in test_cases: for (x1, y1, x2, y2) in queries: flatten_list = [] for i in range(x1 - 1, x2): # converting to 0-indexed for Python access for j in range(y1 - 1, y2...
2044H
wrong_submission
easy
306,267,370
Java 21
TIME_LIMIT_EXCEEDED 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 n = sc.nextInt(); int q = sc.nextInt(); long[][] pA = new long[n + 1][n + 1]; long...
2044H
wrong_submission
easy
302,351,652
Java 21
TIME_LIMIT_EXCEEDED on test 2
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); while (t-- > 0) { int n = scanner.nextInt(); int q = scanner.nextInt(); ...
2044H
wrong_submission
easy
297,224,929
C++17 (GCC 7-32)
TIME_LIMIT_EXCEEDED on test 3
#include<bits/stdc++.h> #define ll long long #define vvi vector<vector<ll>> #define vi vector<ll> #define get(n) int n; cin >> n; using namespace std; vvi M(2001, vi(2001)); vvi Sum(2001, vi(2001)); vvi x_Sum(2001, vi(2001)); vvi y_Sum(2001, vi(2001)); ll n, x1, y_start, x2, y2; int q; vi dp_x(2001); vi dp_y(2001);...
2044H
wrong_submission
medium
297,727,816
C++17 (GCC 7-32)
WRONG_ANSWER on test 3
#include <bits/stdc++.h> using namespace std; int main() { int tt; cin >> tt; while (tt > 0) { int n, q; cin >> n >> q; vector<vector<int>> v(n, vector<int>(n)); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> v[i][j]; ...
2044H
wrong_submission
medium
296,683,375
Python 3
TIME_LIMIT_EXCEEDED on test 3
t = int(input()) results = [] for _ in range(t): n, q = map(int, input().split()) M = [list(map(int, input().split())) for _ in range(n)] prefix_sum = [[0] * (n + 1) for _ in range(n + 1)] for i in range(1, n + 1): for j in range(1, n + 1): prefix_sum[i][j] = M[i-1][j-1] + pref...
2044H
wrong_submission
medium
296,743,366
Python 3
TIME_LIMIT_EXCEEDED on test 3
t = int(input()) for _ in range(t): n, q = map(int, input().split()) M = [[0] * (n+1) for _ in range(n+1)] for r in range(1, n+1): row = list(map(int, input().split())) for c in range(1, n+1): M[r][c] = row[c-1] S = [[0] * (n+1) for _ in range(n+1)] Sr = [[0] * (n+1) ...
2044H
wrong_submission
medium
304,986,223
Java 21
WRONG_ANSWER on test 3
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)); PrintWriter pw = new PrintWriter(System.out); int t = Integer.parseInt(br.readLine()); ...
2044H
wrong_submission
medium
305,079,113
Java 21
WRONG_ANSWER on test 3
import java.io.*; import java.util.StringTokenizer; public class Main{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st = new StringTokenizer(br.r...
2044H
wrong_submission
medium
296,731,220
C++23 (GCC 14-64, msys2)
TIME_LIMIT_EXCEEDED on test 4
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define po pop_back #define vl vector<long long> #define vi vector<int> #define vt vector<int64_t> #define vs vector<string> #define vii vector<pair<int, int>> #define vll vector<pair<long long, long long>> #define si set<int> #defin...
2044H
wrong_submission
hard
296,668,765
C++23 (GCC 14-64, msys2)
TIME_LIMIT_EXCEEDED on test 4
#include "bits/stdc++.h" #define int long long #define uint unsigned long long #define vi vector<int> #define vvi vector<vi > #define vb vector<bool> #define vvb vector<vb > #define fr_3(i,n) for(int i=0; i<(n); i++) #define fb_3(i,a,n) for(int i=(a); i<=(n); i++) #define nl cout<<"\n" #define dbg(var) cout<<#var<<"=...
2044H
wrong_submission
hard
304,236,858
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 4
t = int(input()) for _ in range(t): n, q = map(int, input().split()) matrix = [] for _ in range(n): row = list(map(int, input().split())) matrix.append(row) results = [] for _ in range(q): x1, y1, x2, y2 = map(int, input().split()) # ่ฐƒๆ•ดไธบ 0 ็ดขๅผ• x1 -= 1 y...
2044H
wrong_submission
hard
296,832,311
PyPy 3-64
TIME_LIMIT_EXCEEDED on test 4
t=int(input()) for i in range(t): (n,q)=map(int,input().split()) mi=[] for j in range(n): rdl=input() mir=list(map(int,rdl.split())) mi.append(mir) qryinp=[] for f in range(q): rdll=input() lqry=list(map(int,rdll.split())) qryinp.append(lqry) ...
2044H
wrong_submission
hard
296,914,000
Java 21
TIME_LIMIT_EXCEEDED on test 4
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 i = 1; i <= T; i++){ String[] s = br.readLine().split(" "); ...
2044H
wrong_submission
hard
298,474,531
Java 21
TIME_LIMIT_EXCEEDED on test 4
import java.util.*; import java.io.*; public class Main { static int n, q; static int [][] M; public static void main(String [] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int t = Integer.parseInt(br.readL...
2044H
wrong_submission
hard
261,815,736
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using i64 = long long; void solve() { int x, y; std::cin >> x >> y; int ans = std::max((y + 1) / 2, (x + 4 * y + 14) / 15); std::cout << ans << "\n"; } int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int t; std::cin >> t; ...
1974A
right_submission
none
283,855,329
C++20 (GCC 13-64)
OK
#include <iostream> #include <map> using namespace std; #define ll long long int main() { int t = 0; cin >> t; for(int i = 0 ; i < t ; i++) { int x = 0 , y = 0 , count = 0; cin >> x >> y; count += y/2 + y%2; if(count*15-y*4 >= x) { cout << count << '\n'...
1974A
right_submission
none
262,162,006
C++17 (GCC 7-32)
OK
// allhamdula // NAIM HOSSAIN // JU // IIT13 #include <iostream> #include <vector> #include <algorithm> #include <bits/stdc++.h> #include <string.h> using namespace std; void print(const string &s) { cout << s << endl; } typedef long long int ln; typedef unsigned long long int lnn; #define inf 10000000 #defin...
1974A
right_submission
none
261,869,266
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <iostream> #include <algorithm> using namespace std; #define X 15 #define Y 2 int main() { int t; cin >> t; while (t--) { int x, y; cin >> x >> y; int cnt = 0; cnt += y / Y; if (y % 2) cnt++; int num = cnt * X - y * 4; if (x <= num) cout << cnt << endl; else { x -= num; if (x <= X) co...
1974A
wrong_submission
easy
262,368,618
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; #define ll long long #define cy cout << "YES" << endl #define cn cout << "NO" << endl #define c1 cout<< -1 <<endl #define PI 3.141592653589793238462643383279 const ll mod= 1e9 + 7; ll BinExp(ll a,ll b,ll mod){ll ans=1;while(b>0){if(b&1){ans=(ans*1LL*a)%mod;}a=(a*1LL*a)%mod...
1974A
wrong_submission
easy
261,834,176
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; // Macros #define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ll long long #define ull unsigned long long #define vi vector<int> #define vll vector<long long> #define pii pair<int, int> #define pll pair<long long, long long> #define al...
1974A
wrong_submission
easy
261,832,169
PyPy 3-64
WRONG_ANSWER on test 2
t = int(input()) if (t>=1) and (t<=10000) : A = [] for i in range(t) : a = [] x,y = map(int, input().split()) a.append(x) a.append(y) A.append(a) for i in range(len(A)) : if (A[i][0]>=0) and (A[i][0]<=99) and (A[i][1]>=0) and (A[i][1]<=99) : ...
1974A
wrong_submission
easy
261,855,536
Python 3
WRONG_ANSWER on test 2
def box(x,y): if x <= 0 and y <= 0: return 0 if x > 0 and y <= 0: return 1 + box(x-15,y) elif x <= 0 and y >0: return 1 + box(x,y-2) else: if y <= 2: if x + 4*y <= 15: return 1 else: return 1 + box(x-7,0) elif y > 2: return 1 + ...
1974A
wrong_submission
easy
261,840,599
Python 3
WRONG_ANSWER on test 2
def box(x,y): if x <= 0 and y <= 0: return 0 if x > 0 and y <= 0: return 1 + box(x-15,y) elif x <= 0 and y >0: return 1 + box(x,y-2) else: if x + y*4 <= 15: return 1 else: return 1 + box(x-7,y-2) n = int(input()) for i in range(n): k = input() ...
1974A
wrong_submission
easy
269,241,700
Java 21
WRONG_ANSWER on test 2
// Online Java Compiler // Use this editor to write, compile and run your Java code online import java.util.*; public class HelloWorld { public static void main(String[] args) { Scanner Sc=new Scanner(System.in); int N=Sc.nextInt(); Sc.nextLine(); for(int j=0;j<N;j++){ in...
1974A
wrong_submission
easy
263,111,374
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class Cf{ public static void main(String args[]){ Scanner s=new Scanner(System.in); int t=s.nextInt(); // int t=1; while(t-- >0){ int x=s.nextInt(); int y=s.nextInt(); // int x=18; // int y=3; int ...
1974A
wrong_submission
easy
262,888,992
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t--) { int x, y, ans = 0; cin >> x >> y; int c = y / 2; if(y % 2 == 1) c++; ans = c; if(c == 0) { ans = x / 15; if(x % 15 != 0) ans++; ...
1974A
wrong_submission
medium
261,842,139
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; #define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ll long long int #define nl cout<<endl; int main() { ll t; cin>>t; while(t--){ ll x,y; cin>>x>>y; ll r=ceil(y/2.0); if(x==0 && y==0)cout<<"...
1974A
wrong_submission
medium
261,837,199
PyPy 3-64
WRONG_ANSWER on test 2
import math t=int(input()) for _ in range(t): a,b=map(int,input().split()) if b<=2: x=(a+b*4) print(math.ceil(x/15)) else: x=math.ceil(b/2) n=x*15 m=b*4 o=a//(n-m) print(x+o)
1974A
wrong_submission
medium
261,840,122
Python 3
WRONG_ANSWER on test 2
from collections import Counter import math as mt def si(): return input() def ii(): return int(input()) def fi(): return float(input()) def ili(n=None): if n: return list(map(int, input().split()))[:n] return list(map(int, input().split())) def fli(n=None): if n: ...
1974A
wrong_submission
medium
261,868,253
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(); while(t-- != 0){ int x = sc.nextInt(); int y = sc.nextInt(); if((x * y) != 0 && ((x + 4*y) > 15) ){ System.out.prin...
1974A
wrong_submission
medium
261,827,496
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); // System.out.println(Math.ceil(1.0/7)); int t=sc.nextInt(); for(int i=0;i<t;i++) { int x=sc.nextInt(); double y=sc.nextDouble(); int m=(...
1974A
wrong_submission
medium
261,813,311
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <iostream> #include <cmath> #include <string> #include <algorithm> #include <iomanip> #include <vector> #include <bitset> #include <set> #include <unordered_set> using namespace std; #define DestroeD ios::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL); #define ll long long void solve() { int a, ...
1974A
wrong_submission
hard
263,245,080
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; int i = 1; while(t--) { int x, y; cin >> x >> y; if(i == 1503) cout << "x = " << x << " y = " << y << "\n"; i++; int screens = (y + 1) / 2; int remain = scre...
1974A
wrong_submission
hard
261,884,789
PyPy 3-64
WRONG_ANSWER on test 2
import math def min_screens(x, y): count = 0 a = 15 count = math.ceil(y/2) total_cells = x + (2 * count) o = (15*count) -(4*y) - x if o < 0 : return(math.ceil(x/15) + count) else: return(count) t = int(input()) for _ in range(t): x, y = map(int, input().spli...
1974A
wrong_submission
hard
263,543,897
Python 3
WRONG_ANSWER on test 2
n = int(input()) for i in range(n): a, b = list(map(int, input().split())) if b>a: k = (-(-b//2)) k += a//15 print(k) else: tg = a + (b*4) print(-(-tg//15))
1974A
wrong_submission
hard
261,821,324
Java 21
WRONG_ANSWER on test 2
import java.util.Scanner; public class Q1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0) { int x = sc.nextInt(); // 1 x 1 int y = sc.nextInt(); // 2 x 2 // scre...
1974A
wrong_submission
hard
263,110,569
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class Cf{ public static void main(String args[]){ Scanner s=new Scanner(System.in); int t=s.nextInt(); // int t=1; while(t-- >0){ int x=s.nextInt(); int y=s.nextInt(); // int x=18; // int y=3; int ...
1974A
wrong_submission
hard
294,074,108
Python 3
OK
def dfs_iterative(rows, cols, grid, arr, start_r, start_c): stack = [(start_r, start_c)] while stack: r, c = stack.pop() if arr[r][c]: continue arr[r][c] = 1 for dr, dc, move in [(-1, 0, 'D'), (1, 0, 'U'), (0, -1, 'R'), (0, 1, 'L')]: nr, nc = r + dr, c +...
2034C
right_submission
none
294,059,090
PyPy 3-64
OK
# My competitive programming template - November 2024 # by Eti-ini Effiong-Robert from types import GeneratorType from sys import stdin, stdout, setrecursionlimit from collections import Counter, deque, defaultdict, OrderedDict from math import ceil, comb, sqrt, factorial, perm, log, gcd, lcm, floor, inf from functoo...
2034C
right_submission
none
294,038,676
PyPy 3-64
OK
from math import * from collections import * from bisect import bisect_left, bisect_right, bisect from itertools import * # BOOTSTRAP from types import GeneratorType def bootstrap(f, stack=[]): def wrappedfunc(*args, **kwargs): to = f(*args, **kwargs) if stack: return to else:...
2034C
right_submission
none
294,066,543
Java 21
OK
import java.io.PrintWriter; import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; import java.util.HashMap; import java.util.HashSet; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = ...
2034C
right_submission
none
298,159,988
Java 21
OK
import java.io.*; import java.util.*; public class Labyrinth { static FastReader obj = new FastReader(); public static void main(String[] args) { int tc = obj.nextInt(); for (int i = 0; i < tc; i++) { solver(); } } /*-------------------Solver-------------------*/ ...
2034C
right_submission
none
305,981,153
Java 8
OK
/* โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–Œโ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–€โ–’โ–Œโ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–Œโ–’โ–’โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–€โ–’โ–’โ–’โ–โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–โ–„โ–€โ–’โ–’โ–€โ–€โ–€โ–€โ–„โ–„โ–„โ–€โ–’โ–’โ–’โ–’โ–’โ–โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–„โ–€โ–’โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–ˆโ–’โ–’โ–„โ–ˆโ–’โ–โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–„โ–€โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–€โ–ˆโ–ˆโ–€โ–’โ–Œโ–‘โ–‘โ–‘ โ–‘โ–‘โ–โ–’โ–’โ–’โ–„โ–„โ–’โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–€โ–„โ–’โ–’โ–Œโ–‘โ–‘ โ–‘โ–‘โ–Œโ–‘โ–‘โ–Œโ–ˆโ–€โ–’โ–’โ–’โ–’โ–’โ–„โ–€โ–ˆโ–„โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–ˆโ–’โ–โ–‘โ–‘ โ–‘โ–โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–Œโ–ˆโ–ˆโ–€โ–’โ–’โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–€โ–„โ–Œโ–‘ โ–‘โ–Œโ–‘โ–’โ–„โ–ˆโ–ˆโ–„โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–’โ–’โ–’โ–’โ–Œโ–‘ โ–€โ–’โ–€โ–โ–„โ–ˆโ–„โ–ˆโ–Œโ–„โ–‘โ–€โ–’โ–’โ–‘โ–‘โ–‘...
2034C
right_submission
none
300,224,507
C++17 (GCC 7-32)
OK
#include<bits/stdc++.h> using namespace std; int t,n,m; char a[1005][1005]; int vis[1005][1005],d[1005][1005],vis2[1005][1005],ans=0; // ----------------------------------------------------------copied but understood void dfs(int x,int y){ if(vis[x][y])return; ans++,vis[x][y]=1; if(a[x][y+1]=='L')dfs(x,y+1); if(a[x...
2034C
right_submission
none
294,064,912
C++17 (GCC 7-32)
OK
#include<bits/stdc++.h> #define ll long long using namespace std; int dx[105],dy[105],w[5]={'U','D','L','R'},aw[5]={'D','U','R','L'}; void ini(){ dx['L']=-1; dx['R']=1; dy['U']=-1; dy['D']=1; } void test(){ int n,m; cin>>n>>m; bool a[n+5][m+5]={0}; string s[n+5],v; for(int i=1;i<...
2034C
right_submission
none
294,017,117
C++20 (GCC 13-64)
OK
/** * author: tourist * created: 30.11.2024 06:37:49 **/ #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) 42 #endif const string let = "LRUD?"; const int di[4] = {0, 0, -1, 1}; const int dj[4] = {-1, 1, 0, 0}; int main() { ios::sync_with_stdi...
2034C
right_submission
none
294,018,324
C++23 (GCC 14-64, msys2)
OK
#include <bits/stdc++.h> using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; using u128 = unsigned __int128; std::array<int, 2> go(int x, int y, char c) { if (c == 'L') { y--; } else if (c == 'R') { y++; } else if (c == 'U') { x--; } else { x+...
2034C
right_submission
none
295,444,571
C++20 (GCC 13-64)
OK
//JAI SHREE RAM #include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx,avx2,sse,sse2") typedef long long ll; #define inf 1e18 /* -----------------------------ordered set-------------------- #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/...
2034C
right_submission
none
294,051,402
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
// #pragma GCC optimize(2) /* // ๅฟซ่ฏป๏ผš่ฟ”ๅ›ž่ฏปๅ…ฅ็š„็ฌฌไธ€ไธชๆ•ดๆ•ฐ inline int read() { int x=0,f=1;char ch=getchar(); while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();} while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();} return x*f; }*/ #include <iostream> #include <vector> #include <algorithm> #include <cstring> #include <strin...
2034C
wrong_submission
easy
294,075,033
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
/* (( '-""``""-' )) )-__-_.._-__-( / --- (o _ o) --- \ \ .-* ( .0. ) *-. / _'-. ,_ '=' _, .-'_ / ;#'#'# - #'#'#; \ \_)) #----'#'-----#((_/ #----------# ' #--------#' /..-' #------#'-.\ _\...-\'#---#'/-.../_ ((____)- '#' -(____)) art by - Vinni01 MD_DM - sheber ...
2034C
wrong_submission
easy
294,078,387
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<iostream> #include<algorithm> #include<cmath> #include<vector> #include<cstring> //#include<queue> #define MAXN 1005 using namespace std; int ans = 0; int f[4][2] = { {0,-1},{0,1},{1,0},{-1,0} }; int a[MAXN][MAXN] = { 0 }; char b[MAXN][MAXN]; int n, m; void search(int x,int y) { if (a[x][y]) { ans++; re...
2034C
wrong_submission
easy
294,029,561
Python 3
TIME_LIMIT_EXCEEDED on test 2
def solve_test_case(n, m, grid): def is_valid(x, y): return 0 <= x < n and 0 <= y < m def get_next_cell(x, y, direction): if direction == 'U': return x-1, y if direction == 'D': return x+1, y if direction == 'L': return x, y-1 if direction == 'R': return x, y+1 ...
2034C
wrong_submission
easy
294,065,587
PyPy 3-64
WRONG_ANSWER on test 2
from math import lcm def color(x,y,colors,a): seen={} while 0<=x<len(a) and 0<=y<len(a[0]) and (x,y) not in seen and colors[x][y]==0: seen[(x,y)]=1 if a[x][y]=='U': x-=1 continue if a[x][y]=='D': x+=1 continue if a[x][y]=='R': ...
2034C
wrong_submission
easy
294,030,243
Python 3
TIME_LIMIT_EXCEEDED on test 2
def solve_test_case(n, m, grid): def is_valid(x, y): return 0 <= x < n and 0 <= y < m def get_next_cell(x, y, direction): if direction == 'U': return x-1, y if direction == 'D': return x+1, y if direction == 'L': return x, y-1 if direction == 'R': return x, y+1 ...
2034C
wrong_submission
easy