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 |
|---|---|---|---|---|---|---|
274,420,008 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 9 | #include<bits/stdc++.h>
namespace {
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else... | 1993E | wrong_submission | medium |
274,917,773 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 11 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdi = pair<double, int>;
using pdd = pair<double, double>;
using ull = unsigned long long;
using LL = __int128_t;
using vint = vector<int>;
#define ppc(x) __builtin_popcount(x)
#define clz... | 1993E | wrong_submission | hard |
275,455,906 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 11 | #include <vector>
#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
ostream_iterator<T> oit(const string &s = " "){ return ostream_itera... | 1993E | wrong_submission | hard |
274,535,144 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 11 | import sys
# region fastio
from collections import Counter, defaultdict
from heapq import heappop, heappush
from math import inf
from random import getrandbits
input = lambda: sys.stdin.readline().rstrip()
sint = lambda: int(input())
mint = lambda: map(int, input().split())
ints = lambda: list(map(int, input().spli... | 1993E | wrong_submission | hard |
274,435,901 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 11 | T=int(input())
for t in range(T):
N,M=map(int,input().split())
A=[list(map(int,input().split())) for n in range(N)]
for n in range(N):
A[n].append(0)
for m in range(M):
A[n][-1]^=A[n][m]
A.append([0]*(M+1))
for n in range(N):
for m in range(M+1):
A[N][... | 1993E | wrong_submission | hard |
281,649,394 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 11 | //#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,abm,mmx,tune=native")
#include<vector>
#include<iostream>
#include<stack>
#include<cmath>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<tuple>
#include<bitset>
#include<queue>
#in... | 1993E | wrong_submission | hard |
286,079,354 | C++20 (GCC 13-64) | TIME_LIMIT_EXCEEDED on test 11 | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int inf=1e18;
int a[20][20],b[20][20];
int f[1<<15][16];
int g[20][20];
int ans;
int n,m;
int solve(int n,int m,int a[][20]){
for(int s=0;s<(1<<n);s++) memset(f[s],63,sizeof(f[s]));
for(int i=0;i<n;i++) f[1<<i][i]=0;
for(int i=0;i<n;i++){
for... | 1993E | wrong_submission | hard |
268,243,378 | Python 3 | OK | import sys
import math
import bisect
from sys import stdin,stdout
from math import gcd,floor,sqrt,log
from collections import defaultdict as dd, Counter
from bisect import bisect, bisect_left as bl,bisect_right as br
sys.setrecursionlimit(100000000)
inp =lambda: int(input())
strng =lambda: input().strip()
jn ... | 1957D | right_submission | none |
258,192,927 | PyPy 3-64 | OK | import sys
import collections
import math
import bisect
#import heapq
#import itertools
#import functools
input = sys.stdin.readline
def solve():
n = int(input())
a = list(map(int, input().split()))
if n == 1:
print(0)
return
m = max(a).bit_length()
cnt = [[0] * m for _ ... | 1957D | right_submission | none |
257,994,272 | PyPy 3-64 | OK | import sys,math,bisect,heapq
from collections import deque
input=sys.stdin.readline
flush=sys.stdout.flush
mod=(10**9)+7
for _ in range(int(input())):
n=int(input())
#n,k=map(int,input().split())
a=list(map(int,input().split()))
pre=[]
pre.append([0]*30)
b=[0]*n
c=0
for i in range(n)... | 1957D | right_submission | none |
292,847,552 | Java 21 | OK | import java.io.*;
import java.util.*;
public class Main {
public static void cf1957D(BufferedReader in, PrintWriter out) throws IOException {
int T = Integer.parseInt(in.readLine());
while (T-- > 0) {
int n = Integer.parseInt(in.readLine());
int[] a = new int[n];
... | 1957D | right_submission | none |
258,590,535 | Java 21 | OK | import java.lang.*;
import java.io.*;
import java.util.*;
public final class Solution {
private static class FastScanner {
private final int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
private Fast... | 1957D | right_submission | none |
264,554,715 | C++14 (GCC 6-32) | OK | // Problem: A BIT of an Inequality
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/CF1957D
// Memory Limit: 250 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
using namespace std;
#define rep(x,y,z) for(int x=y;x<=z;x++)
#define per(x,y,z) for(int x=y;x... | 1957D | right_submission | none |
257,703,374 | 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);
std::vector<int> s(n + 1);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
s[i + 1] = s[i] ^ a[i];
}
i64 ans = 0;
for (int k = 0; k < 30; k++) {
... | 1957D | right_submission | none |
259,891,585 | C++20 (GCC 13-64) | OK | /* "If I can run I will run , If I can walk I will walk , If I can crawl I will crawl" */
/* " But I will NEVER_STOP " */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>
using namespace std... | 1957D | right_submission | none |
293,469,428 | C++23 (GCC 14-64, msys2) | OK | #include <bits/stdc++.h>
#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...) (void)0
#endif
using namespace std;
// #define int long long
using i64 = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using i128 = __int128;
void solve(){
int n;
cin >> n;
vector<int> a(n + 1);
fo... | 1957D | right_submission | none |
257,635,708 | 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> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
vector<int> prefix_xor(n + 1, 0);
for (int i = ... | 1957D | wrong_submission | easy |
258,365,596 | C++17 (GCC 7-32) | TIME_LIMIT_EXCEEDED on test 2 | #include <iostream>
#include <cstring>
using namespace std;
typedef long long LL;
const int N=1e5+10;
int dp1[N][32][2],dp2[N][32][2];
int T,n;
int a[N];
inline void ini()
{
for(int i=1;i<=n;++i)
for(int j=0;j<32;++j)
if(a[i]>>j&1)
{
dp1[i][j][0]=dp1[i-1][j][1... | 1957D | wrong_submission | easy |
257,633,309 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
// Function to count the number of tuples satisfying the condition
long long countTuples(vector<int>& arr) {
int n = arr.size();
long long tuples = 0;
unordered_map<int, int> freq;
// Calculate prefix XORs
vector... | 1957D | wrong_submission | easy |
257,630,571 | Python 3 | WRONG_ANSWER on test 2 | t = int(input())
for _ in range(t):
n = int(input())
arr = list(map(int, input().split()))
if n == 1:
print(0)
else:
print(2 ** (n - 1)) | 1957D | wrong_submission | easy |
257,820,053 | Python 3 | WRONG_ANSWER on test 2 | from math import ceil
T = int(input())
for _ in range(0, T):
n = int(input())
a = list(map(int, input().split()))
arr = [[0 for i in range(0, 30)] for j in range(0, n + 1)]
pref = [[[0, 0] for j in range(0, 30)] for i in range(0, n)]
suff = [[[0, 0] for j in range(0, 30)] for i in range(0, n)]
... | 1957D | wrong_submission | easy |
257,728,854 | PyPy 3-64 | WRONG_ANSWER on test 2 | import sys,math,bisect,heapq
from collections import deque
input=sys.stdin.readline
flush=sys.stdout.flush
mod=(10**9)+7
for _ in range(int(input())):
n=int(input())
#n,k=map(int,input().split())
a=list(map(int,input().split()))
pre=[]
pre.append([0]*30)
b=[0]*n
c=0
for i in range(n)... | 1957D | wrong_submission | easy |
292,563,552 | Java 8 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.*;
public class Main {
static String[] temp;
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(System.out);
int T= Integer.parseInt(br.r... | 1957D | wrong_submission | easy |
271,051,911 | Java 8 | WRONG_ANSWER on test 2 | // package BitManipulation;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class ABitOfAnEquality {
public static void main(String[] args)throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader... | 1957D | wrong_submission | easy |
258,520,599 | C++17 (GCC 7-32) | RUNTIME_ERROR on test 3 | #ifdef ONLINE_JUDGE
#include <bits/stdc++.h>
#pragma GCC optimize("O1")
#pragma GCC optimize("O2")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#else
#include "myheader.h"
#endif
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;
void input() {return;}
te... | 1957D | wrong_submission | medium |
257,646,275 | C++17 (GCC 7-32) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n; cin >> n;
vector<int> arr(n, 0);
for (auto& e : arr) cin >> e;
vector<vector<int>> evens(n, vector<int>(32, 0));
vector<int> xors(arr);
for (int i = 1; i < n; i++) xors[i] ^= xors[i-1];
for (int l = 0; l < ... | 1957D | wrong_submission | medium |
292,598,650 | Python 3 | TIME_LIMIT_EXCEEDED on test 3 | times = int(input())
for _ in range(times):
cnt = 0
n = int(input())
nums = list(map(int,input().split()))
pre = [0]
for x in nums:
pre.append(pre[-1]^x)
for x in range(n):
for y in range(x,n):
for z in range(y,n):
if pre[y+1]^pre[x]^pre[z+1]^pre[y]>pr... | 1957D | wrong_submission | medium |
257,625,772 | Python 3 | TIME_LIMIT_EXCEEDED on test 3 | def count_tuples(a):
n = len(a)
prefix_xor = [0] * (n + 1)
for i in range(n):
prefix_xor[i + 1] = prefix_xor[i] ^ a[i]
count = 0
for x in range(1, n + 1):
for y in range(x, n + 1):
xor_xy = prefix_xor[y] ^ prefix_xor[x - 1]
for z in range(y, n + 1):
xor_yz = prefix_xor[z] ^ prefi... | 1957D | wrong_submission | medium |
292,847,296 | Java 21 | WRONG_ANSWER on test 3 | import java.io.*;
import java.util.*;
public class Main {
public static void cf1957D(BufferedReader in, PrintWriter out) throws IOException {
int T = Integer.parseInt(in.readLine());
while (T-- > 0) {
int n = Integer.parseInt(in.readLine());
int[] a = new int[n];
... | 1957D | wrong_submission | medium |
298,179,240 | Java 21 | WRONG_ANSWER on test 3 | import java.util.Scanner;
public class CF1957D {
static int n;
static int[] a;
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
while (t-- > 0) {
n = scanner.nextInt();
a = new int[n];
... | 1957D | wrong_submission | medium |
270,138,089 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int pref[30][100005][2];
int suff[30][100005][2];
void solve()
{
int n;
cin >> n;
vector<int> a(n + 1);
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
for (int i = 0; i < 30; i++)
{
suff[i][n + 1][0] = ... | 1957D | wrong_submission | hard |
299,907,657 | C++20 (GCC 13-64) | MEMORY_LIMIT_EXCEEDED on test 3 | #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> index_set; // find_by_order, order_of_key
//data type //greater... | 1957D | wrong_submission | hard |
257,632,955 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 3 | def find_xor(arr):
result = 0
for num in arr:
result ^= num
return result
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
res = 0
for i in range(n):
for j in range(i,n):
for k in range(j,n):
x = find_xor(a... | 1957D | wrong_submission | hard |
259,103,110 | PyPy 3-64 | MEMORY_LIMIT_EXCEEDED on test 3 | from math import ceil, gcd
from collections import Counter, defaultdict
import heapq
def modM(a, b, M):
return (a%M * b%M)%M
def getL():
return list(map(int, input().split()))
def getT():
return tuple(map(int, input().split()))
def getI():
return int(input())
tt = 1
tt = int(input())
maxN ... | 1957D | wrong_submission | hard |
257,628,103 | Java 8 | TIME_LIMIT_EXCEEDED on test 3 | import java.util.Scanner;
import java.util.Vector;
public class Main {
public static int countTuples(Vector<Integer> arr) {
int n = arr.size();
Vector<Integer> prefix = new Vector<>(n);
prefix.add(arr.get(0));
// Compute prefix XOR array
for (int i = 1; i < n; ++i) {
... | 1957D | wrong_submission | hard |
257,620,978 | Java 21 | WRONG_ANSWER on test 3 | import java.io.*;
public class D {
public static void main(String args[]) throws IOException {
BufferedReader scanner = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(scanner.readLine());
for (int t = 0; t < T; t++) {
int N = Integer.parseInt(s... | 1957D | wrong_submission | hard |
292,417,007 | C++20 (GCC 13-64) | OK | #include<bits/stdc++.h>
using namespace std;
inline int read(){
int ret=0,flg=0;
char c=getchar();
while(c<'0'||c>'9')flg|=c=='-',c=getchar();
while(c>='0'&&c<='9')ret=(ret<<3)+(ret<<1)+c-'0',c=getchar();
return flg?-ret:ret;
}
inline void write(int x,bool flg){
char a[21];
if(!x)putchar('0');
if(x<0)putchar('-... | 2038D | right_submission | none |
292,338,871 | C++23 (GCC 14-64, msys2) | OK | #include <bits/stdc++.h>
using namespace std;
const int N=2e5+5,mod=998244353;
int n,a[N],tr[N],st[18][N];
vector<array<int,4>> p;
int ask(int l,int r){
int t=__lg(r-l+1);
return st[t][l]|st[t][r-(1<<t)+1];
}
void add(int x,int v) {for(;x<=n;x+=x&-x) (tr[x]+=v)%=mod;}
int qry(int x) {int res=0;for(;x;x-=x&-x) (res+=t... | 2038D | right_submission | none |
292,442,536 | C++20 (GCC 13-64) | OK | // [Irelia]
#include<bits/stdc++.h>
namespace Irelia // [Irelia Library] Irelia
{
#define Irelia__ 201307
#define fcc(i, j, k) for(num (i)=(j); (i)<=(k); ++(i))
#define ccf(i, j, k) for(num (i)=(j); (i)>=(k); --(i))
#define I (*this)
#define same_type(T1, T2) (std::is_same<T1, T2>::value)
#def... | 2038D | right_submission | none |
292,168,317 | 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;
template<class T>
constexpr T power(T a, u64 b, T res = 1) {
for (; b != 0; b /= 2, a *= a) {
if (b & 1) {
res *= a;
}
}
return res;
}
templ... | 2038D | right_submission | none |
304,752,637 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include <iostream>
#include <vector>
using namespace std;
const int MOD = 998244353;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
vector<int> prefix_or(n);
prefix_or[0] = a[0];
for (int i = 1; i < n; ++i) {
prefix_or[... | 2038D | wrong_submission | easy |
304,184,540 | Python 3 | WRONG_ANSWER on test 2 | MOD = 998244353
def count_valid_splits(n, a):
dp = [0] * (n + 1)
dp[0] = 1 # Base case: one way to split an empty array
or_values = [0] * (n + 1)
for i in range(1, n + 1):
or_values[i] = or_values[i-1] | a[i-1]
for i in range(1, n + 1):
seen_or = set()
for j in range... | 2038D | wrong_submission | easy |
304,676,039 | Python 3 | WRONG_ANSWER on test 2 | def count_ways_to_split(n, arr):
MOD = 998244353
# Initialize the dp array
dp = [0] * n
dp[0] = 1 # There's one way to split the array up to the first element
# Initialize the bitwise OR of the current segment
current_or = arr[0]
for i in range(1, n):
# Update the cur... | 2038D | wrong_submission | easy |
304,785,976 | Java 21 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class Main{
private static final int MOD = 998244353;
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = scanner.... | 2038D | wrong_submission | easy |
292,787,926 | Java 8 | WRONG_ANSWER on test 2 | import java.util.*;
public class DivideOrConquer {
static final int MOD = 998244353;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Input reading
int n = sc.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
... | 2038D | wrong_submission | easy |
292,187,013 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 3 | #include <iostream>
#include <vector>
using namespace std;
#define MOD 998244353
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
vector<int> dp(n + 1, 0);
dp[0] = 1;
vector<int> bitOr(n + 1, 0);
int sum = 1;
... | 2038D | wrong_submission | easy |
305,404,109 | C++17 (GCC 7-32) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
// dp[i] will store the number of ways to split the array u... | 2038D | wrong_submission | easy |
305,041,061 | Python 3 | WRONG_ANSWER on test 3 | MOD = 998244353
n = int(input())
a = list(map(int, input().split()))
if all(x == a[0] for x in a):
print(pow(2, n - 1, MOD))
exit()
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
current_or = 0
for j in range(i - 1, -1, -1):
current_or |= a[j]
if dp[j]:
if j =... | 2038D | wrong_submission | easy |
292,402,778 | C++17 (GCC 7-32) | TIME_LIMIT_EXCEEDED on test 7 | #include <cstdio>
#include <algorithm>
#include <map>
#include <utility>
using namespace std;
int n,a[200005];
typedef long long int ll;
map<pair<ll,ll>,ll> dp[200005];
#define MOD 998244353ll
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",a+i);
}
dp[0].insert(make_pair(make_pair(... | 2038D | wrong_submission | medium |
297,162,663 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 7 | #include<set>
#include<map>
#include<iostream>
#include<queue>
#include<sstream>
#include<cstdlib>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
typedef vector<int>VI; typedef vector<VI>VVI;
typedef vector<long long>VLL;
typedef vector<string>VS;
typedef p... | 2038D | wrong_submission | medium |
293,309,600 | PyPy 3 | TIME_LIMIT_EXCEEDED on test 7 | M = 998244353
class fenwick(object):
def __init__(self, n):
self.n = n
self.cul = [0]*n
self.maxd = len(bin(n))-3
def update(self,index,diff):
i = index
while i<self.n:
self.cul[i] += diff
self.cul[i] %= M
i += (i+1)&(-i-1)
... | 2038D | wrong_submission | medium |
292,176,325 | PyPy 3-64 | WRONG_ANSWER on test 7 | MOD = 998244353
from collections import defaultdict
import sys
input = sys.stdin.readline
def solve(n, a):
dp = defaultdict(int)
dp[a[0]] = 1
for i in range(1, n):
temp = defaultdict(int)
for x in dp:
y = x | a[i]
temp[y] = (temp[y] + dp[x]) % MOD
... | 2038D | wrong_submission | medium |
294,436,214 | Java 21 | WRONG_ANSWER on test 7 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
static final int MOD = 998244353;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));... | 2038D | wrong_submission | medium |
294,429,834 | Java 21 | WRONG_ANSWER on test 7 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main3 {
static final int MOD = 998244353;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in))... | 2038D | wrong_submission | medium |
292,293,038 | C++20 (GCC 13-64) | WRONG_ANSWER on test 7 | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-... | 2038D | wrong_submission | hard |
294,565,604 | C++23 (GCC 14-64, msys2) | TIME_LIMIT_EXCEEDED on test 7 | #include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod=998244353;
int n;
int a[200010];
map<pair<int,int>,int>dp[2];
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
dp[1][{0,a[1]}]=1;
for(int i=2;i<=n;i++){
dp[i&1].clear();
... | 2038D | wrong_submission | hard |
292,341,793 | Java 8 | TIME_LIMIT_EXCEEDED on test 7 | import java.io.*;
import java.util.*;
public class Main {
boolean MULTI_CASE = false;
boolean ALWAYS_FLUSH = false;
void go() {
int n = nextInt();
int[] a = new int[n];
for (int i = 0; i < a.length; ++i) a[i] = nextInt();
PriorityQueue<int[]> q = new PriorityQueue<>((x, y) ->
x[1] != y[1... | 2038D | wrong_submission | hard |
292,340,180 | Java 8 | TIME_LIMIT_EXCEEDED on test 7 | import java.io.*;
import java.util.*;
public class Main {
boolean MULTI_CASE = false;
boolean ALWAYS_FLUSH = false;
void go() {
int n = nextInt();
int[] a = new int[n];
for (int i = 0; i < a.length; ++i) a[i] = nextInt();
PriorityQueue<int[]>[] q = new PriorityQueue[1 << 20];
for (int i = 0; i <... | 2038D | wrong_submission | hard |
293,312,324 | PyPy 3 | TIME_LIMIT_EXCEEDED on test 10 | M = 998244353
class fenwick(object):
def __init__(self, n):
self.n = n
self.cul = [0]*n
self.maxd = len(bin(n))-3
def update(self,index,diff):
i = index
while i<self.n:
self.cul[i] += diff
self.cul[i] %= M
i += (i+1)&(-i-1)
... | 2038D | wrong_submission | hard |
293,313,325 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 100 | M = 998244353
class fenwick(object):
def __init__(self, n):
self.n = n
self.cul = [0]*n
self.maxd = len(bin(n))-3
def update(self,index,diff):
i = index
while i<self.n:
self.cul[i] += diff
self.cul[i] %= M
i += (i+1)&(-i-1)
... | 2038D | wrong_submission | hard |
289,495,315 | 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, m;
std::cin >> n >> m;
std::vector<std::string> s(n);
for (int i = 0; i < n; i++) {
std::cin >> s[i];
}
int ans = 0;
... | 2036D | right_submission | none |
289,476,205 | C++20 (GCC 13-64) | OK | /**
* author: tourist
* created: 02.11.2024 07:40:10
**/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tt;
cin >> tt;
while (tt--) {
int h, w;
cin >> h... | 2036D | right_submission | none |
292,495,124 | C++17 (GCC 7-32) | OK | #include<bits/stdc++.h>
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
using namespace std;
void solve()
{
int n, m;
cin>>n>>m;
vector<vector<char>> mat(n, vector<char>(m));
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
... | 2036D | right_submission | none |
289,587,537 | C++17 (GCC 7-32) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define endl '\n'
const ll N = 2e5 + 10;
const ll M = 1e9 + 7;
const ll mod = 998244353;
const ll INF = 9e18;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll tt;
cin >> tt;
... | 2036D | wrong_submission | easy |
289,605,128 | C++20 (GCC 13-64) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(X) cerr << #X << " : " << X << '\n';
const int N = 1010;
int a[N][N], f[4];
ll ans = 0;
int ii, jj;
bool u, d, l, r;
char xx;
void change (int min_x, int min_y, int max_x, int max_y) {
if (u) {
if (ii - 1 >= max_x) {
ii --;
}
el... | 2036D | wrong_submission | easy |
289,689,553 | C++23 (GCC 14-64, msys2) | WRONG_ANSWER on test 2 | //author : Sajid Ayman
// problem :
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define nl '\n'
#define tt int tc;cin >> tc;while (tc--)
//if(i<1||j<1||i>n||j>m)
using namespace std;
const double PI=3.14159... | 2036D | wrong_submission | easy |
289,560,350 | PyPy 3-64 | WRONG_ANSWER on test 2 | def fun():
n, m = map(int, input().split())
mx = []
for i in range(n):
mx.append(list(input()))
a = ["1", "5", "4", "3"]
cnt = 0
num = min(n, m) // 2
for idx in range(num):
top, bottom = idx, n - idx - 1
left, right = idx, m - idx - 1
layer = []
... | 2036D | wrong_submission | easy |
289,588,381 | PyPy 3-64 | WRONG_ANSWER on test 2 | def get_matrix_rings(matrix):
if not matrix or not matrix[0]:
return []
rows, cols = len(matrix), len(matrix[0])
top = 0
bottom = rows - 1
left = 0
right = cols - 1
cnt = 0
while top <= bottom and left <= right:
ring = []
for j in range(left... | 2036D | wrong_submission | easy |
290,032,326 | PyPy 3-64 | WRONG_ANSWER on test 2 | import sys
from itertools import chain, islice, repeat
input = sys.stdin.readline
num = [1, 5, 4, 3]
for _ in range(int(input())):
gy, gx = map(int, input().split())
ys = (0, gy - 1)
xs = (0, gx - 1)
grid = [list(map(int, input().rstrip())) for _ in range(gy)]
times = 0
while ys[0] < ys[... | 2036D | wrong_submission | easy |
289,781,590 | Java 21 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.*;
public class ques4 {
private static final int mod = 1000000007;
// Custom class to hold pairs
static class Pair {
int value;
int index;
Pair(int value, int index) {
this.value = value;
this.index = index;
}
}
... | 2036D | wrong_submission | easy |
291,186,975 | Java 21 | WRONG_ANSWER on test 2 | import java.util.*;
import java.io.*;
public class challenge {
static String target = "1543";
static HashSet<String> hash = new HashSet<>();
// 1= ul to ur;
// 2= ur to lr
// 3= lr to ll
// 4= ll to ul
static int solve(String[] k, int x, int y, int type, int j, int total, int minX, int m... | 2036D | wrong_submission | easy |
289,541,525 | PyPy 3-64 | RUNTIME_ERROR on test 2 | t = int(input())
def check(n, m, matrix, layer):
ans = 0
sc = 0
seq = '1543'
for i in range(m-2*layer):
if matrix[layer][layer+i] == seq[sc]:
sc += 1
else:
sc = 0
if sc == 4:
ans += 1
sc = 0
if sc > 0:
sc -= 1
... | 2036D | wrong_submission | medium |
289,571,362 | PyPy 3-64 | WRONG_ANSWER on test 2 | def solve():
n, m = list(map(int, input().split()))
arr = []
for _ in range(n):
arr.append([int(e) for e in list(input())])
w1 = m - 1
w2 = n - 1
w3 = 0
w4 = 0
dontdec = False
if arr[0][0] == 1:
i, j = 0, 0
dire = 0
elif arr[1][0] == 1:
i, j = 1, 0... | 2036D | wrong_submission | medium |
292,107,697 | Java 21 | WRONG_ANSWER on test 2 | import java.util.Scanner;
public class ilove1543 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
for (int k = 0; k < t; k++) {
int n = in.nextInt();
int m = in.nextInt();
int[][] mat = new int[n][m];
... | 2036D | wrong_submission | medium |
289,553,442 | Java 21 | WRONG_ANSWER on test 2 | import java.io.*;
import java.util.Locale;
import java.util.StringTokenizer;
public class Template {
public static void main(String[] args) throws FileNotFoundException {
Locale.setDefault(Locale.ROOT);
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
... | 2036D | wrong_submission | medium |
289,573,697 | C++23 (GCC 14-64, msys2) | RUNTIME_ERROR on test 3 | #define _USE_MATH_DEFINES
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cstring>
#include <fstream>
#include <utility>
#include <cstdlib>
#include <vector>
#include <string>
#include <limits>
#include <cmath>... | 2036D | wrong_submission | medium |
289,552,697 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #include<bits/stdc++.h>
using namespace std ;
#define ll long long
int main(){
int t;
cin>>t;
while(t--){
int n,m ;
cin >> n >> m ;
vector<vector<int>> arr(n,vector<int>(m,0));
for(int i=0 ; i<n ; i++){
int num ; cin >> num ;
for(int j=m-1 ; j>=0 ; j--){
arr[i][j]= num%10 ;
num=num/10;
... | 2036D | wrong_submission | medium |
289,562,858 | PyPy 3 | TIME_LIMIT_EXCEEDED on test 5 | t = int(input())
for ii in range(t):
n,m = list(map(int,input().split()))
t = [[0]*m for i in range(n)]
for jj in range(n):
s = int(input())
for kk in range(m):
t[jj][kk] = s // 10**(m-kk-1) % 10
bound = min(n//2,m//2)
count = 0
rotate = 0
for jj in range(bound)... | 2036D | wrong_submission | hard |
289,586,736 | PyPy 3-64 | TIME_LIMIT_EXCEEDED on test 5 | from collections import defaultdict
from sys import stdin
def I(): return int(stdin.readline().strip())
def II(): return map(int, stdin.readline().strip().split())
def IL(): return list(map(int, stdin.readline().strip().split()))
def SIL(): return sorted(map(int, stdin.readline().strip().split()),)
def S() : ... | 2036D | wrong_submission | hard |
289,795,854 | C++20 (GCC 13-64) | WRONG_ANSWER on test 9 | #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;
#define op() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define srt(a) sort(a.begin(), a.end())
#de... | 2036D | wrong_submission | hard |
291,239,522 | C++20 (GCC 13-64) | WRONG_ANSWER on test 9 | #include<iostream>
#include<vector>
using namespace std;
int n,m;
void print(vector<int>&layer)
{
for(auto&i:layer)
{
cout<<i<<" ";
}
cout<<endl;
}
void strips(int w,vector<int>&layer,vector<vector<int>>&arr)
{
layer.clear();
for(int i=w,j=w;j<=m-w;j++)
{
layer... | 2036D | wrong_submission | hard |
289,781,436 | Java 21 | WRONG_ANSWER on test 9 | import java.io.*;
import java.util.*;
import java.util.StringTokenizer;
public class D_I_Love_1543{
public static int mod = (int)(1e9 + 7);
public static void main(String[] args) {
FastScanner sc = new FastScanner(System.in);
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWri... | 2036D | wrong_submission | hard |
289,945,599 | Java 8 | WRONG_ANSWER on test 9 | import java.util.*;
public class Epic{
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();
char [][] arr = new char[n][m];
for(int i=0;i<n;i++){
arr[i] = sc.next().toCharArray();
}
int ... | 2036D | wrong_submission | hard |
288,360,723 | 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;
template<class T>
constexpr T power(T a, u64 b, T res = 1) {
for (; b != 0; b /= 2, a *= a) {
if (b & 1) {
res *= a;
}
}
return res;
}
templ... | 2035G1 | right_submission | none |
292,620,745 | C++20 (GCC 13-64) | OK | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
#define eb emplace_back
#define rz resize
#define Siz(a) (int)(a.size())
#define MP make_pair
#define MT make_tuple
#define IT iterator
#define fi first
#define se second
#define For(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#defi... | 2035G1 | right_submission | none |
288,377,825 | C++20 (GCC 13-64) | OK | #pragma region Macros
#ifdef noimi
#pragma comment(linker, "/stack:256000000")
#include "my_template.hpp"
#else
// #pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <immintrin.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include ... | 2035G1 | right_submission | none |
288,426,253 | C++20 (GCC 13-64) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
using namespace std;
const int p=998244353;
int t,n,m,f[3011],dp[3011],a[3011],rt;
int fa[6011],id[6011],sz,lc[6011],rc[6011],siz[6011],dep[6011],cl[3011][21],cr[3011][21],lca[3011][3011],pw[3011];
void build(int L,int R,int &x,int d)
{
if(L==R)
{
x=L;//printf("build([%d,%d],%d) dep:%d\n",L... | 2035G1 | wrong_submission | easy |
288,372,357 | C++20 (GCC 13-64) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (ll)(r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (ll)(l); --x)
typedef long long ll;
typedef std::pair<int, int> pii;
typedef std::pair<ll , ll > pll;
using namespace std;
const int N = 3*1024;
const int mod = 998244353;
int inv[N];
ll pw(l... | 2035G1 | wrong_submission | easy |
288,371,155 | C++20 (GCC 13-64) | WRONG_ANSWER on test 2 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lll __int128
#define uint unsigned int
#define ull unsigned long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define vi vector<int>
#define eb emplace_back
#define po pop_back
#define par __builtin_parity
#define pc... | 2035G1 | wrong_submission | easy |
288,319,596 | Python 3 | TIME_LIMIT_EXCEEDED on test 2 | def binary_search(n, k, arr):
l = 1
h = n
while l < h:
m = (l + h) // 2
if arr[m-1] < k:
l = m + 1
else:
h = m
return l
def check_val(n, tests, removed_tests, arr):
for i, (x, k) in enumerate(tests):
if i in removed_tests:
continu... | 2035G1 | wrong_submission | easy |
288,350,787 | C++20 (GCC 13-64) | WRONG_ANSWER on test 2 | #pragma GCC optimize("Ofast","unroll-all-loops","fast-math","no-stack-protector")
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#if 1
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __... | 2035G1 | wrong_submission | easy |
290,745,893 | C++17 (GCC 7-32) | WRONG_ANSWER on test 3 | #include<bits/stdc++.h>
using namespace std;
const int N = 3e5;
const int mod = 998244353;
int n, m;
struct dpnode{
int nr, nr2;
}dp[N];
void add(dpnode &a, dpnode b){
if(b.nr2 == 0)return;
if(a.nr < b.nr){
a = b;
}else if(a.nr == b.nr){
a.nr2 = (a.nr2 + b.nr2)%mod;
}
}
int fastexp(i... | 2035G1 | wrong_submission | easy |
288,377,777 | C++17 (GCC 7-32) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
int t;
int n, k;
int arr[3002];
int DPans[3002];
bool valid[3002];
ll DPcnt[3002];
int S[3002], E[3002];
void binary(int l, int r){
if(l==r) return;
int m = (l+r)/2;
S[m] = l, E[m] = r;
binary(l, m);
... | 2035G1 | wrong_submission | easy |
288,466,504 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int N=3005,mod=998244353;
int n,m,rt,tot,lca[N][N],fa[N*2],ls[N*2],rs[N*2],fd[N*2],to[N*2],a[N],g[N];
ll fc[N],inv[N],pw[N],f[N];
ll qp(ll a,int b){ll ans=1;for(;b;b>>=1,a=a*a%mod)if(b&1)ans=ans*a%mod;return ans;}
ll C(int n,int m){return n<m||m<0?0... | 2035G1 | wrong_submission | easy |
290,014,247 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #include <bits/stdc++.h>
using namespace std;
namespace Combo {
const int mod = 998244353;
vector<int> f = {1}, invf = {1};
int mul(int x, int y) {
return (1LL * x * y) % mod;
}
int exp(int x, int y) {
int ret = 1;
while(y) {
if(y & 1) ret = mul(ret, x);
... | 2035G1 | wrong_submission | medium |
296,251,646 | C++23 (GCC 14-64, msys2) | RUNTIME_ERROR on test 3 | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pr pair<int,int>
const int N=3005,mods=998244353,inf=1e9;
int n,m,t,a[N],b[N],dy[N],pw[N],bh[N][N],idx;
map<pr,pr>q[2][N];
pr hb(pr a,pr b){
if(a.first==b.first)return {a.first,(a.second+b.second)%mods};
if(a.first>b.first)return a;
return b... | 2035G1 | wrong_submission | medium |
289,067,675 | C++23 (GCC 14-64, msys2) | RUNTIME_ERROR on test 3 | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const int N = 3050;
const int mod = 998244353;
vector<int> path[N];
int oper[N],dp[N],cnt[N],used[N],it;
void build(vector<int> a, int l, int r){
if(l > r)return;
if(l == r){
path[l] = a;
return;
}
in... | 2035G1 | wrong_submission | medium |
291,168,134 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | // Cao Quang Hung
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<long long , long long>
#define vi vector<int>
#define vpii vector<pii>
#define SZ(x) ((int)(x.size()))
#define fi first
#define se second
#define ... | 2035G1 | wrong_submission | medium |
288,465,849 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int N=3005,mod=998244353;
int n,m,rt,tot,lca[N][N],fa[N*2],ls[N*2],rs[N*2],fd[N*2],to[N*2],a[N],g[N];
ll fc[N],inv[N],pw[N],f[N];
ll qp(ll a,int b){ll ans=1;for(;b;b>>=1,a=a*a%mod)if(b&1)ans=ans*a%mod;return ans;}
ll C(int n,int m){return n<m||m<0?0... | 2035G1 | wrong_submission | medium |
290,167,952 | C++20 (GCC 13-64) | WRONG_ANSWER on test 3 | #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx,popcnt,sse4,abm")
#include <bits/stdc++.h>
using namespace std;
#ifdef WAIMAI
#define debug(HEHE...) cout << "[" << #HEHE << "] : ", dout(HEHE)
void dout() {cout << '\n';}
template<typename T, typename...U>
void dout(T t, U...u) {cout << t << (sizeof.... | 2035G1 | wrong_submission | medium |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.