code_file1 stringlengths 87 4k | code_file2 stringlengths 82 4k |
|---|---|
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define READ freopen("in.txt", "r", stdin);
#define WRITE freopen("out.txt", "w", stdout);
#define optimize ios::sync_with_stdio(0);cin.tie(0);
#define RESET(a, b) memset... | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, x;
string str;
cin >> n >> x >> str;
for (char& ch : str) if (ch == 'o')x++;else x=max(0,x-1);
cout << x << endl;
return 0;
}
|
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll INF = 10e16;
int main() {
int n, m;
cin >> n >> m;
vector<ll> a(m), b(m);
vector<char> c(m);
rep(i, m) {
cin >> a[i] >> b[i] >> c[i];
... | #include <bits/stdc++.h>
using namespace std;
vector<pair<int,char>> adj[1000];
bool vis[1000][1000];
int best[1000][1000];
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n, m;
cin >> n >> m;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
best[i][j] = 1e9;
}
}
while (m... |
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
... | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cmath>
#include <numeric>
#include <functional>
#include <cassert>
#define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << e... |
/* -*- coding: utf-8 -*-
*
* f.cc: F - Max Matrix
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<ut... | #include "bits/stdc++.h"
#include <chrono>
#include <random>
#define lli long long int
using namespace std;
#define mod 1000000007
#define mod1 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define INF 2000000000
#define common cout << "Case #" << w+1 << ": "
#define maxn 10... |
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <random>
using namespace std;
random_device rnd;
mt19937 mt(rnd());
int main(){
int n,m;
cin >> n >> m;
vector<string> ss(m);
for(int i = 0;i < m;i++){
cin >> ss[i];
}
sort(ss.begin(),ss.end(),[](const... | // 2021-06-26 16:47:13
// clang-format off
#include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i =... |
#include<bits/stdc++.h>
#define eps 1e-9
#define pii pair<double,double>
#define mp make_pair
using namespace std;
const int N=200005;
pii dp[N],sum;
int n,m,k;
bool in[N];
pii operator -(const pii &a,const pii &b)
{
return mp(a.first-b.first,a.second-b.second);
}
pii operator +(const pii &a,const pii &b)
{
return m... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
ll N, M, K, A;
cin >> N >> M >> K;
vector<bool> start(N + 1, false);
rep(i, K) {
cin >> A;
start[A] = true;
}
double L = 0, R = 1e20;
vector... |
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
int N;cin>>N;
vector<pair<int,int>>points(N);
// taking points
for(int i=0,x,y;i<N;i++){
cin>>x>>y;
points[i].first = x;
points[i].second = y;
}
int m;cin>>m;
vector<pai... | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define N 200005
struct Mat { ll m[3][3]; };
Mat op[N], nd[N], p[5], cur;
Mat mul(Mat x, Mat y) {
Mat tmp;
rep(i,3)rep(j,3) {
tmp... |
#include <bits/stdc++.h>
#define maxn 300001
using namespace std;
typedef long long LL;
int n;
LL ans;
int ar[maxn];
int tree[maxn];
void update(int x) {
while(x <= n) {
tree[x]++;
x += (x&(-x));
}
}
int query(int x) {
int sum = 0;
while(x) {
sum += tree[x];
x -= (x&(-x));
}
return sum;
}
int main() {... | // Author: old_school
// Created: 30.01.2021 17:30:27
#include<bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
using namespace std;
#define lld long long int
#define ld long double
#define pb push_bac... |
#include <bits/stdc++.h>
using namespace std;
//begin of def
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define endl '\n'
using lli = long long int;
using ulli = unsigned long long int;
using Ld = long double;
using pii = pair<int, int>;
using pll = pair<lli, lli>;
using pld = pair<Ld, Ld>;
#define ... | #include<bits/stdc++.h>
#include<vector>
#include<string>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
bool flag[2510];
int dx[4];
int dy[4];
int t[51][51];
int p[51][51];
string direction = "UDLR";
int nx,ny;
int mx;
int sm,ma... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int T;
cin>>T;
while(T--){
map<int,bool>cnt;
int n;cin>>n;
for(int i=0;i<n;i++){
int x;cin>>x;
cnt[x]^=1;
}
if(n&1)puts("Second");
else {
bool f=false;
for(auto& i:cnt)f|=i.second;
puts(f?"First":"Second");
}
... | //Code by Ritik Agarwal
#include<bits/stdc++.h>
using namespace std;
#define sz(x) (int)(x).size()
#define int long long int
#define loop(i,a,b) for(int i=a;i<b;i++)
#define scan(arr,n) for (int i = 0; i < n; ++i) cin >> arr[i]
#define vi vector<int>
#define si set<int>
#define pii p... |
#include <bits/stdc++.h>
using namespace std;
struct Node{
vector<Node*> nodes;
long long val;
int depth;
};
vector<Node> node;
void depth_dfs(Node& a, int d){
a.depth = d;
for (auto& next:a.nodes)
if(next->depth==-1)
depth_dfs(*next, d+1);
}
void imos_dfs(Node& a, long now){
now += a.val;
a.... | /* In the name of Allah, The Most Gracious, The Most Merciful!
Iffat Sanzida
JU CSE48
❀(◕‿◕)❀
*/
#include<bits/stdc++.h>
#define ll long long int
#define pi acos(-1)
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
//ll mod=1000000007;
//bool sortBysec(pair<... |
/*pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++)
#define RFOR(i, a, n) for (ll i = (ll)n - 1; i >= (ll)a; i--)
#define rep(i, n) FOR(i, 0, n)
#define r... | /*Name:- Prince Soni
College:- Jalpaiguri Government Engineering College*/
// this is how we declare a constant value
// const int xyz=2500000;
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define fr(i,n) f... |
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<iomanip>
#include<queue>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
#define skip cin>>ws;
#define vll vector<ll>
#define vb ... | #pragma GCC optimize(3)
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <queue>
#include <algorithm>
#define maxn 200010
using namespace std;
int read()
{
int x=0,w=1;
char ch=getchar();
while((ch>'9'||ch<'0')&&(ch!='-')) ch=getchar();
if(ch=='-')
{
w=-1;
ch=getchar();
}
w... |
#include<cstring>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<queue>
#include<map>
#define l(x) (x<<1)
#define r(x) ((x<<1)|1)
#define IL inline
#define reg register
#define LL long long
#define INF 0x3f3f3f3f
using namespace std;
LL b,c,x,y,ans;
IL LL Min(LL a,LL... | /* CREATED BY
STREAM_CIPHER
june-2021
*/
#include<bits/stdc++.h>
using namespace std;
void __print(long long x) {cerr << x;}void __print(unsigned long long x) {cerr << x;}void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}void __print(const char *x) {cerr << '\"' << x << ... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
cout<<n-1<<endl;
return 0;
}
| //yukicoder@cpp14
//coder:luckYrat(twitter:@luckYrat_)
//競技プログラミングから逃げるな
//https://www.youtube.com/watch?v=z_B9iJ8r4ic
//せんげん!
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bit... |
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <que... | #include<iostream>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<b-c<<endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
double N, D, H, maxi;
cin >> N >> D >> H;
// cout << " N " << N << " D " << D << " H " << H;
vector<double> d(N), h(N);
double a = H/D, ans;
// cout << " a " << a << " ans " << ans <<endl;
for(int i = 0; i < N; i++){
cin >> d.at(i) >> h.at(... | /* author: Kite_kuma
created: 2021.01.23 20:57:55 */
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
int n, m, k;
cin >> n >> m >> k;
vector<int> furidashi_ni_modoru(n + ... |
#include <iostream>
#include <math.h>
#include <vector>
#include <string>
#include <numeric>
#include <unordered_set>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <map>
using namespace std;
int main(){
int n,k,m; cin >> n >> k >> m;
vector<int> a(n-1);
for(int i=0;i<n-1;i++) cin >... | #include<bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
int main(){
int n,k,m;
while( cin >> n >> k >> m ){
int arr[n];
int sum = 0;
for( int i = 0; i < n-1; i++ ){
int a;
cin >> a;
sum += a;
}
bool flag = false;
... |
//#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>
#include<math.h>
#define DIV 998244353
#define INF 1e15
using namespace std;
using ll = long long;
using ldb = long double;
vector<string> s(3);
map<char... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL<<60;
const double PI = acos(-1.0);
/*const double PI = atan2(0.0,-1.0)*/
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a... |
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define coy c... | ///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(int a,int b)
{
if(b==0)
return a;
return gcd(b,a%b);
}
#define in(x) scanf("%lld",&x)
#define ... |
#include<bits/stdc++.h>
#define LL long long
#define rint register int
#define LB lower_bound
#define UB upper_bound
#define MS(x,y) memset(x,y,sizeof(x))
#define rep(i,a,b) for(rint i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(rint i=a,i##end=b;i>=i##end;--i)
#define cms printf("%.2lf\n",(&o2-&o1)/1024.0/1024);... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const ll INF = (ll)(1e10 + 5);
const ll MAX = (ll)(2e5 + 5);
const ll mult = (ll)(1e4);
double xd, yd, rd;
ll x, y, r;
bool check(ll next, ll width_2_pow) {
return next * next <= width_2_pow;
}
ll mod_floor(ll right, ll mod) {
if (right ... |
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin(... | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, m;
cin >> n >> m;
vector<vector<vector<int>>> adj_list(n, vector<vector<int>>(26));
vector<pair<int, int>> edges(m);
for (int i = 0; i < m; ++i) {
int a, b;
char cc;
cin >> a >> b >> cc;
int c = (in... |
// Powered by CP Editor (https://cpeditor.org)
//a+b = (a^b) + 2*(a&b)
//b^c = (a^b)^(a^c)
//gcd(x,y) = gcd(x-y,y)
//if n = 5000 then complexity cannot be (n^2*log(n)) means no map ,no sets
//check for long long overflow if input is large
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int lo... | #include <algorithm>
#include <iostream>
using namespace std;
const int MD = 1000000007;
long long inv(int n) {
return n == 1 ? 1 : inv(n - MD % n) * (MD / n + 1) % MD;
}
long long choose(int n, int k) {
return n < k ? 0 : k == 0 ? 1 : choose(n - 1, k - 1) * n % MD * inv(k) % MD;
}
int main() {
int n, m, k; cin... |
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stri... | #include <bits/stdc++.h>
// clang-format off
using namespace std; using ll = long long; using ull = unsigned long long; using pll = pair<ll,ll>; const ll INF = 4e18;
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<fixed<<setprecision(15)<<head;print0(tail...);}
void p... |
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define debug(x) cout << #x << ": " << (x) << endl
#else
#define debug(x)
#endif
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const int maxn=1<<20,inf=0x3f3f3f3f,mod=1e9+7;
int f[maxn],cnt[maxn],pop[maxn];
int main()
{
ios::sync_with_stdio(false)... | #include <bits/stdc++.h>
using namespace std;
template <class A, class B> bool cmin(A& a, B b) { return a > b && (a = b, true); }
template <class A, class B> bool cmax(A& a, B b) { return a < b && (a = b, true); }
class ChromaticrNumber {
public:
int V;
vector<int> adj;
const static int MOD = 1000000007;
Chro... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<double> a(n),b(n),c(n),d(n);
for(int _=0; _<2; _++){
for(int i=0;i<n;i++) cin>>a[i]>>b[i];
int x=0,y=0;
for(int i=0;i<n;i++){
x+=a[i];
y+=b[i];
a[i]*=n;
b[i... | #include<bits/stdc++.h>
#define Woody
#define int long long
#define rep(n) for(int i=0;i<n;i++)
#define mp make_pair
#define eb emplace_back
#define F first
#define S second
#ifdef Woody
#define quick ios::sync_with_stdio(0);cin.tie(0);
#else
#define quick
#endif
#define INF INT64_MAX
#define PI 3.14159265
using namesp... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<bool> vbl;
typedef vector<vector<bool>> vvbl;
void INX(){}
template<typenam... | #include<bits/stdc++.h>
#define fi first
#define se second
#define pii pair<double,double>
#define eps 1e-8
#define equals(a,b) fabs(a - b) < eps
using namespace std;
typedef long long ll;
ll rd(){
ll x;
scanf("%lld",&x);
return x;
}
double dis(pii a,pii b){
return sqrt((a.fi - b.fi) * (a.fi - b.fi) + (a.se - b.... |
#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define sz 209
#define mx 10000000000008
#define mod 998244353
ll n,t,arr[sz][sz],brr[sz],crr[sz],a,k;
vector<ll>v[sz];
void bfs(ll node)
{
a++;
crr[node]=1;
for(int i=0;i<v[node].size();i++)
{
ll x=v[node][i];
if(!cr... | //LYC_music yyds!
#include<bits/stdc++.h>
#define int long long
using namespace std;
int read()
{
int pos=1,num=0;
char ch=getchar();
while (!isdigit(ch))
{
if (ch=='-') pos=-1;
ch=getchar();
}
while (isdigit(ch))
{
num=num*10+(int)(ch-'0');
ch=getchar();
}
return pos*num;
}
void write(int x)
{
if (x<... |
#include<iostream>
#include<string>
#include<algorithm>
#include<queue>
#include<cmath>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include <bitset>
#include<cstring>
#define forn(i,a,n) for(int i=(a);i<(n);i++)
#define ford(i,a,d) for(int i=(a);i>(d);i--)
#define pb push_back
using namespace std;
c... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;
template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (ll i=(ll)from; i<(ll)to; i++)
#define all(vec) vec.begin(), vec.en... |
#include <bits/stdc++.h>
using namespace std;
#define MAX( a , b ) ( a > b ) ? a : b
#define MIN( a , b ) ( a < b ) ? a : b
using ull = unsigned long long;
using ll = long long;
using ul = unsigned long;
ull Euclidean(ull a, ull b){
if((a % b) == 0)
return b;
else
return Euclidean(b , (... | #include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &x){
x = 0; int f = 1; char ch = getchar();
while (!isdigit(ch)) {if (ch == '-') f = -1; ch = getchar();}
while (isdigit(ch)) {x = x * 10 + ch - '0'; ch = getchar();}
x *= f;
}
inline void write(int x){if (x > 9) write(x/10); putchar(x%... |
#include<cstdio>
#include<vector>
#include<algorithm>
typedef long long ll;
ll m,a[45];
std::vector<ll> f,g;
inline ll read() {
ll x=0,f=1;register char s=getchar();
while(s>'9'||s<'0') {if(s=='-') f=-1;s=getchar();}
while(s>='0'&&s<='9') {x=x*10+s-'0';s=getchar();}
return x*f;
}
inline ll max(const ll &x,const ll ... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string X;
ll M;
cin >> X >> M;
int n = X.size();
vector<ll> b(n);
ll m = 0;
for (int i = 0; i < n; i++) {
b[i] = X[i] - '0';
m = max(m, b[i]);
}
auto test = [&](ll N, ll k) { //转 k 进制
vector<ll> a(0);
while (N > 0) {
... |
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x) __builtin_popcount(x)
#define ull unsigned... | #include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>
using namespace std;
typedef u... |
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int pr[100009], sz[100009], d[100009];
vector<int> ch[100009];
void dfs(int n)
{
vector<int> v;
int s = 0;
sz[n] = 1; d[n] = 1;
for (int i = 0; i < ch[n].size(); i++) {
int tn = ch[n][i];
dfs(tn);
sz[n] += sz[tn];
d[n] += sz[t... | #include <bits/stdc++.h>
#define SIS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define lowbit(x) (x & -x)
#define FOR(i,a,b) for(int i=(a); i< (b); ++i)
#define RFOR(i,b,a) for(int i=(b);i>=(a);i--)
#define REP(i,a,b) for(int i=(a); i<=(b); ++i)
#define PI 3.14159265358979323846264338327950L
using nam... |
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll=long long;
using ld=long double;
using pll=pair<ll, ll>;
//using mint = modint1000000007;
#define rep(i,n) for (ll i=0; i<n; ++i)
#define all(c) begin(c),end(c)
#define PI acos(-1)
#define oo 2e18
template<typenam... | #include<iostream>
#include<cstdio>
#include<cstring>
#define re
#define X first
#define Y second
#define mp std::make_pair
#define pb push_back
#define ohh(hhh...) fprintf(stderr,hhh)
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int,int> pii;
template<class T1> inline bool cmax(T1 &x,T1 y) ... |
#include<bits/stdc++.h>
#define N 100005
#define Ms(a,b) memset(a,b,sizeof a)
#define db(x) cerr<<#x<<"="<<x<<endl;
#define db2(x,y) cerr<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define db3(x,y,z) cerr<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
using namespace std;
int rd(){
int res=0,c,f=0;
while(!isdigi... | #include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 600006
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for... |
//include <atcoder>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <tuple>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#define flush fflush(stdout)
#define endl '\n'
#define all... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
const ll mod = 1e9+7;
const int N = 1e5+5;
#pragma region Debugger
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __... |
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;... | #include <bits/stdc++.h>
using namespace std;
#define ll int64_t
void solve()
{
int n, m;
cin >> n >> m;
vector<int> f(n);
for (int i = 0; i < m; i++)
{
int u, v;
cin >> u >> v;
v--, u--;
f[v] |= (1 << u);
f[u] |= (1 << v);
}
for (int i = 0; i < n; ... |
#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define eb emplace_back
#define mk make_pair
using namespace std;
void vec(vector<int> & v){
for(int i = 0;i<v.size() ; i++){
cout<<v[i]<< " ";
}
cout<<endl;
}
void vec_ll(vector<long long... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define debug(x) cerr << #x << ": " << x << '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).r... |
#include <iomanip>
#include <iostream>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int64_t mod = 1e9 + 7;
unordered_map<int64_t, int64_t> memo;
int64_t mod_pow(int64_t x, int64_t n) {
int64_t key = x * 1e6 + n;
if (memo.count(key)) return m... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
co... |
#include <bits/stdc++.h>
#define MOD 100000000
#define MAX 2005
using namespace std;
void test_case(){
long long n, m;
cin>>n>>m;
vector<long long> arr(n);
for(int i=0; i<n; i++)cin>>arr[i];
sort(arr.begin(), arr.end());
// for(auto i:arr)cout<<i<<' ';
// cout<<endl;
int q;
cin>>q;
... | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mp(a,b) make_pair(a,b)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) i... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, x, y) for (int i = x; i < y; i++)
int main()
{
ll N;
cin >> N;
ll ans = 0;
map<int, int> numbers;
rep(i, 0, N)
{
int input;
cin >> input;
if (numbers.find(input) == numbers.end())
{... | #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 rep(i, a , b) for (ll i =a ; i < b ; i++)
#define IOS ios::sync_with_stdio(0... |
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
if (b == 0) {
return a;
} else {
return gcd(b, a % b);
}
}
long long gcd_vec(vector<long long> const &A) { // N個の要素に対する最大公約数
int size = (int)A.size();
long long ret = A[0];
for (int i = 1; i <... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#define pb push_back
#include <iomanip>
#define mp make_pair
#define ll long long
#define vll vector <ll>
#define pll pair <ll,ll>
#define sll set <ll>
#define msll multiset <ll>
#define ml... |
/* -*- coding: utf-8 -*-
*
* e.cc: E - White and Black Balls
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define per(i,a,b) for(int i = (a); i > (b); i--)
#define repl(i,a,b) for(ll i = (a); i < (b); i++)
#define perl(i,a,b) for(ll i = (a); i > (b); i--)
const ll MOD = 1000000007... |
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
//#pragma GCC optimization("unroll-loops")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
template<class T> using indexed_set=tree<T,null_type,less<T>,rb_tree_tag,... | #pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <cstdio>
#include <functional>
#include <queue>
#include <tuple>
using namespace std;
int main() {
int R, C;
scanf("%d%d", &R, &C);
int A[250000], B[250000];
int dist[500000], seen[500000] = {0}, cost, pt, to_hide = R * C;
int top, botto... |
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define pb push_bac(X/j)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long
using namespace std;
vo... | #line 1 "main.cpp"
#include <bits/stdc++.h>
using namespace std;
// template {{{
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
#define range(i, l, r) for (i64 i = (i64)(l); i < (i64)(r); (i) += 1)
#define rrange(i, l, r) for (i64 i = (i64)(r) - 1; i >= (i64)(l); (i... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;
typedef vector<bool> vbl;
typedef vector<vector<bool>> vvbl;
void INX(){}
template<typename Head, typename... Tail>
vo... | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
... |
#include "bits/stdc++.h"
using namespace std;
#include "string"
#define int long long
#define pi pair <int, int>
#define ff first
#define ss second
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#define endl '\n'
#define vi vector<int>
int32_t main() {
boost;
int n, m;
cin >> n >> m;
if(n == 1 && m ==... | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define si(a) scanf("%d",&a)
#define si2(a,b) scanf("%d%d",&a,&b)
#define sl(a) scanf("%lld",&a)
#define sl2(a,b) scanf("%lld%lld",&a,&b)
#define pb push_back
#define mk make_pair
#def... |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=n... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void exgcd(ll a, ll b, ll& x, ll& y) {
if (a == 0) {
x = 0;
y = 1;
return;
}
exgcd(b % a, a, y, x);
x -= (b / a) * y;
}
ll m = 1e9 + 7;
ll flip(ll a) {
ll x, y;
exgcd(a, m, x, y);
if (x < 0) {
ll kj = -x;
kj /= m;
... |
#include <bits/stdc++.h>
#define Mashu cout << "UUZ ate it." << endl
#define RE register int
#define ll long long
using namespace std;
inline int read(){
char ch=getchar();
int x=0,cf=1;
while(ch<'0'||ch>'9') {
if(ch=='-') cf=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9') {
x=(x<<3)+(x<<1)+(ch^48);
ch=getcha... | /*ॐ नमो भगवते वासुदेवाय नमः*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1e9 + 7;
const double pi = 3.14159265359;
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x... |
#include <bits/stdc++.h>
#define endl '\n'
#define all(a) (a).begin(), (a).end()
#define len(a) (int) (a).size()
#define forn(i, n) for (int (i) = 0; (i) < (n); ++(i))
using namespace std;
void solve();
mt19937 rnd(2007);
signed main(){
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", s... | #include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax... |
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <str... | #include <bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)((n)-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se seco... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, s, n) for(int i = (int)(s); i < (int)(... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define eFOR(i,a,n) for(int i=(a);i<=(n... |
#include <iostream>
#include <vector>
#include <utility>
#include<algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <random>
#include <tuple>
#include <set>
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main(){
ll n;
cin >> ... | //QwQcOrZ yyds!!!
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
ll ans = n;
ll t = n + 1;
for (int i = 1; i <= n; i++) {
if (t >= i) t -= i, ans--;
else break;
}
cout << ans + 1 << endl;
} | /**
* Author : RDP
* There are no two words in the English language more harmful than "good job".
* 1729 ;)
**/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void debug_out() { cerr << '\n'; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
cerr << " " << to... |
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
int main... | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i, n) for(int i = 0; i < n; i++)
int main()
{
int n;
cin >> n;
cout << (n+100-1)/100 << endl;
return 0;
} |
/*ver 7*/
#include <bits/stdc++.h>
using namespace std;
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vd = vector<ld>;
using vs = vector<string>;
using vb = vector<bool>;
using vvl = vector<vector<ll>>;
... | #include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stdio.h>
using namespace std;
int main(){
long long N;
cin >> N;
vector<long long> A(N);
for (int i = 0; i < N; i++) cin >> A[i];
vector<long long> p(N); // 動作iでの合計の座標
vector<long long> q... |
#include <algorithm>
#include <cmath>
#include <vector>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <ctype.h>
#include <climits>
#include <queue>
#include <iostream>
#include <string>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
// #define rep(i, a, b) for(ll i = a; i < b; i++... | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
for(int i=0;i<n;i++)
{
int tt;
cin>>tt;
if(tt!=k)
{
cout<<tt<<" ";
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979;
const int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
#define pii pair<int,int>
#define endl "\n"
#define dtor(deg) (((deg)/360)*2*pi)
#define all(a) a.begin(),a.end()
#define overload(_1,_2,_3,_4,nam... | // Author: Vinay Khilwani
// Language: C++
// @vok8: Codeforces, AtCoder, LeetCode, HackerEarth, TopCoder, Google, FB, CSES, Spoj, GitHub
// @vok_8: CodeChef, GFG
// @vok8_khilwani: HackerRank
// Never Stop Trying.
// Trying to be Better than Myself.
// while(true)
// {
// if(AC)
// {
// break;
//... |
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
#define G getchar()
int read()
{
int x=0; bool flg=false; char ch=G;
for (;!isdigit(ch);ch=G) if (ch=='-') flg=true;
for (;isdigit(ch);ch=G) x=(x<<3)+(x<<1)+(ch^48);
return flg?-x:x;
}
#undef G
#define fi first
#define se second
typedef long long ll;... | #include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
const int p = 31;
const int m = 1e9 + 7;
typedef long long ll;
typedef int in;
#define ff first
#define ss second
void __print(int x) {cerr << x;}
voi... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
cin >> A >> B;
cout << 100 * (1 - double(B)/A) << endl;
return 0;
} | #include<bits/stdc++.h>
using namespace std;
/*-----<Defines>-----*/
#define int long long int
#define fast() ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(x) begin(x),end(x)
#define rz(x) resize(x)
#define asn(x,y) assign(x,y)
#define ... |
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
template <class T>
using... | #include <bits/stdc++.h>
using namespace std;
#define int long long
template <typename T>
T inverse(T a, T m) {
T u = 0, v = 1;
while (a != 0) {
T t = m / a;
m -= t * a; swap(a, m);
u -= t * v; swap(u, v);
}
assert(m == 1);
return u;
}
int32_t main(){
ios::sync_with_stdio(0),cin.tie(0);
i... |
/**
* author: tomo0608
* created: 22.05.2021 20:58:10
**/
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include<atcoder/all>
using namespace atcoder;
#endif
typedef long long ll;
typedef long double ld;
template <class T> using V = vector<T>;
temp... | /****Jai Ganesha Deva****/
#include<bits/stdc++.h>
using namespace std ;
#define int long long
#define sz(a) (int)a.size()
#define INF 2000000000000000000
#define double long double
#define bug(x) cerr<<#x<<" is "<<x<<endl
#define de... |
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
//#define vec vector<ll>
//#define mat vector<ve... | #include<bits/stdc++.h>
using namespace std;
int get() {
int x = 0, f = 1; char c = getchar();
while(!isdigit(c)) { if(c == '-') f = -1; c = getchar(); }
while(isdigit(c)) { x = x * 10 + c - '0'; c = getchar(); }
return x * f;
}
const int N = 4e5 + 5;
int n, a[N], len, st[N], top, col[N];
pair<int, int> b[N];
in... |
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
using namespace std;
const int N = 1e8 + 10;
typedef long long ll;
int main(){
int n,m,t,k,ans;
string s;
// cin>>t;
// while(t--){
cin>>s;
int ok=1;
for(int i=0;i<s.size()&&ok;i++){
if(i%2==0&&(s[i]<'a'|... | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define fast_az_fuk ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
#define ull unsigned ll
#define ld long double
#define pb push_back
#define pf push_front
#define dll deque<ll>... |
#include <bits/stdc++.h>
#define ll long long int
#define uu first
#define vv second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tp tuple<int,int,int>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const int ... | /*
このコード、と~おれ!
Be accepted!
∧_∧
(。・ω・。)つ━☆・*。
⊂ ノ ・゜+.
しーJ °。+ *´¨)
.· ´¸.·*´¨) ¸.·*¨)
(¸.·´ (¸.·'* ☆
*/
#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map... |
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
typedef long long ll;
typedef long double lld;
#define fo(i,n) for(int i=0;i<(int)n;i++)
#define rep(i,x,n) for(auto i=x;i<n;i++)
#define ch " "
#define nline "\n"
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
const int MOD=1e9+7;... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define mat vector<vector<int>>
#define vi vector<int>
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define pi pair<int, int>
#define inf 1000000000
#define mod 998244353
#define endl "\n"
const ll INF=1e18+5;
const ... |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int,int>;
const int n = 20;
const int n2 = 1<<n;
const vector<int> p = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71};
int main() {
ll a, b;
cin >> a >> b;
vector<ll> dp... | //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,avx512f")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vect... |
#include<bits/stdc++.h>
using namespace std;
int n,m;
int edge[1001][1001];
bool visited[1001][1001];
vector<int> vc[1001][26];
struct PT{
int st,ed;
int size;
};
int main(){
int x,y,sz;
char c;
cin>>n>>m;
for(int i=0;i<m;i++){
cin>>x>>y>>c;
edge[x][y]=edge[y][x]=1;
vc... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(40)
const ll MOD = 1000000007;
const ll INF = (ll) 1e18;
int main() {
cin.tie(0);
ios::sync_with_s... |
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
const int INF = 1e9;
int dp[1 << 18][18];
int shortestTSPdistance(vector<vector<int> > dist) {
int n = dist.size();
int lim = 1 << n;
for (int i = 0; i < n; ++i)
for (int j = 0; j < lim; ++j)
dp[j][i] = INF;
for (int i = 0; i < 1; i++) {
dp[1 ... | #include <bits/stdc++.h>
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define reset(a, v) memset((a), v, sizeof(a))
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
... |
#include<cstdio>
#include<cmath>
#define db double
#define ri register int
#define sqr(x) ((x)*(x))
#define eps 1e-6
using namespace std;
const int MAXN=100+10;
int n;
int x[MAXN],y[MAXN];
db sdis(int i,int j){return sqr(x[i]-x[j])+sqr(y[i]-y[j]);}
int fa[MAXN];
int get_fa(int u){return u==fa[u]?u:fa[u]=get_fa(f... | //
// main.cpp
//
#include <algorithm>
#include <array>
#include <assert.h>
#include <complex>
#include <iomanip>
#include <iostream>
#include <limits>
#include <inttypes.h>
#include <map>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#inclu... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _... | #include <bits/stdc++.h>
using namespace std;
vector <string> solve(int x) {
if (x == 1) {
vector <string> tmp{"AB"};
return tmp;
}
vector <string> a, b;
a = solve(x - 1);
for (auto s : a) {
string r, t;
for (auto c : s)
if (c == 'A') r += "AB", t += "AA";
else r += "BA", t += "BB... |
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
LL N, fib[100];
vector<int> ans;
int vis[100];
void print() {
LL x = 0, y = 0;
for (int i : ans) {
if (i == 1) x++;
if (i == 2) y++;
if (i == 3) x = x + y;
if (i == 4) y = x + y;
}
cerr << x << endl;
}
in... | #include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define loop(i, a) for (int i = 0; i < (a); ++i)
#define cont(i, a) for (int i = 1; i <= (a); ++i)
#define circ(i, a, b) for (int i = (a); i <= (b); ++i)
#define range(i, a, b, c) for (int i = (a); (c) > ... |
#include <bits/extc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for(int i=0;i<int(n);i++)
#define FOR(i,a,b) for(int i=a;i<=int(b);i++)
#define ALL(x) x.begin(),x.end()
#define MOD (ll)1000000007
set<ll> ans;
vector<pair<ll, ll>> xy;
signed main() {
ll n;
int m;
cin >> n >> m;
ans.insert(n... | #include<bits/stdc++.h>
using namespace std;
int n,m,sum=0;
char str[15][15];
int main(){
cin>>n>>m;
for(int i=1;i<=n;i++)cin>>str[i]+1;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
if(str[i][j]!='#')continue;
int u=0;
if(str[i][j-1]=='#'||(str[i][j-1]!='#'&&str[i-1][j-1]!='#'&&str[i-1][j]=='#'))u+=1;
... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
int A[N];
for(int i = 0; i < N; i++){
cin>>A[i];
}
int count = 0;
for(int i = 0; i < N; i++){
if(A[i] <= 10){
}else if(A[i] > 10){
count += A[i] - 10;
}else{
}
}
cout<<count<<endl;
retur... | #include<iostream>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
struct UF{
vector<int> p;
UF(int n):p(n, -1){}
int leader(int x){
if(p[x] < 0)return x;
return p[x] = leader(p[x]);
}
void merge(int a, int b){
a = leader(a);
b = leader(... |
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define ld long double
#define mod 1000000007
#define mod2 998244353
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
#define vi vector<int>
#define si set<int>
#define pii pair<int,int>
#define mii map<int,int>
#define umii... | #include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define all(v) begin(v), end(v)
#define sz(v) (int)(v).size()
#define fi first
#define se second
const int N = 1e5 + 5;
int n, dp[N];
int main(int argc, char const *argv[])
{
#ifdef LOCAL
freopen... | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for... |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
char s[30];
int main()
{
int n,m;
scanf("%d%d",&n,&m);
int cnt0=0,cnt1=0;
for(int i=1;i<=n;i++)
{
scanf("%s",s+1);
int cnt=0;
for(int j=1;j<=m;j++)cnt+=(s[j]==49);
if(cnt&1) cnt1++;
else cnt0++;
}
printf("%ll... | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 1e9;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep2(i, x, n) for(int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
vo... |
#include <bits/stdc++.h>
// #include <atcoder/all>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
using namespace std;
// using namespace atcoder;
typedef long long int ll;
typedef pair<int, int> P;
#define yn ... | #include<bits/stdc++.h>
#define int long long
#define fer( a , b , c ) for( register int a = b ; a <= c ; a ++ )
#define der( a , b , c ) for( register int a = b ; a >= c ; a -- )
using namespace std ;
inline int read(){
int sum = 0 , f = 1 ;
char ch = getchar() ;
while( ch < '0' || ch > '9' ){
if( ch == '-'... |
#include <bits/stdc++.h>
using namespace std;
#define pi 3.1415926536
#define ll long long int
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main(){
fastio
ll n;
cin>>n;
ll res=(1LL<<60);
ll a,b,c;
for(int i=0;i<60;i++){
//cout<<a<<b<<c... | #pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2")
#include <functional>
template <typename T>
inline void hash_combine(std::size_t &seed, const T &val) {
seed ^= std::hash<T>()(val) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
template <typename T> inline void hash_val(std::size_t &s... |
#include <bits/stdc++.h>
using namespace std;
// template {{{
#define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); (i) -= 1)
#define whole(f, x, ...) ([&](decltype((x)) container) { return (f)( begin(container), end(container), ## ... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,string> pi;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin>>n;
vector<pi>arr;
for(int i=0; i<n; i++){
string s;
int h;
cin>>s>>h;
arr.push_back(pi(h,s));
}
sort(arr.begin(),arr.end());
arr.pop_b... |
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define ins insert
#define pqueue... | #include<cstdio>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<set>
#include<queue>
#include<unordered_map>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll inf=1e18,N=1e5+500;
ll gti(void)
{
char c=getchar();
ll ret=0,st=1;
for (;c!='-'&&!isdigit(c);c=... |
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> //Policy Based Data Structure
// using namespace __gnu_pbds; //Policy Based Data Structure
using namespace std;
// typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> pbds; //Policy Based Data Structure
/... | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>
#include<map>
#include<cassert>
using namespace std;
#define ll long long
#define reps(i, a, b) for(int i = a; i < b; i++)
#define rreps(i, a, b) for(int i = a-1; i >= b; i--)
#def... |
#include "bits/stdc++.h"
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl '\n'
#define all(V) (V).begin(), (V).end()
using namespace std;
typedef long long ll;
int main() {fio;
int n;
cin >> n;
vector <pair <int, int>> a(2 * n);
vector <pair <int, int>> b(2 * n);
string s;
for(int i ... | #include<bits/stdc++.h>
#include<bits/extc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t){
while(*sdbg != ',') { ce... |
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
template<typename T>
void __p(T a) {
cout << a;
}
template<typename T, typename F>
void __p(pair<T, F> ... | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i=0; i<(n); i++)
#define readVec(v) forn(i, v.size()){cin >> v[i];}
#define printArr(arr, n) forn(i, n){if (i) cout << " "; cout << arr[i];} cout << endl;
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define f first
#define s ... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if((a+b==2*c)||(a+c==2*b)||(b+c==2*a))
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep3(i, a, b) for(ll i = a; i >= b; --i)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define eb em... |
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) v.begin(), v.end()
template<class T>bool chmax(T& a, const T& b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T& a, const T& b) { if (b<a)... | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
long k;
str... |
#define _GLIBCXX_DEBUG
#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(v) v.begin(), v.end()
int main() {
ll N;
cin>>N;
vector<pair<int,string>> A(N);
rep(i,N){
cin>>A[i].second>>A[i].first;
}
sort(all(A));
cout<<A[N-... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<long long> Vll;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793
int main(){
ll n;
cin >> n;
vector<ll> a(n),b(n);
ll suma=0;;
rep(i,n){
... |
#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
using namespace std;
void solve() {
ll arr[4];
ll sum = 0;
// ll one;
for(int i=0; i<4; i++){
cin>>arr[i];
sum+=arr[i];
}
//Two
sort(arr, arr+4);
ll one = arr[3];
sum-=arr[3];
if(one < sum){... | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cout << #x << ": " << x << '\n';
#define degreeToRadian(deg) (((deg)/360)*2*M_PI)
#defi... |
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using namespace std;
int main() {
string s,t;
cin >> s >> t;
if (s[0]=='Y') {
t[0]^=32;
cout << t << endl;
}
else {
cout << t << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
char s, t;
cin >> s >> t;
if (s == 'Y'){
if (t == 'a'){
cout << 'A' << endl;
}else if (t == 'b'){
cout << 'B' << endl;
}else if (t == 'c'){
cout << 'C' << endl;
}
} else if (s == 'N'){
cout << t << endl;
}
}
|
#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
using ll = long long;
#define SWAP(a,b) ((a != b)? (a += b,b = a - b,a -= b) : 0 ) //数値のみ
#define SWAP(type,a,b) { type temp = a; a = b; b = temp; } //ポインタ, 構造体, 文字列
#define rng(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)... | #include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
long long n;
cin >> n;
long long res=0;
long long st,fi;
long long c=0;
for(st=1;;st*=10){
fi=10*st-1;
fi=min(n,fi);
res+=(c/3)*(fi-st+1);
c++;
if(fi==n){break;}
}
cout << re... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#include <map>
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using Graph = vector<vector... | #include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define F first
#define S second
#define pb push_back
#define sz(x) (int)x.size()
#define len(x) (int)x.length()
#define pii pair<int,int>
#define ppi pair<pii,int>
#define vi vector<... |
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
constexpr int DEBUG = 0;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, x;
cin >> n >> x;
x *= 100;
int c = 0;
for (int i = 0; i < n; i++) {
int v, p;
cin >> v >> p;
c += v * p;
if (c > x) {
cout... | #include <bits/stdc++.h>
using namespace std;
#define endl ("\n")
#define pi (3.141592653589)
#define mod 1e9+7
#define int long long
#define float double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define min3(a, b, c) min(c, min(a, b))
#define min4(a... |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
/* start */
const int N = 52;
const int mod = 998244353;
int g[N][N], tot;
int was[N];
int fat[N];
vector<int> vx[N], vy[N];
void dfs1(int v) {
tot++;
was[v]=1;
... | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define debug(x) cout << #x << ": " << (x) << endl
#else
#define debug(x)
#endif
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const int maxn=1e6+7,inf=0x3f3f3f3f,mod=1e9+7;
int fa[maxn];
int find(int x)
{
return fa[x]==x?fa[x]:fa[x]=find(fa[x]);
... |
/**
Lost Arrow (Aryan V S)
Saturday 2020-12-19
**/
#ifdef LOST_IN_SPACE
# if __cplusplus > 201703LL
# include "lost_pch1.h" // C++20
# elif __cplusplus > 201402LL
# include "lost_pch2.h" // C++17
# else
# include "lost_pch3.h" // C++14
# endif
#else
# include <bits/stdc++.h>
#endif
constexpr b... | #include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ld long double
#define pb push_back
#define pob pop_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define f0(i,n) for(i=0;i<n;i++)
#define rf0(i,n) for(i=n-1;i... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define all(x) x.begin(),x.end()
#define MOD 1000000007
#define PI acos(-1)
#define debug cerr <<
#define var(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define close << "\n";
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);co... | #include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<deque>
#include<queue>
#include<stack>
using namespace std;
#define int long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#def... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <unordered_map>
#include <map>
#include <algorithm>
#define int long long
inline int read()
{
int num=0,f=1;char c=getchar();
while(c<48||c>57){if(c=='-')f=-1;c=getchar();}
while(c>47&&c<58)num=(num<<3)+(num<<1)+(c^48),c=ge... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 998244353;
const int N = 2e5 + 200;
int n, m;
int factorial[N], invfac[N];
int power(int base, int expo) {
int res = 1;
while(expo) {
if(expo & 1) {
res = (res * base) % mod;
}
base = (base * base) % mod;
expo /= 2;
... |
#include<bits/stdc++.h>
using namespace std ;
#define Next( i, x ) for( register int i = head[x]; i; i = e[i].next )
#define rep( i, s, t ) for( register int i = (s); i <= (t); ++ i )
#define drep( i, s, t ) for( register int i = (t); i >= (s); -- i )
#define re register
#define int long long
int gi() {
char cc = getc... | #include <bits/stdc++.h>
using namespace std;
/*
* @title ModInt
* @docs md/util/ModInt.md
*/
template<long long& mod> class ModInt {
public:
long long x;
constexpr ModInt():x(0) {}
constexpr ModInt(long long y) : x(y>=0?(y%mod): (mod - (-y)%mod)%mod) {}
ModInt &operator+=(const ModInt &p) {if((x +=... |
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("trapv")
#pragma GCC target("sse4")
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
typedef pair<long ... | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int N; cin >> N;
int A[200010], B[200010], P[200010];
int pos[200010];
pair<int, int> W[200010];
for(int i = 1; i <= N; i++) cin >> A[i];
for(int i = 1; i <= N; i++) cin >> B[i];
for(int i = 1; i <... |
#include <iostream>
using namespace std;
int main()
{
int A, B;
cin >> A >> B;
for(int r = B; r >= 1; r--)
{
if((B/r * r) - r >= A)
{
cout << r << '\n';
return 0;
}
}
}
| #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>... |
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0;... | #include <iostream>
#include <vector>
#include <unordered_set>
#include <random>
#include <algorithm>
#define INF (1ll<<60)
#define ll long long
using namespace std;
vector<pair<int,int>> counts[22];
bool HasBit(int x, int b) {
return ((x>>b)&1);
}
ll dp[(1<<18)+1];
ll Solve(int N, int mask, int x) {
if (x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.