id
int64
251M
307M
language
stringclasses
12 values
verdict
stringclasses
290 values
source
stringlengths
0
62.5k
problem_id
stringclasses
500 values
type
stringclasses
2 values
297,473,206
Python 3
WRONG_ANSWER on test 2
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) segments = 0 has_zero = False i = 0 while i < n: if a[i] != 0: segments += 1 while i < n and a[i] != 0: i += 1 else: has_zero = True ...
2049A
wrong_submission
297,485,089
Python 3
WRONG_ANSWER on test 2
# cook your dish here for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) m1=-1 for i in range(n): if a[i]==0: m1=i break if a.count(0)==n: print(0) continue if a[0]==0 and a[-1]==0 and a.count(0)!=2: print(2) ...
2049A
wrong_submission
297,598,486
Python 3
WRONG_ANSWER on test 2
t=int(input()) def solve(): n=int(input()) arr=list(map(int,input().split())) ans=0 if(list(set(arr))==[0]): return 0 if(0 in arr[1:n-1]): return 2 return 1 for _ in range(t): print(solve())
2049A
wrong_submission
297,502,572
PyPy 3-64
WRONG_ANSWER on test 2
def solver(x): breaks = 0 if x[0] == 0: count = 0 else: count = 1 for i in range(len(x)): if x[i] == 0: count = (count + 1) % 2 if x[i] != 0 and count != 0: breaks = breaks + 1 count = 0 if breaks == 0: return print(0) i...
2049A
wrong_submission
297,475,152
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class A_MEX_Destruction { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); // No. of test cases while (t-- > 0) { int n = sc.nextInt(); // Length of array `a` int[] a = new int[n]; // Ar...
2049A
wrong_submission
297,474,849
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): n = int(input()) array = list(map(int,input().split())) zerocount = 0 for num in array: if num == 0: zerocount +=1 if zerocount == n: print(0) continue # exceptfirstandlast = 0 for i in range(1,n-1): if a...
2049A
wrong_submission
297,461,461
PyPy 3-64
WRONG_ANSWER on test 2
get_int = lambda: int(input()) get_tuple_int = lambda: map(int, input().split()) get_list_int = lambda: list(map(int, input().split())) t = get_int() for _ in range(t): n = get_int() a = get_list_int() zeros = [i for i,j in enumerate(a) if j==0] if len(zeros) == n: print(0) elif len(zeros)...
2049A
wrong_submission
297,460,142
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): t=int(input()) w=[*map(int,input().split())] if w.count(0)==t:print(0) else: for i in range(t-2): if w[i]>0 and w[i+1]==0 and w[i+2]>0:print(2);break else:print(1)
2049A
wrong_submission
297,495,458
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class MEXDestruction { 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++) { ...
2049A
wrong_submission
301,291,799
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class MEX { public static void main(String[] args) { Scanner in=new Scanner(System.in); int t=in.nextInt(); for(int z=1;z<=t;z++) { int n=in.nextInt(); int[] a=new int[n]; int c=0;int c1=0;int k=0;boolean flag=true;int x=0; ...
2049A
wrong_submission
304,624,749
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; int main() { int t,n; cin >> t; while(t--) { cin >> n; vector<int> a(n); int sum = 0; for (int i = 0; i < n;i++) { cin >> a[i]; sum += a[i]; } if (sum == 0) { cout << 0 << en...
2049A
wrong_submission
297,616,333
Java 8
WRONG_ANSWER on test 2
import java.io.*; import java.util.*; public class Main { private static class Kattio extends PrintWriter { private BufferedReader r; private StringTokenizer st; public Kattio() { this(System.in, System.out); } public Kattio(InputStream i, OutputStream o) { ...
2049A
wrong_submission
297,505,657
PyPy 3-64
WRONG_ANSWER on test 2
def min_operations_to_zero(t, test_cases): results = [] for n, arr in test_cases: zero_count = arr.count(0) if zero_count == n: results.append(0) elif zero_count == 1: if arr[0] == 0 or arr[n-1]==0: results.append(1) else: ...
2049A
wrong_submission
302,268,257
PyPy 3-64
WRONG_ANSWER on test 2
from collections import Counter import sys def main(): # Read input t = int(input()) for _ in range(t): n = int(input()) arr = list(map(int, input().split())) d = Counter(arr) # all zeros if d[0] == n: print(0) # all non zeros elif d[0] == 0: print(1) # starts with 0 ...
2049A
wrong_submission
297,500,170
Java 21
WRONG_ANSWER on test 2
import java.util.Scanner; import java.util.Arrays; public class Main { static void solve(Scanner sc) { int n = sc.nextInt(); int[] a = new int[n]; int c = 0; for(int i = 0; i < n; i++) { a[i] = sc.nextInt(); if(a[i] == 0) c++; } if(n != ...
2049A
wrong_submission
297,475,062
Java 8
WRONG_ANSWER on test 2
import java.io.*; import java.util.*; //import java.math.*; public class Looser1202{ final static int mod = 1000000007; static long gcd(long a, long b) { while (a > 0 && b > 0) { if (a > b) { a = a % b; } else { b = b % a; ...
2049A
wrong_submission
297,485,046
Java 21
WRONG_ANSWER on test 2
import java.util.*; import java.io.*; /* ⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⣾⡳⣼⣆⠀⠀⢹⡄⠹⣷⣄⢠⠇⠻⣷⣶⢀⣸⣿⡾⡏⠀⠰⣿⣰⠏⠀⣀⡀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⣀⣀⣀⡹⣟⡪⢟⣷⠦⠬⣿⣦⣌⡙⠿⡆⠻⡌⠿⣦⣿⣿⣿⣿⣦⣿⡿⠟⠚⠉⠀⠉⠳⣄⡀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⡀⢀⣼⣟⠛⠛⠙⠛⠉⠻⢶⣮⢿⣯⡙⢶⡌⠲⢤⡑⠀⠈⠛⠟⢿⣿⠛⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣆⠀⠀⠀ ⠀⠀⠀⠀⠀⡸⠯⣙⠛⢉⣉⣙⣿⣿⡳⢶⣦⣝⢿⣆⠉⠻⣄⠈⢆⢵⡈⠀⠀⢰⡆⠀⣼⠓⠀⠀⠀ Nah ⠈⣷⠀⠀ ⠀⠀⠀⠖⠉⠻⣟⡿⣿⣭⢽⣽⣶⣈⢛⣾⣿⣧⠀⠙⠓⠀⠑⢦⡀⠹⣧⢂⠀⣿⡇⢀⣿⠺⠇⠀ I'd⠀ ⣿⠀⠀ ⠀⠀⠀⠀⠐⠈⠉⢛⣿⣿⣶⣤⣈⠉⣰⣗⡈⢛⣇⠀⣵⡀...
2049A
wrong_submission
297,493,725
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class main{ public static void main(String args[]){ Scanner read = new Scanner(System.in); int t = read.nextInt(); for(int q=0; q<t; q++){ int n = read.nextInt(); int[] arr = new int[n]; for(int i=0; i<n; i++){ ar...
2049A
wrong_submission
300,341,508
PyPy 3-64
WRONG_ANSWER on test 2
t=int(input()) for _ in range(t): n=int(input()) a=list(map(int,input().split())) if sum(a)==0: print(0) elif 0 not in a: print(1) elif a.count(0)==1 and a[0]==0 or a.count(0)==1 and a[-1]==0: print(1) elif a.count(0)==2 and a[0]==0 and a[-1]==0: print(1) else...
2049A
wrong_submission
297,601,001
Java 8
WRONG_ANSWER on test 2
import java.util.*; public class JavaCode{ public static int solve(int n , int a[] , int z){ if(z == a.length){ return 0; } if(z == 0){ return 1; } int prev= a[0]; boolean flag = false; for(int i =1 ; i < n-1 ; i++){ i...
2049A
wrong_submission
297,472,642
PyPy 3-64
WRONG_ANSWER on test 4
def algo(): n = int(input()) word = input().replace(" ", "").strip("0") zeros = word.count("0") if len(word) == 0: return 0 if zeros > 0: return 2 return 1 tests = range(int(input())) for i in tests: print(algo())
2049A
wrong_submission
297,508,533
PyPy 3-64
WRONG_ANSWER on test 2
t=int(input()) for _ in range(t): n=int(input()) a=list(map(int,input().split())) v=0 nb=0 if max(a)==0: print(0) else: for j in range(n-1): if a[j]!=0 and v!=8: nb+=1 v=8 if a[j]==0 and v==8: v=0 if ...
2049A
wrong_submission
297,771,860
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class A_MEX_Destruction { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int z=0;z<t;z++){ int n = sc.nextInt(); int a[] = new int[n]; for(int i=0;i<n;i++){ ...
2049A
wrong_submission
297,497,967
Java 21
WRONG_ANSWER on test 2
import java.io.*; import java.util.*; public class Main{ static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ; public static void main(String[] args) throws IOException{ int t = Integer.parseInt(br.readLine()); out :while(t-- > 0){ int n = Integer.parseI...
2049A
wrong_submission
297,459,667
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
// VK5 #include <bits/stdc++.h> using namespace std; // ready for the action #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> typedef __gnu_pbds::tree<int, __gnu_pbds::null_type, less<int>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update> ordered_set; #define ll long ...
2049A
wrong_submission
297,460,506
PyPy 3-64
WRONG_ANSWER on test 2
#from math import ceil,log,lcm,gcd,isfinite #from collections import deque,Counter,defaultdict #from bisect import bisect #from heapq import heappush,heappop #from fractions import Fraction as fr #from sortedcontainers import SortedList,SortedSet,SortedDict #from random import randint from sys import stdin,stdout inp...
2049A
wrong_submission
297,711,609
PyPy 3-64
WRONG_ANSWER on test 2
for k in range(int(input())): n=int(input()) s=input().split(" ") t=s[1:-1] br=0 for i in range(n): if i>0: if s[i]=="0" and "0"!=s[i-1] or s[i]!="0" and "0"==s[i-1]: br+=1 if "0" in t: r=2 else: r=1 if br==1: r=1 if s.count("0")==n: r=0 print(r)
2049A
wrong_submission
297,477,919
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class ans { public static void main(String args[]){ Scanner s=new Scanner(System.in); int t=s.nextInt(); s.nextLine(); for (int i=0;i<t;i++){ int n=s.nextInt(); int sum=0; int[] arr=new int[n]; for (int j=0;j<n;j++){ arr[j]=s.nextI...
2049A
wrong_submission
297,624,772
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class Main { public static void main (String[] args) throws java.lang.Exception { // your code goes heren Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); int arr[]=new int[n]; int count=0; for(int i=0;i<n;i++) { arr[i...
2049A
wrong_submission
297,615,832
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> #define pb push_back #define all(a) a.begin() , a.end() #define int long long #define mpi make_pair using namespace std; int32_t main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int t ; cin >> t ; while(t--){ int n ; cin >> n ; vector<int>a(n); for(int i = 0 ; i < n ; i ++)...
2049A
wrong_submission
297,527,584
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.Scanner; public class Main { public static int ans(int[]arr,int n) {int count=0; for(int i=0;i<n;i++) {if(arr[i]==0) {count++;}} if(count==n){return 0;} if(count==0){ret...
2049A
wrong_submission
297,467,046
Java 21
WRONG_ANSWER on test 3
import java.net.Inet4Address; import java.util.*; public class pupil { static class Pair<T, U> { public T first; public U second; public Pair(T first, U second) { this.first = first; this.second = second; } @Override public String toStrin...
2049A
wrong_submission
297,489,232
Java 21
WRONG_ANSWER on test 2
import java.util.Scanner; public class Solution { 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[] arr = new int[n]; for(int j=0;j<n;j++) { arr[j] = sc.nextInt(); } boolean q = true; for(...
2049A
wrong_submission
297,460,229
PyPy 3-64
WRONG_ANSWER on test 2
######################################################################################################################## # -----------------------------------------------AUTHOR: Omm AKA Antonio Colapso---------------------------------------# ##############################################################################...
2049A
wrong_submission
297,564,566
PyPy 3-64
WRONG_ANSWER on test 2
c=int(input()) for _ in range(c): n=int(input()) a=list(map(int,input().split())) cnt=0 for i in range (n): if a[i]==0: cnt+=1 if cnt==n: print(0) else: if a[0]==0: cnt-=1 if a[-1]==0: cnt-=1 if cnt==0: print(1) else:print(2)
2049A
wrong_submission
301,300,642
PyPy 3-64
WRONG_ANSWER on test 4
# Code by B10_STITI # the world is full of cruel people # [int(x) for x in input().split()] for _ in range(int(input())): n = int(input()) a = [x for x in input().split('0')] res = 0 for x in a: if x not in ['', ' ']: res += 1 if res == 0: print(0) elif res == 1: print(1) ...
2049A
wrong_submission
297,476,779
Java 21
WRONG_ANSWER on test 2
// हर हर महादेव import java.io.*; import java.util.*; public class Solution { static final int MOD = 1000000007; static final int MOD1 = 998244353; static final long INF = (long)1e18; public static void main(String[] args) { try { // For local testing: Redirect input and outp...
2049A
wrong_submission
297,486,124
PyPy 3-64
WRONG_ANSWER on test 2
def f(n,l): a=l.count(0) b=0 d=0 if a==0: return 1 c=l.index(0) if l.count(0)==n: return 0 if c==n-a: return 1 if a==n-1: return 1 for i in range(c+1,n): if l[i]!=0: b+=1 else: break for i in range(n...
2049A
wrong_submission
297,488,721
PyPy 3-64
WRONG_ANSWER on test 2
def func(): b = int(input()) c = list(map(int, input().split())) flag = 0 flag2 = 0 for j in range(b): if c[j] == 0: if j != 0 and j != b - 1: if c[j - 1] != 0: flag2 += 1 elif j == b - 1: flag2 -= 1 else: ...
2049A
wrong_submission
297,466,697
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class A_MEX_Destruction { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t=s.nextInt(); for(int i=1; i<=t; i++){ int n = s.nextInt(); int[] a = new int[n]; int ze=0; for(int j=0; j<n; j++){ a[j] = s.next...
2049A
wrong_submission
297,490,120
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class mex { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tt = sc.nextInt(); while (tt-- > 0) { int n = sc.nextInt(); int arr[] = new int[n]; for (int i = 0; i < arr.length; i++) { arr[i] = sc.nextInt(); } ...
2049A
wrong_submission
297,781,457
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define writtenByGreatRevan ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define ll long long #define ld long double #define pll pair<long long, long long> #define pb push_back #define ff first #define ss second #define sz(s) (ll)s.size() #define all(v) v.begin...
2049A
wrong_submission
297,474,832
PyPy 3-64
WRONG_ANSWER on test 2
t = int(input()) def solve(): n = int(input()) arr = list(map(int,input().split())) if 0 not in arr: return 1 if set(arr) == {0}: return 0 if arr.count(0) > 2: return 2 else: return 1 if (arr[-1] == 0 or arr[0] == 0) else 2 for _ in range(t): print(solve()...
2049A
wrong_submission
297,460,597
PyPy 3-64
WRONG_ANSWER on test 2
for i in range(int(input())): n=int(input()) a=list(map(int,input().split())) if 0 not in a: print(1) elif a.count(0)==n: print(0) else: for i in range(1,n-1): if a[i]==0 and a[i-1]!=0 and a[i+1]!=0: print(2) break else: ...
2049A
wrong_submission
297,603,551
PyPy 3
WRONG_ANSWER on test 2
t = int(input()) # Number of test cases for _ in range(t): n = int(input()) # Length of the array a = list(map(int, input().split())) zero_count = a.count(0) # Apply the conditions if zero_count == n: print(0) elif zero_count == 0: print(1) # Exactly one zero or no zero...
2049A
wrong_submission
306,103,168
PyPy 3
WRONG_ANSWER on test 4
n = int(input()) L = [] for i in range(n): a = int(input()) L1 = list(map(int,input().split())) str1 = '' for i in L1: str1 += str(i) if L1.count(0) == len(L1): L.append(0) elif L1.count(0) == 0: L.append(1) elif str1.strip('0').count('0') != 0: L.append(2) ...
2049A
wrong_submission
297,464,672
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): n=int(input()) l=list(map(int,input().split())) if len(set(l))==1 and l[0]==0: print(0) else: k=0 for i in range(n): if l[i]==0: if i!=0: try: if l[i-1]!=0 and l[i+1]!=0: ...
2049A
wrong_submission
299,434,164
Java 8
WRONG_ANSWER on test 2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int i=sc.nextInt(); sc.nextLine(); for(int z=1;z<=i;z++) { int n=sc.nextInt(); sc.nextLine(); int ar[]=new int[n]; String ...
2049A
wrong_submission
299,136,019
PyPy 3-64
WRONG_ANSWER on test 2
# -------------------------------------------------------------------------------- # होइहि सोइ जो राम रचि राखा। को करि तर्क बढ़ावै साखा॥ # अस कहि लगे जपन हरिनामा। गईं सती जहँ प्रभु सुखधामा॥ # -------------------------------------------------------------------------------- # Author : Shivam Mishra # Date : 28t...
2049A
wrong_submission
300,638,501
PyPy 3-64
WRONG_ANSWER on test 2
t=int(input()) for _ in range(t): n=int(input()) a=list(map(int,input().split())) if n<4: if n==1: if a[0]==0: print(0) else: print(1) elif n==2: if sum(a)==0: print(0) else: pri...
2049A
wrong_submission
297,481,794
PyPy 3-64
WRONG_ANSWER on test 2
t = int(input()) for i in range(t): n= int(input()) a = list(map(int , input().split())) # print(a) count =0 for i in range(n): if a[i] != 0: count =1 for j in range(i+1,n): if a[j] == 0: for k in range(j+1,n): ...
2049A
wrong_submission
297,475,673
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class div2_166 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); sc.nextLine(); while (t-- > 0) { int n = sc.nextInt(); sc.nextLine(); ArrayList<Integer> arr = new Arr...
2049A
wrong_submission
297,464,749
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while (t--) { int n; cin>>n; vector<int>a(n); for (int i = 0; i < n; i++) { cin>>a[i]; } int zeros=0; for (int i =...
2049A
wrong_submission
297,491,257
PyPy 3-64
WRONG_ANSWER on test 2
def mex(b): c=0 while c in b: c=c+1 return c t=int(input()) for _ in range(t): n=int(input()) arr=list(map(int,input().split())) if arr.count(0)==n: print(0) elif 0 not in arr: print(1) else: if arr[0]==0 and arr[-1]!=0: if 0 in arr[1:n-1]...
2049A
wrong_submission
297,516,065
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): n = int(input()) all_zeros = True mid_zero = False for i, num in enumerate(input().split()): num = int(num) if num == 0: if i != 0 and i != n - 1: mid_zero = True else: all_zeros = False if all_zero...
2049A
wrong_submission
299,408,360
Java 8
WRONG_ANSWER on test 2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); sc.nextLine(); for (int z = 1; z <= i; z++) { int n = sc.nextInt(); sc.nextLine(); int ar[] = new in...
2049A
wrong_submission
300,558,579
Java 21
WRONG_ANSWER on test 2
import java.util.*; import java.io.*; import java.math.*; public class CodeChef { public static int abs(int a) { return Math.abs(a); } public static int max(int a,int b) { return Math.max(a,b); } public static int min(int a,int b) { return Math.min(a,b); } public static double floor(double a) { return Math.floor(a); ...
2049A
wrong_submission
297,575,548
PyPy 3-64
WRONG_ANSWER on test 2
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) mid = False for i in range(1,n-1): if a[i]==0: mid = True break all0 = True # check if all 0s for i in range(n): if a[i]!=0: all0 = False ...
2049A
wrong_submission
297,535,534
PyPy 3-64
WRONG_ANSWER on test 2
cases=int(input()) for test in range(cases): n=int(input()) arr=list(map(int, input().split())) if arr.count(0)==len(arr): print(0) continue if arr.count(0)==0: print(1) continue if arr[0]!=0 and arr[-1]!=0 and arr.count(0)==(len(arr)-2): print(2) ...
2049A
wrong_submission
297,590,520
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class A_MEX_Destruction { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int arr[] = new int[n]; int f = -1, l =n; ...
2049A
wrong_submission
297,472,593
PyPy 3-64
WRONG_ANSWER on test 2
from collections import defaultdict, deque from itertools import permutations, combinations import heapq import math from bisect import bisect_right, bisect_left string = lambda: input().strip() n_int = lambda: int(input()) m_int = lambda: map(int, input().split()) array = lambda: list(map(int, input().split())) ...
2049A
wrong_submission
297,478,741
PyPy 3-64
WRONG_ANSWER on test 4
t = int(input()) for i in range(t): n = int(input()) a = "".join(input().split()) a = a.lstrip("0") a = a.rstrip("0") a = list(map(int, a)) if a == []: print(0) continue if 0 in a: print(2) else: print(1)
2049A
wrong_submission
297,465,131
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): n=int(input()) l=[int(x) for x in input().split()] s=set(l) if s=={0}: print(0) else: if l.count(0)==0: print(1) elif l.count(0)==1: if l.index(0)==0 or l.index(0)==n-1: print(1) else: ...
2049A
wrong_submission
297,472,322
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class A_MEX_Destruction { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); for (int i = 0; i < t; i++) { int n = scanner.nextInt(); int[] a = new int[n]; int mex ...
2049A
wrong_submission
297,511,259
Java 21
WRONG_ANSWER on test 2
import java.util.*; import java.lang.*; import java.io.*; public class codechef { 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(); } ...
2049A
wrong_submission
299,798,055
PyPy 3-64
WRONG_ANSWER on test 2
def Fn(a): if sum(a)==0: return 0 for i in range(len(a)): if a[i]!=0: a[i]=1 if sum(a)==len(a): return 1 for index,number in enumerate(a): if number==0: if index==0 or index==len(a)-1: continue else: ...
2049A
wrong_submission
300,397,343
Java 21
WRONG_ANSWER on test 2
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); long[] ans1 = new long[t]; for (int i = 0; i < t; i++) { int n =...
2049A
wrong_submission
297,469,836
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class Main { static int abhimanyu(int n, int arr[]){ int zeroes = 0; boolean mid = false; for(int i = 0; i<n; i++) { if(i > 0 && i < n-1 && arr[i] == 0) mid = true; if (arr[i] == 0) zeroes++; } if(zeroes == n) return 0; ...
2049A
wrong_submission
297,481,094
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): num = int(input()) l=list(map(int,input().split(' '))) if(list(set(l))==[0]): print(0) elif(0 not in l): print(1) else: i=0 j=num-1 if((l[0]==0)^(l[num-1]==0)): print(1) else: if(l[0]==0 and l[num-1...
2049A
wrong_submission
297,462,512
PyPy 3-64
WRONG_ANSWER on test 4
from sys import stdin input = stdin.readline from collections import defaultdict,deque,Counter from bisect import bisect_left,bisect_right from heapq import heappush,heappop,heapify from functools import lru_cache from itertools import accumulate, permutations, combinations from math import * ii = lambda: int(input...
2049A
wrong_submission
297,469,030
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) allzeros = True middlezero = False cnt = 0 for i in range(n): if a[i] != 0: allzeros = False cnt += 1 else: if i != 0 and i != n - 1: middlezero ...
2049A
wrong_submission
297,496,196
PyPy 3-64
WRONG_ANSWER on test 2
T=int(input()) for _ in range(T): t=int(input()) lane=list(map(int,input().strip().split())) n=0 count=0 for i in range(t): if i==t-1 and lane[i]!=0: count+=1 elif lane[i]!=0 and n==0: n=1 elif lane[i]==0 and n==1: count+=1 if count<=2:...
2049A
wrong_submission
297,477,560
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 n = sc.nextInt(); int[] arr = new int[n]; int zero = 0; for(int i=0;i<n;i++){ arr[i] = sc.nextInt(); if(arr[i]...
2049A
wrong_submission
297,544,992
PyPy 3-64
WRONG_ANSWER on test 2
def main(f): final_list=[] for _ in range(f): e=int(input()) a=list(map(int,input().split())) n=0 if all(x==0 for x in a): pass else: for i in range(1): if a[0]==0: if a[-1]==0: ...
2049A
wrong_submission
297,464,172
PyPy 3-64
WRONG_ANSWER on test 2
def INT(): return int(input()) def MAP(): return map(int, (input().split())) def MAT(n): return [list(map(int, (input().split()))) for _ in range(n)] for _ in range(INT()): n=INT() a=list(MAP()) if n==1: print(0 if a[0]==0 else 1) continue if 0 in a: l=a.index(0) else: ...
2049A
wrong_submission
297,471,511
Java 21
WRONG_ANSWER on test 2
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while(t --> 0) { int n = in.nextInt(); int[] arr = new int[n]; for(int i=0; i<n; i++) arr[i] = in.nextInt(); ...
2049A
wrong_submission
297,508,397
PyPy 3-64
WRONG_ANSWER on test 2
t = int(input()) final = [] def ans(n, arr): if arr.count(0) == n: return 0 if 0 not in arr: return 1 if arr.count(0) == 1 and (arr[0] == 0 or arr[-1] == 0): return 1 if arr.count(0) == 1 and arr[0] != 0 and arr[-1] != 0: return 2 if arr.count(0) == 2: if ar...
2049A
wrong_submission
297,527,455
Java 21
WRONG_ANSWER on test 4
import java.util.*; public class A_MEX_Destruction { 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 ar[]=new int[n]; StringBuilder str=new StringBuilder(...
2049A
wrong_submission
302,603,904
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define int long long #define loop(i,startFrom,endBefore) for (int i = startFrom; i < endBefore; i++) #define loopR(i,startFrom,endAt) for (int i = startFrom; i >= endAt; i--) #define inputV(v) for(ll ii...
2049A
wrong_submission
299,816,938
Java 8
WRONG_ANSWER on test 2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in =new Scanner(System.in); int t=in.nextInt(); while (t-- > 0) { int n = in.nextInt() ,z=0; int[] arr=new int[n]; for(int i=0 ; i < n ; i++) ...
2049A
wrong_submission
297,462,364
PyPy 3-64
WRONG_ANSWER on test 2
for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) occur0= [] cnt0 = 0 for i in range(len(a)): if a[i] == 0: occur0.append(i) cnt0 += 1 if cnt0 == n: print(0) elif cnt0 == 0: print(1) elif cnt0 == 1: ...
2049A
wrong_submission
297,463,479
Java 21
WRONG_ANSWER on test 2
import java.util.Scanner; public class F { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); while (N-- > 0) { int length = scanner.nextInt(); if (length == 1) { if (scanner.nextInt() == 0) ...
2049A
wrong_submission
297,507,355
Java 21
WRONG_ANSWER on test 2
// हर हर महादेव import java.io.*; import java.util.*; public class Solution { static final int MOD = 1000000007; static final int MOD1 = 998244353; static final long INF = (long)1e18; public static void main(String[] args) { try { // For local testing: Redirect input and outp...
2049A
wrong_submission
297,473,365
Java 21
WRONG_ANSWER on test 2
import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.util.InputMismatchException; public class Codeforces_Round_994_Div_2 { static Scanner in = new Sca...
2049A
wrong_submission
297,491,565
C++23 (GCC 14-64, msys2)
WRONG_ANSWER on test 2
#include<bits/stdc++.h> #include<iostream> #include<vector> #include<stack> #include<map> #include<queue> #include<algorithm> #include<set> #define mod 1000000007 #define ll long long using namespace std; ll max(ll a,ll b) { return a>=b?a:b; } ll min(ll a,ll b) { return a<=b?a:b; } ll divi(ll a,ll b) { if...
2049A
wrong_submission
297,612,405
C++20 (GCC 13-64)
WRONG_ANSWER on test 2
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define vs vector<string> #define vb vector<bool> #define pb push_back #define pii pair<int, int> #define vpi vector<pii> #define M 1000000007 #define endl "\n" // #define int long long int #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(...
2049A
wrong_submission