code_file1 stringlengths 80 4k | code_file2 stringlengths 91 4k | similar_or_different int64 0 1 |
|---|---|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if ((A - C) * (B - C) < 0) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <iostream>
#include <iomanip>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)
int main()
{
int a, b, c;
cin >> a >> b >> c;
cout << (a <= c && c <= b || b <= c && c <= a ? "Yes" : "No") << endl;
re... | 1 |
/*
g++ --std=c++17 A.cpp
*/
#include <iostream>
#include <iomanip> //! for setprecision(20)
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>
#include <limits.h>
#include <atcoder/all>... | #include <algorithm>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <stack>
#include <string>
#include <vector>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
int main()
{
int n,m;
cin >> n >> m;
int max = 0,min = 1e... | 0 |
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
int a,b,c;
while(cin>>a>>b>>c && (a||b||c)){
int i,n;
cin>>n;
int res[a+b+c+1];
int tmp[n][3];
fill(res,res+a+b+c+1,2);
for(i=0;i<n;i++){
int I,J,K,R;
cin>>I>>J>>K>>R;
if(R == 1){
res[I] = res[J] = res[K] =... | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
struct Data
{
int p[3], r;
};
int main()
{
int a, b, c;
while(scanf("%d%d%d", &a, &b, &c), a){
int n;
scanf("%d", &n);
vector<int> state(a+b+c, 2);
vector<Data> d(n);
for(int i=0; i<n; ++i){
for(int j=0; j<3; ++j){
s... | 1 |
#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int E[N];
int main() {
int n;
string s;
cin >> n >> s;
for (int i = n - 1; i >= 0; i--) {
E[i] = E[i+1] + (s[i] == 'E');
}
int W = 0, res = n;
for (int i = 0; i < n; i++) {
res = min(res, W + E[i+1]);
W += s[i] == 'W';
}
c... | #include <iostream>
using namespace std;
int main() {
int n, q, t, cnt = 0;
cin >> n;
int s[n];
for (int i = 0; i < n; i++) {
cin >> s[i];
}
cin >> q;
for (int i = 0; i < q; i++) {
cin >> t;
for (int j = 0; j < n; j++) {
if (t == s[j]) {
cnt += 1;
break;
}
}... | 0 |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
int a[n + 2];
memset(a, 0, sizeof a);
for (int i = 0; i < m ; i++)
{
int x, y;
cin >> x >> y;
a[x]++;
a[y + 1] --;
}
for(int i = 1; i <= n; ++i){
a[i] += a[i-1];
}
int count = 0;
for(int ... | #include<bits/stdc++.h>
using namespace std;
#define flash ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define endl "\n"
#define int long long int
#define ll long long
#define ld long double
#define vi vector<int>
#defi... | 1 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=42, Max=(1<<17)+10, MOD=1e9+7;
ll n, x, y, z, f[N][Max], sum=1, ans;
inline ll M(ll a){return a%MOD;}
void work(){
for(int i = 0; i < n; i++) sum = M(sum*10);
ll cnt = (1<<x+y+z) -1;
ll tot = (1<<x-1) | (1<<x+y-1) | (1<<x+y+z-1);
f[0][0... | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 998244353;
vector<ll> fac(200005);
vector<ll> ifac(200005);
ll modpow(ll x, ll n){
ll ans = 1;
while(n != 0){
if(n & 1)
ans = ans * x % mod;
x = x * x % mod;
n = n >> 1;
}
return ans;
}
l... | 0 |
/*
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \| |// `.
/ \||| : |||// \
/ _||||| -:- |||||- \
| | \\ - /// | |
| ... | #include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _ov... | 1 |
#include <iostream>
#include <vector>
using namespace std;
int main(void){
int n,t;
cin>>n>>t;
vector<int>time(n);
for(int i=0;i<n;i++){
cin>>time[i];
}
int dif;
long long sum=t;
for(int i=1;i<n;i++){
dif=time[i]-time[i-1];
if(dif<=t)sum+=dif;
else sum+=t;
}
cout<<sum... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define txt \
freopen("ip.txt", "r", stdin); \
freopen("op.txt", "w", stdout)
#define a3 INT_MAX
#define i3 INT_MIN
#define a6 INT64_MAX
#define i6 INT64_MIN
#define ... | 1 |
#include <iostream>
#include <vector>
int main() {
int n;
std::vector<int> v;
std::cin >> n; //skip
while (std::cin >> n) {
v.push_back(n);
}
for (auto&& e = v.crbegin(); e != v.crend(); ++e) {
std::cout << ((e == v.crbegin()) ? "" : " ") << *e;
}
std::cout << std::endl;
... | #include<iostream>
using namespace std;
int main(){
int array[110]={};
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>array[i];
}
for(int i=n-1;i>=1;i--){
cout<<array[i]<<" ";
}
if(n != 0){
cout<<array[0]<<endl;
}
return 0;
} | 1 |
#include<bits/stdc++.h>
using namespace std;
using Long = long long;
int main(){
int n;
cin >>n;
vector<int> v(n);
for( auto &i : v ) cin >> i;
int mx = 0;
Long ans = 0LL;
for( int i = 0 ; i < n ; ++i ){
mx = max( mx , v[i]);
ans += 1LL * ( mx - v[i] );
}
cout << ans... | #include<iostream>
#include <algorithm>
#include <cmath>
#include <set>
#include<map>
#include<cstring>
#include<iomanip>
#include <string>
#include <vector>
#include<unordered_map>
#include<unordered_set>
using namespace std;
typedef long long unsigned llu;
typedef long double ld;
#define ll long long
#define PI 3.... | 1 |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int D,l,cnt[100];
ll pw[100],v[100];
int getlen(ll x){
int len=0;
while(x)++len,x/=10;
return len;
}
ll dfs(int i,ll now){
if(i==l/2)return now==D;
ll ret=0;
for(int d=-9;d<=9;++d){
ll nxt=now+v[i]*d;
if(abs(nxt-D)>v[i])continue;
ret+=(cn... | #include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
ll Power[20];
ll dfs(ll l , ll r , ll d) {
if(l >= r) {
if(d == 0) return l == r ? 10 : 1;
return 0;
}
if(d % 10 == 0) {
if(l != 1) return 10 * dfs(l + 1 , r - 1 , d / 10);
retu... | 1 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n , dp[5005][5005];
pair<ll,ll> a[5005];
bool cmp(pair<ll,ll> x,pair<ll,ll> y){
return x.first+x.second < y.first+y.second;
}
int main(){
ios_base:: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin>>n;
for(ll i=0;i<n;i+... |
#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <numeric>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define int long long int
#de... | 0 |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define fr(i,k,n) for (int i = k; i < n; ++i)
#define fri(i,k,n) for (int i = k; i >= n... | #include<bits/stdc++.h>
#include<atcoder/fenwicktree>
using ll = int_fast64_t;
#define REP(i,b,e) for(ll i=b; i<e; i++)
int main(){
int n, q;
scanf("%d %d", &n, &q);
atcoder::fenwick_tree<ll> bit(n);
REP(i, 0, n){
ll a;
scanf("%ld", &a);
bit.add(i, a);
}
REP(i, 0, q){
ll t, x, y;
scanf("%ld %ld %ld", ... | 1 |
#include <cmath>
#include <cstring>
#include <iostream>
#include <ostream>
#include <vector>
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> v) {
os << "[";
for(int i = 0; i < int(v.size()); i++) {
os << v[i] ... | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <bitset>
#include <cstring>
#include <string.h>
#include <cmath>
#include <queue>
#include <string>
#include <stack>
#include <utility>
#include <queue>
#include <cmath>
#define mp make_pair
#define pii pair<int,int>
#define ff firs... | 1 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9 * 2;
int main() {
int a[3];
rep(i, 3) cin >> a[i];
int k;
cin >> k;
sort(a, a + 3, greater<int>());
ll out = a[0... | #include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using l... | 1 |
#include <iostream>
#include <vector>
using namespace std;
int simulate(vector<long long int> A){
int N = A.size(), ret = 0;
while(1){
int t = 0;
for(int i = 0; i < N; ++i){
if(A[i] > A[t]) t = i;
}
if(A[t] < N) break;
for(int i = 0; i < N; ++i){
if(i != t) ++A[i];
else A[i] ... | #include <iostream>
#include <vector>
using namespace std;
vector<int> permMul(const vector<int>& a, const vector<int>& b){
vector<int> res(a.size());
for(int i=0;i<a.size();i++) res[i] = a[b[i]];
return res;
}
vector<int> permPow(const vector<int>& p, long long K){
if(K == 0){
vector<int> re... | 0 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define REP(i,s,t) for( int i = s; i < t; i++ )
#define dump(x) cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
int main(void)
{
... | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using P = pair<ll, ll>;
using mat = vector<vector<ll>>;
void IOS() { ios::sync_with_stdio(false), cin.tie(0); }
const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-10;
template <typename... | 1 |
#include<bits/stdc++.h>
#define DBG(x) cerr << #x << “ = ” << (x) << endl
#define Rep(i,a,b) for (int i = a, to = b; i < to; i++)
#define pb push_back
#define all(v) v.begin(), v.end()
#define sz(v) (int)v.size()
typedef long long Long;
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(NULL);
Long... | #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <b... | 0 |
#include <bits/stdc++.h>
using namespace std;
#ifdef KACTL
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define sz(x) (int)(x).size()
#endif
#define all(x) begin(x), end(x)
using ll = int64_t;
using ld = long double;
using pii = pair<int32_t, int32_t>;
using vi = vector<int32... | #include <iostream>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main(void) {
int H, W, A, B;
cin >> H >> W >> A >> B;
if ((H / 2) < B || (W / 2) < A) {
cout << -1 << endl;
return 0;
}
rep(i, H) {
char out = '0';
if (i >= B) out = '1';
rep(j, W) {
if (j... | 1 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int A, B, C, D, E, F;
cin >> A >> B >> C >> D >> E >> F;
cout << max(E, F) + max({ A + B + C, A + B + D, A + C + D, B + C + D }) << endl;
}
| #include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(void){
int h, w, a, b;
cin>>h>>w>>a>>b;
vector<vector<int> > v(h, vector<int>(w));
if(w/2>=a && h/2>=b){
vector<int> s1(w);
vector<int> s2(w);
rep(i, a){
... | 0 |
// -*- mode:c++; coding:utf-8; indent-tabs-mode:nil; -*-
// ALDS1_2-D
#include <algorithm>
#include <cstdio>
static void print_ints(const int as[], const unsigned int n,
const char* sep = " ") {
const char* out_sep = "";
for (unsigned int i = 0; i < n; ++i) {
std::printf("%s%d", out_sep... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll maxSubarrayXOR(ll a[], int n) {
int index = 0;
for(int i = 60; i >= 0; i--) {
int pos = index;
int f = 0;
for(int j = index; j < n; j++) {
if(a[j] & (1LL << i)) f = 1, pos = j;
}
if(!f) co... | 0 |
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << end... |
#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 <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cs... | 1 |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int h, w, ah, aw;
while(cin >> h >> w, h || w){
ah = aw = 1000;
for(int i = 1; i <= 150; i++){
for(int j = i+1; j <= 150; j++){
if(i*i + j*j > h*h + w*w || i*i + j*j == h*h + w*w && i > h){
if(i*i + j*j < ah*ah + aw*aw || i*i + j*j == ah... | #include <bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define mp(a,b) make_pair((a),(b))
#define debug(x) #x << "=" << (x)
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif
typedef long... | 1 |
#include<cstdio>
int main(){
int x,S;
1<=x>=100;
scanf("%d", &x);
S=x*x*x;
printf("%d\n", S);
return 0;
} | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <limits.h>
#include <string>
#include <string.h>
#include <sstream>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
int main(){
int nu... | 1 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
long double n,m,d;
cin>>n>>m>>d;
if(d==0){
cout<<fixed<<setprecision(10);
cout<<(m-1)/n<<endl;
return 0;
}
cout<<fixed<<setprecision(10);
cout<<(2*(n-d)*(m-1))/(n*n)<<endl;
} |
//#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cstdlib>
#include<bitset>
#include<sstream>
#include<queue>
#include<stack>
#include<list>
#include<limits>
#include<iomanip>
usi... | 0 |
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecis... | #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
int main()
{... | 1 |
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#inc... | #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
const int maxn = 2e3 + 5;
char readch() {
char ch = getchar();
while (ch != '1' && ch != '0') ch = getchar();
return ch;
}
int s[maxn][maxn], n, m;
int sn[maxn][maxn], sve[maxn][maxn], she[maxn][maxn];
inline int Sum(int s[][m... | 1 |
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
struct Edge {
int from, to;
};
vector<vector<Edge>> ReadDirectedGraph(
int n, int m, bool is_one_indexed=false) {
vector<vector<Edge>> graph(n);
for (int i = 0; i < m; i++) {
int v1, v2;
cin >> v1 >> v2;
if (is_one_indexed)... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define sqr(x) ((x)*(x))
#define mp make_pair
#define uint unsigned
#define ld long double
#define PI pair<int,int>
inline char gc(){
static char buf[100000],*p1=buf,*p2=buf;
return p1==p2&&(p2=(p1=buf)+fread(buf,... | 0 |
/**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author rahdirigs
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T> void s_max(T& a, T b) {
if (a < b) {
a = b;
}
}
class TaskU {
public:
int N;
vector<vector<int>> a;
vector... | #include<bits/stdc++.h>
#define MOD (long long)(1e9+7)
using namespace std;
long long n,a[20][20],dp[1<<17],sum[1<<17];
int main()
{
cin >> n;
for(int i=0; i<n; i++) for(int j=0; j<n; j++) cin >> a[i][j];
for(int i=0; i<(1<<n); i++) for(int j=0; j<n; j++) for(int k=j+1; k<n; k++)
if((i&(1<<j)) && (i&(1<<k))) sum[i... | 1 |
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#pragma warning(disable:4996)
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(... | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
using vi = vector<int>;
using pii = pair<int,int>;
#define ST first
#define ND second
#define PB push_back
const int nax = 301;
const int mod = 998244353;
int n,a[nax];
int dp[nax][nax*nax];
int ans,sum,sub;
int main() {
scanf("%d",&n);
for(int i... | 0 |
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii v... | #pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
inline int read()
{
int x=0,w=1; char c=getchar();
while... | 0 |
#include <bits/stdc++.h>
#include <vector>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define size_of_array(array) (sizeof(array)/sizeof(array[0]))
using ll =long long;
using namespace std;
using Graph=vector<vector<int>>;
using Field=vector<vector<int>>;
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;... | #include <bits/stdc++.h>
using namespace std;
int main() {
long N,A,B,C,D,E;;
cin >> N >> A >> B >> C >> D >> E;
long slow = min(min(A,B),min(C,min(D,E)));
cout << (N + slow - 1) / slow + 4 << endl;
} | 1 |
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a,b;
cin >> a >> b;
if(a == b){
cout << a+b << endl;
}else{
int m = max(a,b);
cout << m + (m-1) << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for(int i=0; i<(int)(a); i++)
typedef long long ll;
const ll INF = 1LL<<60;
const ll mod = 998244353;
int main()
{
int n, m; cin>>n>>m;
bool flg = false;
for (int i=1; i<=m; i++) {
int l = i;
int r = n-i;
if (n%2 == 0 && !flg && r-l <= ... | 0 |
#include <bits/stdc++.h>
using namespace std;
#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;
using ld = long double;
const int MOD = 1e9+7;
const ll INF = 1LL << 60;
int main() {
int x, y; cin >> x >> y;
if(x + y == 2) cout << 1000000 << endl;
else if(x + y == 3) ... | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <iomanip>
using namespace std;
long long mod = 1000000007;
long long pow(long long x, long long k)
{
if (k == 0)
{
return 1LL;
}
long long temp = pow(x, k / 2);
... | 1 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
ll c=a%i_7;
if(c>=0)return c;
return c+i_7;
... | #include<bits/stdc++.h>
using namespace std;
#define maxn 100001
int n,k,he[maxn],ver[2*maxn],nxt[2*maxn],tot,cnt;
void add(int x,int y){
ver[++tot]=y;nxt[tot]=he[x];he[x]=tot;
}
int dfs(int x,int fa){
int maxx=0;
for(int i=he[x];i;i=nxt[i]){
if(ver[i]==fa)continue;
maxx=max(maxx,dfs(ver[i],x));
}if(x==1)return... | 1 |
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using vi=vector<int>;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); }
template<typename T, typename... Args> void... | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define uu unsigned
#define io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MOD 1000000007
#define pl pair<ll,ll>
#define mkp make_pair
#define ss second
#define ff first
#define mit(a,b) map<a,b>::iterator
#define sit(a) set<a>::iterator
#defi... | 0 |
#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
#include<time.h>
#include<array>
#include<iomanip>
#include<list>
#include<set>
#include<map>
#include<random>
#include<unordered_map>
#inc... | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <iomanip>
using ll = long long;
using uint = unsigned int;
using graph = std::vector<std::vector<ll>>;
using wGraph = std::vector<std::vector<std::pair<l... | 0 |
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).be... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
typedef long long ll;
const int MOD = 1000000007;
const int BASE = 27;
const int oo = 1e9;
const double EPS = 1e-9;
const int MX = 2e5 + 1;
int n;
ll x;
struct exam {
ll b, u, v;
};
exam e[MX];
stru... | 1 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
vector<int>a(5);
for (int i = 0; i < 5; i++)cin >> a.at(i);
sort(a.begin(), a.end());
int k;
cin >> k;
for (int i = 0; i < 4; i++) {
for (int j = i; j < 5; j++) {
if (a.at(j) - a.at(i) <= k)continue;
else {
cout << ":(" ... | #include<iostream>
using namespace std;
class dice
{
private:
int status[6];
public:
dice();
int showfront(void);
bool is(int,int);
bool isfront(int);
void rotate(char);
bool rtfront(int);
bool operator==(dice);
bool eqv(dice);
};
bool dice::eqv(dice di2)
{
if(!di2.rtfront((*this).showfront()))... | 0 |
#include <iostream>
#include<algorithm>
using namespace std;
//upper_bound, lower_boundを用いた
//のになぜか通らない・・・
int main(){
int n;
long long a;
if(scanf("%d", &n)==EOF){return 0;}
long long top[n];
long long center[n];
long long down[n];
for(int i = 0; i<n; i++){if(scanf("%lld", &a)==EOF){return 0;} top[i] = a;... | //include,using,define等
#pragma region header
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deq... | 1 |
/* be name khoda */
// #define stream_enable
// #define long_enable
#include <iostream>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
#ifdef stream_enable
#define cin sss
#endif
#if... | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
... | 1 |
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int a;
cin>>a;
a=a+pow(a,2)+pow(a,3);
cout<<a;
}
| #include<bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin>>a;
a= a + a*a + a*a*a;
cout<<a;
return 0;
}
| 1 |
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
void solve(){
int n; cin>>n;
vector<unsigned long long> a(n);
rep(i,n) cin>>a[i];
string s; cin>>s;
vector<unsigned long long> B;
for(int i=n-1;i>=0;i--){
auto v=a[i];
for(auto b:B) v=min(v,v^b);
if(v!=0){
if(s[i]==... | #include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
#define rr register
using namespace std;
const int d[10]={6,2,5,5,4,5,6,3,7,6};
int m,n,x[10],f[10011];
inline signed iut(){
rr int ans=0; rr char c=getchar();
while (!isdigit(c)) c=getchar();
while (isdigit(c)) ans=(ans<<3)+(ans<<1)+(c^48),... | 0 |
//Zory-2019
#include<bits/stdc++.h>
using namespace std;
namespace mine
{
typedef long long ll;
#define pr pair<int,int>
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())... | //IOI 2021
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
typedef long long ll;
typedef pair<int, int> pii;
const int MAXN = 4 * 100 * 1000 + 17;
int n, a[4][MAXN], b[4][MAXN], p[MAXN], q[MAXN], fen[MAXN];
vector<int> v[2];
void add(int x) {
for (; x <= n; x ... | 1 |
#include<bits/stdc++.h>
using namespace std;
//type
typedef long long ll;
#define pii pair<int, int>
#define vi vector<int>
//x * y * 1.0 can cause overflow
//constant
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eps 1e-10
//omission
#define eb emplace_back
#define F first
#define S second
#define SZ(x) ((i... | #include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n;
int p[N];
pair<pair<int, int>, int> c[N];
pair< int, pair<int, int> > e[N];
int group(int a) {
if (p[a] == -1) {
return a;
}
return p[a] = group(p[a]);
}
int main() {
#ifdef LOCAL
freopen("in.txt", "r", stdin);
#endif
scanf("%... | 1 |
#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>;
int main()
{
ll n;
cin >> n;
ll sum = 26;
ll cnt = 1;
while (1)
{
if (n <= sum)
break;
sum = sum * 26 + 26;
cnt++;
... | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//ceil(a/b) (a + (b - 1))/ b
using namespace std;
#de... | 1 |
#include<bits/stdc++.h>
using namespace std;
int h,w;
int maps[101][101];
int check[101][101];
int dy[]={-1,0,1,0};
int dx[]={0,-1,0,1};
int color;
int sy,sx,gy,gx;
int by0[]={0,0,1,1,0,0,1,1};
int bx0[]={0,1,1,0,2,3,2,3};
int by1[]={0,0,1,1,2,3,2,3};
int bx1[]={0,1,1,0,0,0,1,1};
bool solve(int y,int x);
int main()... | #include <iostream>
using namespace std;
int F[102][102];
int xg,yg,ok;
void Maze(int X,int Y,int C){
//cout << X<<Y<<F[X][Y]<<endl;
if(F[X][Y]!=C)
return;
if(X==xg&&Y==yg){
cout << "OK"<<endl;
ok++;
}
F[X][Y]='.';
Maze(X-1,Y ,C);
Maze(X ,Y+1,C);
Maze(X+1,Y ,C);
Maze(X ,Y-1,C);
}
int mai... | 1 |
#include <bits/stdc++.h>
using namespace std;
int n,m,ans,li[505][505],h[10005],a,b;
int main(){
while(1){
cin >> n >>m;
if(n==0&&m==0)break;
for(int i=0;i<m;i++){
cin >> a >> b;
li[a][b]=1;
}
for(int i=2;i<=n;i++){
if(li[1][i]==1||li[i][1]==1){
if(h[i]==0){... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <... | 1 |
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>
#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法
using namespace std;
typedef long long ll;
//マクロ
#define REP(i,n) fo... | #include <stdio.h>
int main (){
int baris,kolom,warna,x;
scanf ("%d",&baris);
scanf ("%d",&kolom);
scanf ("%d",&warna);
if (baris > kolom){
x = (warna - 1)/baris +1;
}
else {
x = (warna - 1)/kolom +1;
}
printf ("%d",x);
return 0;
} | 0 |
#include <bits/stdc++.h>
using namespace std;
// type
typedef long long ll;
typedef long double ld;
// loop
//#define For(i, l, r, x) for (int i = l; i < r; i+=x)
//#define ForE(i, l, r, x) for (int i = l; i <= r; i+=x)
//#define Ford(i, r, l) for (int i = r; i > l; i--)
//#define FordE(i, r, l) for (... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;
#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(... | 0 |
#include<bits/stdc++.h>
#define SORT(v) sort(v.rbegin() , v.rend())
#define si(n) scanf( "%d" , &n)
#define sii(n , m) scanf( "%d %d" , &n , &m)
#define sl(n) scanf( "%lld" , &n)
#define sll(n , m) scanf( "%lld %lld" , &n, &m)
#define ss(cad) scanf( "%s" , cad)
#define sz(x) (int)x.size()
#define PB push_back
#define f... | /*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GC... | 0 |
#include <bits/stdc++.h>
using namespace std;
bool isStraight(vector<int> v, int s) {
for (int i = 1; i < v.size(); ++i) {
if (v[(s+i)%v.size()] != (v[(s+i-1+v.size())%v.size()]+1)%13) {
return false;
}
}
return true;
}
bool isStraight(vector<int> v) {
return isStraight(v, 0) || (v[0] == 0 && isStraight(v,... |
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>
#include <climits>
#include <set>
#include <numeric>
using namespace std;
int t[5];
bool ... | 1 |
#include <bits/stdc++.h>
#define mo 998244353
#define int long long
using namespace std;
const int N = 100001;
int f[N], inv[N], k, n;
inline int read() {
int x = 0, flag = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-') flag = -1;
ch = getchar();
}
while (isdigit(ch)) {
x = x * 10 + ch - 48;... | #include<cstdio>
#include<algorithm>
using std::max;
#define int long long
const int mod=998244353;
int K,n,_2[5010],C[5010][5010];
signed main(){
scanf("%lld%lld",&K,&n);
C[0][0]=1;
for(int i=1;i<=5000;i++){
C[i][0]=1;
for(int j=1;j<=i;j++)
C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
}
_2[0]=1;
for(int i=1;i<=50... | 1 |
#include<iostream>
using namespace std;
int main(){
int n,x,i=3;
cin >> n;
while(n>=i){
x=i;
if(i%3==0){
cout << ' ' << i;
} else if(i%10==3){
cout << ' ' << i;
} else {
while(x!=0){
x/=10;
if(x%10==3){
... | // @author: arch_
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n; cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 3 == 0
|| to_string(i).find("3") != string::npos)
cout << " " << i;
} cout << "\n";
return 0;
} | 1 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ull unsigned long long int
#define ll long lon... | #include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#inc... | 1 |
#include <bits/stdc++.h>
using namespace std;
#define REP(i, init, n) for(int i = (int)(init); i < (int)(n); i++)
#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define pint pair<int, int>
#define plong pair<long, long>
int INF = (1 << 29);
int main() {... | #include<iostream>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//1000000000000223
#define ll long long
#define ld long double
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
int n, m, vis[1009], vis2[1009],par[1009],go[1009][1009] ;
vector<int> v[1009];
vecto... | 1 |
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define what_is(x) cerr << #x << " is " << x << endl;
#define MT make_tuple
#define eb emplace_back
#defin... | #include <iostream>
#include <string>
using namespace std;
bool isPlain(string secret){
bool find_the,find_that,find_this;
find_the = (secret.find("the") != string::npos);
find_that = (secret.find("that") != string::npos);
find_this = (secret.find("this") != string::npos);
return (find_the |... | 0 |
#include <bits/stdc++.h>
using namespace std;
bool solve(){
int n;
cin >> n;
if(n == 0) return true;
vector<pair<double,string> > ls;
for(int i=0;i<n;i++){
string l;
int p, a, b, c, d, e, f, s, m;
cin >> l >> p >> a >> b >> c >> d >> e >> f >> s >> m;
int X = f*s*m -... | #include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
int n, x[105], y[105];
double mx, z[105], PI = acos(-1.0);
int main() {
int i, j, k;
scanf("%d", &n);
for(i=0; i<n; i++) scanf("%d%d", &x[i], &y[i]);
for(i=0; i<n; i++) {
for(j=k=0; j<n; j++) if(i!=j) z[k++] = atan2(y[j]-y[i], x[j]-x[i])... | 0 |
#include <cstdio>
#include <iostream>
using namespace std;
int main(){
int n,i,x;
scanf("%d",&n);
i=1;
do {
x=i;
if(x%3==0){
cout << " " << i;
} else do {
if ( x%10 == 3 ) {
cout << " " << i;
x=0;
}
} while (x/=10,x>0);
} while (++i <= n);
cout << endl;
};
| // C++ 14
#include <bits/stdc++.h>
using namespace std;
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { os << v[i]; if (i != v.size() - 1) os << ", "; } os << "]"; return os; }
template <typename T> void print(T v, string s = "\n") ... | 0 |
#include <bits/stdc++.h>
#define sc(x) scanf("%d", &x)
#define pr(x) printf("%d\n", x)
#define lowbit(x) (x & -x)
#define ll long long
#define N 500010
using namespace std;
ll tot = 0, head[N], v[N], dis[N], n, m, cnt;
struct Xiao
{
int next, to, w;
}f[N * 3];
void add(int x, int y, int z)
{
f[++tot].to = y;
f[tot].... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<long long,long long>
#define ii pair<int,int>
#define mod 1000000007
#define endl '\n'
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
ll power(ll a,ll b){
ll ans=1;
while(b>0){
if(b%2!=0){
ans=(ans*a... | 0 |
#include <bits/stdc++.h>
using namespace std;
struct StQuery
{
StQuery() : m_nLeft(0), m_nRigt(0) { }
int m_nLeft;
int m_nRigt;
};
void fnInput(string& rsStr, vector<StQuery>& rvoQuery)
{
int nStrSiz, nQuerySiz;
cin >> nStrSiz >> nQuerySiz;
rvoQuery.resize(nQuerySiz);
cin >> rsStr;
for (StQuery& ... | #include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <list>
#include <iomanip>
#include <queue>
#include <numeric>
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
using namespace std;
using ll = long lon... | 1 |
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define MP make_pair //pairのコンストラクタ
#d... | #include<iostream>
using namespace std;
int main(){
int N;
int A,AA;
long long ans=0;
cin>>N;
int times=N-1;
int s;
cin>>A;
for(int i=0;i<times;i++){
cin>>AA;
if(A>AA){
s=A-AA;
ans+=s;
AA+=s;
A=AA;
}else{
A=AA;
}
}
cout<<ans<<endl;
}
| 0 |
#include <bits/stdc++.h>
using namespace std;
int main(void){
ios::sync_with_stdio(false);
cin.tie(0);
int n; cin >> n;
vector<int> p(n+1);
cin >> p[0] >> p[1];
for(int i = 0; i < n-2; i++){
int a, b; cin >> a >> b;
p[i+2] = b;
}
{
int a, b; cin >> a >> b;
p[n] = b;
}
int dp[101][... | #include <iostream>
#include <vector>
#include <cmath>
#include <limits.h>
#include <utility>
#include <map>
#include <algorithm>
#include <set>
using namespace std;
using P = pair<int,int>;
using ll = long long;
const int MOD=1e9+7;
void modplus(int &a,int b){
a+=b;
a%=MOD;
}
ll eline(int a){
if(a<=0)retur... | 0 |
#include <cstdio>
#include <cstdlib>
typedef struct node {
long v;
node *parent;
node *left;
node *right;
} Node;
typedef struct {
Node *root;
} Tree;
Tree T = {NULL};
void insertTree(Node *node) {
Node *y = NULL;
Node *x = T.root;
while (x != NULL) {
y = x;
if (node-... | #include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#define NIL -1
#define MAX 610005
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int n;
int root;
int *p = new int[MAX]; // p---| Unit
int *left2 = new int[MAX]; // left2 --|--------> T
int *right... | 1 |
#include<iostream>
using namespace std;
typedef pair<char,int> P;
string str;
int len,size=0,cnt=1,ans=0;
P t[1000000];
int main(){
cin>>str;
str.push_back('-');
len=str.size();
for(int i=1;i<len;i++){
if(str[i-1]==str[i]){
cnt++;
}else{
t[size++]=P(str[i-1],cnt);
cnt=1;
}
}
f... | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<iomanip>
#define pi 3.14159265358979323846
#define ll long long
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
int main(){
int n, sm = 0;
cin >> n;
if(n >= 500){
sm += n / 500 * 1000;
n = ... | 0 |
#include "bits/stdc++.h"
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define all(co) co.begin(), co.end()
using namespace std;
//using P = pair<int, int>;
int main() {
int n;
while (cin >> n && n) {
int k; cin >> k;
vector<string> vec(n);
rep(i, n) cin >> vec[i];
set<string> sets;
vector<bool> used... | #include<iostream>
#include<vector>
#include<set>
#include<string>
using namespace std;
int n,m;
vector<int> came;
string str[11];
set<string> ans;
void serch(int loop,string sans)
{
// cout << "loop:" << loop << endl;
if(loop==m)
{
// cout << "came:" ;
// for(int i=0;i<came.size();i++)
// cout << came[i] << ... | 1 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using iii = pair<ii, int>;
#define vt vector
#define pq priority_queue
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define __lcm(a, b) a * b / __gcd(a, b)
// #define mult... | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main() {
int r;
cin>>r;
if(r<1200) cout<<"ABC"<<endl;
else if(r<2800) cout<<"ARC"<<endl;
else cout<<"AGC"<<endl;
return 0;
} | 1 |
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define PI 3.1415926535897932
#define MOD 1000000007;
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 LCM(long long A,long long B){
long long g=GCD(A,B);
return A/g*B;
}
long lon... | #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define o(a) cout<<a<<endl
using namespace std;
int main(){
int a;
while(scanf("%d",&a)!=EOF){
int d[14]={},p=0,m=0;
char c;
vector<int> n(5);
n[0]=a;
d[n[0]]++;
rep(i,1,5){
cin>>c>>n[i];
d[n[i]]++;
}
sort(n.begin(),n.end());
re... | 0 |
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const int INF=1e9;
int main()
{
i... | //#include <bits/c++config.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#... | 1 |
#include <iostream>
#include <utility>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
do{n=10*n+(c-'0'),... | #include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
template <class T>
using gp_queue=priority_queue<T, vector<T>, less<T>>;
using Weight=int;
using DArray=vector<Weight>;
using DMatrix=vector<DArray>;
static const Weight INF=1<<29;
struct Edge {
size_t src, dst;
... | 0 |
#include <iostream>
using namespace std;
using ll = long long;
using ld = long double;
#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)
const string YES = "Yes";
const string NO = "No";
void solve(ll A, ll B, ll C) {
bool pred = (A-C) * (C-B) > 0;
cout << (pr... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
if(c>=a&&c<=b||c>=b&&c<=a)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
return 0;
} | 1 |
#include <stdio.h>
int main(void)
{
int n;
int min, max;
double sum;
scanf("%d", &n);
int num;
int pointer=0;
scanf("%d", &num);
min=max=sum=num;
for(int i=0; i<n-1; i++){
scanf("%d", &num);
if(min>num) min=num;
if(max<num) max=num;
sum+=num;
}
printf("%d %d %.0lf\n", min, max, sum);
return 0;
... | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
using namespace std;
int main() {
int N, T;
cin >> N >> T;
long long X = 0;
long long preT = 0;
cin >> preT;
for (int i = 0; i < N - 1; ++i) {
int t; cin >> t;
if (preT + T < t) {
X += T;
}
else {
X += (t -... | 0 |
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
using P = pair<int,int>;
template< typename T >
struct BinaryIndexedTree {
vector< T > data;
BinaryIndexedTree(int sz) {
data.assign(++sz, 0);
}
T sum(int k) {
T ret = 0;
for(++k; k... | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
typedef long long ll;
const ll M = 4e18;
ll n, m, mn = M;
vector<ll> ve[1005];
vector<ll> ans;
vector<ll> now;
ll vv[1005];
void dfs(ll p)
{
if(now.size() != 0 && p == now[0])
{
if(mn > now.size())
{
mn... | 0 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " ... | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <functional>
using namespace std;
#defin... | 0 |
#include<iostream>
#include<queue>;
using namespace std;
#define MAX 1000000001
long long CNT = 0;
void merge(long long a[], int begin, int end, int mid) {
queue<long long> left;
queue<long long> right;
for (int i = begin; i < mid; i++)left.push(a[i]);
for (int i = mid; i < end; i++)right.push(a[i]);
left.push(M... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#inc... | 0 |
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define cmin(a,b) (a>b?a=b:a)
#define cmax(a,b) (a<b?a=b:a)
#define mem(a,k) memset(a,k,sizeof(a))
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
#define dec(i,s,t) for(int i=s;i>=(t... | #include <bits/stdc++.h>
#include <algorithm>
#define int long long
using namespace std;
#define mod 1000000007
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
bool vis[200005];
vector<int> vec[2000005], v1;
int child[2000005];
// int parent[2000005];
// //int div1[100... | 0 |
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;
int main() {
int N; cin >> N;
vector<int>... | #include<bits/stdc++.h>
#define pir pair<int,int>
#define qmin(x,y) (x=min(x,y))
#define qmax(x,y) (x=max(x,y))
#define rsort(x,y) sort(x,y),reverse(x,y)
#define fr first
#define se second
using namespace std;
typedef long long ll;
const int Maxn=4100000;
const int inf=0x3f3f3f3f;
int n,x[Maxn],y[Maxn],dir[Maxn],bj[Ma... | 1 |
#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 rep(i, n) for... | #include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr double eps = 1e-9;
constexpr ll MOD = 1000000007LL;
template <typename T>
bool chmin(T& a, T b) {
... | 0 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a;
while (cin >> a) if (a > 8) return cout << ":(" << "\n", 0;
cout << "Yay!" << "\n";
} | //----------------------Shanu Garg here---------------------
//-------------Search on youtube : Shanu Garg---------------
//-Studying at National Institute of Technology Delhi(NITD)-
//---------------------From Delhi, India--------------------
#include<bits/stdc++.h>
using namespace std;
#define f(i,n) for(auto i=0;i... | 1 |
#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
class StrongDisassembly{
private:
ll V;
vector<vector<ll>> E;
vector<vector<ll>> inv_E;
ll *number;
bool *used_dfs;
ll to_write_num = 0;
void dfs(ll now){
used_dfs[now] = 1;
... | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<pair<long long,pair<long long,long long>>> edges;
const long long MAXN = 2e5+5;
long long par[MAXN];
long long sz[MAXN];
pair<pair<long long,long long>,long long> arr[MAXN];
pair<pair<long long,long long>,long long> arr2[MAXN];
long long getpar(lo... | 0 |
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif
void init() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
}
const int N = 12;
const int S = 1e5+5501;
int dp[N][S];
int p[N], c[N];
int rek(int pos,... | #include<bits/stdc++.h>
using namespace std;
int main()
{
int D, G, p[11], c[11];
cin >> D >> G;
for (int i = 0; i < D; ++i)
cin >> p[i] >> c[i];
int ans = 1e9;
for (int mask = 0; mask < 1 << D; ++mask)
{
int sum = 0, num = 0;
for (int i = 0; i < D; ++i)
{
if (mask & 1 << i)
{
sum += (i + 1) ... | 1 |
#include <iostream>
using namespace std;
int main(){
int a,b;
cin >> a;
b = a;
for(int i=1;i < 3;i++){
b = b * a;
}
cout << b << endl;
return 0;
} | #include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#def... | 0 |
#include<iostream>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
#include<numeric>
using namespace std;
using ll = long long;
int main(){
int a, b;
cin >> a >> b;
if(a > 8 || b > 8) {
cout... | #include <iostream>
using namespace std;
int main() {
int N, K; cin >> N >> K;
if (N % K != 0) printf("%d\n", 1);
else printf("%d\n", 0);
} | 0 |
#include <iostream>
#include <algorithm>
#define N 100
#define INF 2000000000
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
int n;
int M[N][N],color[N],d[N],p[N];
//M??????????????????color????¨??????¶???(0,1,2),d????????????????°???????????¨????
//p???MST???????°???¨?????¨?????????????????... | #include <algorithm>
#include <vector>
#include <iostream>
typedef std::vector<int> TTree;
struct TPath
{
int Id1;
int Id2;
int Cost;
TPath(int AId1, int AId2, int ACost)
: Id1(AId1), Id2(AId2), Cost(ACost)
{}
};
bool Compare(const TPath& Left, const TPath& Right)
{
if(Left.Cost < 0) retu... | 1 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string s; cin >> s;
int ans = 0;
int cnt_J = 0;
int cnt_O = 0;
int cnt_I = 0;
char p = 'X';
for (int i = 0;i < s.size();i++){
if(s[i] == 'J') {
cnt_O = ... | #include <iostream>
using namespace std;
char a[1000001];
char w[] = "JOI";
int k=0, l[3];
int main() {
cin>>a;
for(char* c=a;*c!='\0';) {
for(int i=0;i<3;++i) {
l[i]=0;
while(*c!='\0'&&*c==w[i]) {
++l[i];
++c;
}
}
if(l[0]>=l[1]&&l[2]>=l[1])k=(k<l[1]?l[1]:k);
... | 1 |
//#include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <sta... | #include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
string a;
cin>>a;
int tmp=a.find("ST");
while(a.length()>0&&tmp>=0)
{
a.erase(tmp,2);
int x=max(tmp-1,0);
tmp=a.find("ST",x);
if(tmp==string::npos)
tmp=-1;
}
cout<<a.length()<<endl;
return 0;
} | 0 |
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
string s;
cin >> a >> b >> s;
string ans="Yes";
for(int i=0; i<a; i++){
if(0>s.at(i)-'0'||s.at(i)-'0'>9) ans="No";
}
if(s.at(a)!='-') ans="No";
for(int i=0; i<b; i++){
if(0>s.at(i+a+1)-'0'||s.at(i+a+1)-'0... | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
string s;
cin >> s;
if (s.si... | 1 |
#include<bits/stdc++.h>
using namespace std;
int w[8],h[8],x1[15],x2[15],f=0;
char m[8][8],ans[8][8];
void fs(int n=0){
if(f)return;
if(n==8){
f=1;
for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
ans[i][j]=m[i][j];
return;
}
if(h[n]==1)fs(n+1);
else{
for(int i=0;i<8;i++){
if(w[i]+x1[7+i... | #include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#define MAX 10000
#define INFTY 1<<30 // 2^30
#define N 8
using namespace std;
typedef long long llong;
static const ... | 1 |
#include<cstdio>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
class Node{
public:
int parent, rank;
Node(int i): parent(i), rank(0){}
};
bool sortFunc(const vector<int>& A, const vector<int>& B){
return A[2] < B[2];
}
int find(vector<Node>& nodes, const int& x){
if(nodes[x]... | #include <bits/stdc++.h>
using namespace std;
struct UnionFind {
vector<int> par;
UnionFind(int n) : par(n, -1) { }
void init(int n) { par.assign(n, -1); }
int root(int x) {
if (par[x] < 0) return x;
else return par[x] = root(par[x]);
}
bool issame(int x, int y) {
... | 0 |
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()
//UnionFind Template
s... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;
int main() {
ll H, W;
cin >> H >> W;
vector<string>... | 1 |
#include <stdio.h>
typedef struct _Gem{
int x;
int y;
bool hit;
} Gem;
static void
pick_gem(Gem* g, int n, int x, int y)
{
for (int i = 0; i < n; i++) {
if (!g[i].hit && g[i].x == x && g[i].y == y) {
g[i].hit = true;
return;
}
}
}
static bool
check_gem(Gem* g, int n)
{
for (int i = 0; i < n; i++) {
... | #include <iostream>
#include <cstring>
using namespace std;
int map[50][50];
int N;
int x,y;
int main(){
while(1){
cin >> N;
if(N == 0) break;
memset(map,0,sizeof(map));
for(int i = 0; i < N ; i++){
cin >> x >> y;
map[x][y] = 1;
}
int M;
int l;
char d;
int tr ... | 1 |
#include <bits/stdc++.h>
using namespace std;
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef long double ld;
const int inf = 1e9;
const ll inf64 = 1e18;
const int mod = 998244353;
inline int _mul(int a, int ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#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 REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,... | 0 |
#include <iostream>
#include <stdlib.h>
#define inf 99999
using namespace std;
bool check(int *label, int n)
{
for(int i = 1; i <= n; i++){
if(label[i] == 0){
return true;
}
}
return false;
}
void dij(int **a, int n, int s, int t)
{
int *label, current=s, num=1, next, *cost, min;
cost = (int *)calloc... | #include <bits/stdc++.h>
using namespace std;
#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)
#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (... | 1 |
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using vst=vector<string>;
using P =... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define rep(i, start, n) for (int i = (int)(start); i < (int)(n); ++i)
#define all(a) a.begin(), a.end()
#define mp(a, b) make_pair(a, b)
const int MOD = 1e9+7;
const int INF = 1001001001;
const ll... | 0 |
#include<stdio.h>
#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include<iomanip>
#include<iterator>
#include<vector>
#include<map>
#include<utility>
#include<set>
#include<stack>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int k,x;
... | #include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,n,m) for(int i=n;i<m;i++)
#define elif else if
#de... | 0 |
#include "bits/stdc++.h"
using namespace std;
#ifndef LOCAL
#define endl '\n'
#endif
#define fr(i, a, b) for(int i = a; i <= b; i++)
#define rf(i, a, b) for(int i = a; i >= b; i--)
#define pf push_front
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#d... | #include <bits/stdc++.h>
using namespace std;
#define int long long
struct UnionFind{
int num;//連結成分の数
vector<int> r,p;//そのグループのサイズ,自分の親っぽいやつ
UnionFind(){}
UnionFind(int n):num(n),r(n,1),p(n,0){iota(p.begin(),p.end(),0);}
int find(int x){//どのグループに所属するか
return (x==p[x]?x:p[x]=find(p[x]));//xがグループの名前と一致する... | 1 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int I... | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
string str = to_string(N);
string res;
if(str.find("7") != string::npos){
res = "Yes";
} else {
res = "No";
}
cout << res << endl;
return 0;
} | 1 |
#include<iostream>
#include<vector>
#include<algorithm>
int main() {
std::cin.tie(0); std::ios::sync_with_stdio(false);
int N; std::cin >> N;
char buf[1002];
buf[N] = '\n';
buf[N+1] = 0;
if(N >= 4 && N%2 == 0) {
char const* p[2] = {"abcc",
"abdd"};
for(int i = 0; i < N; ++i... | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n;
bool no[10001] = {true,true};
for(int i = 4;i <= 10000;i += 2) no[i] = true;
for(int i = 3;i * i <= 10000;i += 2){
for(int j = i * 2;j <= 10000;j += i) no[j] = true;
}
vector<int> twin;
for(int i = 2;i <= 10000;... | 0 |
#include <bits/stdc++.h>
using namespace std;
void input(int& rnTrgSu, int& rnTrgKin)
{
cin >> rnTrgSu >> rnTrgKin;
}
void searchCntl(int nTrgSu, int nTrgKin)
{
for (int n10000 = 0; n10000 <= nTrgSu; ++n10000)
for (int n5000 = 0; n5000 <= (nTrgSu - n10000); ++n5000)
{
int n1000 = nTrgSu - n10000 - n... | #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>;
using Graph = vector<vector<int>>;
int main(int argc, const char * argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
int a,b;
cin>>a>>b;
int ans=-1e9;
ans=max(ans,... | 0 |
#include <bits/stdc++.h>
#include <type_traits>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (in... | #include "bits/stdc++.h"
#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define rrep(i, n) for(ll i=(n)-1; i >=0; i--)
#define ALL(v) v.begin(),v.end()
#define rALL(v) v.rbegin(),v.rend()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define debug_print(var) cerr << #var << "=" << var <<endl;
#define DU... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.