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
293,645,085
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; const long double PI = acos(-1); //#define int long long typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair<int,int> PII; typedef pair<ll, ll> PLL; typedef tuple<ll, ll, ll> TLL; int lowbit(int x) {return x & (- x);}; const int N = 200...
2018B
wrong_submission
easy
293,476,357
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include <iostream> #include <map> #include <vector> void solve() { int n; std::cin >> n; std::vector<int> v(n); for (int i = 0; i < n; ++i) std::cin >> v[i]; std::vector<int> first(n + 1); int cur = n; for (int i = 0; i < n; ++i) { while (cur >= v[i]) first[cur] = i, --cur; ...
2018B
wrong_submission
easy
283,786,369
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
/* Những mùa thu khác có thể trở về Nhưng mùa thu của chúng ta đã chết... */ // #pragma GCC optimize("Ofast,O3") // #pragma GCC target("avx,avx2,fma,sse4") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; #ifdef Debug #...
2018B
wrong_submission
easy
299,705,611
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) ...
2018B
wrong_submission
easy
299,698,651
Java 21
TIME_LIMIT_EXCEEDED 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) ...
2018B
wrong_submission
easy
283,431,031
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <fstream> #include <cmath> #include <set> #include <cassert> #include <map> using namespace std; #define int long long typedef pair <int, int> ii; vector <int> suf, pref; int Right(int left, int pos, int right) { return suf[r...
2018B
wrong_submission
easy
283,829,234
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t--) { int a; cin >> a; int arr[a], j; vector<int> vec,vec1,vec2; for(int i = 0; i < a; i++) { cin >> arr[i]; } int minn = *min_element(arr, arr + a); ...
2018B
wrong_submission
easy
283,528,155
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> #include<bitset> #include<nmmintrin.h> using namespace std; #define oOo {ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);} #define ll long long #define vc vector #define str string #define e "\n" #define all(v) (v).begin() , (v).end() #define File freopen("two2.in", "r", stdin); #define ONES(x...
2018B
wrong_submission
easy
283,214,477
Python 3
WRONG_ANSWER on test 2
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) mnmtm = float('inf') count = 0 for i in range(n - 1, -1, -1): mnmtm = min(mnmtm, a[i]) if mnmtm >= i + 1: count += 1 print(count-1)
2018B
wrong_submission
medium
284,304,681
PyPy 3-64
RUNTIME_ERROR on test 2
for _ in range(int(input())): n = int(input()) array = [int(i) for i in input().split()] l_a = [float('inf')] r_a = [float('inf')] result = 0 for i in range(n): l_a.append(min(l_a[-1]-1, array[i])) for i in range(n-1,-1,-1): r_a.append(min(r_a[-1]-1, array[i])) r_a.revers...
2018B
wrong_submission
medium
285,646,798
Java 8
WRONG_ANSWER on test 2
import java.io.*; /** * @version 1.0 * @Author 杨雨彤 * @Date 2024/10/13 19:57 * @注释 */ public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); static StreamTokenizer st = new Stream...
2018B
wrong_submission
medium
285,642,442
Java 8
WRONG_ANSWER on test 2
import java.io.*; /** * @version 1.0 * @Author 杨雨彤 * @Date 2024/10/13 19:57 * @注释 */ public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); static StreamTokenizer st = new Stream...
2018B
wrong_submission
medium
284,683,338
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class D_Speedbreaker { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n = sc.nextInt(); int[] a = new int[n]; for(int i=0;i<n;i++) a[i] = sc.nextInt(); Map<Integer,Integer>...
2018B
wrong_submission
medium
284,683,097
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class D_Speedbreaker { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n = sc.nextInt(); int[] a = new int[n]; for(int i=0;i<n;i++) a[i] = sc.nextInt(); Map<Integer,Integer>...
2018B
wrong_submission
medium
283,242,946
Python 3
WRONG_ANSWER on test 2
class Solution(): def __init__(self): pass def getSegem(self): self.segs = {} for i in range(len(self.xs)): if self.xs[i] in self.segs.keys(): old_seg = self.segs[self.xs[i]] self.segs[self.xs[i]] = (old_seg[0], i + 1) else: ...
2018B
wrong_submission
hard
289,109,919
Python 3
WRONG_ANSWER on test 2
for _ in range(int(input())): n = int(input()) a = list(map(int,input().split(' '))) started = [] mn = n mx = 0 # m_num = 2*10**5 +1 # p_sum = [0 for _ in range (m_num)] # print('m:',m_num) for i in range(n): l = max(0,i-a[i]+1) r = min(n,i+a[i]-1) started.app...
2018B
wrong_submission
hard
296,972,726
C++17 (GCC 7-32)
WRONG_ANSWER on test 3
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define ll long long #define vl vector<ll> #define vs vector<string...
2018B
wrong_submission
hard
283,240,800
C++20 (GCC 13-64)
WRONG_ANSWER on test 3
#include<bits/stdc++.h> #define FOR(i,a,b) for(int i=(a); i<=(b); ++i) #define ROF(i,a,b) for(int i=(a); i>=(b); --i) #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()) #define x first #define y second #define pb push_back #define...
2018B
wrong_submission
hard
284,359,993
Java 21
TIME_LIMIT_EXCEEDED on test 4
import java.util.*; import java.io.*; public class B_Speedbreaker { public static void main(String[] args) { FastScanner sc = new FastScanner(); int t = sc.nextInt(); while(t-- > 0) { int n = sc.nextInt(); int[] a = new int[n]; for(int i = 0; i < n; ...
2018B
wrong_submission
hard
283,432,721
Java 21
TIME_LIMIT_EXCEEDED on test 4
import java.util.*; import java.io.*; public class SpeedBreaker { static HashSet<Integer> set; public static void counter(int arr[],int s,int e,int t){ if( s > e || t > e - s + 1) return; if(t >= 1 && s == e){ set.add(s); } counter(arr, s + 1, e, Math.min(t, arr[s...
2018B
wrong_submission
hard
262,842,968
Python 3
OK
ansl = [] for _ in range(int(input())): n = int(input()) a_i = list (map(int, input() . split())) a_i.sort() each_count = [] s = set(a_i) s2 = list(s) for i in range(len(s)): count = 0 for j in a_i: if s2[i] == j: count += 1 each_count.append(...
1957A
right_submission
none
257,586,822
PyPy 3-64
OK
for _ in range(int(input())): n = int(input()) nums = map(int, input().split()) d = {} for n in nums: if n not in d: d[n] = 1 else: d[n]+=1 res = 0 for e in d.keys(): while d[e] > 2: res += 1 d[e] -= 3 print(res)
1957A
right_submission
none
257,886,415
PyPy 3-64
OK
t = int(input()) for i in range(t): n = int(input()) a = list(map(int,input().split())) ans = 0 b = list(set(a)) for i in b: if a.count(i) >= 3: ans += a.count(i)//3 print(ans)
1957A
right_submission
none
257,594,457
Java 21
OK
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 n = sc.nextInt(); int[] a =new int[n]; for(int j=0;j<n;j++) { a[j]...
1957A
right_submission
none
257,590,781
Java 8
OK
import java.util.*; public class App { private static int solve(int n) { return n; } private static int solve(int n, int[] arr){ int[] count = new int[101]; for(int i=0;i<n;i++){ count[arr[i]]++; } int ans = 0; for(int i=1;i<=100;i++){ ...
1957A
right_submission
none
278,532,717
Java 21
OK
import java.util.*; public class stickogon { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int q=1;q<=t;q++) { int n=sc.nextInt(); int arr[]=new int[n]; for(int i=0;i<n;i++) arr[i]=sc.nextInt(); HashMap<Integer,Integer> mp=new HashMap<>(); ...
1957A
right_submission
none
257,621,188
C++17 (GCC 7-32)
OK
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; vector<long long> sticks(n); for(int i=0; i<n; i++) { cin>>sticks[i]; } unordered_map<long long, int> mp; for(auto it: sticks) { ...
1957A
right_submission
none
257,583,313
C++17 (GCC 7-32)
OK
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll t; cin>>t; while(t--) { ll n; cin>>n; vector<ll> v; for(ll i=0, a; i<n; i++) { cin>>a; v.push_back(a);...
1957A
right_submission
none
257,591,862
C++20 (GCC 13-64)
OK
//Think twice,code once. #include<bits/stdc++.h> #define endl '\n' #define INF 0x3f3f3f3f3f3f3f #define inf 0x3f3f3f3f #define ff first #define ss second #define pii pair<int,int> #define mem(i,n) memset(i,n,sizeof i) #define dg(a) std::cout << #a << " = " << a << endl #define int long long using namespace std; void ...
1957A
right_submission
none
257,702,583
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using i64 = long long; void solve() { int n; std::cin >> n; std::vector<int> a(n); for (int i = 0; i < n; i++) { std::cin >> a[i]; } int ans = 0; std::sort(a.begin(), a.end()); for (int i = 0, j = 0; i < n; i = j) { while (j < n && a[i] =...
1957A
right_submission
none
257,627,342
C++14 (GCC 6-32)
WRONG_ANSWER on test 2
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int n,m,ans,sum; int a[1000]; int main() { cin>>n; for(int i=0;i<n;i++){ cin>>m; if(m<3){ for(int k=0;k<m;k++){ cin>>a[k]; } cout<<0<<endl; continue; } if(m>2){ sum=0; ans=0; for(int k=0;k<m;k++){ cin>>a[k...
1957A
wrong_submission
easy
257,625,062
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<iostream> #include<algorithm> using namespace std; int main() { short int t; cin >> t; while(t--) { short int n, i, j, k, cot=0; cin >> n; short int stick[n]; for(i=0; i<n; i++) { cin >> stick[i]; } if(n>2) { ...
1957A
wrong_submission
easy
266,128,732
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <iostream> using namespace std; int main() { int n; cin>>n; int e[n]; for(int i=0;i<n;i++) { int m; cin>>m; int a[m]; for(int j=0;j<m;j++) { cin>>a[j]; } int y[101]={0}; for(int k=0;k<m;k++) { y[a[k]]++; } int u; int s=0; for(int z=0;z<m;z++) ...
1957A
wrong_submission
easy
257,590,068
Python 3
WRONG_ANSWER on test 2
t=int(input()) for _ in range(t): n=int(input()) arr=list(map(int,input().split())) c=0 d={} for num in arr: if num not in d: d[num]=1 else: d[num]+=1 for i in d: if d[i]>2: c+=1 print(c)
1957A
wrong_submission
easy
257,588,341
Python 3
WRONG_ANSWER on test 2
# Function to count the frequency of stick lengths def count_sticks(sticks): freq = {} for stick in sticks: if stick in freq: freq[stick] += 1 else: freq[stick] = 1 return freq # Function to calculate the maximum number of polygons def max_polygons(freq): max_po...
1957A
wrong_submission
easy
257,756,854
Python 3
WRONG_ANSWER on test 2
def solution(): n:int = int(input()) nums = list(map(int,input().split())) freq = {} ans:int =0 for i in nums: if i in freq: freq[i]+=1 else: freq[i]=1 for key in freq: if freq[key]>2: no:int=3 while freq[key]%no!=0: ...
1957A
wrong_submission
easy
285,043,530
Java 21
WRONG_ANSWER on test 2
/* ॐ भूर् भुवः स्वः। तत् सवितुर्वरेण्यं। भर्गो देवस्य धीमहि। धियो यो नः प्रचोदयात् ॥ @Author : ANKUSH @Country : INDIA */ import java.io.*; import java.util.*; public class Main {// Codechef { static class pair { long val1; long val2; public pair(long val1,...
1957A
wrong_submission
easy
257,591,137
Java 21
WRONG_ANSWER on test 2
import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) { var sc = new Scanner(System.in); var t = sc.nextInt(); while (t-- > 0) { var n = sc.nextInt(); int[] nums = new int[n]; for (var i=0; i < n; i++) nums[i] = s...
1957A
wrong_submission
easy
258,941,214
C++17 (GCC 7-32)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> #define all(x) x.begin(),x.end() #define pp push_back #define ones(x) __builtin_popcountll(x) #define yes cout<<"YES\n"; #define no cout<<"NO\n"; // 32bit(1)=2147483647 using namespace std; #define ll long long bool const sorted (const pair<long long,long long>&p1,const pair<long long,long lo...
1957A
wrong_submission
medium
257,579,548
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> constexpr auto sp = " "; constexpr auto en = "\n"; using ull = unsigned long long; using ll = long long; using ld = long double; #define isz(x) int((x).size()) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define fin(x) for (auto& it : x) cin >> it; #define foutsp(x)...
1957A
wrong_submission
medium
276,393,056
Python 3
WRONG_ANSWER on test 2
t=int(input()) while t: n=int(input()) side_length=[] count={} x=input().split() side_length=list(x) for i in side_length: if i in count: count[i]=count[i]+1 else: count[i]=1 sum=0 for i in count: if count[i]>=3: sum=sum+1 ...
1957A
wrong_submission
medium
257,582,846
Python 3
WRONG_ANSWER on test 2
from sys import stdin def input(): return stdin.readline() def solve(): l=int(input()) a = list(map(int, input().split())) c=[0]*100 i=0 while(i<l): c[a[i]]=c[a[i]]+1 i=i+1 i=0 count=0 while(i<l): if(c[i]>=4): count=count+1 i=i+1 print(co...
1957A
wrong_submission
medium
257,583,377
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class A940 { static class Pair implements Comparable<Pair>{ int first; int second; public Pair(int first, int second){ this.first=first; this.second=second; } @Override public int compareTo(Pair other){ ...
1957A
wrong_submission
medium
257,623,842
Java 8
WRONG_ANSWER on test 2
import java.lang.*; import java.util.*; public class A { public static void main(String args[]) { Scanner s=new Scanner(System.in); int t=s.nextInt(); while(t-->0) { int n=s.nextInt();int a[]=new int[n];int b[]=new int[n]; /...
1957A
wrong_submission
medium
271,930,652
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> #define endl '\n' #define int long long using namespace std; const int N=1e5+5; const int mod=998244353; const int INF=0x3f3f3f3f; int arr[N]; signed main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); int t; cin>>t; while(t--) { int n,cnt=0; cin>>n; priority_queue<int,v...
1957A
wrong_submission
hard
257,698,641
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<long long > #define vpi vector<pair<long long, long long >> #define vvi vector<vector<int>> #define sl set<ll>; #define f(a,i) a[i].second #define f(i, a, b) for (ll i = a; i < b; i++) #define fors(n) for (ll i = 0; i < n; i++) #defin...
1957A
wrong_submission
hard
257,763,898
PyPy 3-64
WRONG_ANSWER on test 2
x = int(input()) for _ in range(x): y = int(input()) z = list(map(int, input().split())) z.sort() z2 = z[:] sum = 0 for i in range(len(z)-1): if z[i] == z[i+1]: z2.remove(z[i]) for k in z2: if z.count(k)>2: sum += 1 print(sum)
1957A
wrong_submission
hard
260,198,046
PyPy 3-64
WRONG_ANSWER on test 2
T = int(input()) for t in range(T): n = int(input()) l = [int(i) for i in input().split()] # print(l) freq = {} for i in l: freq[i] = freq.get(i, 0)+1 count = 0 for k, v in freq.items(): if v > 2: count += 1 print(count)
1957A
wrong_submission
hard
268,642,057
Java 21
WRONG_ANSWER on test 2
import java.util.Scanner; public class Stickogon { private static int solve(int n, int[] sticks) { int[] freq = new int[101]; int res = 0; for (int stick : sticks) { freq[stick]++; if (freq[stick] == 3) { res++; } } ...
1957A
wrong_submission
hard
258,311,475
Java 21
WRONG_ANSWER on test 2
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class lol{ static Scanner input = new Scanner(System.in); static PrintWriter output = new PrintWriter(Syst...
1957A
wrong_submission
hard
286,791,122
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; template<class Info> struct SegmentTree { int n; std::vector<Info> info; SegmentTree() : n(0) {} SegmentTree(int n_, Info v_ = Info()) { init(n_, v_); } template<class T> SegmentTr...
2030F
right_submission
none
289,170,154
C++20 (GCC 13-64)
OK
#include<bits/stdc++.h> using namespace std; namespace gza{ #define int long long #define pb push_back #define MT int TTT=R;while(TTT--) #define pc putchar #define R read() #define fo(i,a,b) for(int i=a;i<=b;i++) #define rep(i,a,b) for(int i=a;i>=b;i--) #define m1(a,b) memset(a,b,sizeof a) namespace IO { in...
2030F
right_submission
none
286,808,203
C++17 (GCC 7-32)
OK
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; typedef long long ll ; const ll N = 2e5 + 10,SQ=320,LOG=31; const ll inf = 2e9, MD = 1e9 + 7; #define endl '\n' #define pb(x) push_back(x) #define md(x) (((x%MD)+MD)%MD) #define all(V) V.begin(),V.end() #def...
2030F
right_submission
none
290,826,791
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; #define lowbit(x) x&(-x) #define int long long typedef long long ll; int INF = 1e18; const int N = 2e5+10; //int mod = 1e9+7; //int ways[4][2] = {{1,0},{-1,0},{0,1},{0,-1}}; int n,q; int oc[N],a[N],nex[N],ac[N]; vector<int> have[N]; #define se second #define fi first ...
2030F
wrong_submission
easy
286,824,745
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; using pii = pair<int,int>; #define int long long const int N = 2e5 + 10; struct Info { int mx; Info operator+(const Info &o) const { Info ret; ret.mx = max(mx, o.mx); return ret; } } tr[N << 2]; int pre[N], pre1[N]; void pu...
2030F
wrong_submission
easy
296,265,658
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e6 + 10; const int mod = 998244353; inline int add(int x, int y) { return x += y, x < mod || (x -= mod), x; } inline void cadd(int &x, int y) { x += y, x < mod || (x -= mod); } int T, n, m, a[MAXN], p[MAXN], pre[MAXN], nxt[M...
2030F
wrong_submission
easy
291,479,591
PyPy 3-64
WRONG_ANSWER on test 2
import sys, os, io input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline def update(i, x): i ^= l1 tree[i] = x i >>= 1 while i: tree[i] = max(tree[i << 1], tree[i << 1 ^ 1]) i >>= 1 return def get_max(s, t): s, t = s ^ l1, t ^ l1 ans = 0 while s <= t: i...
2030F
wrong_submission
easy
290,476,883
PyPy 3-64
WRONG_ANSWER on test 2
import heapq class SegmentTree: def __init__(self, data, default=0, func=max): """initialize the segment tree with data""" self._default = default self._func = func self._len = len(data) self._size = _size = 1 << (self._len - 1).bit_length() self.data = [default] ...
2030F
wrong_submission
easy
287,989,060
Python 3
WRONG_ANSWER on test 2
# vai proshno onk difficult, eta dia hoibo na # def is_orangutan_approved(subarray): # S = set(subarray) # while True: # found = False # l = 0 # while l < len(subarray): # r = l # while r + 1 < len(subarray) and subarray[r + 1] == subarray[l]: # r ...
2030F
wrong_submission
easy
286,822,719
Java 21
WRONG_ANSWER on test 2
import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Scanner; public class F { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(...
2030F
wrong_submission
easy
286,812,254
Java 21
WRONG_ANSWER on test 2
import java.util.Scanner; public class F { 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(); int[] arr = new int[n]; for(int i=0; i<n;...
2030F
wrong_submission
easy
286,898,276
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<class Info> struct SegmentTree { #define l(p) (p<<1) #define r(p) (p<<1|1) int n; vector<Info> info; SegmentTree() {} SegmentTree(int n) { this->n = n; info.resize(4 * n + 10); } SegmentTree(vector<Info> _in...
2030F
wrong_submission
medium
291,308,983
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#define _CRT_SECURE_NO_WARNINGS #include<bits/stdc++.h> #define int long long #define YES cout<<"YES\n" #define NO cout<<"NO\n" #define endl "\n" #define debug cout<<'*'<<'\n' const int N = 2e5 + 500, M = 5e5 + 500; const int mod = 1e9 + 7, inf = 0x3f3f3f3f3f3f3f3f; using namespace std; using pii=pair<int,int>; struc...
2030F
wrong_submission
medium
286,823,427
PyPy 3-64
WRONG_ANSWER on test 2
#!/usr/bin/env python import os import sys from io import BytesIO, IOBase class RangeQuery: def __init__(self, data, func=min): self.func = func self._data = _data = [list(data)] i, n = 1, len(_data[0]) while 2 * i <= n: prev = _data[-1] _data.append([func...
2030F
wrong_submission
medium
286,817,042
PyPy 3-64
WRONG_ANSWER on test 2
# for I/O for local system import sys from os import path if(path.exists('Input.txt')): sys.stdin = open('Input.txt','r') sys.stdout = open('Output.txt','w') # For fast I/O input = sys.stdin.buffer.readline # input = sys.stdin.readline print = sys.stdout.write # Import libraries here whenever required from ...
2030F
wrong_submission
medium
286,804,043
Java 21
TIME_LIMIT_EXCEEDED on test 3
import java.io.*; import java.util.*; public class OrangutanApprovedSubarrays { static class Pair { int first, last; Pair(int f, int l){ first = f; last = l; } } // Binary search to find the first index >= target static int lowerBound(ArrayList<Integ...
2030F
wrong_submission
medium
286,801,842
Java 21
TIME_LIMIT_EXCEEDED on test 3
import java.io.*; import java.util.*; public class OrangutanApprovedSubarrays { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st = new StringTok...
2030F
wrong_submission
medium
286,794,862
C++17 (GCC 7-32)
WRONG_ANSWER on test 6
#include <bits/stdc++.h> using std::bitset; using std::cout; using std::deque; using std::endl; using std::greater; using std::lower_bound; using std::make_pair; using std::map; using std::max; using std::min; using std::multimap; using std::multiset; using std::nth_element; using std::pair; using std::priority_queue; ...
2030F
wrong_submission
hard
296,368,984
C++20 (GCC 13-64)
RUNTIME_ERROR on test 6
#include<bits/stdc++.h> using namespace std; namespace cs{ #define LL long long const int N=2e5; const int INF=2e9; int T,n,Q,a[N+5],pt,ma[N+5],cnt[N+5],lst[N+5]; bool End[N+5]; deque<int>dq; vector<int>v[N+5]; void Init(){ pt=0; for(int i=1;i<=n;i++){ ma[i]=0;cnt[i]=0; End[i]=0; v[i].clear(); } ...
2030F
wrong_submission
hard
286,831,492
PyPy 3-64
WRONG_ANSWER on test 6
import sys import heapq input = sys.stdin.readline def fg(): return int(input()) def fgh(): return [int(xx) for xx in input().split()] def tt(): sys.stdout.flush() def sd(): print('Yes') def df(): print('No') for __ in range(fg()): n, q = fgh() a = fgh() ind = {} for i in range(n): ...
2030F
wrong_submission
hard
286,810,931
PyPy 3-64
WRONG_ANSWER on test 6
import sys import heapq input = sys.stdin.readline def fg(): return int(input()) def fgh(): return [int(xx) for xx in input().split()] def tt(): sys.stdout.flush() def sd(): print('Yes') def df(): print('No') for __ in range(fg()): n, q = fgh() a = fgh() ind = {} for i in range(n): ...
2030F
wrong_submission
hard
290,458,678
Java 21
WRONG_ANSWER on test 6
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; import java.util.function.BiFunction; public class F_PrimeArray { public static void main(String[] args) throws IOException { Buffe...
2030F
wrong_submission
hard
286,984,514
C++20 (GCC 13-64)
RUNTIME_ERROR on test 6
#include<bits/stdc++.h> using namespace std; const int N=2e5+10; const int inf=0x3f3f3f3f; int T,n,q; int a[N]; int lst[N],ps[N],nxt[N]; struct segtree{ #define maxx N*4 #define ls p<<1 #define rs p<<1|1 int t[maxx]; void push_up(int p) {t[p]=min(t[ls],t[rs]);} void build(int p,int l,int r) ...
2030F
wrong_submission
hard
294,169,434
Python 3
OK
from collections import deque def min_steps_to_reach(n, m, maze): directions = { "up": (-1, 0), "down": (1, 0), "left": (0, -1), "right": (0, 1), } # Find start (S) and end (T) positions start = end = None for i in range(n): for j in range(m): ...
2041D
right_submission
none
304,194,834
Python 3
OK
from collections import deque def drunken_maze(n, m, maze): directions = [(0, 1), (1, 0), (0, -1), (-1, 0)] direction_chars = ['R', 'D', 'L', 'U'] for i in range(n): for j in range(m): if maze[i][j] == 'S': start = (i, j) elif maze[i][j] == 'T': ...
2041D
right_submission
none
294,126,287
PyPy 3-64
OK
from collections import deque def find_start(maze: list[str]) -> tuple[int, int]: for i, row in enumerate(maze): for j, cell in enumerate(row): if cell == 'S': return (i, j) return (-1, -1) rows, columns = map(int, input().split()) maze = [input() for _ in range(rows)...
2041D
right_submission
none
305,036,511
Java 21
OK
import java.util.*; public class Main{ static class State { int x, y; int dir, cnt, steps; State(int x, int y, int dir, int cnt, int steps) { this.x = x; this.y = y; this.dir = dir; this.cnt = cnt; this.steps = steps; } ...
2041D
right_submission
none
304,216,025
Java 21
OK
import java.io.*; import java.util.*; public class Main{ static class State { int x, y, steps, dir, consecutiveSteps; public State(int x, int y, int steps, int dir, int consecutiveSteps) { this.x = x; this.y = y; this.steps = steps; this.dir = di...
2041D
right_submission
none
293,747,402
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 = false; // init ...
2041D
right_submission
none
295,273,434
C++20 (GCC 13-64)
OK
#include<bits/stdc++.h> using namespace std; void solve(){ int n, m, dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, ans = -1; queue<array<int, 5>> q;//cnt, i, j, dir, streak cin>>n>>m; vector<string> grid; for(int i = 0;i<n;i++){ string s; cin>>s; grid.push_back(s); ...
2041D
right_submission
none
293,337,314
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 inf = 1E9; constexpr int dx[] = {1, 0, -1, 0}; constexpr int dy[] = {0, 1, 0, -1}; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); ...
2041D
right_submission
none
300,045,389
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = 1e6 + 5, MOD = 1e9 + 7; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; string dir = "RLDU"; int main() { ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); ll n, m, si, sj, ei, ej, ans = 1e18; cin >> n >...
2041D
right_submission
none
305,465,293
C++20 (GCC 13-64)
OK
#include <bits/stdc++.h> using namespace std; #define int long long struct State { int row, col, steps, dir, count; }; int dx[] = {0, 0, -1, 1}; // L, R, U, D int dy[] = {-1, 1, 0, 0}; // L, R, U, D void solve() { int n, m; cin >> n >> m; vector<vector<char>> grid(n, vector<char>(m)); vector...
2041D
right_submission
none
298,735,098
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include <iostream> #include <vector> #include <queue> #include <tuple> using namespace std; const int MAX_N = 10000; const int INF = 2e9; const int directions[4][2] = { {1, 0}, {-1, 0}, {0, 1}, {0, -1} }; // Down, Up, Right, Left struct State { int x, y, dir, steps, dist; }; int bfs(vector<string>& maze, i...
2041D
wrong_submission
easy
303,962,947
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <iostream> #include <queue> #include <vector> #include <tuple> using namespace std; struct State { int row, col, dir, step_count, total_steps; }; int drow[] = {1, 0, -1, 0}; // D, R, U, L int dcol[] = {0, 1, 0, -1}; int main() { int n, m; cin >> n >> m; vector<vector<char>> board(n, ...
2041D
wrong_submission
easy
293,228,948
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> using namespace std; #define vcoistnt ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define int long long #define ull unsigned long long #define bit __builtin_popcountll #define lowbit(x) ((x)&-(x)) #define vi vector<int> #define vb vector<bool> typedef pair<int,int> pll; ...
2041D
wrong_submission
easy
304,392,350
Python 3
WRONG_ANSWER on test 2
from collections import deque def bfs(maze, start, end): n = len(maze) m = len(maze[0]) directions = [(0, 1), (0, -1), (1, 0), (-1, 0)] # Queue for BFS: (x, y, steps, consecutive_steps_in_each_direction) queue = deque([(start[0], start[1], 0, [0, 0, 0, 0])]) visited = set((start[0], start[1]...
2041D
wrong_submission
easy
304,594,167
Python 3
WRONG_ANSWER on test 2
from collections import deque def drunken_maze(maze): # Directions for moving up, down, left, and right directions = [(0, 1), (0, -1), (1, 0), (-1, 0)] # Find the start and end positions for i in range(len(maze)): for j in range(len(maze[0])): if maze[i][j] == 'S': ...
2041D
wrong_submission
easy
304,460,734
Python 3
WRONG_ANSWER on test 2
from collections import deque def drunken_maze(maze): # Define the possible directions directions = [(0, 1), (0, -1), (1, 0), (-1, 0)] # Define the opposite directions opposites = {(0, 1): (0, -1), (0, -1): (0, 1), (1, 0): (-1, 0), (-1, 0): (1, 0)} # Read the maze and find the start position ...
2041D
wrong_submission
easy
304,625,645
Java 21
WRONG_ANSWER on test 2
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; public class Main{ static int[][] directions = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; static char[] dirChars = {'U', 'D', 'L', 'R'}; public static void main(Stri...
2041D
wrong_submission
easy
304,464,864
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class Main{ private static final int[][] DIRECTIONS = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; private static final int MAX_STEPS = 3; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int m = scann...
2041D
wrong_submission
easy
293,457,772
C++20 (GCC 13-64)
WRONG_ANSWER on test 6
#include<bits/stdc++.h> #include<format> #define ll long long #define ull unsigned long long using namespace std; char mp[10010][10010]; bool visited[10010][10010]; struct pos { int x, y, t; int lian; // 连续向一个方向数 int lpos; // 连续的朝向 pos(int a, int b, int c, int l = 0, int d = 0) { x = a, y = b, t = c, lia...
2041D
wrong_submission
medium
293,596,742
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 6
#include <bits/stdc++.h> #define ff first #define ss second #define ll long long int #define mod 1e9+7 #define pb push_back #define eb emplace_back #define mpp make_pair #define vi vector<int> #define vc vector<char> #define mpf map<int,int> #define SI set<int> #define rr(i,a,b) for(int i=a;i>=b;i--) #define r(i,a,b)...
2041D
wrong_submission
medium
293,934,003
PyPy 3-64
WRONG_ANSWER on test 6
from collections import deque def find_start(maze_x, maze_y, maze): for x in range(maze_x): for y in range(maze_y): if maze[x][y] == "S": return x, y return -1, -1 def check_cell(new_x, new_y, maze_x, maze_y, maze): if (not (0 <= new_x < maze_x and 0 <= new_y < maze_y...
2041D
wrong_submission
medium
298,745,823
PyPy 3-64
WRONG_ANSWER on test 6
from collections import deque def bfs(grid, n, m): # find x and y direction = { 0: "U", 1: "R", 2: "D", 3: "L", } opp = { 'R' : 'L', 'L' : 'R', 'U' : 'D', 'D' : 'U', } for row in range(n): for col in range(m): ...
2041D
wrong_submission
medium
293,382,069
Java 21
WRONG_ANSWER on test 6
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class p2041D{ public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintW...
2041D
wrong_submission
medium
294,980,620
Java 21
WRONG_ANSWER on test 7
import java.io.*; import java.util.*; public class D_Drunken_Maze { public static void main(String[] args) { int n = sc.nextInt(); int m = sc.nextInt(); char[][] a = new char[n][m]; for (int i = 0; i < n; i++) { String s = sc.next(); for (int j = 0; j < m;...
2041D
wrong_submission
medium
295,749,476
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 10
#include <bits/stdc++.h> #define ll long long int #define F(i, a, b) for (ll i = a; i < b; i++) #define RF(i, a, b) for (ll i = a - 1; i >= b; i--) #define FF(a) for (auto it : a) #define pb push_back #define ff first #define ss second #define yes cout << "YES\n" #define no cout << "NO\n" #define all(v) v.begin(), v.en...
2041D
wrong_submission
hard
293,417,347
C++20 (GCC 13-64)
TIME_LIMIT_EXCEEDED on test 10
#include <bits/stdc++.h> #pragma GCC optimize("Ofast,fast-math,unroll-loops") #pragma GCC target("avx2,fma") using namespace std; #define ll long long #define int ll #define all(a) a.begin(),a.end() #define allr(a) a.rbegin(),a.rend() #define pb push_back #define yes cout<<"YES" #define no cout<<"NO" #define endl '...
2041D
wrong_submission
hard
296,500,257
PyPy 3-64
WRONG_ANSWER on test 10
from collections import deque from heapq import heappush, heappop, heapify from math import ceil n, m = map(int, input().split()) grid = [input() for i in range(n)] MAX_N = 200000 + 1 AL = [[] for _ in range(MAX_N)] s = 0 t = 0 cc = 1 mapper = {} mapper_index = {} for i in range(n): for j in range(m): mapp...
2041D
wrong_submission
hard