source_code stringlengths 26 62k | lang_cluster stringclasses 11
values | src_uid stringlengths 32 32 | code_uid stringlengths 32 32 | difficulty int32 -1 3.5k ⌀ | exec_outcome stringclasses 1
value |
|---|---|---|---|---|---|
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define pb push_back
#define pf push_front
#define F first
#define S second
#define MOD 1000000007
#define MAXN 1000001
#define MODA 998244353
#define vi vector<int>
#define vll vector<ll>
#define all(a) ... | C++ | 18cf79b50d0a389e6c3afd5d2f6bd9ed | 42308191a94358e4a2640dcd263463ac | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define IOS ios::sync_with_stdio(false); cin.tie(NULL);
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __p... | C++ | 18cf79b50d0a389e6c3afd5d2f6bd9ed | e13a340c3a740dca56696104655d2f0c | 1,900 | PASSED |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define sync() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define fileIO() freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout)
#define F first
#define S second
#define ers erase
#defi... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | 52f65a6e0a284613337e84868a25d52b | 2,600 | PASSED |
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
#include <bitset>
#include <cctype>
typedef long long ll;
#define MAX 1005
using names... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | f117e9513578b739e0b3027045604c21 | 2,600 | PASSED |
///In the name of GOD
#include<bits/stdc++.h>
using namespace std;
typedef double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string , string> pss;
#define all(x) (x).begin(),... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | 3fdd6d9690c668e659f86285a29a650e | 2,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<LL,LL> pii;
const int SZ = 2100;
const int INF = 1e9 + 10;
const int mod = 998244353;
const LD eps = 1e-12;
LL read() {
LL n = 0;
char a = getchar();
bool flag = 0;
while(a > '9' || a < '0') { if(a ... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | e9596cf5fc6103e09c0e1cfffdd0fe22 | 2,600 | PASSED |
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define all(x) (x).begin(),(x).end()
#define F ... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | 1a152103a4b2b3656dd4b1dd03e48da5 | 2,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
const int Maxn = 1005;
ld C[Maxn][Maxn];
int n, m;
vector <int> my[Maxn];
int has[Maxn];
bool extr[Maxn];
map <int, vector <int> > M;
ld dp[Maxn][Maxn];
int main()
{
for (int i = 0; i < Maxn; i++) {
C[i][0] = C[i][i] = 1;
for ... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | 969cc25e892b63c3f9a3057f2b5a6c26 | 2,600 | PASSED |
/**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author majk
*/
#ifndef MAJK_LIB
#define MAJK_LIB
#include <vector>
#include <stack>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <iomanip>
#include <set>
#include <functional>... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | 28567b530a16df636aad63e9f91478b0 | 2,600 | PASSED |
/**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author alireza_kaviani
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T> using Tree = tree<T, null_t... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | 9542c9c8d98f5b152285eca755ab96d9 | 2,600 | PASSED |
#include <iostream>
#include <vector>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <iomanip>
using ll = long long;
using ld = long double;
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) < (b)) ? (b) : (a))
int const nmax = 1000;
ll const inf = 1000000000000000000;
int _coun... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | af1ee82d87a4c9d3d8d3fa00f4bf420d | 2,600 | PASSED |
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define pb push_back
#define pii pair < int , int >
#define F first
#define S second
#define int long long
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
/// khodaya komak kon
/// ya navid
const int N=1003;... | C++ | b8b3f75baaef9c4232e7fd7555d4fabb | 96aa35b2daf32dc9230870bc6df69f4e | 2,600 | PASSED |
#include <math.h>
#include <ctype.h>
#include <limits.h>
#include <string.h>
#include <assert.h>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
#define nl std::cout << "\n"
#define in(x) std::cin >> (x)
#define out(x) std::cout << (x) << " "
#defin... | C++ | 6551be8f4000da2288bf835169662aa2 | 3449000973d08e4a414e39cb0327b15c | 1,600 | PASSED |
/*
AUTHOR: Shyaam Shobanadevi
எண்ணித் துணிகக் கருமம் துணிந்தபின்
எண்ணுவம் என்பது இழுக்கு
*/
#include <bits/stdc++.h>
using namespace std;
//to compile in c++11 use the command : --std=c++11
#define ll long long
#define ull unsigned long long
#define ld long double
#define mod 1000000007LL
#define eps 1e-13
#... | C++ | 6551be8f4000da2288bf835169662aa2 | 89b8486ada3bf9d99cb53528cb9f2457 | 1,600 | PASSED |
/*
AUTHOR: Shyaam Shobanadevi
எண்ணித் துணிகக் கருமம் துணிந்தபின்
எண்ணுவம் என்பது இழுக்கு
*/
#include <bits/stdc++.h>
using namespace std;
//to compile in c++11 use the command : --std=c++11
#define ll long long
#define ull unsigned long long
#define ld long double
#define mod 1000000007LL
#define eps 1e-13
#... | C++ | 6551be8f4000da2288bf835169662aa2 | 85a432a93d5505d5ffdc5a47cae70521 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ln "\n"
long long gcd(int a ,int b){
if(a%b==0)
return b;
else
return gcd(b,a%b);
}
int main(){
long long a,b,l,h;
cin>>a>>b;
int q; cin>>q;
long long n = gcd(a,b);
vector<long long> v;
for(long long i=1; i<=sqrt(n); i++)
{
if(n%i == 0){
... | C++ | 6551be8f4000da2288bf835169662aa2 | 192bb8b5d034986e0da6ff58ff3fa6a0 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)
#define ll long long int
#define ld long double
#define fr first
#define se second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort... | C++ | 6551be8f4000da2288bf835169662aa2 | 9f751c2197a8ca2ea393f777ed278aac | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define ll long long int
#define ld long double
#define fr first
#define se second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) sort(all(v... | C++ | 6551be8f4000da2288bf835169662aa2 | a9e47dba4efb13f17c61c7eb32919a3a | 1,600 | PASSED |
#include <functional>
#include<algorithm>
#include <utility>
#include <numeric>
#include<iostream>
#include<valarray>
#include<stdio.h>
#include<iomanip>
#include<complex>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<set>
#include<map>
#defi... | C++ | 6551be8f4000da2288bf835169662aa2 | 693b9700a35c3c591da9e6df84ac20b8 | 1,600 | PASSED |
/*
....................................................................................
RRRRRRRRRR EEEEEEEEEEE ZZZZZZZZZZZZZ K K K K .
RRRRRRRRRR EEEEEEEEEEE ZZZZZZZZZZZZZ K K K K .
R R R R E E E E ... | C++ | 6551be8f4000da2288bf835169662aa2 | fe8403a10f3d6022ca8d77a6a6ae8bad | 1,600 | PASSED |
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define all(x) x.begin(),x.end()
#define sorta(x) sort(all(x))
#define test int t;cin>>t;while(t--)
#define input(a,n) for(i=0;i<n;i++)cin>>a[i];
#define forn(i,n) for(int i = 0; i < int(n); i++)... | C++ | 6551be8f4000da2288bf835169662aa2 | b48e5e12efc70f9cb673d20bdf9f56f0 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int gcd(int a,int b)
{
if(b==0)
return a;
return gcd(b,a%b);
}
int bs(int x,vector<int>v,int low,int high)
{
int mid;
while(low<=high)
{
mid=low+(high-low)/2;
if(v[mid]==x)
return mid;
else if(v[mid]<x)
... | C++ | 6551be8f4000da2288bf835169662aa2 | eb2199c852d3177f63522461a5c20ab8 | 1,600 | PASSED |
/*▄███████▀▀▀▀▀▀███████▄
░▐████▀▒RAPHAELMEU▒▀██████▄
░███▀▒▒▒▒▒PATO▒▒▒▒▒▒▀█████
░▐██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░... | C++ | 6fcd8713af5a108d590bc99da314cded | 712e865db9d275e27a86d42b364552bc | 2,300 | PASSED |
/*▄███████▀▀▀▀▀▀███████▄
░▐████▀▒RAPHAELMEU▒▀██████▄
░███▀▒▒▒▒▒PATO▒▒▒▒▒▒▀█████
░▐██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░... | C++ | 6fcd8713af5a108d590bc99da314cded | 863a5c8b71e0e7270c0f777f9d5668d8 | 2,300 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#defi... | C++ | 6fcd8713af5a108d590bc99da314cded | 1b34a1e8bfad204450d314d57fd196db | 2,300 | PASSED |
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
... | C++ | 6fcd8713af5a108d590bc99da314cded | 071cb7d6cad15ca6391573bd4ed4d86c | 2,300 | PASSED |
#include <bits/stdc++.h>///18:20
using namespace std;
#define DIM 2009
#define INF 1e11+9
#define pairll pair<long long,long long>
#define fi first
#define se second
#define ld long double
#define MOD 1000000006
long long i,j,k,l,n,m,x,y;
typedef long long matrix[DIM][DIM];
matrix a,p;
void mult(matrix &a,matrix ... | C++ | 6fcd8713af5a108d590bc99da314cded | f811946eb01a3dab660cfde7e81a5938 | 2,300 | PASSED |
/*input
27230 83472 9488 55320 2081
*/
//assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pii pair<ll int,ll int>
#define vpii vector< pii >
#d... | C++ | 6fcd8713af5a108d590bc99da314cded | 2e12cf986b6ef23195b19f75dba06738 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U... | C++ | 6fcd8713af5a108d590bc99da314cded | 48c947b928854ac6224e6f423b6afd23 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U... | C++ | 6fcd8713af5a108d590bc99da314cded | 6c2a0023533ffd32f2c16d4689475cf8 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U... | C++ | 6fcd8713af5a108d590bc99da314cded | e8ef3ebbb8af40637ba6be6a85edb121 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1e9 + 7;
const int DIM = 3;
struct Matrix {
ll a[DIM][DIM];
ll *operator [] (int r) { return a[r]; };
Matrix(int x = 0) {
memset(a, 0, sizeof a);
if (x)
{
for (int i = 0; i < DIM; i++) a[i][i] = x;
}
}
} const I(1);
Matrix... | C++ | 6fcd8713af5a108d590bc99da314cded | 7551555cecfe92a0fc89f98dedba8e6c | 2,300 | PASSED |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.Stream;
import java.util.Map;
import java.util.Collection;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Optional;
import java.util.HashMap;
/**
* Built usi... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | ec44c9e26481ba76a5cfed39006f342f | 1,400 | PASSED |
import java.util.*;
public class Watchmen {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
Map<Long, Integer> X = new HashMap<>();
Map<Long, Integer> Y = new HashMap<>();
Map<Map<Long,Long>,Integer> XY = new HashMap<>();
int n... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | b1ccf9203ab960e56259ca5a050bc862 | 1,400 | PASSED |
import java.util.*;
public class Watchmen1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
Map<Long, Integer> X = new HashMap<>();
Map<Long, Integer> Y = new HashMap<>();
Map<Map<Long,Long>,Integer> XY = new HashMap<>();
int ... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | 6ec247606f390aa04bb47b0f5f4c47d2 | 1,400 | PASSED |
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Watchmen {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in=new Scanner(System.in);
int num=in.nextInt();
Map<Long,Integer> X=new HashMap<>();
Map<Long,Integer> Y=new HashMap<>();
... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | f8d7fd60bf34412a1cce0cf2d0aba396 | 1,400 | PASSED |
import javafx.util.Pair;
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Reader in = new Reader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
int n = in.nextI... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | 0f6d62b4179da3f4fbcb121b25235bb9 | 1,400 | PASSED |
import java.awt.Point;
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class Watchmen {
static class Solver {
MyReader mr = new MyReader();
public void solve() {
int n = mr.nextInt();
Map<Integer,Integer> xm = new HashMap<>();
Map<Integ... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | 080e330e8655a58a567d54c49bea28a2 | 1,400 | PASSED |
import java.awt.*;
import java.util.*;
/**
* Created by maxim on 3/12/16.
*/
public class C651 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long res = 0;
HashMap<Integer, Integer> xCoords = new HashMap<>();
HashMap<... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | be7edad50fb9351a0a19bf557a9e4f9d | 1,400 | PASSED |
import java.awt.Point;
import java.util.HashMap;
import java.util.Scanner;
public class c651 {
public static void main(String[] args) {
// TODO Auto-generated method stub
HashMap<Integer, Integer> xs = new HashMap<Integer,Integer>();
HashMap<Integer,Integer> ys = new HashMap<Integer,Integer>();
HashMap<Point... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | 63341deb109ef7afdbd22826bae87575 | 1,400 | PASSED |
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Watchmen {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in=new Scanner(System.in);
int num=in.nextInt();
Map<Long,Integer> X=new HashMap<>();
Map<Long,Integer> Y=new HashMap<>();
... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | c76a30d7978610e5aed7979d8705c590 | 1,400 | PASSED |
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class ProblemC {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();// n~2e5
Set<Point> p = new HashSet<>();
Map<Point, Integer> dup =... | Java | bd7b85c0204f6b36dc07f8a96fc36161 | 69b762a66e99314a5980963ffe96db52 | 1,400 | PASSED |
#include <bits/stdc++.h>
#ifdef NJUDGE
#include "kowski.h"
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <ll> vl;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int MO... | C++ | fc0d3b122d800dcbcb99795581229d42 | 630c81f791f54253403b5687d935ab4a | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
string s;
cin >> s;
for(int i=1; i<s.size(); i++)
if (s[i]!=s[i-1]) cout << 1 << ' ';
else cout << 0 << ' ';
if (s[s.size()-1]=='a') cout << 1;
else cout << 0;
return 0;
}
| C++ | fc0d3b122d800dcbcb99795581229d42 | 7e76886e4cd5c6e3e0e6482e98e80d71 | 1,500 | PASSED |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
char s[1010];
int main()
{
while(~scanf("%s",s))
{
int len=strlen(s);
int k=0;
if(s[0]=='a')k=1; //判定最左端是否存在a
for(int i=0;i<len;i++)
{
if(i==len-1) //最后一个位置直接处理
{
... | C++ | fc0d3b122d800dcbcb99795581229d42 | a8a1498fb7ea90d516b3e44a3bceeadb | 1,500 | PASSED |
#include <iostream>
#include<cstdio>
#include<string.h>
using namespace std;
char a[100050];
int s[10050];
int main()
{
int k=0,n;
scanf("%s",a);
n=strlen(a);
if(a[0]=='a')
k=1;
for(int i=0;i<n;i++)
{
if(i==n-1&&k==0)
s[i]=1;
if(k==1&&a[i]=='b'&&a[i+1]=='a')
... | C++ | fc0d3b122d800dcbcb99795581229d42 | ae8a083c15354125d78310740014e314 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
// freopen("temp.in","r",stdin);
string s;
cin >> s;
for(int i=0; i<s.size(); ++i){
cout << ( (s[i]=='a'&&i+1==s.size())||(i+1<s.size()&&s[i]!=s[i+1]) ) << " ";
}
cout << '\n';... | C++ | fc0d3b122d800dcbcb99795581229d42 | bc645b9ab39ab645707c6f7d36874eb4 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
// testing submission :)
// testing submission :)
// testing submission :)
// testing submission :)
vector<int> res;
vector<int> b;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
res.resize(s.size());
for (int i = 1; i < s.s... | C++ | fc0d3b122d800dcbcb99795581229d42 | d1e0b645eac7c50b067b665d0bf27da1 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
// testing submission :)
// testing submission :)
// testing submission :)
// testing submission :)
vector<int> res;
vector<int> b;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
res.resize(s.size());
for (int i = 1; i < s.s... | C++ | fc0d3b122d800dcbcb99795581229d42 | 6afc785f1fe1828c5ef2741ed7f288ef | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
// testing submission :)
// testing submission :)
// testing submission :)
// testing submission :)
vector<int> res;
vector<int> b;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
res.resize(s.size());
for (int i = 1; i < s.s... | C++ | fc0d3b122d800dcbcb99795581229d42 | ae848332d04d35da99c104489ae4607e | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
vector<int> dp(s.size(), 0);
for (int i = 1; i < s.size(); i++) {
if (s[i] == 'a') {
dp[i-1] ^= 1;
dp[i] ^= 1;
}
}
for (auto e : dp) {
cout << e << ' ';
}
retur... | C++ | fc0d3b122d800dcbcb99795581229d42 | 3f726b5ab68c9247c286d958baf0a966 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
vector<int> res;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
res.resize(s.size());
for (int i = 1; i < s.size(); i++) {
if (s[i] == 'a') {
res[i] = 1;
res[i-1] ^= 1;
}
}
for ... | C++ | fc0d3b122d800dcbcb99795581229d42 | 5782fe5f52f065b5526fa72988ddc9ab | 1,500 | PASSED |
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Stack;
import java.util.StringTokenizer;
public class Main {
static class Reader
{
BufferedReader r;
... | Java | a3e88504793c44fb3110a322d9dbdf17 | 7416a75ba97e4010e0a242821df8d487 | 2,000 | PASSED |
#include <bits/stdc++.h>
#define fl(i,n) for(int i = 0; i < n; i++)
#define ll long long
#define nl endl
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define PII pair<int,int>
#define EPS 1e-9
#define INF 1e16
using namespace std;
string s;
struct tree{
int o,... | C++ | a3e88504793c44fb3110a322d9dbdf17 | c630d9820fc7acf12633a6e349c5daa6 | 2,000 | PASSED |
/* ^^ ====== ^^
ID: meixiuxiu
PROG: test
LANG: C++11
*/
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <climits>
#include <string>
#include <vector>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <... | C++ | a3e88504793c44fb3110a322d9dbdf17 | 886a5499033525ff22e4f166c1b014df | 2,000 | PASSED |
#pragma warning (disable : 4996 4018)
//#include <thread>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
#include <vector>
#include <bitset>
#include <limits>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <... | C++ | a3e88504793c44fb3110a322d9dbdf17 | 0ab5c705707df7abc6eb1d85ff510f8f | 2,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
struct node
{
int l = 0, r = 0, f = 0;
node() {}
};
char str[1000050];
node tree[5000000];
node _merge(node l, node r)
{
node t;
int x= min(l.r, r.l);
t.f = l.f + r.f + x;
t.l = l.l + r.l - x;
t.r = l.r + r.r - x;
return t;
}
node build(in... | C++ | a3e88504793c44fb3110a322d9dbdf17 | f8e06880b28e488db3cb6b5846e55276 | 2,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define N 1000001
struct node {
int ans;
int opn;
int cls;
node() {
ans = 0;
opn = 0;
cls = 0;
}
};
node t[4 * N];
char s[N];
node combine(node lhs, node rhs) {
node res;
res.ans = lhs.ans + rhs.ans + 2 * min(lhs.opn, ... | C++ | a3e88504793c44fb3110a322d9dbdf17 | b655e3d1dd9896627e5d018090a546eb | 2,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PI;
struct Node{
Node *lch,*rch;
int maxL,l,r;
Node(){
lch=rch=nullptr;
maxL=l=r=0;
}
Node(int _maxL,int _l,int _r):maxL(_maxL),l(_l),r(_r){}
inline void up(){
maxL=lch->maxL+rch->maxL+min(lch->l-lch->maxL,rch->r-rch->m... | C++ | a3e88504793c44fb3110a322d9dbdf17 | 0381aa0c6a3389d62e6d146afb9a2cb6 | 2,000 | PASSED |
#include<iostream>
using namespace std;
const int N = 1e6 + 10;
int arr[N] , n;
string s;
struct node{
int a , b , ans;
}seg[N << 2];
node merge(node A,node B){
node ret;
ret.ans = A.ans + B.ans + 2 * min(A.b , B.a);
ret.a = A.a + max(0 , B.a - A.b);
ret.b = B.b + max(0 , A.b - B.a);
return ... | C++ | a3e88504793c44fb3110a322d9dbdf17 | 954f8b50bfb3704baebd65e191f1108f | 2,000 | PASSED |
#include <bits/stdc++.h>
#define fi first
#define se second
#define p_b push_back
#define pll pair<ll,ll>
#define endl "\n"
#define m_p make_pair
#define all(x) x.begin(),x.end()
using namespace std;
typedef long long ll;
const ll MAXN = 4 * 1123456;
template <typename T>
T sqr(T x){
return x * x;
}
template <t... | C++ | a3e88504793c44fb3110a322d9dbdf17 | 70c79d4358c8c46c62c67a1bb74b607e | 2,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
char s[1000100];
struct node
{
int f,s,b;
} Tree[4000100];
int q,a,b,n;
void build(int cn,int st,int ed)
{
if(st==ed)
{
Tree[cn].b=0;
if(s[st]=='(') Tree[cn].f=1;
else Tree[cn].s=1;
return;
}
int lft=cn<<1,rgt=lft+1,mid=(st... | C++ | a3e88504793c44fb3110a322d9dbdf17 | b392838180e0ad8f0dd2a65335acb28e | 2,000 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int NN=123456;
typedef long long INT;
INT dp[NN][4],a[NN][4],n;
int main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif
cin>>n;
for(int i=1;i<=3;i++){
for(int j=1;j<=n;j++)scanf("%I64d",&a[j][i]);
}
dp[1][1]=a[1][1]; dp[1][2]=dp[1][1]+a[1][2]... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | fd6b8db7f31927eee92d4924729fabc9 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int NN=101010;
typedef long long INT;
INT a[4][NN];
INT dp[4][NN];
int main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif
int n;
cin>>n;
for(int i=1;i<=3;i++){
for(int j=1;j<=n;j++)scanf("%I64d",&a[i][j]);
}
dp[1][1]=a[1][1];
dp[2][1]=dp[1]... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | 5f9ea6819db91aced3426aff09735840 | 2,300 | PASSED |
#include<bits/stdc++.h>
#define NN 100100
using namespace std;
typedef long long INT;
typedef pair<INT,INT>pii;
INT w[3][NN];
INT dp[3][NN];
int main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif
int n;
cin>>n;
for(int i=0;i<3;i++)for(int j=1;j<=n;j++)scanf("%I64d",&w[i][j]);
dp[0][1]=w[0][1];
d... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | 5ce6f35b72d9de969a0f372a6664c6fc | 2,300 | PASSED |
#define inf 0x3f3f3f3f3f3f3f3f
#include<bits/stdc++.h>
#define NN 101010
using namespace std;
using INT=long long;
template<typename A, typename B> inline void smax(A &a, const B &b) {if(a<b) a=b;}
int a[NN][4];
INT dp[NN][4];
int main() {
int n; scanf("%d", &n);
for(int i=1; i<=3; i++) {
for(int j=1; j<=n; j++)... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | d4d379279c71eee29aa811d23892d370 | 2,300 | PASSED |
#include<bits/stdc++.h>
#define NN 100100
#define inf 1e18
using namespace std;
typedef long long INT;
typedef pair<INT,INT>pii;
INT w[3][NN];
INT dp[3][NN];
int main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
freopen("out.out","w",stdout);
#endif
int n;
cin>>n;
for(int i=0;i<3;i++)for(int j=1;j<=n;j... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | 5254372901b70c1d42fd6d91e881d555 | 2,300 | PASSED |
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f3f3f3f3fll
#define NN 100100
using namespace std;
typedef long long INT;
INT dp[5][NN];
INT a[5][NN];
INT ans;
int main(){
#ifndef ONLINE_JUDGE
freopen("in.in", "r", stdin);
freopen("out.out", "w", stdout);
#endif
int n;
scanf("%d", &n);
for(int i = 1; i <= 3; i++) ... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | 30dbe9ce512184ce60426e5ed2eb0d4b | 2,300 | PASSED |
#include<bits/stdc++.h>
#define NN 101010
using namespace std;
using INT=long long;
inline void smax(INT &a, const INT &b) {if(a<b) a=b;}
int a[NN][4];
INT dp[NN][4];
int main() {
int n; scanf("%d", &n);
for(int i=1; i<=3; i++) {
for(int j=1; j<=n; j++) scanf("%d", a[j]+i);
}
dp[1][1]=a[1][1], dp[1][2]=dp[1][3... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | aea0b01fbbe905bbd779499694bd4814 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int NN=123456;
typedef long long INT;
INT dp[NN][4];
int a[NN][4],n;
int main(){
#ifndef ONLINE_JUDGE
freopen("in.in","r",stdin);
#endif
cin>>n;
for(int i=1;i<=3;i++){
for(int j=1;j<=n;j++)scanf("%d",&a[j][i]);
}
dp[1][1]=a[1][1]; dp[1][2]=dp[1][1]+a[1][... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | 542ba5862982b3da0007d3e9624ab071 | 2,300 | PASSED |
#include <iostream>
#include <cstdio>
#include <algorithm>
#define maxn 100005
#define INF 1e18
using namespace std;
long long dp[3][maxn], num[3][maxn];
long long sum(int i, int j, int k){
if(j > k)
swap(j, k);
long long p = 0;
for(int h = j; h <= k; h++)
p += num[h][i];
return p;
}
int mai... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | ad37cab723bc8497e53c5768e264a8a2 | 2,300 | PASSED |
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX 1e18
long long grid[3][100010];
long long memo[3][100010];
// Find sum between two grid points x,y1 and x,y2
long long colSum(int x, int y1, int y2){
long long total = 0;
if (y1 > y2) for(; y2 <= y1; ++y2) total += grid[y2][x];
els... | C++ | 301a6dd54b3d404e98f5e1ee014d5c89 | 30a670ee2b44886dd268ba133ce43050 | 2,300 | PASSED |
#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>
using namespace std;
#define rep(i,a,b) for(int i = a; i < b; i++)
#define S(x) scanf("%d",&x)
#define S2(x,y) scanf("%d%... | C++ | 14b65af01caf1f3971a2f671589b86a8 | 13e5f112032a3407d36205c9463ef3aa | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;
#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq prior... | C++ | 14b65af01caf1f3971a2f671589b86a8 | 40a7913740ca891b22861b48245c734a | 1,800 | PASSED |
// Author - abbi_18
#include<bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define inf 1e18
#define PI 3.14159265
#define mset(A,num,n); memset(A,num,n);
#d... | C++ | 14b65af01caf1f3971a2f671589b86a8 | c8a9ee824d7acac5172b107624b7b702 | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e17;
const int N = 3e5 + 7;
int n, m;
int c[N];
vector <int> g[N];
long long w[N], sum = -inf, f[N];
bool imp = true;
void dfs(int v, int p) {
w[v] += c[v];
int cnt = 0;
for (int u: g[v]) {
if (u != p) {
dfs(u, v);
f[v] = max... | C++ | 14b65af01caf1f3971a2f671589b86a8 | d93077e7519edcbe2329eef5b81ed20b | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e17;
const int N = 3e5 + 7;
int n, m;
int c[N];
vector <int> g[N];
long long w[N], sum = -inf, f[N];
bool imp = true;
void dfs(int v, int p) {
w[v] += c[v];
int cnt = 0;
for (int u: g[v]) {
if (u != p) {
dfs(u, v);
f[v] = max... | C++ | 14b65af01caf1f3971a2f671589b86a8 | 8a7938a40197f7dac96825bd8b04078d | 1,800 | PASSED |
#include<iostream>
#include <utility>
#include<stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <stdint.h>
#include <vector>
typedef int64_t ULL;
using namespace std;
ULL n;
ULL plnt[200001];
vector<int> graph[200001];
int vis[200001] = {0};
ULL max_res=-1000000000000000;
ULL max_res_old =-1... | C++ | 14b65af01caf1f3971a2f671589b86a8 | 08ed045cd5cd2c0b99eccb90ba1c6a89 | 1,800 | PASSED |
# include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define y0 asdsahhajkshdasdks
#define y1 asdjklasjldkjklqwj
#define next asdjlsadjlwjerwj
#define prev sdjfkljlkwjrw... | C++ | 14b65af01caf1f3971a2f671589b86a8 | c32d431a6b970eeb9647d8091066647c | 1,800 | PASSED |
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cmath>
#define N 500005
#define INF -20000000000005
using namespace std;
int n,x,y;
long long ans=0;
int head[N];
long long dp[N],a[N],sum[N];//dp[i]表示以i为根节点的子树中和最大的值,sum[i]表示i的子树和
struct Tree{
int next,to;
}e[500005];... | C++ | 14b65af01caf1f3971a2f671589b86a8 | cdd1041305c83c0df8344c133f6c2926 | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
typedef long long LL;
#define pb push_back
#define mp make_pair
#define f first
#define sc second
#define inf (long long)(2e+17)
#define all(o) (o).begin(), (o).end()
const int N = 200005;
LL a[N];
LL val[N];
LL sum[N];
vector<int> V[N];
LL ans = -in... | C++ | 14b65af01caf1f3971a2f671589b86a8 | c46f82df02c3482c015f0122839c5e27 | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
typedef long long LL;
#define pb push_back
#define mp make_pair
#define f first
#define sc second
#define inf (long long)(2e+17)
#define all(o) (o).begin(), (o).end()
const int N = 200005;
LL a[N];
LL val[N];
LL sum[N];
vector<int> V[N];
LL ans = -in... | C++ | 14b65af01caf1f3971a2f671589b86a8 | 38590911c55c70676b55e04f6630e0e7 | 1,800 | PASSED |
#include <bits/stdc++.h>
#include <bits/extc++.h>
// abbr
using Int = int32_t;
// using Int = int64_t;
#define for0(i, n) for (Int i = 0; i < Int(n); ++i)
#define for1(i, n) for (Int i = 1; i <= Int(n); ++i)
#define for0r(i, n) for (auto i = Int(n-1); i >= 0; --i)
#define for1r(i, n) for (auto i = Int(n); i >= 1; --i)... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | cf6797209236e5dcc69a1e7eb94909d4 | 1,700 | PASSED |
#include <bits/stdc++.h>
#include <bits/extc++.h>
// abbr
using ll = int32_t;
// using ll = int64_t;
#define for0(i, n) for (ll i = 0; i < ll(n); ++i)
#define for1(i, n) for (ll i = 1; i <= ll(n); ++i)
#define for0r(i, n) for (auto i = ll(n-1); i >= 0; --i)
#define for1r(i, n) for (auto i = ll(n); i >= 1; --i)
#define... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 08a7d3c341bdb2f6e24929f05dbf70f5 | 1,700 | PASSED |
#include <bits/stdc++.h>
#include <bits/extc++.h>
// abbr
using Int = int32_t;
// using Int = int64_t;
#define for0(i, n) for (Int i = 0; i < Int(n); ++i)
#define for1(i, n) for (Int i = 1; i <= Int(n); ++i)
#define for0r(i, n) for (auto i = Int(n-1); i >= 0; --i)
#define for1r(i, n) for (auto i = Int(n); i >= 1; --i)... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 294826c0603d9f99e5a8eda47f7ecd1e | 1,700 | PASSED |
#include <bits/stdc++.h>
#include <bits/extc++.h>
// abbr
using ll = int32_t;
// using ll = int64_t;
#define for0(i, n) for (ll i = 0; i < ll(n); ++i)
#define for1(i, n) for (ll i = 1; i <= ll(n); ++i)
#define for0r(i, n) for (auto i = ll(n-1); i >= 0; --i)
#define for1r(i, n) for (auto i = ll(n); i >= 1; --i)
#define... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 3492747ead0a014bf33e1f80e9a487b5 | 1,700 | PASSED |
#include <bits/stdc++.h>
#include <bits/extc++.h>
// abbr
using Int = int32_t;
// using Int = int64_t;
#define for0(i, n) for (Int i = 0; i < Int(n); ++i)
#define for1(i, n) for (Int i = 1; i <= Int(n); ++i)
#define for0r(i, n) for (auto i = Int(n-1); i >= 0; --i)
#define for1r(i, n) for (auto i = Int(n); i >= 1; --i)... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 7197665d0ac633f1b4fe12b9dab27809 | 1,700 | PASSED |
#include <bits/stdc++.h>
#include <bits/extc++.h>
// abbr
using Int = int32_t;
// using Int = int64_t;
#define for0(i, n) for (Int i = 0; i < Int(n); ++i)
#define for1(i, n) for (Int i = 1; i <= Int(n); ++i)
#define for0r(i, n) for (auto i = Int(n-1); i >= 0; --i)
#define for1r(i, n) for (auto i = Int(n); i >= 1; --i)... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 30ac8e4ffa8a655920f045aa356fd9c7 | 1,700 | PASSED |
#include <bits/stdc++.h>
#include <bits/extc++.h>
// abbr
#define for0(i, n) for (auto i = decltype(n)(0); i < n; ++i)
#define for1(i, n) for (auto i = decltype(n)(1); i <= n; ++i)
#define for0r(i, n) for (auto i = n - 1; i >= 0; --i)
#define for1r(i, n) for (auto i = n; i >= 1; --i)
#define forxy(i, x, y) for (auto i... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 32e79f1350471f725f9520ca75fbb064 | 1,700 | PASSED |
#include<bits/stdc++.h>
//typedef long long ll;
//#define int long long
#define F first
#define S second
#define endl "\n"
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define memset(a,b) memset(a,b,sizeof(a));
#define IOS i... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 430998e38a6cfb818c3a2fe4b1edd6d7 | 1,700 | PASSED |
#include<bits/stdc++.h>
//typedef long long ll;
//#define int long long
#define F first
#define S second
#define endl "\n"
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define memset(a,b) memset(a,b,sizeof(a));
#define IOS i... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 6550837ad3762db2da256cf0782d98c6 | 1,700 | PASSED |
#include<bits/stdc++.h>
//typedef long long ll;
//#define int long long
#define F first
#define S second
#define endl "\n"
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define memset(a,b) memset(a,b,sizeof(a));
#define IOS i... | C++ | 04fd1a55027cce56a491b984ce3a1d6d | 4f78c1d942ce9459c0873d569fba1616 | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define ZERO (1e-10)
#define INF int(1e9+1)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define DEB printf("DEB!\n");
#define D(X) cout<<" "<<#X": "<<X<<endl;
#define EQ(A,B) (A+ZERO>B&&A-ZERO<B)
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vecto... | C++ | 624bf3063400fd0c2c466295ff63469b | f898645a98c3c2f4abd90cf0f0d7925a | 2,500 | PASSED |
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <chrono>
#include <ctime>
#include <math.h>
#include <iomanip>
#include <assert.h>
#include <stdio.h>
#include <cstring>
#include <random>
#define int long long
#define ld ... | C++ | 624bf3063400fd0c2c466295ff63469b | 5a30a57ce4bce6e9f9d34c8dc8c54a91 | 2,500 | PASSED |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int nn = 1010;
const int inf = 0x3f3f3f3f;
const int pp = 1000000007;
const int mod = 998244353;
int n, k, a[nn];
int dp[nn][nn];
int slove(int x) {
dp[0][0] = 1;
int ans = 0, now = 0;
for (int i = 1; i <= n; i++) {
while(now... | C++ | 624bf3063400fd0c2c466295ff63469b | c4b0f3fbe2a37098c2db875347ae9027 | 2,500 | PASSED |
#include<bits/stdc++.h>
#define REP(i,s,t) for(int i=s;i<=t;i++)
using namespace std;
const int Mod=998244353;
int ans,a[1005],n,k,f[1005][1005],sum[1005];
int main(){
cin>>n>>k;
REP(i,1,n) cin>>a[i];
sort(a+1,a+1+n);
int lim=100000/(k-1);
REP(c,1,lim){
memset(sum,0,sizeof sum);
int pt=0;
REP(i,1,n){
whil... | C++ | 624bf3063400fd0c2c466295ff63469b | c1e8c5315f577ac2a104b697d3d608fd | 2,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const int mod = 998244353;
int sum(int a, int b) {
int s = (a + b);
if (s >= mod) s -= mod;
return s;
}
int sub(int a, int b) {
int s = a - b;
if (s < 0) s += mod;
return s;
}
int mult(int a, int b) {
... | C++ | 624bf3063400fd0c2c466295ff63469b | 08338287380157be1033e147a94eef09 | 2,500 | PASSED |
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
const int mod = 998244353;
int sum(int a, int b) {
int s = a + b;
if (s >= mod)
s -= mod;
return s;
}
int sub(int a, int b) {
int s = a - b;
if (s < 0)
s += mod;
return s;
}
int mul(int a, in... | C++ | 624bf3063400fd0c2c466295ff63469b | 81c4ea259d9537d9180dce9a40c20f7d | 2,500 | PASSED |
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define dep(i,a,b) for(int i=b;i>=a;i--)
using namespace std;
#define ll long long
const int N=3e5+5;
const int mod = 998244353;
int sum(int a, int b) {
int s = (a + b);
if (s >= mod) s -= mod;
return s;
}
int sub(int a, int b) {
int s = a... | C++ | 624bf3063400fd0c2c466295ff63469b | 8f476fada6d3c6c33054c8585c0d6be1 | 2,500 | PASSED |
#include<cstdio>
#include<algorithm>
#include<cstring>
#define ll long long
using namespace std;
const ll MOD=998244353;
int n,k,a[1005];
ll f[1005][1005],res[100005],ans,s[1005][1005];
int main()
{
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
sort(a+1,a+n+1);
a[0]=-1000000000;
for(int v=1;v*(k-1)<... | C++ | 624bf3063400fd0c2c466295ff63469b | 727f82d756eed36b5e879d832ed029b6 | 2,500 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.