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 |
|---|---|---|---|---|---|---|
264,890,699 | C++17 (GCC 7-32) | WRONG_ANSWER on test 3 | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 2e5;
const ll mod = 998244353;
const ll inf = 1e18;
ll v[N];
pair<ll,ll> nr[4];
void solve(){
ll n,mx = 0,mn = 0;
ll m1 = 1,m2 = 1;
cin>>n;
for(ll i = 0;i < n;i++){
cin>>v[i];
int cnt;
if(mx == mn){
... | 1984C2 | wrong_submission | medium |
264,916,121 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
#define int long long
long long mod = 998244353;
signed main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int t;
cin>>t;
long long po[200001];
po[0] = 1;
for(int i = 1;i<=2e5;i++){
po[i] = (po[i-1]*2)%mod;
}
while(t--){
int... | 1984C2 | wrong_submission | medium |
264,917,850 | PyPy 3-64 | WRONG_ANSWER on test 3 | import sys
import math
import heapq
from collections import deque
def II():
return int(sys.stdin.readline())
def LI():
return list(map(int, sys.stdin.readline().split()))
def MI():
return map(int, sys.stdin.readline().split())
def SI():
return sys.stdin.readline().strip()
def ask(l,x):
# sys.stdout.fl... | 1984C2 | wrong_submission | medium |
264,913,002 | PyPy 3-64 | WRONG_ANSWER on test 3 | import sys
input = sys.stdin.readline
INF = 998244353
for _ in range(int(input())):
n = int(input())
a = [*map(int, input().split())]
c = 0
prefix_sum = [0]
for i in a:
prefix_sum.append(prefix_sum[-1] + i)
res = prefix_sum[-1]
idx = [-1]
for i in range(1, n + 1):
... | 1984C2 | wrong_submission | medium |
265,120,040 | Java 8 | WRONG_ANSWER on test 3 | import java.util.*;
import java.io.*;
public class Main {
private static BufferedReader br;
private static StringTokenizer toker = null;
private static int mod = 998244353;
private static String next() throws IOException {
if (br == null) br = new BufferedReader(new InputStreamReader(System.... | 1984C2 | wrong_submission | medium |
265,201,659 | Java 8 | WRONG_ANSWER on test 3 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class MagnitudeHard {
final static int mod = 998244353;
public static void main(String[] args){
try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
... | 1984C2 | wrong_submission | medium |
265,716,902 | C++17 (GCC 7-32) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int MAX = 2 * 1e5;
int N;
long long A[MAX + 3], pfx[MAX + 3];
int nk, pk;
int pw[MAX + 3];
void test_case() {
nk = 0, pk = 0;
long long minn = 1e18;
cin >> N;
for(int i = 1; i <= N; i++) {
cin >> A[i];
p... | 1984C2 | wrong_submission | hard |
265,007,914 | C++14 (GCC 6-32) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (long long i = a; i < b; i++)
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
long long T;
cin >> T;
vector<long long> sol(T);
rep(I, 0, T)
{
long long kl=998244353;
long long n;
cin >> n;
... | 1984C2 | wrong_submission | hard |
266,371,657 | PyPy 3-64 | WRONG_ANSWER on test 3 | from collections import deque
t=int(input())
for _ in range(t):
n=int(input())
a=list(map(int,input().split()))
c=0
# for i in range(len(a)):
# if a[i]*c>=0:
# c+=a[i]
# else:
# c=abs(c)+a[i]
# print(abs(c))
sum=0
l=deque()
for i in range(n):
sum+=a... | 1984C2 | wrong_submission | hard |
284,490,701 | PyPy 3-64 | WRONG_ANSWER on test 3 | from math import ceil
def li():return [int(i)for i in input().split()]
mod=998244353
for _ in range(int(input())):
n,=li()
a=li()
p,s=[],0
for i in a:s+=i;p+=[s]
mi,q=min(p),[]
if mi>=0:print(" ",pow(2,n,mod));continue
for i in range(n):
if p[i]==mi:q+=[i]
q=q[::-1]
s=0
ans,f=0,1
for i in range(n):
if ... | 1984C2 | wrong_submission | hard |
264,894,077 | Java 21 | WRONG_ANSWER on test 3 | import java.util.*;
import java.io.*;
public class Main {
static long MOD = 998244353;
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
StringTokenizer... | 1984C2 | wrong_submission | hard |
264,933,390 | Java 21 | WRONG_ANSWER on test 3 | import java.io.*;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;
public class Main {
static final long M = 998244353;
public static void main(String[] args) {
FastReader sc = new FastReader();
long start1 = System.currentTimeMillis();
ArrayList<Long> ... | 1984C2 | wrong_submission | hard |
295,209,996 | PyPy 3-64 | OK | def check(mid,arr):
l = arr[::]
op = 0
mx = 0#?
while(max(l)>mid):#?
cur = 0
for i in range(n):
#j = (i+mx)%n
#l[j]+=cur
if(l[i]<mid):
continue
cur=(l[i]-mid+1)//2
op+=cur
l[i]=mid-int(mid%2!=l[i]%2)
l[(i+1)%n]+=cur
#l... | 2038B | right_submission | none |
292,178,569 | PyPy 3-64 | OK | import sys
from itertools import groupby
input = lambda: sys.stdin.readline().rstrip()
rint = lambda: int(input())
rlist = lambda: list(map(int, input().split()))
def solve(N, A):
ans = 0
if all(x == A[0] for x in A):
return 0
C = [0] * N
for loops in range(32):
lo = min(A)
... | 2038B | right_submission | none |
292,314,861 | PyPy 3-64 | OK | import math
def check(a, eq, idx_max):
a = list(a); sum_ = sum(a)
cnt = 0; i = idx_max
while sum_ > eq * len(a):
if i == len(a): i = 0
if a[i] <= eq: i += 1; continue
op = (a[i] - eq) // 2
if (a[i] - eq) % 2 > 0: op += 1
cnt += op
a[i] -= 2 * op; sum... | 2038B | right_submission | none |
299,143,330 | Java 21 | OK | import java.util.*;
import java.io.*;
public class B2038 {
private static int[] arr;
private static int max;
private static long check(int m){
int len = arr.length;
int left = 0; int right = max;
long total = 0;
double[] sol = new double[len];
while(... | 2038B | right_submission | none |
292,720,828 | 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
... | 2038B | right_submission | none |
292,725,106 | 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
... | 2038B | right_submission | none |
292,334,375 | C++17 (GCC 7-32) | OK | #include <bits/stdc++.h>
#define int long long
using namespace std;
typedef long long LL;
const int N = 1e6 + 10;
const LL INF = 0x3f3f3f3f3f3f3f3f;
int n, a[N], t[N];
bool check(int mid) {
for (int i = 1; i <= n; i++)
t[i] = a[i];
for (int cnt = 0; cnt < 5; cnt++) {
bool flag = true;
while (flag ||... | 2038B | right_submission | none |
292,255,353 | C++20 (GCC 13-64) | OK | // Author: Mkswll
// Date: 2024-11-18 14:00:13
// Problem: B. Make It Equal
// Contest: Codeforces - 2024-2025 ICPC, NERC, Southern and Volga Russian Regional Contest (Unrated, Online Mirror, ICPC Rules, Preferably Teams)
// URL: https://codeforces.com/contest/2038/problem/B
// Memory Limit: 512 MB
// Time Limit: 2000 ... | 2038B | right_submission | none |
292,165,413 | 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;
std::cin >> n;
std::vector<i64> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
std::vector<i64> b(n);
whi... | 2038B | right_submission | none |
292,396,538 | C++23 (GCC 14-64, msys2) | OK | #include<bits/stdc++.h>
#define int long long
using namespace std;
const int C = 1e9+7;
int modbinexp(int a,int b)
{
if(b==0) return 1;
int res=(modbinexp(a,b/2))%C;
if(b%2==1) return (a*((res*res)%C))%C;
return (res*res)%C;
}
bool fun(int a[],int val,int n)
{
int x = 1;
int sum = 0;
in... | 2038B | right_submission | none |
294,578,885 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include <cstdio>
using namespace std;
#define __IN freopen("a.in","r",stdin)
#define __OUT freopen("k.out","w",stdout)
#define ll long long
const int N = 2e5 + 10;
ll a[N], b[N], t, n;
int solve(ll v, ll pos)
{
// printf("-%lld-\n", v);
for(int i=1; i<=n; i++) b[i] = a[i];
// for (int i=1;i<=n;i++) pr... | 2038B | wrong_submission | easy |
292,191,021 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 2 | #include <cstdio>
#include <algorithm>
using namespace std;
int t;
int n;
int a[300005];
int b[300006];
int chk(int k){
int i,res=0,c;
for(i=1;i<=n;i++) a[i]=b[i];
a[1]-=k*2;
a[2]+=k;
res+=k;
for(i=2;i<n;i++){
if((a[i]-a[1])%2==1||a[i]<a[1]) return -1;
else{
c=(a[i]-a[1])/2;
a[i]=a[1];
a[i+1]+=c;
... | 2038B | wrong_submission | easy |
292,176,268 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include <iostream>
using namespace std;
long long test, n, cnt, a[200010], tmp;
pair<long long,long long> maxx;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> test;
while (test--) {
cin >> n;
cnt = 0;
for (int i = 0; i < n; i++) cin >> a[i];
maxx = {0,0};
for (int i = 0; i < n;... | 2038B | wrong_submission | easy |
292,175,571 | PyPy 3-64 | WRONG_ANSWER on test 2 | def check(L,num,id,n):
M = [x for x in L]
for i in range(id,id+2*n):
id1 = (i%n)
id2 = (i+1)%n
x1 = M[i%n]
x2 = M[(i+1)%n]
a = x1-num
if(a%2 == 0):
M[id1] = num
M[id2] += a//2
else:
if(num > 0):
M[id1] = ... | 2038B | wrong_submission | easy |
292,311,642 | PyPy 3-64 | WRONG_ANSWER on test 2 | import math
def check(a, eq, idx_max):
a = list(a)
cnt = q = 0
i = idx_max
while q < len(a):
if i == len(a): i = 0
if a[i] <= eq:
q += 1; continue
op = (a[i] - eq) // 2
if (a[i] - eq) % 2 > 0: op += 1
cnt += op
if i + 1 < len(a):
... | 2038B | wrong_submission | easy |
292,313,616 | PyPy 3-64 | WRONG_ANSWER on test 2 | import math
def check(a, eq, idx_max):
a = list(a); sum_ = sum(a)
cnt = 0; i = idx_max
_5n = len(a) * 3; cnt_step = 0
while sum_ > eq * len(a):
cnt_step += 1
if cnt_step >= _5n: break
if i == len(a): i = 0
if a[i] <= eq: continue
op = (a[i] - eq) // 2
... | 2038B | wrong_submission | easy |
295,861,618 | Java 8 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.*;
import java.lang.*;
import java.util.function.LongConsumer;
public class CP
{
static long mod = (long)(1e9+7);
static int minInt = Integer.MIN_VALUE;
static int maxInt = Integer.MAX_VALUE;
static long minLong = Long.MIN_VALUE;
static long maxLong = Long.MAX_VA... | 2038B | wrong_submission | easy |
295,382,725 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class Solution {
public static void main(String[] args) {
int t, n, carry, k, tmp;
long sum;
boolean canBe;
Scanner sc = new Scanner(System.in);
int[] arr = new int[2*100000];
t = sc.nextInt();
while (t-- != 0) {
n = ... | 2038B | wrong_submission | easy |
300,266,298 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #include<bits/stdc++.h>
using namespace std;
//#define map unordered_map
#define re register
#define ll long long
#define cll const ll
#define forl(i,a,b) for(re ll (i)=(a);i<=(b);(i)++)
#define forr(i,a,b) for(re ll (i)=(a);i>=(b);(i)--)
#define forll(i,a,b,c) for(re ll (i)=(a);i<=(b);(i)+=(c))
#define forrr(i,a,b,c) ... | 2038B | wrong_submission | medium |
292,297,704 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5+10;
int n;
int a[N];
int b[N];
int check(int x) {
for(int i = 1;i <= n;i++) b[i] = a[i];
int sum = 0;
for(int i = 1;i <= n;i++) {
int rd = b[i]-x;
if(rd <= 0) continue;
else {
if(rd%2 == 1) rd++;
rd /= 2;
b[i] -= 2*rd;
b[i%n+1] += ... | 2038B | wrong_submission | medium |
293,476,202 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 3 | """
Let m be the final equal value.
Let x_i be the number of times we subtract 2 from a_i.
We have the following equation:
a_0 - 2x_0 + x_{n-1} = m
a_1 - 2x_1 + x_0 = m
a_2 - 2x_2 + x_1 = m
...
a_{n-1} - 2x_{n-1} + x_{n-2} = m
Def: We say m is feasible if the above system has a solution x where each x_i is non-neg... | 2038B | wrong_submission | medium |
292,211,607 | Python 3 | WRONG_ANSWER on test 3 | for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
mn = min(a)
for i in range(0, n):
if a[i] == mn:
if i != n - 1:
a = a[i + 1: ] + a[: i + 1]
break
t = 0
for i in range(0, n):
t += (a[i] << i)
if t % ((1... | 2038B | wrong_submission | medium |
292,717,882 | Java 21 | WRONG_ANSWER on test 3 | 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
... | 2038B | wrong_submission | medium |
292,724,574 | Java 21 | WRONG_ANSWER on test 3 | 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
... | 2038B | wrong_submission | medium |
292,598,286 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
using PII = pair<int, int>;
const int N = 2e5 + 10;
int a[N], b[N];
int n;
bool check(int x)
{
for (int i = 1; i <= n; i++)
{
b[i] = a[i] - x;
cerr << b[i] << ' ';
}
bool flag = true;
while (flag)
... | 2038B | wrong_submission | hard |
292,226,139 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 3 | #include <bits/stdc++.h>
using namespace std;
#define int long long
void solve() {
int n; cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
int mx = -1e9, ix = 0;
for (int i = 0; i < n; i++)
if (a[i] > mx) mx = a[i], ix = i;
if (ix != 0) rotate(a.begin(),... | 2038B | wrong_submission | hard |
296,011,937 | Python 3 | TIME_LIMIT_EXCEEDED on test 4 | import sys
def input():
return sys.stdin.readline().strip()
def getints():
return map(int, sys.stdin.readline().strip().split())
def con(num, l):
l = list(l)
ans = 0
for i in range(len(l)):
if l[i] > num:
t = l[i] - num
if t % 2 != 0:
t += 1
... | 2038B | wrong_submission | hard |
292,211,013 | PyPy 3-64 | WRONG_ANSWER on test 4 | from __future__ import annotations
import bisect # noqa
import heapq # noqa
import math # noqa
import random # noqa
import statistics # noqa
import sys
from bisect import bisect_left as lower_bound
from bisect import bisect_right as upper_bound
from collections import Counter, defaultdict, deque # noqa
from cop... | 2038B | wrong_submission | hard |
292,720,757 | Java 21 | WRONG_ANSWER on test 4 | 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
... | 2038B | wrong_submission | hard |
295,862,537 | Java 8 | WRONG_ANSWER on test 5 | import java.io.*;
import java.util.*;
import java.lang.*;
import java.util.function.LongConsumer;
public class CP
{
static long mod = (long)(1e9+7);
static int minInt = Integer.MIN_VALUE;
static int maxInt = Integer.MAX_VALUE;
static long minLong = Long.MIN_VALUE;
static long maxLong = Long.MAX_VA... | 2038B | wrong_submission | hard |
303,255,609 | PyPy 3-64 | OK | def inp():
return(int(input()))
def inlt():
return(list(map(int,input().split())))
def insr():
s = input()
return(list(s[:len(s) - 1]))
def invr():
return list(map(int,input().split()))
def solve(arr):
"""
"""
pref = arr.copy()
suff = arr.copy()
for i in range(1, n):pref[i] = ... | 2031D | right_submission | none |
301,310,740 | PyPy 3-64 | OK | for test in range(int(input())):
n=int(input())
a = [int(i) for i in input().split()]
prefL = [a[0]] #largest from front
for i in range(1,n):
prefL.append(max(prefL[-1],a[i]))
suffS = [a[-1]] #smallest from back
for i in range(n-2,-1,-1):
suffS.append(min(suffS[-1],a[i]))
... | 2031D | right_submission | none |
303,533,167 | PyPy 3-64 | OK | #I know exactly where you are!!
for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
mn = []
for i in a:
mn.append(i)
for i in range(1, n):
a[i] = max(a[i - 1], a[i])
for i in range(n - 1, 0, -1):
mn[i - 1] = min(mn[i] , mn[i - 1])
#print(... | 2031D | right_submission | none |
306,831,990 | Java 8 | OK | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Main {
public static BufferedReader rd=new BufferedReader(new InputStreamReader(System.in));
public static BufferedWriter wd=new BufferedWriter(new OutputStreamWriter(Sys... | 2031D | right_submission | none |
291,763,325 | Java 21 | OK | import java.util.*;
public class D_Penchick_and_Desert_Rabbit{
static ContestScanner sc = new ContestScanner();
static ContestPrinter out = new ContestPrinter();
public static void main(String[] args) throws java.lang.Exception {
int t = 1;
t = sc.nextInt();
while (--t >= 0) {
... | 2031D | right_submission | none |
291,762,722 | Java 21 | OK | import java.util.*;
public class D_Penchick_and_Desert_Rabbit{
static ContestScanner sc = new ContestScanner();
static ContestPrinter out = new ContestPrinter();
public static void main(String[] args) throws java.lang.Exception {
int t = 1;
t = sc.nextInt();
while (--t >= 0) {
... | 2031D | right_submission | none |
292,048,138 | C++20 (GCC 13-64) | OK | #include<bits/stdc++.h>
using namespace std;
#define pll pair<ll, ll>
#define ll long long
#define x first
#define y second
const int mod = 1e9 + 7;
const int N = 5e5 + 50;
ll a[N], n, ans[N];
pll p1[N], p2[N], p3[N], b[N];
void solve()
{
pll p0;
cin >> n;
p0.x = p0.y = 0;
for (int i = 1; i <= n... | 2031D | right_submission | none |
291,588,970 | C++20 (GCC 13-64) | OK | /**
* author: tourist
* created: 15.11.2024 04:42:34
**/
#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;
cin >> n;
... | 2031D | right_submission | none |
291,632,396 | C++20 (GCC 13-64) | OK | #include <bits/stdc++.h>
typedef long long int ll;
#define pb push_back
#define pi 3.14159265
#define MAXN 1000005
#define mod 1000000007
using namespace std;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
struct union_find
{
// When data[x] < 0, x is a root and -data[x] is its tree size. When data[x] >... | 2031D | right_submission | none |
293,197,633 | 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;
std::cin >> n;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
auto pre = a, suf = a;
for... | 2031D | right_submission | none |
291,633,991 | C++20 (GCC 13-64) | OK | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long int
#define pb push_back
#... | 2031D | right_submission | none |
291,630,527 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include<cstdio>
using namespace std;
int a[500005],T,n,ans[500005],st[500005],lst;
inline int Mx(int x,int y){return x>y?x:y;}
inline int Mn(int x,int y){return x<y?x:y;}
int main(){
scanf("%d",&T);
while(T--){
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
an... | 2031D | wrong_submission | easy |
291,721,609 | C++17 (GCC 7-32) | TIME_LIMIT_EXCEEDED on test 2 | #include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const int N=500010;
int n;
int a[N];
int rpos[N];
int mx[N],mxpos[N];
int ans[N];
int tr[1000010];
int f[N];
inline int lowbit(int x)
{
return x&(-x);
}
int query(int x)
{
int mx=0;
while (x>0)
{
mx=max(mx,tr... | 2031D | wrong_submission | easy |
295,374,006 | C++20 (GCC 13-64) | WRONG_ANSWER on test 2 | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for (int p=0;p<n;p++)
{
if(p==0)cout<<3<<" "<<3<<" "<<3<<" "<<4<<endl;
if(p==1)cout<<5<<" "<<5<<" "<<5<<" "<<5<<" "<<5<<endl;
if(p==2)cout<<2<<" "<<2<<" "<<2<<" "<<3<<endl;
if(p==3)cout<<1<<" "<<1<<" "<<3<<" "<<3<<endl;
if(p==4)cout<<8... | 2031D | wrong_submission | easy |
295,369,937 | Python 3 | TIME_LIMIT_EXCEEDED on test 2 | import random
def adjust(list_n,xiabiao,flag):
global list_max,index_list
max_tmp=list_n[xiabiao]
#print(list_max)
list_max.append(max_tmp)
for j in range(len(list_n)):
if xiabiao>j and list_n[xiabiao]<list_n[j] and flag==1:
list_max.append(list_n[j])
index_list.a... | 2031D | wrong_submission | easy |
295,361,096 | Python 3 | TIME_LIMIT_EXCEEDED on test 2 | def solve_rabbit_jumps():
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
def dfs(start, visited):
max_height = a[start]
visited[start] = True
# 向左跳(跳到更高的树)
for j in range(... | 2031D | wrong_submission | easy |
295,369,607 | Python 3 | TIME_LIMIT_EXCEEDED on test 2 | import random
def adjust(list_n,xiabiao,flag):
global list_max,index_list
max_tmp=list_n[xiabiao]
#print(list_max)
list_max.append(max_tmp)
for j in range(len(list_n)):
if xiabiao>j and list_n[xiabiao]<list_n[j] and flag==1:
list_max.append(list_n[j])
index_list.a... | 2031D | wrong_submission | easy |
302,715,491 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
import java.io.*;
public class codeforces {
static int MOD = 998244353 ;
static long modInverse(long x, int MOD) {
return power(x, MOD - 2, MOD);
}
static long power(long base, long exp, int MOD) {
long result = 1;
while (exp > 0) {
if ((exp... | 2031D | wrong_submission | easy |
303,170,462 | Java 21 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.*;
public class CodeForcesSolution {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static StringTokenizer st;
static int MOD = (int) 99... | 2031D | wrong_submission | easy |
293,554,698 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define endl '\n';
#define int ll
#define double long double
vector<int> ans;
vector<vector<int>> gr;
vector<int> used;
void dfs(int i)
{
used[i] = 1;
for (auto c : gr[i])
{
if (!used[c])
{
dfs(c);
}
... | 2031D | wrong_submission | medium |
300,287,663 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 2 | #pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
// #include <atcoder/all>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
x += 0x9e3779b97f4a7... | 2031D | wrong_submission | medium |
293,125,585 | PyPy 3-64 | WRONG_ANSWER on test 2 | import math
from sys import stdout
def ii():
return int(input())
def mi():
return map(int, input().split())
def li():
return list(mi())
class UF:
def __init__(self, n):
self.p = [i for i in range(n)]
self.ranks = [0] * n
def find(self, x):
if x == self.p[x... | 2031D | wrong_submission | medium |
291,851,954 | PyPy 3-64 | WRONG_ANSWER on test 2 | import sys
input = sys.stdin.readline
from collections import deque
from bisect import bisect_left
def dfs(i):
if dp[i] != -1: return dp[i]
dp[i] = li[i]
dp[i] = max(dp[i], dfs(b[i]))
dp[i] = max(dp[i], dfs(f[i]))
return dp[i]
def solve():
global n, b, f, dp, li
n = int(input())... | 2031D | wrong_submission | medium |
291,654,015 | Java 8 | TIME_LIMIT_EXCEEDED on test 2 | import java.util.Scanner;
public class Main {
static int maxHeight(int index, int n, int[] heights, int[] memo, boolean[] visited) {
if (visited[index]) {
return memo[index];
}
visited[index] =true;
int max = heights[index];
max = Math.max(max, backJumps(index, ... | 2031D | wrong_submission | medium |
291,766,822 | Java 21 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class Forked {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt(); // Number of test cases
while (t-- > 0) {
int n = sc.nextInt(); // Length of permutation
int[] p = new int[n];
... | 2031D | wrong_submission | medium |
291,625,458 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 4 | #include<bits/stdc++.h>
#include <cmath>
#include <complex>
#include<string>
#include <ext/pb_ds/assoc_container.hpp>
//#include "testlib.h"
//freopen("orxor.in", "r", stdin);
using namespace std;
//using namespace __gnu_pbds;
//template <class T>
//using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_stati... | 2031D | wrong_submission | hard |
291,655,848 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 4 | #include <bits/stdc++.h>
#define ff cout.flush()
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define FAST ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
#define ll long long
#define str string
using ld = long double;
#define pb push_back
#define pf push_front
#define pob pop_... | 2031D | wrong_submission | hard |
292,528,660 | Python 3 | TIME_LIMIT_EXCEEDED on test 4 | visitados = [0]
saida = [0]
def bfs(grafo, lista, i):
if visitados[i] == 0:
visitados[i] = 1
else:
return 0
fila = [i]
aux = [i]
maior = lista[i]
while fila:
v_atual = fila[0]
del fila[0]
for vz in grafo[v_atual]:
if visitados[vz]... | 2031D | wrong_submission | hard |
306,215,034 | PyPy 3-64 | MEMORY_LIMIT_EXCEEDED on test 4 | I = lambda : list(map(int, input().split(' ')))
R = lambda : (int(input()))
import sys
import math
from collections import deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heapify, heappush
# from typing import List
def join_parents(tp1 : int, tp2 : int, grp_map, parents_ma... | 2031D | wrong_submission | hard |
291,814,472 | Java 8 | TIME_LIMIT_EXCEEDED on test 4 | import java.util.*;
public class RabbitJump {
public static void solve() {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
int[] heights = new int[n];
for (int i = 0; i < n; i++) {
... | 2031D | wrong_submission | hard |
291,739,154 | Java 21 | TIME_LIMIT_EXCEEDED on test 4 | import java.util.*;
public class program{
public static void main(String [] args) {
Scanner sc=new Scanner(System.in);
int t= sc.nextInt();
while(t-->0) {
int n=sc.nextInt();
ArrayList<Integer> x=new ArrayList<>();
int [] prevMax=new int[n];
int max=0;
for(int i=0;i<n;i++) {
int a=sc.nextInt()... | 2031D | wrong_submission | hard |
294,772,108 | C++23 (GCC 14-64, msys2) | OK | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
using namespace std;
const int S=10,N=1000001,T=2000001,Z=94;
struct info{
int l,dfn,id;
friend bool operator<(info x,info y)
{
if (x.l!=y.l) return x.l>y.l;
if (x.dfn!=y.dfn... | 2041I | right_submission | none |
293,880,561 | C++20 (GCC 13-64) | OK | #include "bits/stdc++.h"
using namespace std;
const int N = (int) 2e6 + 22;
vector<pair<char, int>> go[N];
int dp[N], parent[N], root = 0, cnt = 1, len[N];
string ID[N];
set<int> kek[N];
int get(int v, char ch) {
for (auto [c, u] : go[v]) {
if (c == ch) {
return u;
}
}
retu... | 2041I | right_submission | none |
293,396,230 | 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;
constexpr int N = 2E6 + 2;
constexpr int A = 94;
std::set<int> ids[N];
int dp[N];
int tot = 1;
int trie[N][A];
int main() {
std::ios::sync_with_stdio(false);
std::cin.t... | 2041I | right_submission | none |
297,650,842 | C++23 (GCC 14-64, msys2) | OK | #include <bits/stdc++.h>
using namespace std;
namespace r = ranges;
namespace v = r::views;
#define λ(expr) ([&](auto const& _) { return (expr); })
#define λ2(expr) ([&](auto const& _1, auto const& _2) { return (expr); })
template<class F>
struct Y {
F f;
decltype(auto) operator()(auto &&...args) const {
re... | 2041I | right_submission | none |
293,214,684 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | /*
Code by: linvg
Created: 25.11.2024 14:07:16
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return ... | 2041I | wrong_submission | easy |
304,186,383 | Python 3 | RUNTIME_ERROR on test 2 | class TrieNode:
def __init__(self):
self.children = {}
self.pattern_ids = []
class Trie:
def __init__(self):
self.root = TrieNode()
def insert(self, pattern, pattern_id):
node = self.root
for char in pattern:
if char not in node.children:
... | 2041I | wrong_submission | easy |
304,293,551 | Java 21 | RUNTIME_ERROR on test 2 | 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 n = Integer.parseInt(br.readLine());
Map<String, TreeMap<Integer, String>> patterns = new H... | 2041I | wrong_submission | easy |
304,524,457 | Java 21 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.*;
public class Main{
static class TrieNode {
Map<Character, TrieNode> children;
int id;
boolean isEndOfPattern;
public TrieNode() {
children = new HashMap<>();
id = -1;
isEndOfPattern = false;
}
}... | 2041I | wrong_submission | easy |
293,350,728 | C++17 (GCC 7-32) | WRONG_ANSWER on test 3 | #include <cstdio>
#include <algorithm>
#include <utility>
#include <cstring>
#include <set>
using namespace std;
int T;
char op[10],s[2000005];
struct Node
{
Node* np[127];
Node* pre;
pair<int,int> lgst;//Length,-Id.
set<pair<int,int> >* ids;
Node()
{
for(int i=0;i<127;i++)
np[i] = NULL;
pre = NULL... | 2041I | wrong_submission | easy |
293,352,396 | C++17 (GCC 7-32) | RUNTIME_ERROR on test 3 | #include <cstdio>
#include <algorithm>
#include <utility>
#include <cstring>
#include <set>
using namespace std;
int T;
char op[10],s[2000005];
struct Node
{
Node* np[127];
Node* pre;
pair<int,int> lgst;//Length,-Id.
set<pair<int,int> >* ids;
Node()
{
for(int i=0;i<127;i++)
np[i] = NULL;
pre = NULL... | 2041I | wrong_submission | easy |
305,125,709 | Python 3 | WRONG_ANSWER on test 3 | class TrieNode:
def __init__(self, parent=None):
self.children = {}
self.best_id = -1
self.max_length = 0
self.is_end = False
self.pattern_id = None
self.parent = parent
class Trie:
def __init__(self, n):
self.root = TrieNode()
self.patterns = [N... | 2041I | wrong_submission | easy |
304,199,340 | Python 3 | WRONG_ANSWER on test 3 | from bisect import bisect_left
def find_best_match(current_text, patterns):
best_match_id = -1
best_length = -1
for length, pattern, pattern_id in patterns:
if length < len(current_text):
continue
if pattern.startswith(current_text):
if length > best_length or (le... | 2041I | wrong_submission | easy |
296,538,249 | C++17 (GCC 7-32) | RUNTIME_ERROR on test 4 | // Jan Zakrzewski
#define NDEBUG
#include <bits/stdc++.h>
using namespace std;
#define assert(expr) {if(!(expr)){while(1);}}
constexpr int A = 33;
constexpr int B = 126;
constexpr int NONE = -123;
struct Node {
priority_queue<int> id;
int dp_len;
int dp_id;
int parent;
int children[B - A +... | 2041I | wrong_submission | medium |
296,140,542 | C++17 (GCC 7-32) | WRONG_ANSWER on test 4 | #include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define ar array
#define pb push_back
#define ln '\n'
#define size(x) (int)(x).size()
//~ #define int long long
using i64 = long long;
template <class F, class _S>
bool chmin(F &u, const _S &v){
bool flag = false;
if ( u > v... | 2041I | wrong_submission | medium |
304,970,696 | Python 3 | TIME_LIMIT_EXCEEDED on test 4 | def main():
import sys
input = sys.stdin.read
data = input().splitlines()
n = int(data[0])
patterns = {} # id -> pattern
current_text = ""
output = []
for line in data[1:n+1]:
parts = line.split()
action = parts[0]
if action == 'add':
i = int... | 2041I | wrong_submission | medium |
304,179,999 | Python 3 | TIME_LIMIT_EXCEEDED on test 4 | 2041I | wrong_submission | medium | |
304,978,101 | Java 21 | TIME_LIMIT_EXCEEDED on test 4 | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
scanner.nextLine(); // Consume the newline after the integer
StringBuilder t = new StringBuilder();
Map<Integer, Str... | 2041I | wrong_submission | medium |
304,214,296 | Java 21 | TIME_LIMIT_EXCEEDED on test 4 | import java.util.*;
import java.io.*;
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 n = Integer.parseInt(br.readLine());
Ma... | 2041I | wrong_submission | medium |
296,268,791 | C++23 (GCC 14-64, msys2) | TIME_LIMIT_EXCEEDED on test 4 | #include <bits/stdc++.h>
using namespace std;
#define int long long
vector<string> s;
int curr;
int last;
struct compare{
int depth;
compare(int d = 0) : depth(d) {}
bool operator()(int a, int b) const {
const string& sa = s[a];
const string& sb = s[b];
if (sa.length() == sb.le... | 2041I | wrong_submission | hard |
299,413,614 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 4 | #include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define pb push_back
using namespace std;
//tree of all prefixes of patterns
//add: add prefixes
//delete: delete prefixes, appearences of matchings
//append: deepen search
//backspace: go back x
const int maxn = 1e6+3;
struct pattern {
in... | 2041I | wrong_submission | hard |
293,511,657 | C++23 (GCC 14-64, msys2) | MEMORY_LIMIT_EXCEEDED on test 4 | #define Many_SubTask
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define all(a) begin(a), end(a)
#define pb push_back
#define pii pair<int, int>
#define F first
#define S second
#define mp make_pair
const int mod = 998244353;
const int inf = 1e18;
const int MAXN = 1000005;
struct node {
... | 2041I | wrong_submission | hard |
293,191,614 | C++20 (GCC 13-64) | WRONG_ANSWER on test 4 | // -*- mode: c++; coding: utf-8-emacs; -*-
#include<bits/stdc++.h>
//#define int long long
using namespace std;
struct NODE{
int dep;
int fa;
int mx;
int md;
multiset<int> id;
map<char,int> c;
NODE(int d,int f) : dep(d),fa(f),mx(-1),md(1){}
};
struct TREE{
map<int,string> pattern;
vector<NODE> a;
string t;
i... | 2041I | wrong_submission | hard |
293,134,219 | C++17 (GCC 7-32) | MEMORY_LIMIT_EXCEEDED on test 4 | #include <bits/stdc++.h>
using namespace std;
#define fastio(); ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
char END_CHAR = ' ';
bool compare(pair<int, pair<string, int>>& A, pair<int, pair<string, int>> & B) {
if (A.first != B.first) {
return (A.first > B.first);
}
if (A.second.first... | 2041I | wrong_submission | hard |
304,195,651 | Java 21 | TIME_LIMIT_EXCEEDED on test 5 | import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
scanner.nextLine(); // Consume newline
StringBuilder currentText = new StringBuilder();
TreeSet<Pattern> patterns = new T... | 2041I | wrong_submission | hard |
285,395,769 | C++20 (GCC 13-64) | OK | #include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define L(i, j, k) for(int i = (j); i <= (k); i++)
#define R(i, j, k) for(int i = (j); i >= (k); i--)
#define ll long long
#define pb emplace_back
#define ull unsigned long long
#define sz(a) ((int) a.size())
#define vi vector... | 2018B | right_submission | none |
283,187,765 | 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 n;
std::cin >> n;
std::vector<int> a(n);
std::vector<int> l(n, n), r(n, -1);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
a[i]--;
l[a[i]] = std... | 2018B | right_submission | none |
284,014,100 | C++20 (GCC 13-64) | OK | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF (int)1e18
mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count());
void Solve()
{
int n; cin >> n;
vector <int> a(n + 1);
for (int i = 1; i <= n; i++){
cin >> a[i];
}
vector <int> b(... | 2018B | right_submission | none |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.