code_file1 stringlengths 87 4k | code_file2 stringlengths 82 4k |
|---|---|
///////////////////////Loading Payloads.......////////////////////////////
#include<bits/stdc++.h>
#define f(i,a,b) for(int i = a; i < b; i++)
#define fd(i,a,b) for(int i = a; i > b;i--)
#define fld(i,a,b) for(ll i = a ; i > b;i--)
#define ll long long
#define fl(i,a,b) for(ll i = a; i < b; i++)
#define VI vector<int>
... | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp> // Common file
#include<ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define ll long long
#define pb pus... |
// -----------------------------------
// author : MatsuTaku
// country : Japan
// created : 11/22/20 20:12:05
// -----------------------------------
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int INF = 2e9;
int main() {
cin.tie(nullptr); ios::sync_with_stdio(false);
int a... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll r1, r2, c1, c2;
cin >> r1 >> c1 >> r2 >> c2;
ll r = r2-r1, c = c2-c1;
if (r == 0 && c == 0) cout << 0 << endl;
else if (r == c || r == -c || abs(r) + abs(c) <= 3) cout << 1 << endl;
else if ((r+c)%2 == 0 || abs(r+c) <= 3 ||... |
#include <bits/stdc++.h>
#define rep0(i,r) for (int i=0,i##end=r;i<i##end;++i)
#define rep(i,l,r) for (int i=l;i<=r;++i)
#define per(i,r,l) for (int i=r;i>=l;--i)
#define pr pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pb push_back
using namespace std;
const int N=2... | #include <bits/stdc++.h>
using namespace std;
#define repi(i, a, n) for (int i = a; i < (int)(n); ++i)
#define rep(i, n) repi(i, 0, n)
#define all(v) begin(v), end(v)
using ll = long long;
int main() {
// freopen("1.txt", "rb", stdin);
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int V, T, S, D;
ci... |
///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"
#define ll long long
#define int ll
#define fi first
#define si ... | #include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
struct MB{
int x;
MB(int _x=0):x(_x){}
void operator +=(const MB& o){ *this = *this + o; }
void operator -=(const MB& o){ *this = *this - o; }
void operator *=(const MB& o){ *this = *this * o; }
MB& operator ++(){ return *this = *... |
#include <bits/stdc++.h>
using namespace std;
using P = pair<int,int>;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<vector<int>> g(n);
vector<int> root(n,-1);
root[0] = 0;
for (int i=0;i<n-1;i++) {
int p;
cin >> p;
p--;
g[i+1].emplace_back(p);
g[p]... | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define MP make_pair
#define N 200005
typedef long long LL;
int n, p[N];
int f[N], sz[N];
vector<int> E[N];
void dfs(int x)
{
++sz[x];
vector<int> v, v2;
for (auto &y: E[x])
{
dfs(y);
if (sz[y]&1) v.push_back(f[y]);
else v2.push_back(f[... |
//***********************************************************//
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define forr(i,a,n) for(ll i=a;i<n;i++)
#define forrr(i,a,n) for(ll i=a;i<=n;i++)... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
const ll INF2 = 1e18;
const double PI = 3.141592653589793;
int main() {
const int div = 1e9 + 7;
int n;
ll ans = 1;
cin >> n;
vector<int> A(n, 0);
vector<int> B(n, 0);
... |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <chrono>
#define int long long
#define ld long double
#define db double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define m... | #include <bits/stdc++.h>
using namespace std;
const int N = 200 + 1;
bool possible[N];
int id[N];
int a[N];
int b[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
fill(id, id + 2 * n, -1);
for (int i = 0; i < n; ++i) {
cin >> a[i] >> b[i];
if (a[i] != -1) {
... |
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
... | #include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
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; }
#define rep(i,cc,n) for(int i=cc... |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<ll, ll> Pair;
typedef vector<Pair> VP;
typedef vector<string> VS;
typedef vector<char> VC;
//typedef modint1000000007 mint;
//typedef modin... | #include<iostream>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b;
cin >> c >> d;
cout << b - c << endl;
return 0;
} |
#include <bits/stdc++.h>
using namespace std;
/*<DEBUG>*/
#define tem template <typename
#define can_shift(_X_, ...) enable_if_t<sizeof test<_X_>(0) __VA_ARGS__ 8, debug&> operator<<(T i)
#define _op debug& operator<<
tem C > auto test(C *x) -> decltype(cerr << *x, 0LL);
tem C > char test(...);
tem C > struct itr{C b... | #include <bits/stdc++.h>
using namespace std;
const int maxN = 55, mod = 998244353;
int n, lim;
int pa[maxN + 1], a[maxN + 1][maxN + 1];
int fac[maxN + 1], sz[maxN + 1];
inline int find(int x) { return pa[x] == x ? x : pa[x] = find(pa[x]); }
int main()
{
scanf("%d %d", &n, &lim);
for(int i = 1; i <= n; i++)
for... |
#include <bits/stdc++.h>
typedef long long LL;
#define lowbit(x) (x & (-x))
const LL inf = 1e17+9;
const LL mod = 1e9+7;
const LL maxn = 2e2+8;
LL n, m, fa[maxn];
double x[maxn], y[maxn], hi[maxn], lo[maxn];
LL find(LL u) {
if (fa[u] == u) return u;
return fa[u] = find(fa[u]);
}
void solve() {
LL i, j... | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
class union_find{
int n;
vector<int> p;
public:
union_find(int n):n(n),p(n,-1){}
int find(int u){ return p[u]<0?u:p[u]=find(p[u]); }
void unite(int u,int v){
u=find(u); v=find(v);
if(u!=v){
if(p[v]<p[u]) swap(u,v);
p... |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for(ll i = m; i < (n); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
using vl = vector<ll... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endll "\n"
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#define ull unsigned long long
#define rep(i,b) for(int i=0;i<b;i++)
#define For(i, a, b) for(int i=a;i<=b;i++)
#define Rof(i, a, b) for(int i=a;i>=b;i--)
#define rest(a, b) memset(a,b,... |
/**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <iostream>
#include <fstream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
inline int inint(istream& in) {int x; in >> x; return x;}
inline ll inll(istream& in) {ll x; in >> x; retur... | #include <bits/stdc++.h>
#define endl '\n'
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define LL long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
using namespace std;
typedef pair<int,int>pii;
long double a,b;
int main(){
cin>>a>>b;
cout<<a*b/100.0<<endl;
return 0;
}... |
// Author: Amey Bhavsar - ameybhavsar24@(github & twitter)
// IDE: Geany on Ubuntu 20.04
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define repD(i,a,b) for(auto i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#d... | #include <bits/stdc++.h>
#define f(a, n) for (int a=0; a<n; a++)
#define F(a, n) for (int a=1; a<=n; a++)
using namespace std;
int P[200005];
int find(int x){
if (P[x] == 0) return x;
return P[x] = find(P[x]);
}
bool join(int x, int y){ // 1 on non-trivial join
int a = find(x), b = find(y);
if (a == ... |
/*** 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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;
#define LL long long
int n;
vector<int> a, b, c;
vector<int> e;
int zz = 0;
int ... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,w;
cin >> n >> w;
cout << n/w << endl;
} | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
int main(){
int a, mf;
cin >> a >> mf;
int ms = a + mf;
if (ms >= 15 && mf >= 8)
cout << 1;
else if (ms >= 10 && mf >= 3)
cout << 2;
else if (ms >= 3)
cout << 3;
else
cout << 4;
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(int i=a;i<=b;i++)
inline ll rd() {
ll 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;
}
#define d rd()
ll a[3];
int main(){
a[0]=d,a[1]=d,a[2]=d;... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
ll X;
vector<map<ll,ll>> memo;
vector<ll> c;
vector<ll> a;
ll dp(int pos,ll value){
if (pos == N) return 1LL;
if (memo[pos].find(value) != memo[pos].end()) return memo[pos][value];
ll ans = dp(pos + 1,(value/a[pos])*a[pos]);
ll r = val... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int a, b;
cin >> a >> b;
int c = a + b;
int answer = 0;
if(c>=15 && b>=8){
answer = 1;
}
else if(c>=10 && b>=3){
answer = 2;
}
else if(c>=3){
answer = 3;
}
else{
answer = 4;
}
cout << answer <<... | #include<bits/stdc++.h>
using namespace std;
#define fi(a,b) for(int i=a;i<b;i++)
#define fj(a,b) for(int j=a;j<b;j++)
#define ff first
#define ss second
#define ll long long
#define ld long double
#define ull unsigned long long
#define bp(x) __builtin_popcount(x)
#define pr(x) for(auto it: x) cout<<... |
#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using namespace std;
//#define int long long
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef vector<vector<int>> graph;
#define pu push
#define p... | #include <iostream>
#include <cmath>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;
#define mp make_pair
#define x first
#define y second
typedef pair<int,int> pii;
typedef long long ll;
typedef pair<ll,int> pl;
ll arr[100005],b[100005];
vector<pl> v;
int main(){
ios::sync_with_stdi... |
#pragma GCC diagnostic ignored "-Wunused-const-variable"
#ifdef MAC
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <chrono>
#include <complex>
#include <algorithm>
#include <utility>
#in... | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type , less<ll> , rb_tree_tag , tree_order_statistics_Node_update>
#define ll long long
#define ull unsigned long long
#define pb... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
scanf("%d%d", &a, &b);
if (a + b >= 15 && b >= 8) {
cout << 1 << endl;
}
else if (a + b >= 10 && b >= 3) {
cout << 2 << endl;
}
else if (a + b >= 3) {
cout << 3 << endl;
}
else {
cou... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n,m,t;
while(scanf("%d%d",&n,&m)!=EOF)
{
n+=m;
if(n>=15&&m>=8)t=1;
else if(n>=10&&m>=3)t=2;
else if(n>=3)t=3;
else t=4;
printf("%d\n",t);
}
}
|
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll n;
cin>>n;
for(ll i=0;;i++){
if(stoll(to_string(i)+to_string(i))>n){
cout<<i-1<<endl;
return 0;
}
}
cout<<n/11<<endl;
}
| #include <bits/stdc++.h>
using namespace std;
//解答
int main(){
string S;
cin >> S;
reverse(S.begin(),S.end());
for(int i=0;i<S.length();i++){
if(S[i] == '6'){
S.erase(i,1);
S.insert(i,"9");
}else if(S[i] == '9'){
S.erase(i,1);
S.insert(i,... |
#include<iostream>
using namespace std;
#include<vector>
using ll = long long;
using vi = vector<int>;
int main() {
int N,i;
cin>>N;
int a,c;
vi A(N,0), B(N);
for (i=0;i<N;i++) {
cin>>a;
A[a-1]++;
}
for (i=0;i<N;i++) cin>>B[i];
ll ans=0;
for (i=0;i<N;i++) {
cin>>c;
ans += A[B[c-1]-1]... | #include<bits/stdc++.h>
#define lint long long int
#define rep(i,n) for(int i=0;i<int(n);i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define arep(i,a,n) for(int i=a;i<n;i++)
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
#define fill(a,x) fill(a.begin(),a.end(),x)
#define eb(dat... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e6+5,M=1e9+7,OO=0x3f3f3f3f;
int main(){
//freopen("myfile.txt","w",stdout);
int n,m;
scanf("%d%d",&n,&m);
vector<int> arr(n);
for(int i=0;i<n;++i)
scanf("%d",&arr[i]);
sort(arr.begin(),arr.end());... | #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define MT make_tuple
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#defi... |
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <iomanip>
using ll = long long int;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);
#define l_ength size
void mul_mod(ll& a, ll b){
a *= b;
a %= MOD;
}
void add... | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define F first
#define S second
#define P pair<int,int>
#define V vector
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define endl "\n"
#define all(x) x.begin(), x.end()
#define forstl(i, s) for (__type... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;
// clang-format off
#ifdef _DEBUG_
#define dump(...) do{... | #include <bits/stdc++.h>
using namespace std;
long long dp[110][110][110][110] = {0}; //何個目まで見たか 何個選んだか mod mod何か
int main(){
long long N,X;
cin >> N >> X;
vector <long long> potion;
long long maxa = 0;
for(int i=0;i<N;i++){
long long a;
cin >> a;
potion.push_back(a);
... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define per(i, a, b) for (auto i = (b); i-- > (a); )
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) int((x).size())
#define lb(x...)... | #include <bits/stdc++.h>
using ull = unsigned long long int;
using ll = long long;
using ld = long double;
using pii = std::pair<int,int>;
using pll = std::pair<ll, ll>;
using vi = std::vector<int> ;
using vvi = std::vector<vi> ;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using vd = std::vector<double... |
//
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, D, H;
cin >> N >> D >> H;
int O[N][2];
for (int i = 0; i < N; i++) {
for (int j = 0; j < 2; j++)
cin >> O[i][j];
}
int noview = 0;
int ans = 0;
for (int i = 0; i <= H; i++) {
float m = ((float)H - (float... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
const int MOD=1e9+7;
int main(){
int N, D, H;
cin>>N>>D>>H;
double a = INFint;
for(int i = 0; i < N; ++i) {
int d, h;
cin>>d>>h;
a = min(a, (H - h)/(double(D - d)));
}
cout... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
const int MOD = 1e9 + 7, N = 3e3 + 5;
int add(int x, int y)
{
x += y;
while (x >= MOD)
x -= MOD;
while (x < 0)
x += MOD;
return x;
}
int mul(int x, int y)
{
return (x * 1ll * y) % MOD;
}
int... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll; //int:2*10**9
typedef long double ld;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_back
#define MOD 1000000007 //998244353... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i,x,n) for(int i = x;i <= n;++i)
#define forr(i,x,n) for(int i = n;i >= x;--i)
#define Angel_Dust ios::sync_with_stdio(0);cin.tie(0)
const int N = 2e6+7,MOD = 1e9+7;
int fact[N],infact[N];
ll qpow(ll a,ll b,ll MOD)
{
ll res = 1;
... | //INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a) (a).begin(),(a).end()
#define ALL(a,n) (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vect... |
#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
if(n%2!=0)
{
cout<<"Black";
}
else{
cout<<"White";
}
return 0;
} | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_set>
#include <vector>
#define REP(i, n) for(int i = 0; i < n; ++i)
using namespace std;
using LLONG = long long;
const LLONG MOD = 100000... |
#include<bits/stdc++.h>
using namespace std;
#define lowbit(x) (x&-x)
#define reg register
typedef long long LL;
typedef unsigned long long uLL;
typedef unsigned int uint;
const int INF=0x7f7f7f7f;
const int jzm=233;
const int mo=998244353;
const double Pi=acos(-1.0);
typedef pair<int,int> pii;
const double PI=acos(-1.... | // C -Comma
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(int)(n); ++i)
#define rep2(i, s, n) for(int i=(s); i<(int)(n); ++i)
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main(){
string N;
cin >> N;
ull len = 0;
ull s3 = 999999-1000+1, s6 = (999999999-1000... |
#include <bits/stdc++.h>
//#include <atcoder/all>
#define For(i, a, b) for (int(i) = (int)(a); (i) < (int)(b); ++(i))
#define rFor(i, a, b) for (int(i) = (int)(a)-1; (i) >= (int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
t... | /*input
*/
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <sstream>
#include <iterator>
#include <cstdlib>
#include <unordered_map>
#include <map>
#include <list>
#include <utility>
using namespace std;
#define en... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef unordered_map<int, int> uii;
typedef unordered_map<ll, ll> ull;
#def... | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int main() {
int n, m; cin >> n >> m;
int a[n], b[m];
rep(i, n) cin >> a[i];
rep(i, m) cin >> b[i];
set<int> ans;
rep(i, n){
bool flag = true;
rep(j, m){
... |
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FORI(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define ll long long
#define mp(m, n) make_pair((m), (n))
// #define DEBUG
#ifdef DEBUG
template<typename T>
void _debug(string s, T x) {
cerr << s << "... | #include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define bit(n,k) ((n>>k)&1) //nのk bit目
#define vec(T) vector<T>
#define vvec(T) vector<vector<T>>
using ll = long long;
using ... |
#include<bits/stdc++.h>
using namespace std;
#define FOR(i, x, y) for(int i = (x); i < (y); ++i)
#define REP(i, x, y) for(int i = (x); i <= (y); ++i)
#define PB push_back
#define MP make_pair
#define PH push
#define fst first
#define snd second
typedef long long ll;
typedef unsigned long long ull;
typedef double lf... | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
string s;
int cnt[10];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> s;
for(char i : s) cnt[i - '0']++;
int i = 8;
if((int)s.length() == 2... |
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define int long long
#define inf 1e15
#define pii pair<int,int>
#define fi first
#define se second
int dis[17][17];
int dp[(1<<17)][17];
int k;
int fun(int mask,int i){
if(__builtin_popcount(mask)==1 && mask&(1... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=1000000007;
constexpr ll INF=1e18;
VVI edge(110000,VI(0));
VI d(110000,INF);
void dijk... |
#include<bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repn(i,a,b) for(int i=a;i>=b;i--)
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#defi... | #include<string>
#include<iostream>
#include <algorithm>
#include<vector>
#include<functional>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <numeric>
#include <math.h>
#define ll long long
#define PI 3.14159265358979323846
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define rep1(x,n) for(ll x=1;x<(ll)n... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
ll gcd(ll x, ll y) {return (x%y) ? gcd(y, x%y) : y; }
const int inf = 1000000000;
const int dx[]={1,0,-1,0};
const int dy[]={0,1,0,-1};
const ll mod = 1e9+7;
int main(){
int x, y;
cin >> x >... | #include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#define ll long long
#define MAXN 200005
#define uns unsigned
#define MOD 998244353ll
#define INF 0x7f7f7f7f
using namespace std;
inline ll read(){
ll x=0;bool f=1;ch... |
#include<stdio.h>
#include<math.h>
#include<algorithm>
#define it register int
#define ct const int
#define il inline
typedef long long ll;
#define rll register ll
#define cll const ll
#define mkp make_pair
using namespace std;
const int N=30;
const ll inf=1e15;
int n,x[N],y[N],z[N],pw[N];
ll w[N][N],f[20][1<<19];
il... | #include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(), a.end()
#define ff(i,a,b) for(int i=a;i<=b;i++)
#define fb(i,b,a) for(int i=b;i>=a;i--)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 20;
const ll inf = 1e18 + 5;
int n;
a... |
#include <bits/stdc++.h>
using namespace std;
typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldbl;
typedef pair<int, int> pii;
typedef pair<uint, uint> puu;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<double, double> pdd;
typedef vector<int> vi... | #include <cstdio>
#include <algorithm>
using namespace std;
int main(){
long long n;
scanf("%lld",&n);
long long ans=n;
for(int b=0;b<=62;b++){
long long a=n>>b;
long long c=n-(a<<b);
ans=min(ans,a+b+c);
}
printf("%lld",ans);
return 0;
} |
#include<bits/stdc++.h>
using namespace std;
#define ps push_back
#define mk make_pair
#define ll long long int
int main()
{
int n;
cin>>n;
unordered_map<int,vector<int>> a;
unordered_map<int,vector<int>> b;
unordered_map<int,vector<int>> c;
int cnt;
for(int i=0;i<n;i++)
{
... | #include <iostream>
#include <vector>
int main() {
int N;
std::cin >> N;
std::vector<int> A(N), B(N), C(N);
for (auto& x : A) {
std::cin >> x;
x -= 1;
}
for (auto& x : B) {
std::cin >> x;
x -= 1;
}
for (auto& x : C) {
std::cin >> x;
x -= 1... |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double db;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using order... | #include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <b... |
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif
#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
us... | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i64 i=0; i<n; i++)
#define all(v) v.begin(),v.end()
#define pp pair<int,int>
using Graph=vector<vector<int>>;
using i64=int64_t;
int main() {
int n;cin>>n;
vector<int>a(n);rep(i,n)cin>>a[i];
i64 ans=0;
rep(i,n) {
ans+=max(0, a[i... |
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
int n, count = 1;
double total = 0;
bool same = 1;
cin >> n;
double t[n], leng = n;
for(int i = 0; i < n; i++){
cin >> t[i];
total += t[i];
}
sort(t, t + n);
... | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;
// clang-format off
#ifdef _DEBUG_
#define dump(...) do{... |
#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>
... | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll dp[100010];
ll tong[10];
int jud(string s,string t){
int tt[10]={0},ss[10]={0};
int i;
for(i=0;i<5;i++)ss[s[i]-'0']++;
for(i=0;i<5;i++)tt[t[i]-'0']++;
ll sums=0,sumt=0;
for(i=1;i<=9;i++){
sums+=pow(10,ss[i])*i;
... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long
const ll mod = 998244353;
int n, m, k;
char grd[5005][5005];
ll dp[5005][5005], pw3[10005];
int cnt[5005][5005];
int sm(int x1, int y1, int x2, int y2){
if(x1 > x2) swap(x1, x2);
if(y1 > y2) swap(y1, y2);
return c... | #include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define... |
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
int main(){
int m, n;
cin >> n >> m;
vector<int> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
}
vector<int> used(n);
set<int> unused;
for(int i = 0; i <= n; i++){
unused.inser... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned ll
#define pi pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vd vector<double>
#define vs vector<string>
#define vvi vector<vi>
#define ff first
#define ss seco... |
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
using namespace std;
vector<int> v(200, -1);
void print_answer(int x)
{
int cnt = 0;
vector<int> t;
for (int i = 0; i < 20; ++i)
{
if (x & (1 << i))
{
t.push_back(i + 1);
cnt++;
}
}
cout << cnt << " ";
for (int d... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,l,r) for(int i=(l);i<(r);++i)
#define per(i,l,r) for(int i=(r)-1;i>=(l);--i)
#define dd(x) cerr<<#x<<"="<<x<<","
#define de(x) cerr<<#x<<"="<<x<<endl
//-------
const int N = 201;
int n, a[N], dp[N][N][4];
pair<int, int> go[N][N][4];
pair... |
#include<bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define MOD 1000000007
typedef long long ll;
using namespace std;
int ans, cnt;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N;
cin >> N;
vector<pair<int, string>> V(N);... | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
int main() {
int n;
cin >> n;
vector<int> a(n);
rep(i, n) cin >> a[i];
ll now = 0, s = 0, mx = 0;
ll ans = 0;
rep(i, n) {
s += a[i];
mx = max(mx, s);
ans = max(ans, ... |
/*****************************
* Author :: Πρασαννα Κ. Ροι *
*****************************/
/***********************************
* Unus pro omnibus, omnes pro uno *
***********************************/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namesp... | #include <bits/stdc++.h>
using namespace std;
int N,M, dist[1000000];
vector<int> lst[1000000];
vector< tuple<int,int,char> > A;
queue<int> q;
bitset<1000> bs[1000];
int main() {
scanf("%d %d", &N, &M);
for (int i = 0; i < M; ++i) {
int u,v; char c; scanf(" %d %d %c", &u, &v, &c); u--, v--;
bs... |
#include <iostream>
using namespace std;
int main() {
int a,b;
cin>>a>>b;
int milk_solid=a+b;
if (milk_solid>=15 && b>=8){
cout<<"1";
}
else if(milk_solid>=10 && b>=3 ){
cout<<"2";
}
else if(milk_solid>=3 && b>=0){
cout<<"3";
}
else{
cout<<"4";
}
return 0;
} | #include<bits/stdc++.h>
namespace gengar
{
#pragma GCC optimize("Ofast")
using namespace std;
namespace TypeDef
{
#define int long long
#define itn int
#define uint unsigned long long
using Int=int64_t;
using uInt=uint64_t;
#define ld long double
#define P pair<int,int>
#define vt(tp) vector<tp>
#... |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define mp make_pair
#define pb push_back
#define ll long long
//#define debug(x) ;
#define debug(x) cerr << #x << " = " << x << "\n";
ostream& operator<<(ostream& cerr, vector<ll> a... |
// '-.-'
// () __.'.__
// .-:--:-. |_______|
// () \____/ \=====/
// /\ {====} )___(
... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
const int MOD=1e9+7;
int main(){
int N;
cin>>N;
vector<pair<pair<ll,ll>, int>> py(N), px(N);
for (int i = 0; i < N; i++) {
int x, y;
cin>>x>>y;
py[i] = {{y, x}, i};
px[i] =... | #include<bits/stdc++.h>
using namespace std;
#define DONTSYNC ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) //dont use stdio with iostream functions //input and output are out of order now!
#define TEST unsigned long long T; cin>>T; while(T--) //loop over each testcase
#define endl "\n"
#define for... |
#include <bits/stdc++.h>
using namespace std;
#define inf 1000000001
typedef long l;
typedef long long ll;
const ll INF = 1e18L + 5;
# define MOD 1000000007
# define PI 3.14
#define vi vector<int>
#define vl vector<l>
#define vll vector<ll>
#define pb push_back
#define pob pop_back
#define f first
#define s second
#def... | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vs = vector<string>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<ll, ll>>;
using ld = double;
#define sz(... |
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
ll n, d; cin>> n>> d;
ll a[n+n+1]={0};
for(ll i=1; i<=n+n; i++){
if(i<=n+1){
a[i]=i-1;
}
else{
ll k=i-n;
a[i]=n-k+1;
}
}
ll ans=0;
for(ll i=... |
/**
* Dont raise your voice, improve your argument.
* --Desmond Tutu
*/
#include <bits/stdc++.h>
using namespace std;
const bool ready = [](){
ios_base::sync_with_stdio(false); cin.tie(0);
cout << fixed << setprecision(12);
return true;
}();
const double PI = acos(-1);
using ll= long long;
#define in... |
/* Created By::Shashwat Singh
* (shashwa_t)
*
* Alwayz look for edge cases(n=1 or 1111 or similar mutiple values).
* Look for integer overflow.(>=10^6);
* Look for out of bounds(array);
*/
# include<bits/stdc++.h>
# define ll long long
# define pb push_back
# define endl "\n"
# define mod 1000000007ll... | #include <bits/stdc++.h>
#define pb push_back
#define db1(x) cout << #x << " = " << x << endl
#define db2(x, y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define paging cout << "-----------------------" << endl
using namespace std;
void localFileInput() {
#ifndef ONLINE_JUDGE
freopen("input.t... |
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
char In[1 << 20], *ss = In, *tt = In;
#define getchar() (ss == tt && (tt = (ss = In) + fread(In, 1, 1 << 20, stdin), ss == tt) ? EOF : *ss++)
ll read() {
ll x = 0, f = 1; char ch = getchar();
for(; ch < ... | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int ans = INT_MAX;
for (int i = 0; i < (1<<(n-1)); i++)
{
int in, out;
in = out = 0;
for (int j = 0; j < n; j++... |
#include<bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')';}
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_... | #include <bits/stdc++.h>
// clang-format off
using namespace std; using ll =long long; using ull = unsigned long long; using pll = pair<ll,ll>; const ll INF=9e18;
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<fixed<<setprecision(15)<<head;print0(tail...);}
void prin... |
#include<bits/stdc++.h>
using namespace std;
#define test_case int t;cin>>t;while(t--)
const double pi=acos(-1.0);
void RAmadAN()
{
/*
cout<<fixed<<setprecision(2);
itoa to convert any system itoa(n,bin,2)
*/
std::ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
long long gcd(long l... | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque>
#include <string>
using namespace std;
int main()
{
int a, b;
scanf("%d%d", &a, &b);
int total = a * 2 + 100;
int left = total - b;
p... |
#include <bits/stdc++.h>
#define int long long
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mod 998244353
//#define lld long double
#define mii map<int, int>
#define mci map<char, int>
#define msi map<string, int>
#define pii pair<int, int>
#define ff first
#d... | #include<bits/stdc++.h>
#define fi first
#define se second
#define io std::ios::sync_with_stdio(false)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
const ll mod=1e9+7,INF = 0x3f3f3f3f;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll exgcd(ll a, ll b, ll &x, ll... |
#include<cstdio>
#include<iostream>
#define re register
using namespace std;
long long n,k;
long long sum=3;
long long a=1,b,c;
template<typename T>
inline void read(T&x){
x=0;re bool f=true;re char c=getchar();
while(c<'0'||c>'9'){if(c=='-') f=false;c=getchar();}
while(c>='0'&&c<='9'){x=(x<<3)+(x<<1)+(c^48);c=get... | #include <bits/stdc++.h>
#define int long long
using namespace std;
main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n, k; cin >> n >> k;
int real = k;
vector <vector <int>> f(4, vector <int> (3 * n + 1)), sum(4, vector <int> (3 * n + 1));
for (int i = 0; i <= 3 * n; ++ i) su... |
/*
ID: hedichehaidar
TASK: photo
LANG: C++11
*/
#include<bits/stdc++.h>
typedef long long ll;
ll gcd(ll a , ll b) {return b ? gcd(b , a % b) : a ;} // greatest common divisor (PGCD)
ll lcm(ll a , ll b) {return (a * b) / gcd(a , b);} // least common multiple (PPCM)
#define ss second
#define ff first
#define all(x) (x).... | #include <stdio.h>
#include <iostream>
#include <vector>
// #include <bits/stdc++.h>
#include <queue>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;
#define rep(i,k,n) for(ll i=k; i<(ll)(n); i++)
int main() {
double a,b; cin >> a >> b;
... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b){return b? gcd(b, a % b): a;}
const int N = 73;
int prime[N], vis[N], cnt = 0;
ll l, r, dp[1 << 21];
void init(void) {
for (int i = 2; i < N; i++) {
if (vis[i]) continue;
prime[++cnt] = i;
for (int j = i; j < N; j += i) vis[j]... | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
typedef long long ll;
using namespace std;
const int maxn = 1e2 + 50, INF = 0x3f3f3f3f;
inline ll read () {
register ll x = 0, w = 1;
register char ch = getchar ();
for (; ch < '0' || ch > '9'; ch = getchar ()) if (ch == '-') w = -1;
... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pf(a) cout << a << endl
#define sz(x) (int)(x).size()
#define pb push_back
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bo... | // C - Made Up
#include <bits/stdc++.h>
#define repi(i, s, n) for(int i=(int)(s); i<(int)(n); ++i)
#define rep(i, n) repi(i, 0, n)
#define rrep(i, n, s) for(int i=(int)(n-1); i>=(int)(s); --i)
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main(){
int n;
cin >> n;
map<int, i... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,0,-1}, dy[4]={1,0,... | #include <bits/stdc++.h>
#define sort stable_sort
using namespace std;
int _;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
int n,cnt[400050],ans;
set<int> s,p[400050];
inline void dfs(int x)
{
for(auto v:p[x])
{
p[v].erase(x);
p[x].erase(v);
cnt[x]--;
cnt[v]--;
if(cnt[v] == 0)
... |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
int n;
cin >> n;
double a[n],b[n],c[n];
int ans = n*(n-1)/2;
rep(i,n){
cin >> a[i] >> b[i] >> c[i];
if(a[i] ==2)
{c[i] -= 0.1;}
else if(a[i] ==3)
{b[i] += 0.1;}
else i... | /********************************************************************************/
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
const double PI = 4*atan(1);
#defi... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<ll> vl;
#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-... | ///Bismillahir Rahmanir Rahim
/*
Author: Tanzin Ahammad
*/
#include<bits/stdc++.h>
#define u64 uint64_t
#define ll long long
#define endl "\n"
#define PI acos(-1)
#define fi first
#define si second
#... |
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
int N, C;
cin >> N;
vector<double> x(N);
vector<double> y(N);
C = 0;
for (int i = 0; i < N; i++) {
cin >> x.at(i) >> y.at(i);
}
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j < N; j++) {
doubl... | //pikuskd_32->42
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define fr(i,s,e) for(ll i=s;i<=e;i++)
#define rfo(i,s,e) for(ll i=s;i>=e;i--)
#define f(x,m) for(auto x : m)
#define ff first
#define ss second
const ll INF = (1LL << 60) - 1;
#define pb push_back
#define pp pop_back
... |
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main() {
string s; cin >> s;
bool flag = false;
if (s.size() == 1) {
if (s == "8") flag = true;
}
else if (s.size() == 2) {
if (stoi(s) % 8 == 0) flag = true;
swap(s[0], s[1]... | #include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<utility>
#include<set>
#include<map>
#include<queue>
#include<complex>
#define Debug cout<<"line: "<<__LINE__<<"Debug"<<endl;
#define Yes cout<<"Yes"<<endl;
#define YES cout<<"YES"<<endl;
#define No cout... |
#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 ll long long
#define INF 999999999
#define MOD 1000000007
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
using namespace std;
long... | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int,int>
#define PI 3.141592653589793
const int INF = 1001001001;
const ll MX = 1e18;
const int mod = 998244353;
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
... |
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<(n); ++i)
#define RREP(i, n) for(int i=(n);i>=0;--i)
#define FOR(i, a, n) for (int i=(a); i<(n); ++i)
#define RFOR(i, a, b) for(int i=(a);i>=(b);--i)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define DUMP(x) c... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int n;
ll a[200010], b[200010], maxa[200010], maxb[200010];
int main(){
scanf("%d", &n);
ll maxn = -1e18;
for(int i = 1; i <= n; i++) scanf("%lld", &a[i]);
for(int i = 1; i <= n; i++) scanf("%lld", &b[i]);
maxa[1] = a[1];
for(int i = 2; i <= n;... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define u unsigned
#define ull unsigned long long
#define ld long double
#define pb push_back
#define fasterInOut ios::sync_with_stdio(false); cin.tie(0);
#define pi acos(-1)
#define f(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,a,b) for(int i=(a);i>=(... | #include<bits/stdc++.h>
using namespace std;
int main(void){
int a, b, c;
cin >> a >> b >> c;
if (a == b) cout << c << endl;
else if (b == c) cout << a << endl;
else if (c == a) cout << b << endl;
else cout << 0 << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// --------------------------------------------------------
template <class T>
bool chmax(T& a, const T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T>
bool chmin(T& a, const T b) {
if (b < a) {
... | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1e9;
const long long INFLL = 1e18;
using ll = long long;
int digit(int n){
int res = 0;
while(n > 0){
res += n % 10;
n /= 10;
}
return res;
}
int main(){
int a, b;
cin >> a >> b;
cout << max(digit(a), digi... |
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
typedef unsigned long long int ll;
#define MAX 1000000000
#define mod 1000000007
ll gcd(ll a, ll b){
if (a == 0)
return b;
else
return gcd(b % a, a);
}
ll lcm(ll a, ll b) {
return (a*b)/gcd(a, b);
}
ll fact(ll n){
if(n==... | #include<bits/stdc++.h>
#include<algorithm>
#define int long long
using namespace std;
signed main(){
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
//MessageBox(GetForegroundWindow(),"标题","内容",MB_YESNO);
int n;
cin>>n;
int sum=1;
for(int i=1;i<=n;i++){
sum*=i/(__gcd(sum,i));
}
cout<<sum+1-1+1-1+1... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPi(i, a, b) for(int i=int(a); i<int(b); i++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define mp make_pair
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
constexpr char ln = '\n';
constexpr long long MOD = 1000000007;
constexpr long long INF = 1<<30;
constexpr long long LINF = 1LL<<60;
constexpr double EPS = 1e-9;
#define all(v) v.begin(), v.end()
#define rep(i, ... |
#include<bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int>>
#define pb push_back
#define int long long int
#define mod 1000000007
#define from(i,n) for(int i=0;i<(int)n;i++)
#define from_j(i,j,n) for(int i=j:i<(int)n;i++)
using namespace... | #include<bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int i=a,i##_end=b;i<i##_end;++i)
using ll=long long;
using pii=pair<int,int>;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
const int mo=1e9+7;
using L=__int128;
ll Pow(ll a,ll b,ll p=mo){ll r=1;for(;b;b>>=1,a=(L)a*a%p)if... |
#include <bits/stdc++.h>
using namespace std;
// #define LOCAL // 提出時はコメントアウト
#define DEBUG_
typedef long long ll;
const double EPS = 1e-9;
const ll INF = ((1LL<<62)-(1LL<<31));
typedef vector<ll> vecl;
typedef pair<ll, ll> pairl;
template<typename T> using uset = unordered_set<T>;
template<typename T, typename U> usi... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,k;
int main()
{
scanf("%d%d",&n,&k);
ll x=n;
for(int i=1;i<=k;)
{
if(x%200ll==0)x/=200ll,i++;
else
{
if(i<k)
{
int t=x%2;t*=10;
x/=2;
x*=10;
x+=t/2+1;
i+=2;
// cout<<x<<" ";
}
else
{
cout<<x;
... |
#include<bits/stdc++.h>
using namespace std;
#define INF 1234567890
#define ll long long
#define MOD 998244353
ll N, M, K, res;
ll pw(ll a, ll n)
{
ll ret = 1;
while(n)
{
if (n&1) ret=ret*a%MOD;
a=a*a%MOD;
n>>=1;
}
return ret;
}
int main()
{
scanf("%lld %lld %lld", &N, &M, &K);
if (N < M) swap(N, M);
... | #include <vector>
#include <set>
#include <iostream>
#include <algorithm>
#include <string>
#include <utility>
#define mod % 998244353
#define MAX 998244353
#define ll long long
using namespace std;
int main() {
int high,wide,k;
cin >> high;
cin >> wide;
cin >> k;
ll ans = 0;
if(high == wide and high == 1... |
#define G 3
#include<map>
#define AK goto
#include<cmath>
#include<queue>
#include<bitset>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
#define md ((l+r)>>1)
#define cht 1000000007
#define inf 1145141919810
#define mem(i,j)memset(i,j,sizeof(i))
#define ... | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std;
void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long ... |
//BadWaperZ
#include<bits/stdc++.h>
#define inf 1e9
#define eps 1e-6
#define mp make_pair
#define pb push_back
#define fr first
#define sd second
#define pa pair<ll,ll>
#define re register ll
#define FOR(i,a,b) for(re i=a;i<=b;i++)
#define REP(i,a,b) for(re i=a;i>=b;i--)
#define MEM(a) memset(a,0,sizeof(a))
#define N 5... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
void c... |
#include "bits/stdc++.h"
#include <cmath>
#include <limits>
using namespace std;
#define int long long
#define pb push_back
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fast ios::sync_with_stdio(0); cin.tie(0); c... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define in pair<int, int>
#define f first
#define s second
#define pb push_back
#define pob pop_back
#define INF 1e17
#define zero (int)0
#define MX (int)3e5+5
#define fast() ios_base::sync_with_stdio(false); cin.tie(NULL);
const int mod = 1e9+7; //may... |
#define rep(i,n) for (int i=0;i<n;i++)
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
ll h,w,co=0;
cin >> h >> w;
vector <vector <char>>s(h,vector<char>(w));
rep(i,h){
rep(j,w){
cin >> s.at(i).at(j);
}
}
//cout << 1 << endl;
rep(i,h){
rep(j,w-... | #include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functi... |
#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;
int main(){
long m, h;
long A;
cin >> m >> h;
A = h % m;
if(A == 0)cout << "Yes" << endl;
else cout << "No" << endl;
} |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e9+7;
ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ll,ii>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define pb push_back
#define vll vector<ll>
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
///I hope I ... | #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 ll long long
#define add(a,b) a=((a)+(b))%mod
#define mod 3
#define Mod 1
//#define file
using namespace std;
int n,i,j,k,l;
char st[400001];
int a[400001];
int ans;
ll Jc[3];
ll qpower(ll a,int b) {ll ans=1... |
//! 尺卂乃卂.卂フ乇乇ㄒ
#include<bits/stdc++.h>
//#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
//Using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> Ordered_set;
#define ll long long
#define int long long
#define ld... | #include<bits/stdc++.h>
#define ull unsigned long long
#define ll int64_t
#define f(i,s,e) for(i=s;i<e;++i)
#define endl << "\n"
#define sp << " "
#define INF INFINITY
#define mset(a,b) memset(a,b,sizeof(a))
#define mod 1000000007
#define mp(a,b) make_pair(a,b)
#define F first
#define S second
#define all(x) x.begin()... |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
int main()
{
int n;
ll w;
cin >> n >> w;
vll need(200000,0ll);
for (int i = 0; i < n; i++)
{
int s,t;
cin >> s >... | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fast_IO ios::sync_with_stdio(false);
#define DEBUG fprintf(stderr,"Running on Line %d in Function %s\n",__LINE__,__FUNCTION__)
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#de... |
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main() {
ll n, s, d;
cin >> n >> s >> d;
using pll = pair<ll, ll>;
vector<pll> xy(n);
for (int i = 0; i < n; i++) {
cin >> xy.at(i).first >> xy.at(i).second;
}
bool judge = false;
for (int i = 0; i < n; i++) {
if (xy.at... | #include <bits/stdc++.h>
using namespace std;
typedef long double ld;
int main() {
int n;int mn=INT_MAX;
cin>>n;
for (int i=0;i<n;i++){
int a,p,x;
cin>>a>>p>>x;
//cout<<x<<" "<<a<<"\n";
if (x-a>0)mn=min(p,mn);
}
if (mn!=INT_MAX)cout<<mn<<"\n";
else cout<<"-1\n";
return 0;
} |
#include <bits/stdc++.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;
ll mod(ll a, ll b){
ll ret=a%b;
if(ret<0) ret+=b;
return ret;
}
ll modpow(ll a,ll b,ll c){
ll res=1;
while(b>0){
if(b&1) res=mo... | #include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(nullptr);
#define ll long long
#define l long int
#define f(i, a, b) for(int i=a; i<b; i++)
#define fr(i, a, b) for(int i=a; i>=b; i--)
#define endl '\n'
#define pb push_back
#define pf pop.front()
#define all(x) x.begin(),x.end()
#define de... |
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
#include <cstdint>
#include <string>
#include <sstream>
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 ... | #include<iostream>
#include<algorithm>
using namespace std;
int main() {
int n;
int k[1001] = {};
cin >> n;
int ans, m, b;
ans = m = b = 0;
int aa = 0;
for (int i = 1;i <= n;i++) {
int a; cin >> a;
aa = max(aa, a);
int j = 2;
while (1) {
if (a%j == 0) {
m = j, k[j]++;
if (a / j == 1) break;
... |
#include <bits/stdc++.h>
using namespace std;
#define trav(a, A) for (auto & a : A)
#define f first
#define s second
typedef long long ll;
ll MOD = 1e+9+7;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
const ll MAXN = 1e+5+7;
int main ()
{
ios_base::sync_with_stdio (0);
cin.tie (0);
ll i, j, n... | #include <bits/stdc++.h>
using namespace std;
int main() {
string N;
cin >> N;
int l = N.size();
int zero = 0, one = 0, two = 0;
for (int i = 0; i < l; i++) {
if (N[i]%3 == 1) one++;
else if (N[i]%3 == 2) two++;
else zero++;
}
if (one == 0 && two == 0) cout << 0 << endl;
else if... |
//REST IN THE END NOT IN THE MIDDLE
//CODE STARTS FROM HERE.
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
if(floor(1.08*n)<206){
cout<<"Yay!";
}
if(floor(1.08*n)==206){
cout<<"so... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e6+10;
const double eps = 0.01;
inline ll read()
{
ll x=0,f=1;char ch=getchar();
while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;
}
inline ll pt(ll ans,ll f){
... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dbl;
typedef float flt;
#define for0(i, n) for(ll i=0; i<n; i++)
#define for1(i, n) for(ll i=1; i<=n; i++)
#define forab(i, a, b) for(ll i=a; i<=b; i++)
#define clr0(a) memset(a, 0, sizeof(a))
void solv... | #include <stdio.h>
int main()
{
int i, j, N, A[100] = {}; //入力しないところ1にしておく
int k, GCD, maxGCD = 0, ans = 0;
scanf("%d", &N);//これの存在忘れてた。もっと簡単にできた
for (i = 1; i <= N; i++) {
scanf("%d", &A[i]);
}
for (k = 2; k <= 1000; k++) { //ここたぶんあほ
GCD = 0; //GCD reset
for (j = 1; j <= N; j++) {
if (A[j] % k == ... |
// Rishabh Singhal
#include<bits/stdc++.h>
#define w(x) int x; cin>>x; for(int tc=1;tc<=x;tc++)
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define pb push_back
#define endl "\n"
#define mod 1000000007
#... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<double,double> pdd;
#define forn(i,x,n) for(int i = x;i <= n;++i)
#define forr(i,x,n) for(int i = n;i >= x;--i)
#define Angel_Dust ios::sync_with_stdio(0);cin.tie(0)
#define x first
#define y second
const int N = 2005;
pdd a[N];
int main... |
// Problem: B - Hydrate
// Contest: AtCoder - AtCoder Beginner Contest 207
// URL: https://atcoder.jp/contests/abc207/tasks/abc207_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
//The code written by Javokhir Akramjonov
#include <bits/stdc++.h>
using namespace st... | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define Bs binary_search
#define In insert
#define Mp make_pair
#define All(x) x.begin(), x.end()
#defin... |
#include <bits/stdc++.h>
long long extGCD(long long a, long long b, long long c, long long &x, long long &y){
long long a_gcd = a;
long long b_gcd = b;
std::vector< long long > A, B;
A.push_back(a_gcd);
B.push_back(b_gcd);
while(b_gcd != 0){
long long tmp = a_gcd % b_gcd;
a... | #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 pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpll =... |
//Code by Ritik Agarwal
#include<bits/stdc++.h>
using namespace std;
#define sz(x) (int)(x).size()
#define int long long int
#define loop(i,a,b) for(int i=a;i<b;i++)
#define scan(arr,n) for (int i = 0; i < n; ++i) cin >> arr[i]
#define vi vector<int>
#define si set<int>
#define pii p... | #include <bits/stdc++.h>
using namespace std;
/*
#include <atcoder/all>
using namespace atcoder;
*/
#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).... |
#include <bits/stdc++.h>
#define pb push_back
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
#define INF 3000000000000001 // 3e15
#define ll_max 9000000000000000000
#define PI 3.14159265358979323846L
#define fill(a, n, x) for(int i = 0; i < n; i++) a[i] = x;
#define fast ios_base::sync_with_stdio(... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
#define mkunique(a) a.resiz... |
//There are no beautiful surface without a terrible depth
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,... | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define n_l '\n'
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define forn(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
typedef vector<int> vi;
typedef v... |
#include <cmath>
#include <iostream>
using namespace std;
using ll = long long;
int main (int argc, char* argv[]) {
ll s, p;
cin >> s >> p;
auto flag = false;
for (auto i = 1; i < sqrt (p + 1); i++) {
auto j = p / i;
if (i * j != p) continue;
if (i + j == s) {
flag = true;
break;
... | /**
* author: BueVonHun 🐼🎋
* More Info: https://github.com/Bue-von-hon
**/
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <cstring>
#include <cmath>
#include <tuple>
#include <set>
#include <map>
#include <bitset>
#include <sstream>
typedef lo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.