code_file1 stringlengths 87 4k | code_file2 stringlengths 82 4k |
|---|---|
#include <bits/stdc++.h>
using namespace std;
typedef long long i64;
const int MAX_N = 200000 + 5;
const int A = 1e8;
int n[2], N, Q;
int a[2][MAX_N];
i64 ans;
int Root[2], total_node;
struct SegmentNode {
i64 cnt, sum;
int ls, rs;
} node[MAX_N * 50];
inline void segment_update(int i) {
node[i].cnt = ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
constexpr int MOD = 1000000007;
template <typename T>
struct BIT {
int n;
vector<T> dat;
BIT(int n) : n(n), dat(n + 1, 0) {}
T sum(int idx) { ... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = 2e5 + 5;
struct Edge
{
int next,to;
}e[MAXN<<1];
int head[MAXN],etot=0;
inline void add(int u,int v)
{
e[++etot] = (Edge){ head[u],v};
head[u] = etot;
}
int n;
int dep[MAXN], mxdep[MAXN];
void dfs_dep(in... | #include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
const int N=105,M=105*105;
int a[M],b[M],ans[M];
int c[N],vis[N];
vector<int> rem;
vector<pair<int,int> > adj[N];
int can[N][N];
int n,m;
void go(int x,int pa=-1)
{
if(vis[x]==1) return;
vis[x]=1;
for(auto i:adj[x])
{
if(i.S==pa) c... |
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<tuple>
#include<cstring>
#include<bitset>
#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((ll)(x).... | //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i, a, b) for(ll i = a; i < b; i++)
#define rep(i, n) FOR(i, 0, n)
#define rFOR(i, a, b) for(ll i = a - 1; i >= b; i--)
#define rrep(i, a) rFOR(i, a, 0)
#define pb push_back
using namespace std;
using ll = long long;
using ld = long double;
typedef pair<ll,ll... |
#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e9 + 7;
const int64_t MOD2 = 998244353;
const int INF = 1e9;
const long long inf = 1LL<<62;
/*
<方針>
B-A<=72であり, A-B間で数を選んでも73以上の共通因数をもつことはない.
(proof)A-B間の数n, m(n != m)が共通因数r>=73を持つとすると
n = ra_1
m = ra_2
が成り立つ. この時n<mとしても一般性を失わず, a_2 > a_1で... | #include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define S(x) (int)(x).size()
#define L(x) (int)(x).length()
#define ld long double
#define... |
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define l long
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define ld long double
... | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <unordered_map>
#include <numeric>
#include <set>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <tuple>
#include <cstdio>
#include <chrono> //performance check
using ... |
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
#define DBG(a) cout<< "line "<<__LINE__ <<" : "<< #a <<" --> "<<(a)<<endl
#define eps 1e-8
#define eq(x,y) (fabs((x)-(y)) < eps)
using namespace std;
typedef long long ll;
typedef long... | // clang-format off
#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;
#ifndef godfather
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,a... |
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// #include <boost/rational.hpp>
// using bigint = boost::multiprecision::cpp_int;
// using fraction = boost::rational<bigint>;
using namespace std;
#define pb push_back
#define eb emplace_back
#define unused [[maybe_unused]]
#define tempT templa... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < b; ++i)
int n, h, w, a, b, ans = 0;
int p[20][20];
main() {
cin >> h >> w >> a >> b;
n = h * w;
ans = 0;
rep(mask, 0, (1 << n)) {
if ((int)__builtin_popcount(mask) == a) {
rep(subm, 0, (1 << a)) {... |
#include <bits/stdc++.h>
#define ll long long
#define ls id << 1
#define rs id << 1 | 1
#define mem(array, value, size, type) memset(array, value, ((size) + 5) * sizeof(type))
#define memarray(array, value) memset(array, value, sizeof(array))
#define fillarray(array, value, begin, end) fill((array) + (begin), (array) +... | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); (i)++)
#define per(i, n) for (ll i = n - 1; i >= 0; (i)--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define ROF(i, a, b) for (ll i = (b) - 1; i >= (a); i--)
#define ALL(x) std::begin(x), std... |
#include <stdint.h>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);//cout.precision(dbl::max_digits10);
#define pb(x) push_back(x)
#define mod 1000000007ll //998244353ll
#define vi vector<int>
#define v... | #include <bits/stdc++.h>
#define poi 200100
#define int long long
using namespace std;
typedef long long ll;
typedef double db;
set<int> s;
inline int re()
{
char c = getchar();
int x = 0, k = 1;
while (c < '0' || c > '9')
{
if (c == '-')
k = -1;
c = getchar();
}
whil... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using vll = vector<ll>;
ll const mod = 1e9 + 7;
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define repr(i,a,n) for(ll i=a;i>=n;i--)
#define aashish_999 ios_base::sync_with_stdio(f... | #include <bits/stdc++.h>
#define fo(a,b,c) for (a=b; a<=c; a++)
#define fd(a,b,c) for (a=b; a>=c; a--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
#define inf 2147483647
#define ll long long
//#define file
using namespace std;
int n,i,j,k,l;
int c[501][501];
int a[501],b[501];
ll A[501],B[501];
ll ma1,ma2,mb... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<ll, ll>;
using tp = tuple<ll, ll, ll>;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
#define all(hoge) (hoge).begin(), (hoge).end()
#... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N,K;
cin >> N >> K;
vector<vector<long long>> data(N, vector<long long>(2));
for (int i = 0; i < N; i++) {
for (int j = 0; j < 2; j++) {
cin >> data.at(i).at(j);
}
}
sort(data.begin(),data.end());
long long a=K;
for (int i ... |
#include <bits/stdc++.h>
#pragma region my_template
struct Rep {
struct I {
int i;
void operator++() { ++i; }
int operator*() const { return i; }
bool operator!=(I o) const { return i < *o; }
};
const int l_, r_;
Rep(int l, int r) : l_(l), r_(r) {}
Rep(int n) : Rep(0, n) {}
I begin() const... | /*#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")*/
// only when really needed
/* GNU G++17 7.3.0: No long long for faster code
GNU G++17 9.2.0 (64 bit, msys 2): Long long only for faster code */
#include <bits/stdc++.h>
#define for1(i,a,b) for (int i = a; ... |
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <iomanip>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<pair<int, int>> vpii;
int main() {
int n;
cin >> n;
double e = 0.0;
for(int i = n; i > 1;... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(Array) sort(... |
/* author: jeetganatra */
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define int long long
#define ld long double
#define pb push_back
#define mp ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n;
cin >> n;
if (n < 1000) {
cout << 0 << endl;
}
else if (n < 1000000) {
int64_t ans = 1 * (n - 999);
cout << ans << endl;
}
else if (n < 1000000000) {
int64_t ans = 0;
ans += 1 * (9... |
#include <bits/stdc++.h>
using namespace std;
template <int mod = (int)(998244353)>
struct ModInt {
int x;
constexpr ModInt() : x(0) {}
constexpr ModInt(int64_t y)
: x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
constexpr ModInt &operator+=(const ModInt &p) noexcept {
if ((x += p.x) >= mod) x -= ... | #include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
typedef long long ll;
template <typename T> inline void read(T &x) {
x = 0; char c = getchar(); bool flag = false;
while (!isdigit(c)) { if (c == '-') flag = true; c = getchar(); }
while (isdigit(c)) { x = (x << 1) + (x << 3) + (c ^ 48); c... |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
// size(x), rbegin(x), rend(x) need C++17
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define sor(x) sort(all(... | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
void solve(int tc)
{
int h, w; cin >> h >> w;
vector<string> board(h);
for (int i = 0; i < h; i++)
cin >> board[i];
auto inc = [&](int i, int j) {
return (board[i][j] == '+') == ((... |
#include<bits/stdc++.h>
#define int long long
#define N 200015
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define inf 0x3f3f3f3f
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define fi first
#define se second
#define lowbit(i) ((i)&(-i))
#define VI vector<... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define ld long double
#define el '\n'
#define bizarre ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ordered_set tree<pair<int, int> , null_type,less<pa... |
#include <stdio.h>
int t;
long long p = 1000000007;
long long n, a, b, x, y, z, w;
int main() {
scanf("%d", &t);
for (int q = 0; q < t; q++) {
scanf("%lld%lld%lld", &n, &a, &b);
if (a + b > n) {
printf("0\n");
continue;
}
x = n - a - b + 2;
y = x - 1;
z = (n - a + 1) * (n - b + 1) % p;
z *= 2 * x;... | #include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define ... |
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define fi first
#define se second
#define pub push_back
#define pi pair<int,int>
#define all(v) (v).begin(), (v).end()
#define rep(i, l, r) for(int i=(int)(l);i<(int)(r);... | /* *Which of the favors of your Lord will you deny ?* */
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define vpnt(ans) \
for (ll i = 0; i < ans.size(); i++) \
cout << ans[i] << (i + 1 < ans.size() ? ' ' : '\n');
#define setbit(x, ... |
#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
//using namespace atcoder;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
typedef vector<vector<int> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
temp... | #include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pii pair<int,int>
#define vi vector<int >
#define all(a) (a).begin(), (a).end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define tr(it, a) for(au... |
/* in the name of Anton */
/*
Compete against Yourself.
Author - Aryan Choudhary (@aryanc403)
*/
#ifdef ARYANC403
#include "/home/aryan/codes/PastCodes/template/header.h"
#else
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize ("... | /* ** *** In the name of God *** ** */
// Only Haider is Amir al-Momenin
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 10;
int a[maxn][2];
bool sq(int x) {
return sqrt(x) == (int) sqrt(x);
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int k; cin >... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#defin... | #include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define mod 1000000007LL
#define endl "\n"
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define all... |
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define endl "\n"
#define scd(a) scanf("%d",&a)
#define scdd(a,b) scanf("%d%d",&a,&b)
#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)
con... | //
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- ||||... |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#define gcd(m,n) __gcd(m,n)
#define lcm(m,n) m*(n/gcd(m,n))
#define fast std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pi acos(-1.0)
#define endl '\n'
#define MOD 1000000007
#define ... | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B;
cin >> A >> B;
int a,b;
a = A/100+(A/10)%10+A%10;
b = B/100+(B/10)%10+B%10;
if(a>=b){
cout << a << endl;
}else{
cout << b << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int N;
cin >> N;
double x, y, X, Y;
cin >> x >> y >> X >> Y;
double dx = X - x;
double dy = Y - y;
double r = sqrt(dx * dx + dy * dy);
double th = (double) 360 / N * acos(-1) / 180.0;
double x0 = x - (x... | #include<bits/stdc++.h>
#include<vector>
#include<math.h>
#include<string.h>
using namespace std;
#define MOD 1000000007
#define MAX 200005
#define PMAX 55
#define EPS 0.000001
#define INF 2000000000000000000
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#include <ext/pb_ds/assoc_container.hpp>
#include... |
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9+7;
const long long inv = (mod+1)/2;
long long mpow(long long a, long long b){
if(b==0)return 1;
if(b==1)return a;
long long res = mpow(a, b/2);
res *= res;
res %= mod;
if(b&1){
res *= a;
res %= mod;
}
... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 1000000007ll //998244353ll
#define lld long double
#define mii map<int, int>
#define p... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <... | //Author: RingweEH
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#define ll long long
#define db double
using namespace std;
int min( int a,int b ) { return a<b ? a : b; }
int max( int a,int b ) { return a>b ? a : b; }
void bmax( int &a,int b ) { a=(a>b) ? a : b; }
void bmin( int &a,int b ... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
vector<vector<int>> t(n,vector<int>(n));
for(int i=0;i<n;++i){
for(int j=0;j<n;++j) cin >> t[i][j];
}
int x1,x2;
vector<int> p;
for(int i=1;i<n;++i) p.push_back(i);
int sum;
int num... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using ll = long long;
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF (int)1e9
#define LLINF (long long)1e12
#define MOD (int... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
int main() {
int n; cin >> n;
int amax = 0;
int bmin = 1000;
int tmp;
REP(i, n) {
cin >> tmp;
if (tmp > amax) amax = tmp;
}
REP(i, n) {
cin >> tmp;
if (tmp < bmin) bmin = tmp;
... | #include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n), b(n);
for(int i = 0; i < n; i++) cin >> a[i];
for(int i = 0; i < n; i++) cin >> b[i];
int m = 0, M = 1001;
for(int i = 0; i < n; i++){
m = max(m, min(a[i], b[i]));
M = min(M,... |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define vi vector<int>
#define pii pair<int,int>
#define si set<int>
#define mii map<int,int>
#define F first
#define S second
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define... | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x).begin(),(x).end()
#define uniq(v) (v).erase(unique(all... |
#include<bits/stdc++.h>
#define M_PI 3.14159265358979323846
#define Speed_UP ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#warning Remember to change t
inline void s... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define MOD 1000000007
#define MOD2 1000000009
#define endl "\n"
#define pii pair <int, int>
#define pll pair <ll, ll>
#define F first
#define S second
int main()
{
IOS;
... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,j,n) for(int i=j;i<n;i++)
#define readvec(v,n) for(int i=0;i<n;i++){cin>>v[i];}
#define MOD 1000000007
int main()
{
int a,b,w;cin>>a>>b>>w;w*=1000;
if(w<a){cout<<"UNSATISFIABLE";return 0;}
int t=w%a;
if(w<a||(a+((double)(t))/(w/... | //#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 <array>
#include <unordered_map>
#include<unordered_set>
#include <numeric... |
#include <bits/stdc++.h>
#define rep(i,begin, end) for (ll i = begin; i < (ll)(end); i++)
using namespace std;
using ll = long long;
template<typename T>
using vec2 = vector<vector<T>>;
template<typename T>
using vec3 = vec2<vector<T>>;
template<typename T>
using vec4 = vec3<vector<T>>;
template<typename T>
using vec... | #include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define maxn
ll mod=1e9+7;
inline ll ksm(ll a,ll b){
ll ans=1,base=a;
while(b){
if(b&1) ans=ans*base%mod;
base=base*base%mod;
b/=2;
}
return ans;
}
int main(){
ll n,p;
cin>>n>>p;
cout<<(p-... |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
using P = pair<long long,long long>;
using ll = long long;
int main() {
int N,M;
cin >> N >> M;
vector<int> A(M+2);
A.at(0) = 0;
A.at(1) = N+1;
rep(i,M) cin >> A.at(i+2);
sort(A.begin(),A.end());
... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0 ; i < n ; i++)
#define repl(i, n) for (ll i = 0 ; i < n ; i++)
#define Rep(i, n) for (int i = 1 ; i <= n ; i++)
#define Repl(i, n) for (ll i = 1 ; i <= n ; i++)
#define rep3(i, a, n) for (int... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using cd = complex<ld>;
struct edge {
int from, to;
char c;
};
vector<edge> g[1000];
bool calced[1000][1000];
int dp[1000][1000];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nu... | #include<bits/stdc++.h>
#define M 100005
typedef long long ll;
using namespace std;
bool f2;
char IO;
int rd(){
int num=0;bool f=0;
while(IO=getchar(),IO<48||IO>57)if(IO=='-')f=1;
do num=(num<<1)+(num<<3)+(IO^48);
while(IO=getchar(),IO>=48&&IO<=57);
return f?-num:num;
}
int n,m;
struct node{
int v;ll C,D;
};
vect... |
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(),... |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#include<string.h>
using namespace std;
#define pb push_back
#define all(v) v.begin(),v.end()
#define see(x) cout<<endl<<#x<<" : "<<(x)<<endl;
#define ya cout<<"YES"<<endl;
#d... |
// 解き直し.
// https://atcoder.jp/contests/arc111/editorial/519
// C++(GCC 9.2.1)
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using PQ = priority_queue<P, vector<P>, greater<P>>;
using vPQ = vector<PQ>;
using vp = vector<P>;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;
template<class T>inline bool chmax(T &a, const T &b) { if (b > a) { a = b; return true; } return false; }
template<class T>inline bool chmin(T &a, const T &b) { if (b < ... |
#include <bits/stdc++.h>
#define ff first
#define ss second
#define endl '\n'
using namespace std;
const long long INF = (long long) 1e18;
const int mod = (int) 1e9+7;
const int MAXN = (int) 3e5+5;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll n, m;
vector... | #include<bits/stdc++.h>
#define MAX 200000
#define MOD 1000000007
using namespace std;
vector<int> v[MAX+10];
vector<int> dist[MAX+10];
vector<int> path;
int in[MAX+10], out[MAX+10];
int count(int l,int r, int k)
{
return upper_bound(dist[k].begin(),dist[k].end(),r)-lower_bound(dist[k].begin(),dist[k].end(),l);
}
voi... |
#include <bits/stdc++.h>
using namespace std;
int n, k;
char temp[105];
string s;
char getWin(char a, char b) {
if (a == 'R') {
if (b == 'R' || b == 'S') return a;
else return b;
} else if (a == 'P') {
if (b == 'P' || b == 'R') return a;
else return b;
} else {
if (b == 'S' || b == 'P') return a;
else ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int inf = 1001001001;
ll INF = 1001001001001001001;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define rep(i, n) FOR(i, 0, n)
#define all(x) x.begin(), x.end()
#define pb push_back
#define pf push_front
ll MOD = 1000000007;
using P = pair... |
#include "bits/stdc++.h"
using namespace std;
#define int long long
using ll = long long;
using P = pair<ll, ll>;
const ll INF = (1LL << 61);
ll mod = 998244353;
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) :x((x%mod + mod) % mod) {}
mint operator-() const { return mint(-x); }
mint& operator+=(const... | #include <bits/stdc++.h>
using namespace std;
typedef bool boool;
typedef long long ll;
#define vl vector<ll>
#define vb vector<boool>
#define vs vector<string>
#define vp vector<pair<ll, ll>>
#define vvl vector<vector<ll>>
#define vvp vector<vector<pair<ll, ll>>>
#define mod 998244353
#define all(x) x.begin(), x.end()... |
//void __(){
// string tmp;
// _(int,n);
// _(string,s);
// for(char c : s){
// if(sz(tmp) >= 2 && tmp.substr(sz(tmp)-2) == "fo" && c == 'x'){
// tmp.pop_back();
// tmp.pop_back();
// }
// else
// tmp.pb(c);
// }
// print(sz(tmp));
//}
//
#include ... | #include<iostream>
#include<vector>
using namespace std;
int main(){
int N,len,ans=0;
string S;
vector<char> vec;
cin>>N>>S;
for(int i=0;i<N;i++){
vec.push_back(S[i]);
while(true){
len = vec.size();
if(len>=3 && vec[len-1]=='x' && vec[len-2]=='o' && vec[len-3]=='f'){
vec.pop_back();
vec.pop_back(... |
//Solution By SlavicG
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define forn(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb ... | #include <bits/stdc++.h>
#include <ctime>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define cps CLOCKS_PER_SEC
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define cset(x) cout<<fixed<<setprecision(x)
int st=0;
string S;
int h=0;
int ti;
void snu(strin... |
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0, length = n; i < length; i++)
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define ep emplace
#define epb emplace_back
#define scll static_cast<long long>
#define sz(x) static_cast<int>((x).size())
#define pfll(x) printf("%lld... | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
ll a,b,c;
cin >> a >> b >> c;
ll p=998244353;
ll ans=1;
ll x=a*(a+1)/2,y=b*(b+1)/2,z=c*(c+1)/2;
x%=p;
y%=p;
z%=p;
ans=x;
ans%=p;
ans*=y;
ans%=p;
ans*=z;
ans%=p;
... |
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
int main(){
int sl=9;
int ans=0;
string S;
cin>>S;
for (int i = 0; i < sl; i++)
{
string zone=S.substr(i,4);
if(zone=="ZONe") ans++;
}
cout<<ans;
} | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x) cerr << "Line " << __LINE__ << ": " << #x << " = " << (x) << "\n";
#define spa << " " <<
#define fi first
#define se second
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
using ld =... |
#include<bits/stdc++.h>
#define mem(a,x) memset(a,x,sizeof(a))
#define rep(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i <= _##i; ++i)
#define repd(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i >= _##i; --i)
#ifndef ONLINE_JUDGE
#define debug(x...) printf("["#x"]="),print(x);
#else
#defi... | #pragma GCC optimize("Ofast","inline","-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#define int long long
using namespace __gnu_pbds;
using namespace std;
struct custom_hash {
static uint64_t splitmix... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int N; cin>>N;
if(N%100==0) cout<<N/100;
else cout<<N/100+1;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(intt i=0;i<(intt)(n);i++)
#define repm(i,n) for(intt i=(intt)(n)-1;i>=0;i--)
#define rept(i,n) for(intt i=1;i<(intt)(n);i++)
#define reptm(i,n) for(intt i=(intt)(n);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define siz(s) (s).size()
#define fof(i,a,... |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define deb(x) cout << #x << " " << x << endl;
#define debtwo(x,y) cout << x << ", " << y << endl;
#define mod 1000000007
#define N 1000001
void solve() {
ll n, m, t, a, b, pre = 0;
cin >> n >> m >> t;
ll lim = n;
bool f = 0;
while (m--) {... | #include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(a, n) for (int i = a; i < n; i++)
#define Fo(k, n) for (int i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", s)
#define ... |
#include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
using namespace std;
#pragma region Macros
using ll = long long;
#define int ll
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V<V<T>>;
#define IO... | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int fa[N], n, q, siz[N];
map<int, int> m[N];
int find(int x) {
if (x == fa[x]) return x;
return fa[x] = find(fa[x]);
}
void merge(int x, int y) {
x = find(x);
y = find(y);
if (x == y) return;
if (m[x].size() > m[y].size()) swap(x, y);
fa[x] =... |
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define nl "\n"
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, n) FOR(i, 0, n)
#define ROF(i, n, a) for(int i = n; i >= a; --i)
#define R0F(i, n) ROF(i, n, 0)
#define tra... | #include<bits/stdc++.h>
#define int long long
#define rint regester int
const int maxn = 1e6 + 10;
const int INF = 1e9;
using std::ios;
using std::cin;
using std::cout;
using std::max;
using std::min;
using std::sort;
using std::unique;
using std::lower_bound;
using std::swap;
using std::abs;
using std::acos;
using std... |
#include<bits/stdc++.h>
using namespace std;
int main(void){
int n;
long long k;
long long x,y;
vector<pair<long long ,long long>> a;
cin>>n>>k;
for(int i=0;i<n;i++){
cin>>x>>y;
a.push_back({x,y});
}
sort(a.begin(), a.end());
for(int i=0;i<n;i++){
... | #include <bits/stdc++.h>
#define kyou using
#define mo namespace
#define kawaii std
kyou mo kawaii; // hi honey~
#define ll long long
#define ld long double
#define endl "\n"
const int MX = 200005;
const int LG = (int)log2(MX) + 1;
const int BLOCK = 205;
const int inf = 1000000069;
const ll inf_ll = 8000000000000000... |
#include<bits/stdc++.h>
#define ss second
#define ff first
#define pb push_back
#define ll long long
using namespace std;
typedef pair<int,int> pii;
const int maxn=2e5+10;
int main(){
///freopen("test.txt","r",stdin);
int n,m;
scanf("%d %d",&n,&m);
if(n==1 && m==0){
printf("1 2\n");
return 0;
... |
//Shrey Dubey
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<vector>
#include<set>
#include<list>
#include<iomanip>
#include<queue>
#include<stack>
#include <math.h>
#include<climits>
#include<bitset>
#include<cstring>
#include<numeric>
#include<array>
using... |
//#pragma GCC target("avx")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <fu... | #include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;
#define pq_max priority_queue<ll>
#define pq_min priority_queue<ll,vi,greater<ll> >
#define iint int
#define f(i,a,b)... |
#include<bits/stdc++.h>
using namespace std;
int n,q,a[300005],seg[1200005];
void build (int l,int r,int id){
if (l==r) seg[id]=a[l];
else {
int mid=l+(r-l)/2;
build(l,mid,id*2);
build (mid+1,r,id*2+1);
seg[id]=seg[id*2]^seg[id*2+1];
}
}
void change(int p,int val,int l,int r,int id){
if (l>p||r<p) return;
... | #include <bits/stdc++.h>
//#include <chrono>
#pragma GCC optimize("O3")
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
using ll = long long;
using vec ... |
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF INT_MAX
#define LLINF LLONG_MAX
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i+... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define vt vector
#define pb push_back
#define mp make_pair
#define rep(i, n) for (int i = 0; i < n; i++)
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
// 🚩
// 20210424 21:52:52~
//
void flip(string& S,... |
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <s... | #include <iostream>
using namespace std;
int main() {
int N;
cin>>N;
if (N%2==0){
cout<<"White";
}
else {
cout<<"Black";
}
}
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
#define sz(a) int((a).size())
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(... | #include <iostream>
#include <cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
int main(void){
double n,x0,y0,xn2,yn2;
cin >> n;
cin >> x0 >> y0;
cin >> xn2 >> yn2;
double xm = (x0+xn2)/2.0;
double ym = (y0+yn2)/2.0;
dou... |
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using ll = int64_t;
using ull = uint64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define pb push_back
#define ss second
#define ff first
#define all(v) v.begin(), v.end()
#define deb(x) cerr << "\n" \
<< #x << "=" << x << "\n";
#define deb2(x, y) cerr << "\n" \
... |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pi pair<int,int>
#define f first
#define s second
void find(int N,vector<int>& a)
{
int n=(N<<1);
vector<bool> vis(n,1);
vector<pi> val(n);
for(int i=0;i<n;i++)
val[i]=make_pair(a[i],i);
sort(val.begin(),val.end());
... | #pragma GCC optimize("Ofast")
#if 1
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
using ll = int64_t;
using db = double;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpii = ... |
#include<bits/stdc++.h>
using namespace std;
int main() {
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b) cout<<c;
else if(b==c) cout<<a;
else if(a==c) cout<<b;
else cout<<0;
return 0;
} | #include<bits/stdc++.h>
using namespace std;
int main () {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << min(min(a,b),min(c,d)) << endl;
} |
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
long long n,x,mnh=0,che=0;
double uqu=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>x;
mnh+=abs(x);
uqu+=x*x;
che=max(abs(che),abs(x));
}
cout<<fixed<<setprecision(15);
cout<<mnh<<endl;
cout<<sqrt(uqu)<<endl;
cout<<ch... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
// MACROS
using ll = long long;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define rep(i, n) for (int i = 0; i < ... |
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<sstream>
#include<cstring>
#include<cstdio>
#include<string>
#include<deque>
#include<cmath>
#include<queue>
#include<set>
#include<map>
using namespace std;
int a, b;
int aBoard[1010];
int bBoard[1010];
int main(void)
{
scanf("%d%d", &a, &b);
if ... | #include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define bit(x,j) ((x>>j)&1)
using namespace std;
// bitset<8>set1(p);
// __builtin_popcountll(x);
// bitset<100> b("1010");
ll int mod=998244353;
int mul(ll int x, ll int y)
{
return (x * 1ll * y... |
#include <bits/stdc++.h>
using namespace std;
struct ios
{
inline char read()
{
static const int IN_LEN = 1e6 + 10;
static char buf[IN_LEN], *s, *t;
return (s == t) && (t = (s = buf) + fread(buf, 1, IN_LEN, stdin)), s == t ? -1 : *s++;
}
template <typename _Tp>
inline ios &o... | #include <bits/stdc++.h>
using namespace std;
int main() {
int V,T,S,D;
cin >> V >> T >> S >> D;
cout << ((V*T <= D && V*S >= D)?"No":"Yes") << endl;
} |
#include<bits/stdc++.h>
using namespace std;
long long arr[200200];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
long long sum = 0;
cin >> n;
for(int i = 0; i < n; i++){
long long a, b;
cin >> a >> b;
arr[i] = 1ll * 2*a + b;
sum += a;
}
... | #include <stack>
#include <queue>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <set>
#include <tuple>
#include <cmath>
#include <random>
#include <algorithm>
#include <vector>
#include <iostream>
#include <fstream>
#include <chrono>
#include <numeric>
#define fio ios_base... |
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define prin... | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <climits>
using namespace std;
using ll = int64_t;
struct Point{
int x;
int y;
int z;
};
inline int D(const Point& l, const Point& r)
{
return abs(r.x - l.x) + abs(r.y - l.y) + max(0, r.z - l.z);
}
int tsp(co... |
#include <bits/stdc++.h>
using namespace std;
template<typename T>
void debug(vector<T> item) {
for (auto i : item) {
cout << i << " ";
}
cout << endl;
}
int main() {
int N;
cin >> N;
int64_t mn = -(int64_t)1e9;
int64_t mx = 1e9;
int64_t sum = 0;
for (int i = 0; i < N; ++i) {
int64_t a, b;
cin >>... | #pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x)... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ff first
#define ss second
typedef long long ll;
ll power(ll a, ll b){//a^b
ll res=1;
a=a%MOD;
while(b>0){
if(b&1){res=(res*a)%MOD;b--;}
a=(a*a)%MOD;
b>>=1;
}
return res;
}
ll fermat_inv(ll y){return... | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string(string(s)); }
string to_string(bool b) { return to_string(int(b)); }
string to_string(vector<bool>::reference b) { return to_string(int(b)); }
string to_stri... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define x first
#define y second
#define pb push_back
#define mp make_pair
template <typename T> void chkmin(T &x,T y){y<x?x=y:T();}
template <typename T> void chkmax(T &x,T y){x<y?x=y:T();}
te... | #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;
}
double Sx, Sy, Gx, Gy;
int main() {
Sx = get(), Sy = get(), Gx = get(), Gy = get();... |
#include <bits/stdc++.h>
using namespace std;
void chmin(int &a, int b) { if(a>b) a=b; }
int main(void) {
int N, M;
cin >> N >> M;
vector<int> A(N+1, 0);
vector<int> B(M+1, 0);
vector<vector<int>> dp(N+1, vector<int>(M+1, INT_MAX));
for (int i=1; i<=N; i++) { cin >> A[i]; }
for (int i=1; i... | /*
author: lone_star
I love coding, particle physics and chilled beer.
*/
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
long long mod(ll x, ll M){
return ((x%M + M)%M);
}
long long add(ll a, ll b, ll m){
return mod(mod(a,m)+mod(b,m),m);
}
long long mul(ll... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, c) for(int i = 0; i < (int)c; i++)
const int inf = 1000000000; // 10^9
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; retur... | #include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
int main() {
ll N;cin>>N;
vector<vector<ll>> vec(N,vector<ll> (5));
for(ll i=0;i<N;i++) {
for(ll j=0;j<5;j++) {
cin>>vec[i... |
#include <cstdio>
#define rep( i, a, b ) for( int i = (a) ; i <= (b) ; i ++ )
#define per( i, a, b ) for( int i = (a) ; i >= (b) ; i -- )
typedef long long LL;
const int MAXN = 2e5 + 5;
template<typename _T>
void read( _T &x )
{
x = 0;char s = getchar();int f = 1;
while( s > '9' || s < '0' ){if( s == '-' ) f = -1... | #include<bits/stdc++.h>
using namespace std;
#define ll long long
// memo fixed setprecision(20);
using vvll = vector<vector<ll>>;
ll mod =1e9+7;
/*"itob" int to "N"base */ template<typename TypeInt> string itob(const TypeInt v, int base){static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";s... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <array>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
... | #include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vp = vector<P>;
us... |
#include <bits/stdc++.h>
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;
#define PI 3.14159265359
#define tMOD 998244353
#define mkpr(x,y) make_pair(x,y)
#define rep(i,n) for(ll i=0;i<n;i++)
int main(){
ll N;cin>>N;
ll ans=N;
for(ll b=0;(1LL<<b)<=N;b++){
... | #include"bits/stdc++.h"
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
temp... |
#include <bits/stdc++.h>
#define ll long long
#define coutp(a) cout << "(" << a.first << ", " << a.second << ")"
using namespace std;
const int mx = 2e5;
int parent[mx + 10], Rank[mx + 10];
int get(int a)
{
return parent[a] = (parent[a] == a? a: get(parent[a]));
}
void Union(int a, int b)
{
a = get(a);
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
vector<int> V[100001];
int f[100001], sz[100001];
void dfs(int pos) {
f[pos] = -1, sz[pos] = 1;
int sum = 0;
vector<int> odd;
for (int w : V[pos]) {
dfs(w); sz[pos] += sz[w];
if (sz[w] & ... |
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a:x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define f first
#define s second
#define nl "\n"
#define pb push_back
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,... | #include <bits/stdc++.h>
using namespace std;
int main()
{
//freopen ("input.txt","r",stdin);
//freopen ("output.txt","w",stdout);
int a,b;
scanf("%d%d",&a,&b);
double ans = (double)(a*b)/100;
cout << ans << endl;
return 0;
} |
// execute g++ main.cpp -std=c++14 -I C:\Users\naoya\Desktop\code\Atcoder
#include<bits/stdc++.h>
//#include<atcoder/all>
typedef long long ll;
typedef long double ld;
using namespace std;
//using namespace atcoder;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
//ordered_set 重複不可
#include <ext/pb_ds/assoc_con... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i, init, end) ... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template<class T> bool chmin(T& a,T b){if(a>b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b){if(a<b) {a = b; return true;} return fa... | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int x[n];
int y[n];
for(int i=0;i<n;i++)
{
cin >> x[i];
}
for(int j=0;j<n;j++)
{
cin >> y[j];
}
int mul[n];
int sum=0;
for(int p=0;p<n;p++)
{
mul[p]=x[p]*y[p];
}
for(int o=0;o<n;o++)
{
su... |
/*
@uthor: Kashish Gilhotra
user: CodeChef, CodeForces, HackerEarth, HackerRank, SPOJ: kashish001
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long int
typedef vector<int> vi;
typedef vector<pair<int, int>> vpi;
typedef vector<vi> vvi;
const int mod = 1e9 + 7;
#define FAST io... | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define forf(i,a,b) for(ll i = a; i < b; i++)
#define forb(i,a,b) for(ll i = b; i >= a; i--)
#define pb push_back
#define ff first
#define ss second
#define pi 3.141592653589793
#define fast ios_base::sync_with_stdio(false);ci... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<typename T>
void view_1d(vector<T> V, string sep) {
for (ll i=0; i<V.size(); i++) {
cout << V[i];
if (i == V.size() - 1) {
cout << endl;
} else {
cout << sep;
}
}
}
template<typ... | #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 ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;... |
#include <iostream>
#include <vector>
#include <map>
#include <tuple>
#define fi first
#define se second
#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 srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(... | #include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR(i,a,b) for(i= a ; i < b ; ++i)
#define rep(i,n) FOR(i,0,n)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define INF INT_MAX
#define pb push_back
#define tc int t;cin>>t;while(t--)
#define ll lon... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define For(i,x,y) for(ll i=(x);i<=(y);++i)
#define FOr(i,x,y) for(ll i=(x);i>=(y);--i)
#define rep(i,x,y) for(ll i=(x);i<(y);++i)
#define clr(a,v) memset(a,v,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(a))
#define fi first
#defi... | #include <bits/stdc++.h>
#define ll long long
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FOR(i, a, b) for (int i=a; i<(b); i++)
using namespace std;
ll mod = 998244353;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll a,b,c;
cin >> a >> b >> c;
ll x1 = (a*(a+1)/2) %... |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int N;
cin >> N;
vector<pair<int, int>> v(N);
for (int i = 0; i < N; ++i) {
cin >> v[i].first >> v[i].second;
}
int ans = 0;
for (int i = 0; i < N; ++i) {
for (int j = i + 1; j < N; ++j) {
if (abs(v[i].first - v[j].fir... | #include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define rArr(v) for(auto &i: v) cin >> i
#define pArr(v) for(auto i: v) cout << i << " "
#define ll long long
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%... |
#include <bits/stdc++.h>
#define LL long long
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) wr... | #include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <queue>
#include <iomanip>
#include <numeric>
#include <cmath>
using namespace std;
int main() {
string n;
cin >> n;
int k;
cin >> k;
int nn = n.si... |
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t; using Vll =vector<ll>; using VVll =vector<vector<ll>>;
template <class T> using Vec = vector<T>; template <class T> using VVec = vector<vector<T>>;
#define INF 9223372036854775807LL/2
void Z(ll i=-1){ if(i==-1)cout<<"Test"<<endl; else cout<<"Test"<<i<<e... | #pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
using ll = int64_t;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
constexpr char newl = '\n'... |
// Lights will guide you home
#include <bits/stdc++.h>
#define slld(longvalue) scanf("%lld", &longvalue)
#define ll long long
#define pll pair < long long, long long >
#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back
#define bug printf("BUG\n")
#define mxlld LLONG_M... | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
int main() {
int T;
cin >> T;
vector<long long> c(T);
rep(i,T) cin >> c[i];
rep(i,T) {
if(c[i] % 2 == 1) {
cout << "Odd" << endl;
}
else if((c[i] / 2) % 2 == 0) {
cout << "Even" << endl;
... |
#include <bits/stdc++.h>
int ri() {
int n;
scanf("%d", &n);
return n;
}
int main() {
int h = ri();
int w = ri();
int x = ri() - 1;
int y = ri() - 1;
std::string s[h];
for (auto &i : s) std::cin >> i;
int cnt = -3;
for (int i = x; i < h && s[i][y] != '#'; i++) cnt++;
for (int i = x; i >= 0 && s[i][y] != '#... | #include<bits/stdc++.h>
using namespace std;
int a[200005];
int cnt;
int vis[2005];
vector<int>adj[20005];
void dfs(int v)
{
vis[v] =1;
cnt++;
for(auto u: adj[v]){
if(vis[u]==0)
dfs(u);
}
}
int main()
{
int n, m;
cin >> n >>m ;
for(int i=0;i<m;i++){
int u, v;
... |
#include <bits/stdc++.h>
using namespace std;
#define Rep(i,j,n) for(int i=j; i<n; i++)
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100//000000000
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<P,P>
#defi... | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
vector<int> a(n), b(m);
rep(i, n) cin >> a[i];
... |
#include "bits/stdc++.h"
#include<sstream>
using namespace std;
typedef long long ll;
#define _USE_MATH_DEFINES
#include <math.h>
#define NIL = -1;
#define all(x) x.begin(),x.end()
const ll INF = 1e9;
const long long inf = 1e18;
const ll INFL = 1e18;
const ll MOD = 1e9 + 7;
int digit(ll x) {
int digits = 0;
... | #include<bits/stdc++.h>
using namespace std;
#define rep(i, N) for(int i = 0; i < (int)N; i++)
#define all(v) v.begin(), v.end()
#define MOD 1000000007
long int powi(long int a, long int n){
int re = 1;
rep(i, n) re *= a;
return re;
}
long int func(long int a){
long int re = 0;
vector<long int> v;
... |
#include<iostream>
#include<string>
#include<array>
using namespace std;
int main() {
int a, b, c,d;
cin >> a >> b >> c >> d;
cout << a * d - b * c;
} | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d,k,sum;
scanf("%d %d %d %d",&a,&b,&c,&d);
k=c*d-b;
if(k<=0){
printf("-1\n");
}else{
sum=a/k;
if(sum*k<a)
sum++;
printf("%d\n",sum);
}
return 0;
} |
/*
Author : MatsuTaku
Date : 05/22/21
Certificate:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDF9T447OEo8XSQ6O1AznN5tKC8mzvYc4Zs3+oOKfMqgLXfOwQnpfcoxKs4MAP1eICBD13PkcIezJ9IlV6nKQZKs1BQmvjSXJ+zKK8YCKvAueNPuNO0Bim43IBaNHNFWcMvcmUvHgRb6hUSO0V8I7OsjiFo20KDBj3gAznu9tir0Q== CompetitiveProgrammingCertification:tk... | #include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<n;++i)
#define rrep(i, n) for(ll i=n-1;i>=0;--i)
#define rep1(i, n) for(ll i=1; i<=n; ++i)
#define repitr(itr,mp) for(auto itr=mp.begin();itr!=mp.end();++itr)
#define ALL(a) (a).begin(),(a).end()
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
... |
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define fori(a) for(auto i : a )
#define all(a) begin(a), end(a)
#define set(a,b) memset(a,b,sizeof(a))
#define sz(a) a.size()
double pi=acos(-1);
#define ll long lon... | #include <bits/stdc++.h>
#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(v) v.begin(),v.end()
#define Mod (ll)(1e9+7)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<long long> vl;
const int Inf = INT_MAX... |
//@formatter:off
#include<bits/stdc++.h>
#define overload4(_1,_2,_3,_4,name,...) name
#define rep1(i,n) for (ll i = 0; i < ll(n); ++i)
#define rep2(i,s,n) for (ll i = ll(s); i < ll(n); ++i)
#define rep3(i,s,n,d) for(ll i = ll(s); i < ll(n); i+=d)
#define rep(...) overload4(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__)
#defi... | /* [Template].cpp
Example code to use when starting new code. This particular problem was problem
977A_Wrong_Subtraction from CodeForces
Compile: g++ -o B.exe B.cpp
Execute: ./B
*/
#include <cstdio>
#include <iostream>
#include <cmath>
#include <limits>
#include <iomanip>
#include <cstring>
#include <bits/std... |
#include<bits/stdc++.h>
using namespace std;
#define GODSPEED ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define f first
#define s second
#define newl cout<<"\n";
#define pb push_back
#define mset(a... | //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<... |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<vector>
#include<cstring>
#include<map>
#include<set>
#include<cstdlib>
#include<bitset>
using namespace std;
#define FAST ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
typedef int ll;
ll n,m;
ll cnt=0;
long long ans=0;
long long mo... | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define f first
#define s second
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
const int inf = 1e9;
const ll infll = 1e18;
const int M = 998244353;
const int N = 2e5;
int fact[N+1], inv[N+1];
int ad(... |
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, x; cin >> n >> x;
vector <int> a(n);
for(int &y: a) cin >> y;
vector <vector <int> > dp(n, vector <int> (2, 0));
dp[n - 1][0] = dp[n - 1][1] = 1;
for(int i = n ... | #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <deque> // deque
#include <iomanip> // setprecision
#in... |
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>;
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
const vector<int> dy={-1... | #include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<map>
#include<set>
#define int long long
#define lowbit(x) (x&(-x))
#define mid ((l+r)>>1)
#define lc (x<<1)
#define rc (x<<1|1)
#define fan(x) (((x-1)^1)+1)
#define max M... |
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
void one_case() {
int n;
cin >> n;
cout << max(0, n);
}
int main() {
// std::ios::sync_with_stdio(false);
// std::cin.tie(nullptr);
int t = 1;... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <iterator>
#include <queue>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ll long long int
using nam... |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
/* INCLUDE STATEMENTS */
#include <bits/stdc++.h>
/* NAMESPACES */
using namespace std; // (┛ಠ_ಠ)┛ "Bad" Practice
/* ALIASES */
typedef long long lli;
typedef long double ld;
typedef unsigned uns;
typedef pair<int, int> pi;
typedef pair<lli, lli> pl... | /*** author: yuji9511 ***/
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define prin... |
#include <algorithm>
#include <cmath>
// #include <cstdio>
// #include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#ifdef BUGS
#define PEEK(x) cout << #x << ": " << x << endl;
#el... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
using LL=long long;
using vL=vector<LL>;
using vvL=vector<vL>;
const int MAX = 2000001;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fa... |
#include <bits/stdc++.h>
using namespace std;
stack<char> zhan;
int main(){
int n;
string k;
cin >> n >> k;
for(int i = 0;i < k.length();i++){
if(zhan.size() < 2){
zhan.push(k[i]);
continue;
}
char c = zhan.top();
zhan.pop();
if(zhan.top() ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n,i;cin>>n;
vector<ll> a(n),b(n+1);
for(i=0;i<n;i++){
cin>>a[i];
b[a[i]]=1;
}
int r=0;
for(i=1;i<=n;i++){
if(b[i]!=1){
r=1;
break;
}
}
if(r==0... |
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
int m,h;
scanf("%d %d",&m,&h);
if(h%m==0) printf("Yes\n");
else printf("No\n");
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define F first
#define S second
#define YES(n)cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
int main(){
int M,H;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.