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 |
|---|---|---|---|---|---|---|
279,392,542 | C++20 (GCC 13-64) | OK | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int n, q; cin >> n >> q;
vector<int> cnt(n + 1, 0);
for (int i = 0; i < n; i++) {
int x; cin >> x;
cnt[x]++;
}
vector<int> pref(n + 1, 0);
for (int i = 1; i <= n; i++)
pref[i] = pref[i ... | 2008H | right_submission | none |
279,144,589 | C++20 (GCC 13-64) | OK | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
const int buc = 100;
int A[... | 2008H | right_submission | none |
279,221,950 | C++20 (GCC 13-64) | WRONG_ANSWER on test 2 | // Awwawa! Dis cold yis ratten buy kitten!
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
int n = v.size();
for (int i = 0; i < n; ++i)
os << v[i] << ' ';
return os;
}
using namespace std;
using i64 =... | 2008H | wrong_submission | easy |
279,170,772 | C++17 (GCC 7-32) | TIME_LIMIT_EXCEEDED on test 2 | /*
JAI SHREE RAM
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define ld long double
#define nl cout<<endl
#define notpos cout<<-1<<endl
#define sqrt sqrtl
#define yes cout<<"YES"<<endl
... | 2008H | wrong_submission | easy |
280,766,704 | C++20 (GCC 13-64) | RUNTIME_ERROR on test 2 | /**
* https://codeforces.com/contest/2008/submission/280763922
*
* (c) 2024 Diego Sogari
*/
#include <bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
#define debug
#else
#include "debug.h"
init();
#endif
template <typename T> ostream &operator<<(ostream &os, const vector<T> &a) {
return ranges::for_... | 2008H | wrong_submission | easy |
279,280,590 | PyPy 3-64 | WRONG_ANSWER on test 2 | def check(mid,tar,q):
cnt=0
for i in range(0,n+1,q):
if i==0:
cnt+=qzh[mid]
else:
if i+mid>n:
cnt+=qzh[n]-qzh[i-1]
continue
cnt+=qzh[i+mid]-qzh[i-1]
if cnt<tar:
return False
else:
return True
for i in r... | 2008H | wrong_submission | easy |
294,857,452 | Python 3 | WRONG_ANSWER on test 2 | def sakurako_test(t, test_cases):
results = []
for _ in range(t):
n, q = test_cases[_]['n_q']
a = test_cases[_]['a']
queries = test_cases[_]['queries']
# Precompute the remainders for each x from 1 to n
freq = [{} for _ in range(n + 1)]
for x in rang... | 2008H | wrong_submission | easy |
279,226,667 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
n, q = list(map(int, input().split()))
arr = list(map(int, input().split()))
ans = []
for _ in range(q):
k = int(input())
if k == 1:
ans.append(k-1)
continue
cs = [0]*k
r = (n+1)//2 if n%2 else (n+2)//2
... | 2008H | wrong_submission | easy |
279,235,488 | Java 8 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.*;
public class Main {
boolean MULTI_CASE = true;
boolean ALWAYS_FLUSH = false;
void go() {
int n = nextInt();
int qn = nextInt();
int[] a = new int[n];
for (int i = 0; i < a.length; ++i) a[i] = nextInt();
int[] q = new int[qn];
for (int i = 0; i < q.length... | 2008H | wrong_submission | easy |
279,173,352 | Java 8 | WRONG_ANSWER on test 2 | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.O... | 2008H | wrong_submission | easy |
280,749,662 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 7 | //In the name of God
#include<bits/stdc++.h>
/*MHN*/
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> pii;
typedef vector<lli> ve;
typedef vector<pii> vp;
const lli N=4e5+100;
const lli mod=1e9+7;//998244353;//1e9+9
const lli INF=1e18;
lli power(lli x,lli y){lli res = 1;x = ... | 2008H | wrong_submission | medium |
291,286,346 | C++17 (GCC 7-32) | RUNTIME_ERROR on test 7 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define run freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define bismillah ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pii pair<int,int>
#define f first
#define s second
int MOD=1e9+7;
int db... | 2008H | wrong_submission | medium |
282,827,411 | PyPy 3-64 | MEMORY_LIMIT_EXCEEDED on test 7 | from collections import Counter
for _ in range(int(input())):
n, Q = map(int, input().split())
medc = (n+1)//2 if n%2 else (n//2 + 1)
a = Counter(map(int, input().split()))
dp = [-1]*n
dp2 = [-1]*n
for q in range(Q):
x = int(input())
if not dp2[x-1]+1:
if not dp[x-1... | 2008H | wrong_submission | medium |
282,822,294 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 7 | def findMid(l, h, a, x, medc):
while l < h:
mid = (l+h)//2
c = sum(i%x <= mid for i in a)
if c < medc: l = mid+1
else: h = mid
return h
for _ in range(int(input())):
n, Q = map(int, input().split())
medc = (n+1)//2 if n%2 else (n//2 + 1)
a = list(map(int, input().sp... | 2008H | wrong_submission | medium |
279,211,174 | Java 8 | TIME_LIMIT_EXCEEDED on test 7 | import java.util.Scanner;
import java.util.Arrays;
public class Solution
{
int check(int l, int arr[], int x)
{
for(int i=0;i<l;i++)
{
arr[i]=arr[i]%x;
}
Arrays.sort(arr);
return arr[l/2];
}
public static void main(String args[])
{
Scanne... | 2008H | wrong_submission | medium |
279,204,192 | Java 8 | TIME_LIMIT_EXCEEDED on test 7 | import java.util.Scanner;
import java.util.Arrays;
public class Solution
{
int check(int l, int arr[], int x)
{
for(int i=0;i<l;i++)
{
arr[i]=arr[i]%x;
}
Arrays.sort(arr);
return arr[l/2];
}
public static void main(String args[])
{
Scanne... | 2008H | wrong_submission | medium |
287,173,535 | Python 3 | TIME_LIMIT_EXCEEDED on test 7 | for _ in range(int(input())):
n, m = map(int, input().split())
a = list(map(int, input().split()))
c = [0] * (n + 1)
for i in range(n):
c[a[i]] += 1
for i in range(1, n + 1):
c[i] += c[i - 1]
res = [0] * (n + 1)
for x in range(1, n + 1):
l, r = 0, ... | 2008H | wrong_submission | hard |
279,162,987 | Python 3 | TIME_LIMIT_EXCEEDED on test 7 | import sys
def calculate_median(freq, n):
count = 0
prev_count = 0
prev_index = -1
for i in range(len(freq)):
prev_count = count
prev_index = i
count += freq[i]
if n % 2 == 1:
if count >= (n + 1) // 2:
return i
else:
if co... | 2008H | wrong_submission | hard |
279,915,012 | C++17 (GCC 7-32) | TIME_LIMIT_EXCEEDED on test 8 | #pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "D:\Users\TauLee\OneDrive\Mine\c++\debug.h"
#else
#define debug(...) 42;
#define endl '\n'
#endif
void solve(int _) {
int n, q, x;
map<int, int>ans;
cin >> n >> q;
vector... | 2008H | wrong_submission | hard |
279,141,023 | C++17 (GCC 7-32) | TIME_LIMIT_EXCEEDED on test 8 | #include <bits/stdc++.h>
using namespace std;
#define lep(i, l, r) for(int i = (l); i <= (r); i ++)
#define rep(i, l, r) for(int i = (l); i >= (r); i --)
#define Lep(i, l, r) for(int i = (l); i < (r); i ++)
#define debug(...) fprintf (stderr, __VA_ARGS__)
using i64 = long long;
using ld = long double;
using LL =... | 2008H | wrong_submission | hard |
285,003,347 | Java 21 | TIME_LIMIT_EXCEEDED on test 34 | import java.io.*;
import java.math.*;
import java.util.*;
import static java.lang.Math.min;
public class H_2008 {
private static final int MAX = 200005;
public static void main(String[] args) throws IOException {
final var cin = new Reader();
final var sb = new StringBuilder();
int t = cin.nextI... | 2008H | wrong_submission | hard |
287,452,966 | Java 21 | TIME_LIMIT_EXCEEDED on test 34 | import java.io.*;
import java.util.*;
public class Main {
static final int N = 100010;
static long[] a = new long[N], cnt = new long[N];
public static void main(String[] args) throws IOException {
FastScanner f = new FastScanner();
PrintWriter w = new PrintWriter(System.out);
int... | 2008H | wrong_submission | hard |
267,130,970 | C++20 (GCC 13-64) | OK | #include <bits/stdc++.h>
using i64 = long long;
void solve() {
int n, m;
std::cin >> n >> m;
std::string s;
std::cin >> s;
std::vector<int> ind(m);
for (int i = 0; i < m; i++) {
std::cin >> ind[i];
ind[i]--;
}
std::string c;
std::cin >> c;
std::... | 1986C | right_submission | none |
270,645,922 | C++17 (GCC 7-32) | OK | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vb vector<bool>
#define pb push_back
#define all(s) (s).begin(),(s).end()
#define rall(s) (s).rbegin(),(s).rend()
#define fo(i,s,n) for(int i=s;i<n;i++)
#de... | 1986C | right_submission | none |
267,047,695 | C++17 (GCC 7-32) | OK | //
// Created by Divyanshu on 23-06-2024.
//
//
// Created by Divyanshu on 06-06-2024.
//
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define CEIL(m,n) ((m)+(n)-1)/(n)
using namespace __gnu_pbds;
using namespace std;
template <typename T>... | 1986C | right_submission | none |
272,074,488 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
#define ll long long
#define all(c) c.begin(),c.end()
#define sz(c) int(c.size())
#define tr(a,it) for(auto it=a.begin(); it!=a.end(); it++)
#define present(c, x)(c.find(x) != c.end())
#define cpresent(c, x)(find(all(c), x) != c.end())
#define vi vector<int>
#define vll vector<ll>
#define vvll ... | 1986C | wrong_submission | easy |
267,074,267 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
using namespace std;
// ifstream fin("C:\\Users\\Bia\\Desktop\\vscode\\kattis\\i.txt");
// ofstream fout("C:\\Users\\Bia\\Desktop\\vscode\\kattis\\o.txt");
typedef long long ll;
int main()
{
int ca;
cin >> ca;
for (int ih = 0; ih < ca; ih += 1)
{
int n, m;
... | 1986C | wrong_submission | easy |
267,070,360 | C++14 (GCC 6-32) | WRONG_ANSWER on test 2 | #include<iostream>
using namespace std;
#include<vector>
#include<math.h>
#include<algorithm>
#include<queue>
#include<unordered_map>
#include<string>
#include<limits.h>
#include <utility>
string solve(string& a, string& b, vector<int>& vec) {
// Priority queue to get the smallest character first
priority_que... | 1986C | wrong_submission | easy |
269,495,252 | PyPy 3 | RUNTIME_ERROR on test 2 | from collections import Counter
from collections import defaultdict
from collections import deque
import math
import heapq
t = int(input())
for i in range(t):
n, m = input().split()
s = input()
inds = list(map(int, input().split()))
c = input()
c = sorted(c)
inds.sort()
#print(c)
#prin... | 1986C | wrong_submission | easy |
267,061,337 | PyPy 3-64 | WRONG_ANSWER on test 2 | t = int(input())
res=[]
for _ in range(t):
n, m = map(int, input().split())
s = input().strip()
ind = list(map(int, input().split()))
ind=set(ind)
c = input()
c=sorted(c)
updates = []
i=0
for e in ind:
updates.append((e, c[i]))
i=i+1
result = list(s)
# Ap... | 1986C | wrong_submission | easy |
267,021,771 | PyPy 3-64 | WRONG_ANSWER on test 2 | for _ in range(int(input())):
n, m = map(int,input().split())
s = list(input())
idx = sorted(set(map(int,input().split())))
min_i = idx[0]
idx = list(map(lambda x: x - min_i, idx))
c = sorted(input())
for ci, i in enumerate(idx):
s[i] = c[ci]
print(''.join(s)) | 1986C | wrong_submission | easy |
271,043,317 | Java 8 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.*;
public class Update_Queries{
static FastReader sc = new FastReader();
public static void main(String[] args){
int t = sc.nextInt();
while (t-- > 0){
solve();
}
}
public static void solve(){
int n = sc.nextInt();
... | 1986C | wrong_submission | easy |
267,020,332 | Java 21 | WRONG_ANSWER on test 2 | //
// Author : Swarnadip Kar
// IIT Bhilai
//
import java.lang.*; // imports everything
import java.util.*;
public class C_Update_Queries
{
//static ArrayList<Integer> a=new ArrayList<>();
//static int max;
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new... | 1986C | wrong_submission | easy |
267,065,007 | C++17 (GCC 7-32) | WRONG_ANSWER on test 4 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
int n, m;
string s, c, final = "s";
cin >> n >> m >> s;
int ind[m+2];
for(int i = 0; i < m; i++){
cin >> ind[i];
}
cin >> c;
sort(ind, ind + m);
sort(c.begin(), c.end());
for(int i = ... | 1986C | wrong_submission | medium |
267,469,472 | C++17 (GCC 7-32) | WRONG_ANSWER on test 4 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
int n, m, y;
cin >> n >> m;
int pos = m;
vector<char> s, c;
vector<bool> ex(n, false);
string x;
vector<int> ind;
cin >> x;
for (auto i : x) s.push_back(... | 1986C | wrong_submission | medium |
267,854,257 | Java 21 | WRONG_ANSWER on test 4 | import java.util.*;
public class Main {
public static void solve(Scanner sc) {
int n = sc.nextInt();
int m = sc.nextInt();
String s = sc.next();
int[] a = new int[m];
Set<Integer> st = new HashSet<>();
for (int i = 0; i < m; i++) {
a[i] = s... | 1986C | wrong_submission | medium |
268,013,139 | Java 8 | WRONG_ANSWER on test 4 | //package org.example.div2;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class UpdateQueries {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
solveT(sc);
}
public static void solveT(Scann... | 1986C | wrong_submission | medium |
272,496,254 | PyPy 3 | TIME_LIMIT_EXCEEDED on test 6 | def sort_string(s):
chars = list(s)
n = len(chars)
for i in range(n):
for j in range(0, n-i-1):
if chars[j] > chars[j+1]:
chars[j], chars[j+1] = chars[j+1], chars[j]
return ''.join(chars)
t = int(input())
for i in range(t):
list1=list(map(int, input().strip().spli... | 1986C | wrong_submission | medium |
267,122,177 | Python 3 | TIME_LIMIT_EXCEEDED on test 6 | for _ in range(int(input())):
x,y=map(int, input().split())
a=list(input())
ind=sorted(list(map(int, input().split())))
b=sorted(list(input()))
ind.append(-1)
for i in range(y):
if ind[i]==ind[i+1]:
b=[*b[:i],b[-1],*b[i:-1]]
b=list(b)
for i in range(y):
... | 1986C | wrong_submission | medium |
267,066,635 | Python 3 | TIME_LIMIT_EXCEEDED on test 7 | for t in range(int(input())):
n,m=map(int, input().split())
s=list(input())
ind=list(map(int, input().split()))
c=list(input())
ind.sort()
find=[]
x=sorted(c)
for i in ind:
if i not in find:
find.append(i)
d=len(ind)-len(find)
fc=x[:len(x)-d]... | 1986C | wrong_submission | hard |
267,040,279 | C++17 (GCC 7-32) | TIME_LIMIT_EXCEEDED on test 8 | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n >> m;
string s, c;
cin >> s;
multiset<int> ind_mst;
for (int i = 0; i < m; ++i) {
int a;
cin >> a;
ind_mst.insert... | 1986C | wrong_submission | hard |
269,514,684 | C++14 (GCC 6-32) | TIME_LIMIT_EXCEEDED on test 8 | #include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
char a[100010] = {}, b[100010] = {};
int in[100010] = {};
int n, m;
int t;
int main()
{
int t;
cin >> t;
while (t--)
{
cin >> n >> m;
cin >> a;
for (int i = 1; i <= m; i++)
{
cin >> in[i];
}
cin >> b;
sort(in + 1, in + 1... | 1986C | wrong_submission | hard |
267,026,004 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 8 | def shift(c):
c.insert(0, c.pop())
def solve():
n, m = map(int, input().split())
s = list(input())
ind = sorted(map(int, input().split()))
c = sorted(input())
k = set()
for i in range(m):
i1 = ind[i]-1
if i1 in k:
s[i1] = min(s[i1], c[i])
... | 1986C | wrong_submission | hard |
267,042,739 | Java 21 | TIME_LIMIT_EXCEEDED on test 9 | import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Scanner;
import java.util.TreeSet;
public class Solution2 {
public static String sortString(String inputString)
{
char tempArray[] = inputString.toCharArray();
Arrays.sort(tempArray);
... | 1986C | wrong_submission | hard |
267,266,772 | Java 21 | TIME_LIMIT_EXCEEDED on test 9 | import java.util.*;
public class problem3 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
int m = sc.nextInt();
sc.nextLine();
String s = sc.next... | 1986C | wrong_submission | hard |
297,506,088 | Python 3 | OK | # from io import StringIO
import sys
def all_nonzero_subsequences(arr):
subsequences = []
current_subsequence = []
for num in arr:
if num != 0:
current_subsequence.append(num)
else:
if current_subsequence:
subsequences.append(current_subsequence)
... | 2049A | right_submission | none |
297,464,260 | PyPy 3-64 | OK | for _ in range(int(input())):
n=map(int,input().split())
L=list(map(int,input().split()))
if 0 not in L:
print(1)
elif set(L)=={0}:
print(0)
else:
ans1,ans=True,True
while L and L[-1]==0:
L.pop()
ans1=False
while L and L[0... | 2049A | right_submission | none |
297,466,443 | PyPy 3-64 | OK | for __ in range(int(input())):
n = int(input())
ar = list(map(int,input().split()))
if sum(ar) == 0:
print(0)
continue
x,y = 0, n-1
for i in range(n):
if ar[i] != 0:
x = i
break
for i in range(n-1,-1,-1):
if ar[i] != 0:
y = i
break
if 0 in ar[x:y+1]:
print(2)
else:
print(1) | 2049A | right_submission | none |
297,536,362 | Java 21 | OK | import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef
{
public static void main (String[] args) throws java.lang.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++){
... | 2049A | right_submission | none |
297,525,595 | C++17 (GCC 7-32) | OK | /*
g++ -std=gnu++20 cf2028.cpp -o cf2028 && ./cf2028 < input.txt > output.txt
auto isEven = [&](int a) {
return a % 2 == 0
};
*/
#include <vector>
#include <iostream>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <deque>
#include <set>
#include <math.h>
#include <queue>
#include ... | 2049A | right_submission | none |
297,466,233 | Java 21 | OK | import java.util.Scanner;
public class Cf1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int T=scanner.nextInt();
while(T-->0) {
int n = scanner.nextInt();
long[] arr = new long[n];
int z=0;
for (int i... | 2049A | right_submission | none |
299,418,011 | Java 21 | OK | import java.util.*;
public class A_MEX_Destruction{
static ContestScanner sc = new ContestScanner();
static ContestPrinter out = new ContestPrinter();
public static void main(String[] args) throws java.lang.Exception {
int t = 1;
t = sc.nextInt();
while (--t >= 0) {
s... | 2049A | right_submission | none |
297,528,032 | C++17 (GCC 7-32) | OK | #include<bits/stdc++.h>
using namespace std;
int mex (vector<int>& arr) {
sort(arr.begin(), arr.end());
for (int i = 0; i < arr.size(); i++) {
if (arr[i] != i) return i;
}
return arr.size();
}
void solve() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)... | 2049A | right_submission | none |
304,253,301 | C++20 (GCC 13-64) | OK | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define pb push_back
#define f first
#define s second
const ll MOD = 1e9+7;
ll gcd(ll a, ll b) {
if (a == 0) return b;
return gcd(b % a, a);
}
ll pow(... | 2049A | right_submission | none |
297,680,942 | C++23 (GCC 14-64, msys2) | OK | #include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
void solve() {
int n;
std::cin >> n;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
if (std::count(a.begin(), a.en... | 2049A | right_submission | none |
297,472,239 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include <iostream>
#include <vector>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin>>n;
vector<int> con(n);
bool allZero = true, hasMiddleZero = false;
for (int i=0; i<n; i++) {
cin >> con[i];
if (con[i]!=0) {
... | 2049A | wrong_submission | easy |
299,292,362 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include<iostream>
using namespace std;
int main(){
// problem: https://codeforces.com/contest/2049/problem/A
int t;
cin >> t;
while(t--){
int n;
cin >> n;
int arr[n];
for(int i = 0; i < n; i++){
cin >> arr[i];
}
// if there is only one... | 2049A | wrong_submission | easy |
297,529,337 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include<iostream>
using namespace std;
int a[501];
int main()
{
int n;
cin >> n;
for (int x = 0; x < n; x++)
{
int y;//测试样例
cin >> y;
for (int i = 0; i < y; i++)
{
cin >> a[i];
}
int temp = 0, TEMP = 0;
for (int m = 0; m < y; m++)
{
if (a[m] != 0) { TEMP++; }
}
for (int j = 0; j < ... | 2049A | wrong_submission | easy |
297,587,008 | Python 3 | WRONG_ANSWER on test 2 | ct = int(input())
for w in range(ct):
l = int(input())
v = list(map(int,input().split()))
if sum(v) == 0:
print(0)
elif 0 not in v:
print(1)
else:
if v[0] > 0:
c = 1
else:
c = 0
for i in range(len(v)):
... | 2049A | wrong_submission | easy |
297,488,961 | Python 3 | WRONG_ANSWER on test 2 | def main():
t = int(input())
for case in range(t):
n = int(input())
arr = []
arr = list(map(int, input().split()))
if max(arr) == 0:
print(0)
continue
flag = False
for i in range(1, len(arr)-1):
if arr[i] == 0:
f... | 2049A | wrong_submission | easy |
297,464,701 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class cf994a {
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];
int f=0,s=0;
for (int j = 0; ... | 2049A | wrong_submission | easy |
297,626,054 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
public class MEXDestruction {
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int t = in.nextInt();
for(int i=0;i<t;i++){
int n = in.nextInt();
int[] arr = new int[n];
int cnt=0;
for(int j=0;j<n;... | 2049A | wrong_submission | easy |
297,486,120 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n+5];
int fl0=0,fl1=0;
for(int i=1;i<=n;i++){
cin>>a[i];
if(a[i]==0) fl0=1;
else fl1=1;
}
if(fl0&&!fl1){
printf("0\n");
}
else if(!fl0&&fl1){
printf("1\n");
}
else if(fl0&&fl1){
... | 2049A | wrong_submission | easy |
297,469,551 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 2 | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key
#define int long long
#define pii pair<int... | 2049A | wrong_submission | medium |
297,563,508 | 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;
vector<int>v(n);
int zero_cnt = 0;
for(int i=0 ; i<n ; i++){
cin >> v[i];
if(v[i] == 0) zero_cnt++;
}
if(zero_cnt == v.size()){
cout << 0 << endl;
continue;
}
if(zero_cnt == 0){
... | 2049A | wrong_submission | medium |
302,188,966 | Python 3 | WRONG_ANSWER on test 2 | def code(num):
for i in range(num):
len = int(input())
inp = input()
lst = [int(n) for n in inp.split(" ")]
count = 0
for i in range(len):
if lst[i] == 0:
count += 1
if count == len:
print(0)
elif count == 0:
... | 2049A | wrong_submission | medium |
297,462,931 | Python 3 | WRONG_ANSWER on test 2 | mod = 1000000007
test_cases = int(input())
for _ in range(test_cases):
size = int(input())
arr = list(map(int, input().split()))
zero_count = arr.count(0)
if zero_count == size:
print(0)
else:
if zero_count == 1 and (arr[0] == 0 or arr[-1] == 0):
print(1)
elif... | 2049A | wrong_submission | medium |
297,497,162 | 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 cases=sc.nextInt();
while(cases-->0){
int n=sc.nextInt();
int[] arr=new int[n];
int count=0;
for(int i=0;i<n;i++){
arr[i]=sc.nextInt();
i... | 2049A | wrong_submission | medium |
297,463,941 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
import java.io.*;
public class A_MEX_Destruction {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st =... | 2049A | wrong_submission | medium |
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 | hard |
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 | hard |
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 | hard |
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 | hard |
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 | hard |
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 | hard |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.