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 |
|---|---|---|---|---|---|
304,787,042 | Java 21 | WRONG_ANSWER on test 2 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import static java.lang.Math.*;
public class Solution {
private static final boolean USE_TESTCASES = true;
public static void main(String[] marcoIsAGenius) {
... | 2031A | wrong_submission |
304,535,593 | Python 3 | WRONG_ANSWER on test 2 | def min_operations(pillar_heights):
operations = 0
prev_height = 1
for height in pillar_heights:
if height < prev_height:
operations += prev_height - height
prev_height = height
return operations
t = int(input())
for _ in range(t):
n = int(input())
pillar_heights = ... | 2031A | wrong_submission |
296,241,880 | Python 3 | WRONG_ANSWER on test 2 | from collections import Counter
v = int(input(""))
l2 = []
for i in range(v):
s = int(input(""))
l = list(map(int,input().split()))
l1 = set(l)
l1 = list(l1)
count = 0
if len(l1) == len(l):
for i in range(len(l)):
if l1[i] != l[i]:
count+=1
l2.append(c... | 2031A | wrong_submission |
291,623,323 | Python 3 | WRONG_ANSWER on test 2 | def min_operations_to_non_decreasing(n,h):
operations = 0
for j in range(1, n):
if h[j] < h[j - 1]:
operations += 1
h[j] = h[j - 1]
return operations
for _ in range(int(input())):
n=int(input())
h=list(map(int,input().split()))
print(min_operations_to_... | 2031A | wrong_submission |
295,805,682 | Python 3 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n=int(input())
vec=[int(x) for x in input().split()]
mas=0
con=1
for i in range(n-1):
if vec[i]==vec[i+1]:
con+=1
else:
mas=max(mas,con)
mas=max(mas,con)
print(n-mas) | 2031A | wrong_submission |
291,648,542 | 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 t=sc.nextInt();
while(t-->0) {
int n=sc.nextInt();
int arr[]=new int[n];
for(int i=0;i<n;i++){
arr[i]=sc.nextInt... | 2031A | wrong_submission |
291,625,089 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class A {
public static void main(String[] args) {
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++){
heig... | 2031A | wrong_submission |
304,222,172 | Java 21 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt(); // Number of test cases
while (t-- > 0) {
int n = scanner.nextInt(); // Number of pillars
int[] h = new int... | 2031A | wrong_submission |
291,612,076 | PyPy 3-64 | WRONG_ANSWER on test 2 | n = int(input())
for _ in range(n):
k = int(input())
lis = list(map(int, input().split()))
ans = 1
left = 0
cnt = 1
for i in range(1, k-1):
if lis[i] == lis[left]:
cnt += 1
else:
ans = max(ans, cnt)
left = i
cnt = 1
print(k - ma... | 2031A | wrong_submission |
295,352,456 | Python 3 | WRONG_ANSWER on test 2 | p=int(input())
ll=[]
for i in range (p):
c=0
t=0
g=int(input())
l=input().split(' ')
for j in range(g):
f=int(l[0])
if int(l[j])<f:
c+=1
for j in range(g):
f=int(l[-1])
if int(l[j])>f:
t+=1
if t<c:
c=t
ll.append(c)
fo... | 2031A | wrong_submission |
291,586,304 | PyPy 3-64 | WRONG_ANSWER on test 2 | from sys import stdin
from math import ceil as ce,lcm,gcd,sqrt
input = lambda: stdin.readline().rstrip()
def is_prime(x):
if x <= 2:
return True
i = 2
while i * i <= x:
if x % i == 0:
return False
i += 1
return True
for _ in range(int(input())):
n = int(in... | 2031A | wrong_submission |
291,640,061 | PyPy 3-64 | WRONG_ANSWER on test 2 | def solve():
t = int(input())
for _ in range(t):
n = int(input())
hskatienoob = list(map(int, input().split()))
iamkatienoobdunnotheanswer = 0
maximkatienooob = hskatienoob[0]
for i in range(1, n):
if hskatienoob[i] < maximkatienooob:
iamkatien... | 2031A | wrong_submission |
291,613,382 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
int[] h = new int[n];
for (int i = 0; i < n; i++) {
... | 2031A | wrong_submission |
292,207,617 | Python 3 | WRONG_ANSWER on test 2 | for q in range(int(input())):
n = int(input())
h = set(map(int, input().split()))
print(len(h)-1) | 2031A | wrong_submission |
291,625,101 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n = int(input())
res = 0
zxc = list(map(int, input().split()))
for i in range(n - 1):
if zxc[i] > zxc[i + 1]:
res += 1
zxc[i + 1] = zxc[i]
print(res) | 2031A | wrong_submission |
291,931,578 | Python 3 | WRONG_ANSWER on test 2 | n = int(input())
for x in range(n):
k = int(input())
lst = list(map(int, input().split()))
start = lst[0]
cnt = 0
for x in lst:
if start > x:
cnt += 1
print(cnt) | 2031A | wrong_submission |
291,607,136 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class A {
public static void main(String[] args) {
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++){
heig... | 2031A | wrong_submission |
291,639,087 | 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 a[]=new int[n];
for(int i=0;i<n;i++)
{
a[... | 2031A | wrong_submission |
291,591,857 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split(' ')))
mx = a[0]
c = 0
for i in range(1,n):
# print('i',i)
if mx>a[i]:
c +=1
mx = max(a[i],mx)
print(c) | 2031A | wrong_submission |
291,666,348 | Java 8 | WRONG_ANSWER on test 2 | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-- !=0){
int n=sc.nextInt();
int[] arr=new int[n];
int min=Integer.MAX_VALUE;
int max=Integer.MIN_VAL... | 2031A | wrong_submission |
291,589,053 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for i in range(t):
h = int(input())
k = list(map(int,input().split()))
print(k[0]-k[-1]) | 2031A | wrong_submission |
291,618,569 | Python 3 | WRONG_ANSWER on test 2 | t=int(input())
for _ in range(t):
n=int(input())
h=list(map(int,input().split(" ")))
le=len(h)
mle=le*-1
if len(h)==1:
print(0)
continue
else:
c=0
for i in range(n-1):
if h[i]>h[i+1]:
c+=1
h[i],h[i+1]=h[i+1],h[i]
... | 2031A | wrong_submission |
291,605,472 | 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 a[]=new int[n];
for(int i=0;i<n;i++)
{
a[... | 2031A | wrong_submission |
291,618,701 | Python 3 | WRONG_ANSWER on test 2 | def INT():
return int(input())
def STR():
return str(input())
def il():
return list(map(int,input().split()))
def sl():
return list(map(str,input().split()))
def im():
return map(int,input().split())
def smap():
return map(str,input().split())
def out(a):
print(a)
def out2(a,b):
print(a,... | 2031A | wrong_submission |
292,128,195 | 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()))
ans = 0
last = a[0]
for i in a:
if i < last:
ans += 1
last = i
print(ans) | 2031A | wrong_submission |
291,591,095 | Python 3 | RUNTIME_ERROR on test 2 | t=int(input())
for i in range(t):
n=int(input())
l=list(map(int, input().split()))
c=1
cl=[]
if n>1:
for j in range(n-1):
if l[j]==l[j+1]:
c+=1
else:
cl.append(c)
c=1
cl.sort(reverse=True)
print(n-cl[0])
... | 2031A | wrong_submission |
291,588,668 | Python 3 | WRONG_ANSWER on test 2 | num = int(input())
for x in range(num):
count = 0
pil_num = int(input())
pil = list(map(int, input().split()))
pil.sort()
# print(pil)
for x in range(1, len(pil)):
if pil[x] > pil[x - 1]:
count += 1
print(count) | 2031A | wrong_submission |
297,103,318 | Python 3 | WRONG_ANSWER on test 2 | import collections
n=int(input(''))
for i in range(n):
a=int(input(''))
l=[int(x) for x in input().split()]
t=0
for i in range(a-1):
if l[i]==l[i+1]:
t+=1
else:
break
print(a-t-1) | 2031A | wrong_submission |
296,044,709 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
n=int(input())
l=list(map(int,input().split()))
s = set(l)
print(len(s)-1) | 2031A | wrong_submission |
291,664,425 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class CD1511B {
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];
Set<Integer> set = new HashSet<>();
for(int i = 0; i < n ; i++... | 2031A | wrong_submission |
291,596,611 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for i in range(t):
n = int(input())
h = list(map(int, input().split()))
if n == 1:
print(0)
else:
for i in range(n):
if i == n-1:
print(0)
break
elif h[i] != h[i+1]:
print(n-1-(... | 2031A | wrong_submission |
292,446,597 | C++20 (GCC 13-64) | WRONG_ANSWER on test 2 | #include<bits/stdc++.h>
using namespace std;
const int N=5e5;
int n,a[N];
void solve(){
cin>>n;
map<int,int> mp;
for(int i=1;i<=n;i++){
cin>>a[i];
mp[a[i]]=1;
}
cout<<mp.size()-1<<'\n';
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
int t=1;
cin>>t;
while(t--){
solve();
}
return 0;
... | 2031A | wrong_submission |
291,592,780 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 2 | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 3e5+9;
int a[N], b[N];
void haha()
{
int n;cin >> n;int cnt =0;
if(n == 1) cnt = 0;
else if(n == 2)
{
if(a[1] > a[2]) cnt = 1;
}
else if(n >= 3)
{
for(int i = 1; i <= n; i++)
{
cin >> a[i];
b[i] = a[i];
}
sort(b+1,... | 2031A | wrong_submission |
295,352,003 | PyPy 3-64 | WRONG_ANSWER on test 2 | test_times=int(input())
sve=[]
for i in range(test_times):
lenth=int(input())
pillars=input().split()
pillars=[int(m) for m in pillars]
def sort_pillars(pillars):
times=0
mark=(len(pillars))//2
for m in range(len(pillars)):
if m<mark:
if pillars[m]>p... | 2031A | wrong_submission |
292,335,364 | PyPy 3-64 | WRONG_ANSWER on test 2 | t=int(input())
l=[]
for i in range(0,t):
a=0
n=int(input())
p=list(map(int,input().split()))
if len(p)==1:
l.append(0)
else:
s=set(p)
s=list(s)
for j in range(0,len(s)):
if p.count(s[j])>1:
a+=1
else:
a+=0
... | 2031A | wrong_submission |
291,592,456 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class Solution {
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];
for (int i = 0; i < n; i++) {
ar... | 2031A | wrong_submission |
291,748,496 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n,t;
cin>>t;
while(t--){
int c1=0,c2=0;
cin>>n;
int h[n];
for(int i=0;i<n;i++){
cin>>h[i];
}
for(int i=n/2-1;i>=0;i--){
if(h[i]!=h[n/2])
c1++... | 2031A | wrong_submission |
291,578,262 | PyPy 3-64 | WRONG_ANSWER on test 2 | import sys, math
from collections import *
from bisect import *
from types import GeneratorType
from random import randrange
MOD = 1000000007
# MOD = 998244353
RANDOM = randrange(2**62)
def wrap(x):
return x ^ RANDOM
def bootstrap(f, stack=[]):
def wrappedfunc(*args, **kwargs):
if stack:
... | 2031A | wrong_submission |
291,584,046 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n = int(input())
h = list(map(int, input().split()))
count = 0
for i in range(1, n):
if h[i] < h[i - 1]:
count += 1
print(count) | 2031A | wrong_submission |
292,382,085 | PyPy 3-64 | WRONG_ANSWER on test 2 | n = int(input())
for i in range(n):
m = int(input())
arr = []
distinct = []
prev = -1
arr = [int(x) for x in input().split()]
for i in range(len(arr)):
if (arr[i] != prev):
distinct.append(arr[i])
prev = arr[i]
def find_most_common_number():
winner = 0
max_count = -1
fo... | 2031A | wrong_submission |
291,624,305 | PyPy 3-64 | WRONG_ANSWER on test 2 | import collections
# 2 2 1-> op = 1
# 2 1 1-> op = 2
# 2 2 1 1 1 -> 3
def solve(n,h):
fq = collections.Counter(h)
res = []
for key,val in fq.items():
res.append([key,val])
res.sort()
# print(res,res[-1,[1]])
return n - res[-1][1]
t = int(input())
for _ in ran... | 2031A | wrong_submission |
291,636,954 | Java 21 | WRONG_ANSWER on test 2 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new I... | 2031A | wrong_submission |
291,589,592 | Java 21 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
for(int i = 0;i<n;i++){
int w = input.nextInt();
int [] arr = new int [w];
for(int j = 0;j<w;j++){
arr[j] = i... | 2031A | wrong_submission |
291,603,842 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class Penchick {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int testCase =sc.nextInt();
for(int z=0;z<testCase;z++){
int size = sc.nextInt();
int count=0;
int a = sc.nextInt();
for(in... | 2031A | wrong_submission |
291,624,063 | Java 8 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class file {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
for (int tc = 0; tc < t; tc++) {
int n = scanner.nextInt();
int[] heights = new int[n];
for (int... | 2031A | wrong_submission |
291,655,257 | Java 21 | WRONG_ANSWER on test 2 | // Online Java Compiler
// Use this editor to write, compile and run your Java code online
import java.util.*;
public class a {
public static void main(String[] args) {
Scanner sc= new Scanner (System.in);
int t=sc.nextInt();
while(t>0)
{
int n= sc.nextInt();
... | 2031A | wrong_submission |
291,614,578 | 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();
while (t-- > 0) {
int n = sc.nextInt();
int[] h = new int[n];
for (int i = 0; i < n; i++) {
... | 2031A | wrong_submission |
291,585,565 | PyPy 3-64 | WRONG_ANSWER on test 2 | for i in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(n-1):
if l[i]>l[i+1]:
if((i+1)!=(n-1)):
l[i+1]=max(l[i],l[i+2])
c+=1
print(c) | 2031A | wrong_submission |
291,728,258 | PyPy 3-64 | WRONG_ANSWER on test 2 | from typing import List
from bisect import *
from collections import *
from itertools import *
from math import *
from functools import *
from string import *
from heapq import *
from random import randint
from types import *
from sys import *
setrecursionlimit(100000)
M = 10**9 + 7
SALT = randint(1, 10**9)
for _... | 2031A | wrong_submission |
291,641,507 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class Sample
{
public static void main(String[] args)throws Exception
{
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++)
{
... | 2031A | wrong_submission |
291,577,892 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
n = int(input())
c = list(map(int, input().split()))
s = 0
for i in range(1, n):
if c[i] != c[i - 1]:
s += 1
print(s) | 2031A | wrong_submission |
291,618,027 | PyPy 3-64 | WRONG_ANSWER on test 2 | t=int(input())
for _ in range(t):
n=int(input())
arr=list(map(int,input().split()))
print(len(list(set(arr)))-1) | 2031A | wrong_submission |
292,975,751 | PyPy 3-64 | WRONG_ANSWER on test 2 | def solve():
n = int(input())
h = list(map(int, input().split()))
min = 0
for i in range(n):
if i+1 < n:
if h[i] > h[i+1]:
min += 1
print(min)
t = int(input())
for _ in range(t):
solve() | 2031A | wrong_submission |
291,636,584 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
n = int(input())
l = list(map(int, input().split()))
a = 0
l2 = []
if n == 1:
print(0)
else:
for i in l:
l2.append(l.count(i))
m = max(l2)
if m <= 2:
print(n-m)
else:
print(min(m, n-m)) | 2031A | wrong_submission |
291,616,526 | PyPy 3-64 | WRONG_ANSWER on test 2 | import sys
from heapq import *
from bisect import bisect_left, bisect_right
from os import path
from math import sqrt, gcd, factorial, log
from io import BytesIO, IOBase
from collections import defaultdict, Counter, deque
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
... | 2031A | wrong_submission |
291,579,859 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n = int(input())
h = list(map(int,input().split()))
re = 0
for i in range(1,n):
if h[i]<h[i-1]:
re+=1
print(re) | 2031A | wrong_submission |
291,598,509 | Java 21 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.*;
public class CF {
static class FastIO {
BufferedReader br;
StringTokenizer st;
public FastIO() {
br = new BufferedReader(new InputStreamReader(System.in));
st = new StringTokenizer("");
}
String next() {
... | 2031A | wrong_submission |
291,586,612 | Java 21 | 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 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++){
... | 2031A | wrong_submission |
291,793,685 | PyPy 3-64 | WRONG_ANSWER on test 2 | def solve():
n = int(input())
height = list(map(int, input().split()))
ans = 0
for i in range(1,n):
if height[i-1]>height[i]:
ans+=1
print(ans)
t = int(input())
for i in range(0,t):
solve() | 2031A | wrong_submission |
291,606,830 | Java 8 | WRONG_ANSWER on test 2 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class PenchickAndModern {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
Pr... | 2031A | wrong_submission |
291,682,155 | Java 21 | WRONG_ANSWER on test 2 | /******************************************************************************
Online Java Compiler.
Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.
***************************************************... | 2031A | wrong_submission |
291,601,931 | PyPy 3-64 | WRONG_ANSWER on test 2 | from collections import Counter
def split_segments(arr):
res, seg = [], []
for n in arr:
if not seg or n >= seg[-1]:
seg.append(n)
else:
res.append(seg)
seg = [n]
if seg:
res.append(seg)
return res
for _ in range(int(input())):
n = int(... | 2031A | wrong_submission |
291,585,673 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n = int(input())
h = list(map(int, input().split()))
count = 0
for i in range(1, n):
if h[i-1] > h[i]:
h[i] = h[i-1]
count += 1
print(count) | 2031A | wrong_submission |
291,600,936 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
n = int(input())
h = list(map(int, input().split()))
operations = 0
for i in range(1, n):
if h[i] < h[i - 1]:
operations += 1
h[i] = h[i - 1]
print(operations) | 2031A | wrong_submission |
291,638,888 | Java 21 | 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 t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
int[] h = new int[n];
for (int i = 0; i < n; i++) {
... | 2031A | wrong_submission |
291,604,001 | Java 21 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class penchick{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t,n;
t=sc.nextInt();
for(int i=0;i<t;i++){
n=sc.nextInt();
int[] arr=new int[n];
int maxct=1;
int currct=... | 2031A | wrong_submission |
291,610,286 | Java 21 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class Main{
public static int minOperations(int[] h) {
int operations = 0;
int prev = h[0];
for (int i = 1; i < h.length; i++) {
if (h[i] > prev) {
continue;
}
operations += prev - h[i];
prev =... | 2031A | wrong_submission |
291,595,293 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class Ques1
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int t,z,i,n,l,c,opr;
t=sc.nextInt();
for(z=1;z<=t;z++)
{
n=sc.nextInt();
int h[]=new int[n];
for(i=0;i<n;i++)
... | 2031A | wrong_submission |
293,658,173 | PyPy 3-64 | WRONG_ANSWER on test 2 | from math import ceil, floor
ii = lambda: int(input())
il = lambda: list(map(int, input().split()))
isc = lambda: list(input())
for _ in range(ii()):
n = ii()
arr = il()
d = 0
for i in range(n - 1):
if arr[i] == arr[i+1]:
d += 1
print(n - 1 - d) | 2031A | wrong_submission |
291,639,886 | PyPy 3-64 | WRONG_ANSWER on test 2 | results=[]
def funn(n,li):
count=0
if len(li)==1:
count=0
return count
else:
for j in range(n-1):
if li[j+1]<li[j]:
count +=1
li[j+1]=li[j]
return count
t=int(input())
for i in range(t):
n=int(input())
li=list(map(int,input().split()))
results.append(funn(n,li))
for ... | 2031A | wrong_submission |
291,601,428 | PyPy 3-64 | WRONG_ANSWER on test 2 | import collections
import random
def solve():
n = int(input())
rand = random.randint(0, 10000)
list_h = list(map(int, input().split()))
list_h = [str(h + rand) for h in list_h]
counter = collections.Counter(list_h)
unique_values = sorted(counter.keys(), reverse=True, key=lambda x: int(x))
cn... | 2031A | wrong_submission |
291,591,843 | PyPy 3-64 | WRONG_ANSWER on test 2 | def problem2031A() -> int:
n = int(input())
h = list(map(int, input().split(' ')))
left = 0
right = 0
for h_i in h:
if h_i == h[0]:
left += 1
if h_i == h[-1]:
right += 1
return min(n - left, n - right)
test_cases = int(input())
for _ in range(test_ca... | 2031A | wrong_submission |
291,602,726 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
import java.io.*;
public class test {
static Scanner sc = new Scanner(System.in);
static PrintWriter pw = new PrintWriter(System.out);
static final int mod = 1000000007;
//-----------------------------------------------------------------------------
public static void main (S... | 2031A | wrong_submission |
300,546,064 | PyPy 3-64 | WRONG_ANSWER on test 2 | import statistics
ran = int(input())
for _ in range(ran):
n = int(input())
l = list(map(int,input().split()))
mdn = statistics.median(l)
c = 0
for i in l:
if (abs(mdn-i)!=0):
c += 1
print(c) | 2031A | wrong_submission |
291,665,138 | Java 8 | WRONG_ANSWER on test 2 | // package extra;
import java.util.*;
public class hbhb {
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];
for(int i = 0; i < n; i++) arr[i] = sc.nextInt();
int ans = 0;
for(int i = 1... | 2031A | wrong_submission |
297,654,330 | Java 21 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class Penchick_and_Modern_Monument {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
int t = sc.nextInt();
int[] k = new int[t];
... | 2031A | wrong_submission |
291,737,233 | Java 8 | WRONG_ANSWER on test 2 | import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
int a[]=new int[n];
for(int i=0;i<n;i++){
a[i]=sc.nextInt();
}
int ans=0;
for... | 2031A | wrong_submission |
291,593,814 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n=int(input())
arr=list(map(int,input().split()))
c=0
for i in range(n-1):
if arr[i]>arr[i+1]:
c+=1
arr[i+1]=arr[i]
print(c) | 2031A | wrong_submission |
291,619,487 | Java 21 | WRONG_ANSWER on test 2 | // Source: https://usaco.guide/general/io
import java.io.*;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
int t = Integer... | 2031A | wrong_submission |
296,029,929 | PyPy 3-64 | WRONG_ANSWER on test 2 | for i in range(int(input())):
a=int(input())
l=list(map(int,input().split()))
count = 0
for i in range(a - 1):
if l[i] > l[i + 1]:
count += 1
print(count) | 2031A | wrong_submission |
291,662,494 | PyPy 3-64 | WRONG_ANSWER on test 2 | import sys, threading
import math
from os import path
from collections import deque, defaultdict, Counter
from bisect import *
from string import ascii_lowercase
from functools import cmp_to_key
from random import randint
from heapq import *
from array import array
from types import GeneratorType
def readInts():
... | 2031A | wrong_submission |
291,577,202 | Java 21 | WRONG_ANSWER on test 2 | /*
Author: WORTH
Problem: Penchick and Modern Monument
*/
// Solution at end
import java.util.*;
import java.io.*;
import java.util.function.*;
public class Main {
static ContestScanner sc = new ContestScanner();
static FastWriter out = new FastWriter();
public static void main(String[] args) ... | 2031A | wrong_submission |
291,624,690 | PyPy 3-64 | WRONG_ANSWER on test 2 | class Solution:
def operation(self,n:int,h:list)->int:
ans=0
c={}
for i in h:
if i in c:
c[i]+=1
else:
c[i]=1
life=max(c)
for i in h:
if i!=life:
ans+=1
return ans
if __name__=... | 2031A | wrong_submission |
291,606,525 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class A_Penchick_and_Modern_Monument {
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[] h = new int[n];
int cnt=0;
int same=0;
int pura=0;
... | 2031A | wrong_submission |
291,763,086 | PyPy 3-64 | WRONG_ANSWER on test 2 | from functools import *
from itertools import *
from collections import *
from math import *
from bisect import *
from heapq import *
def factors(n):
i = 1
res = []
while i <= sqrt(n):
if (n % i == 0):
if (n / i == i):
res.append(i)
else:
res... | 2031A | wrong_submission |
292,080,466 | PyPy 3-64 | WRONG_ANSWER on test 2 | t=int(input())
while t>0:
t-=1
n=int(input())
lst=list(map(int,input().split()))
result=n-1
if n!=1:
for i in range(0,n-1):
if lst[i]==lst[i+1]:
result-=1
print(result) | 2031A | wrong_submission |
291,586,822 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef {
private static void solve(Scanner sc) {
int n = sc.nextInt();
if (n == 1) {
System.out.println(0);
return;
}
int[] arr = new int[n];
for (int i = 0; i < n; i++) arr[i] ... | 2031A | wrong_submission |
294,314,227 | PyPy 3-64 | WRONG_ANSWER on test 2 | a = int(input())
lis = []
for i in range(a):
store = int(input())
b = list(map(int,input().split()))
lis.append(b)
for i in lis:
req = i[0]
re = len(i)
for k in i:
if(k == req):
re -= 1
print(re) | 2031A | wrong_submission |
291,644,126 | PyPy 3 | WRONG_ANSWER on test 2 | t=int(input())
l=[]
while(t!=0):
t=t-1
n=int(input())
h=[]
m=input().split(" ")
for i in m:
h.append(int(i))
k=[]
k.extend(h)
c=0
for i in range(n-1):
if h[i]==h[i+1]:
c=c+1
l.append(n-(c+1))
for i in l:
print(i) | 2031A | wrong_submission |
291,652,367 | PyPy 3 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
N = int(input())
H = list(map(int, input().split()))
if N == 1:
print(0)
continue
T = H[:]
ans = 0
a = b = 0
for i in range(N-1):
if H[i] <= H[i+1]: continue
H[i+1] = H[i]
a += 1
for i in range(N-1):
if T[-i-1] >= T[-i-2]: continue
T[-i-2] ... | 2031A | wrong_submission |
291,588,772 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n = int(input())
arr = list(map(int, input().split()))
cnt = 0
expected = 1
for i in arr:
if i < expected:
cnt += 1
else:
expected = i
print(cnt) | 2031A | wrong_submission |
291,651,032 | PyPy 3 | WRONG_ANSWER on test 2 | import sys
# from io import StringIO
def main():
input = sys.stdin.read
data = input().splitlines()
index = 0
t = int(data[index])
index += 1
for _ in range(t):
n = int(data[index])
index += 1
heights = list(map(int, data[index].split()))
index += 1
... | 2031A | wrong_submission |
296,380,537 | PyPy 3-64 | WRONG_ANSWER on test 2 | # PyRival PyPy3 Fast IO
import math
import os
import sys
from io import BytesIO, IOBase
def main():
pass
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._file = file
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in fil... | 2031A | wrong_submission |
304,215,755 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
n = int(input())
lst = list(map(int, input().split()))
ans = 0
for i in range(1,n):
if lst[i] < lst[i-1]:
ans += 1
print(ans) | 2031A | wrong_submission |
291,832,844 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n = int(input())
heights = list(map(int, input().split()))
def find(n , arr):
freqCnt = 0
prev = -1
maxFreq = 1
for i in range(n):
if arr[i] == prev:
freqCnt += 1
else:
maxFreq = max(ma... | 2031A | wrong_submission |
291,584,072 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
h = int(input())
l = list(map(int,input().split()))
countr = 0
for i in range(h-1):
if l[i] > l[i+1]:
countr += 1
print(countr) | 2031A | wrong_submission |
291,677,286 | 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 n;
cin>>n;
int v[n];
int k=0;
for(int i=0;i<n;i++){cin>>v[i];}
int count=1;
int res=1;
for(int i=0;i<n;i++){
if(v[i]==v[i+1]){count++;}
... | 2031A | wrong_submission |
291,618,513 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 2 | import sys
from math import inf
input = lambda: sys.stdin.readline().rstrip()
def solve():
n = int(input())
a = list(map(int, input().split()))
ans = inf
def dfs(i, total):
if i == n - 1:
nonlocal ans
ans = min(ans, total)
return
fo... | 2031A | wrong_submission |
295,972,764 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(1, n):
if a[i] < a[i - 1]:
s += 1
a[i] = a[i - 1]
print(s) | 2031A | wrong_submission |
291,601,088 | PyPy 3-64 | WRONG_ANSWER on test 2 | def min_operations_to_non_decreasing(t, test_cases):
results = []
for case in test_cases:
n, heights = case
operations = 0
for i in range(n - 1):
if heights[i] > heights[i + 1]:
operations += 1
heights[i + 1] = heights[i]
results.append... | 2031A | wrong_submission |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.