code_file1 stringlengths 87 4k | code_file2 stringlengths 82 4k |
|---|---|
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define dbg(x) cerr << "[" << #x << " = " << x << "] ";
template<class T> auto vec( int r, int c, T v ){ return vector<vector<T>>( r, vector<T>( c, v ) ) ; }
template<class T> auto vec(int o1, int o2, int o3, T v){ return vector<vector<vector<T>>>... | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
int64_t N;
cin >> t >> N;
cout << (N*100+t-1)/t+(N-1) << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,fma")
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
#define FOR(i, a, b) for(int i = (a); i ... | #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 <... |
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define MP make_pair
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
int main() {
#ifndef LOCAL
ios::sync_with_stdio(false);
cin.tie(nullptr);
#endif
int n = 0;
cin >> n;
set<int> st;
... |
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define LETS_GET_SCHWIFTY ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ff first
#de... |
#include <bits/stdc++.h>
#define s second
#define f first
#define pb push_back
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define read(x) for(auto& qw : (x)) cin >> qw;
#define print(x) for(auto& qw : (x)) cout << qw << " "; cout << endl;
using namespace s... | #include <bits/stdc++.h>
#define LL long long
#define ull unsigned long long
#define F(i, j, k) for(int i = j; i <= k; i++)
#define DF(i, j, k) for(int i = j; i >= k; i--)
using namespace std;
template <typename T> inline void read(T &n) {
T w = 1;
n = 0;
char ch = getchar();
while (!isdigit(ch) && ch != EOF)... |
#ifdef _LOCAL
#include "local_include.hpp"
#else
#include <bits/stdc++.h>
using namespace std;
#endif
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define fto(i, s, e) for (int i = (s); i <= (e); ++i)
#define fto1(i, s, e) for (int i = (s); i < (e); ++i)
#define fdto(i, s, e) for (... | #include<bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long h , w , m , tree [800020] , ans , mn = 1e9 , num;
vector < int > v [200005];
void up ( int nod , int l , int r , int x )
{
if ( x < l || r < x ) return;
if ( l == r )
{
tree [nod] = 1;
return;
}
int... |
/* by Natsu Kinmoe */
#include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define loop(i, n) for(int i = 0; i < (n); ++i)
#define cont(i, n) for(int i = 1; i <= (n); ++i)
#define circ(i, a, b) for(int i = ... | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
int H, W, A, B;
int dp[1 << 16][10][10];
int unit(int bit, int a, int b)
{
if(bit == (1LL << H * W) - 1)return 1;
if(dp[bit][a][b] != -1)return dp[bit][a][b];
int n = 0;
for(int i = 1;; n++)if(!(b... |
#include<bits/stdc++.h>
//#include <atcoder/all>
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define fi first
#define se second
#define sz(x) ((int)x.size())
using namespace std;
//using namespace atc... | #include <iostream>
#include <vector>
#include <deque>
#include <cstring>
#include <map>
#include <cmath>
#include <algorithm>
#include <stdlib.h>
#include <set>
#include <climits>
#include <string.h>
#include <unordered_map>
#include <queue>
#include <list>
#define int long long int
#define fastio ios_base::sync_with_... |
#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <iterator>
#include <unordered_map>
#include <unordered_set>
#include <sstream>
#include <fstream>
#... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll t, N;
cin >> t >> N;
set<ll> hundred;
vector<ll> hundred2;
// for (int i = 1; i <= 1000000; i++) {
// hundred.insert(((100 + t) * i) / 100);
// }
// for (int i = 1; i <= 1000000; i++) {
// if (!(hundred.count(i)))... |
#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
int n;
cin>>n;
set <int> s1;
int mi,ma;
for(int i=0;i<n;i++)
{
int x;
cin>>x;
s1.insert(x);
if(i==0)
{
mi=x;
ma=x;
}
mi=min(mi,x);
ma=max(ma,x);
}
if(s1.size()==n && mi... | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
vector<int>A(3);
for(auto&&x:A)cin>>x;
sort(A.begin(),A.end());
if(A[2]-A[1]==A[1]-A[0])cout <<"Yes"<<endl;
else cout <<"No"<<endl;
return 0;
} |
#include <bits/stdc++.h>
#define INF 1e9
#define INFLL 1ull<<60u
using namespace std;
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a) (a).begin(),(a).end()
#define endl "\n"
template<class T>b... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1e6;
int length(int x)
{
int cnt = 0;
while(x) cnt ++, x /= 10;
return cnt;
}
int main()
{
// freopen("1.in", "r", stdin);
LL n;
cin >> n;
int res = 0;
for(int i = 1; i < N; ++ i)
{
int j = length(i);
if((LL)i * pow(10, j... |
#include <algorithm>
#include <iostream>
#include <list>
#include <queue>
#include <vector>
using namespace std;
struct AdjacentVertex {
int vert_idx;
int edge_c;
};
int main() {
int n, m;
cin >> n >> m;
vector<list<AdjacentVertex>> graph(n);
for (int i = 0; i < m; ++i) {
int u, v, c;
cin >> u ... | #include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,m;
cin>>n>>m;
vector<pair<int,int>> vp(m);
map<int,int> lj;
map<int,map<int,int>> ed;
for(auto &p:vp){
int i,j;
cin>>i>>j;
p={i,j};
lj[j-1]=0;
lj[j]=0;
l... |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i = 0; i < (n); i++)
#define REP(i,s,n) for(long long i = (s); i <= (n); i++)
#define repr(i,n) for(long long i = (n - 1); i >= 0; i--)
#define REPR(i,s,n) for(long long i = (s); i >= (n); i--)
#define all(v) (v).begin(), (v).end() //biginからe... | #include <iostream>
#include <cmath>
#include <set>
using namespace std;
typedef long long ll;
int main(){
ll n, a, x;
cin >> n;
set<ll> st;
for (a=2; a<=sqrt(n); a++){
x = a * a;
while (x <= n){
st.insert(x);
x *= a;
}
}
cout << n-st.size() << endl;
return 0;
} |
#include<stdio.h>
#include<stdlib.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
static inline int IN(void)
{
int x=0,f=0,c=getchar();while(c<48||c>57){f^=(c==45),c=getchar();}
while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline void OUT(int x){if(x<0){putchar('-'),x=-x;}if(x>=10){OUT(x/10);}pu... | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... |
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
// #include <atcoder/all>
// #include "icld.cpp"
using namespace std;
using ll = long long int;
using vi = vector<int>;
using si = set<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>... | #include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>
using namespace std;
typedef u... |
/* by Natsu Kinmoe */
#include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define loop(i, n) for(int i = 0; i < (n); ++i)
#define cont(i, n) for(int i = 1; i <= (n); ++i)
#define circ(i, a, b) for(int i = ... | #line 1 "/workspaces/compro/lib/template.hpp"
#line 1 "/workspaces/compro/lib/io/vector.hpp"
#include <iostream>
#include <vector>
#ifndef IO_VECTOR
#define IO_VECTOR
template <class T> std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
int size = v.size();
for (int i = 0; i < size; i++) {
... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define PI 3.14159265359
#define mod 1000000007
#define ALL(a) (a).begin(),(a).end()
int main(){
ll a,b;
cin >> a >> b;
int ans = 1;
for(int i = 1; i <= 200000; i++){
if(a % i != 0){
... | #include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define eb emplace_back
#define fi first
#define se ... |
#include <iostream>
#include <vector>
using namespace std;
using i64 = long long;
int main()
{
i64 n, w;
cin >> n >> w;
vector<i64> imos(2 * 100000 + 1, 0ll);
for (int i = 0; i < n; i++)
{
i64 s, t;
i64 p;
cin >> s >> t >> p;
imos[s] += p;
imos[t] -= p;
... | /* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dd double
#define scf(n) scanf("%d",&n)
#define lscf(n) scanf("%lld",&n)
#define lpri(n) printf("%lld ... |
#include<bits/stdc++.h>
#define fer( a , b , c ) for( register int a = b ; a <= c ; a ++ )
#define der( a , b , c ) for( register int a = b ; a >= c ; a -- )
using namespace std ;
inline int read(){
int sum = 0 , f = 1 ;
char ch = getchar() ;
while( ch < '0' || ch > '9' ){
if( ch == '-' ){
f = -1 ;
}
c... | #include <bits/stdc++.h>
using namespace std;
int N, ans[100005], lp[100005];
void Sieve() {
vector<int> v;
for(int i = 2; i <= N; i++) {
if (lp[i] == 0) {
lp[i] = i;
v.push_back(i);
}
for(int j = 0; j < (int)v.size() && v[j] <= lp[i] && i*v[j] <= N; j++) {
lp[i * v[j]] =... |
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<vector<char>> mat;
vector<vector<char>> in;
int n,m;
void answer_print(){
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout << mat[i][j] ;
if(j==n-1) cout << endl;
}
}
}
bool isP... | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define pll pair<long long,long long>
#define pdd pair<long double,long double>
#define vll vector<ll>
#define rep(i,j,n) for(int i=j;i<n;i++)
#define mp make_pair
#define pb push_back
#define pf push_front
#define inf 1e17
#defin... |
#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>
using namespace std;
int h,w;
vector <int> a;
int main(){
cin >> h >> w;
a = vector<int>(h*w);
int minimum = INT_MAX;
for(int i = 0; i < h*w; i++){
cin >> a[i];
minimum = min(a[i],minimum);
}
long long ans = 0;
for(int i = 0; i < h*w; i++){
if... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<21-a-b-c<<endl;} | #include<bits/stdc++.h>
using namespace std;
typedef long long li;
typedef long double ld;
typedef pair<int,int> pt;
typedef pair<ld, ld> ptd;
typedef unsigned long long uli;
#define SORT(vec) sort(vec.begin(), vec.end())
#define loop(i,a,n) for(int i=a;i<n;i++)
#define pb push_back
#define mp make_pair
#define mset(a... |
#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... |
// Problem : E - Throne
// Contest : AtCoder - Panasonic Programming Contest (AtCoder Beginner Contest 186)
// URL : https://atcoder.jp/contests/abc186/tasks/abc186_e
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
// God & me
// Fly ...
//#pragma GCC o... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int N, M;
cin >> N >> M;
if (M < 0 || N == M) {
cout << "-1\n";
return 0;
}
if (M == 0) {
for (int i = 1; i <= N; i++) {
cout << 2 * i << " " << 2 * i + 1<< "\n";
}
} el... | #include <bits/stdc++.h>
/* snippet: useful macros and functions */
#define ARC(i, a, b) for(Int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(Int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)
#define ALL(v) v.begin(), v.end()
template<class T> T rng(const T &a, const T &... |
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main()
{
vector<pair<ll,ll>> m;
ll n,Y;
cin>>n>>Y;
int a,b,c;
for(ll i=0;i<n;i++){
cin>>a>>b>>c;
m.emplace_back(a-1,c);
m.emplace_back(b,-c);
}
sort(m.begin(),m.end());
ll charge=0,t=0,sum_total=0;
for(auto [x,y] : m){
if(x!=... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=200005;
vector<int> tree(4*N,0);
void update(int idx,int l,int r,int pos,int val)
{
if(l==r) tree[idx]=val;
else
{
int m=(l+r)/2;
if(pos<=m) update(2*idx,l,m,pos,val);
else update(2*idx+1,m+1,r,pos,val... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
long long a[n];
long long b[n];
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
cin>>b[i];
multiset<long long,greater<long long>> m;
long long max1=0;
cout<<a[0]*b[0]<<endl;
max1=a[0]*b[0];
m.insert(max1);
max1=... | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;++i)
#define per(i,a,b) for(int i=(a),i##end=(b);i>=i##end;--i)
//mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template<typename T>void chkmax(T&x,T y){if(x<y)x=y;}
template<typename T>v... |
// Problem: C - Coprime Set
// Contest: AtCoder - AtCoder Regular Contest 118
// URL: https://atcoder.jp/contests/arc118/tasks/arc118_c
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __g... | #include<cstdio>
#include<vector>
#include<algorithm>
#include<set>
#include<unordered_map>
#include<string>
#include<iostream>
#include<cstring>
#include<cmath>
#include<queue>
using namespace std;
using ll = long long;
constexpr int N = 1e4 + 5;
constexpr int M = 2505;
int n;
bool vis[N];
int main() {
scanf("%d... |
#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 LLI long long int
#define REP(i, n) for(LLI i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(LLI i = s, i##_l = (e)... | #include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int keisan(int num) {
int goukei = 0;
for (int i=0; i<3; i++) {
goukei += num%10;
num /= 10;
}
return goukei;
}
int main() {
int a, b;
cin >> a >> b;
a = keisan(a);
b = keisan(b);
... |
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rng(i, a, b) for (int i=int(a);i<int(b);++i)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i=int(b)-1;i>=int(a);--i)
#define per(i, b) gnr(i, 0, b)
#define all(obj) begin(obj), end(obj)
#define allr(obj) rbegin(obj)... | #include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
int n;
cin >> n;
vector<string> s(3);
vector<int> a(4);
... |
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(N);
vector<int> B(M);
... | #include <bits/stdc++.h>
using namespace std;
#define KP \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define ll long long int
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define MIN -1e9
#define MAX 1e9
#define endl "\n"
#define vi vector<ll>
#define pb push_back
#define all(v)... |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
typedef long long ll;
int main(void)
{
ll N,K;
cin>>N>>K;
ll ans=0;
if(K<0){
K*=-1;
}
for(ll i=2;i<=2*N-K;i++){
ll j=i+K;
if(i<=N && j<=N){
ans+=(i-1)*(j-1);
}else if(i>N && j>N){
ans+=(2*... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll pow_mod(ll x, ll n, ll mod) {
ll ret = 1;
while (n > 0) {
if (n & 1) ret = ret * x % mod;
x = x * x % mod;
n >>= 1;
}
return ret;
}
int main(){
ll n, p;
cin >> n >> p;
ll mod = pow(10,9)+7;
ll ans = (... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll n; cin>>n;
int ans = 0;
for(ll i = 1; i <= 1000000; i++) {
string s = to_string(i);
string t = s + s;
ll m = stoll(t);
if(m<=n) {
ans++;
}
}
cout<<ans;
r... |
#include <bits/stdc++.h>
using namespace std;
int main () {
string n, front, back;
cin >> n;
int len = n.length();
if (stoll(n) < 11) {
cout << 0;
return 0;
}
else if (len%2==1) {
for (int i = 0; i < (len-1)/2;++i) {
cout << '9';
}
}
else {
for (int i = 0; i < len/2; ++i){
... |
#include<bits/stdc++.h>
#define ll long long int
#define fab(a,b,i) for(int i=a;i<b;i++)
#define db double
#define endl "\n"
#define f first
#define se second
#define MOD 1000000007
#define quick ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
ll add(ll x, ll y) {ll res = x + y; return (res >= MOD ? res -... | #include<bits/stdc++.h>
using namespace std;
#define fo(i,a,n) for(i=a;i<n;i++)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i=0;i<(int)(n);i++)
template <typename T> bool chmax(T &a, const T& b) {if (a < b) {a = b; return true;}return false;}
template <typename T> bool chmin(T &a, const T& b) {if (a > b) {a = b; return true;}return false;}
const in... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int a, b, c;
cin>>a>>b>>c;
cout<<21-(a+b+c)<<endl;
return 0;
} |
//
// Created by myungki cho on 2/20/21.
//
//
// Created by myungki cho on 2/20/21.
//
#include <iostream>
#include <algorithm>
#include <cstring>
#include<vector>
#include<set>
using namespace std;
typedef long long ll;
set<ll> st;
ll n;
ll ans;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(... | #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) { a = b; return 1; } return 0; }
#define ... |
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define nl cout<<endl
#define pii pair<ll,ll>
#define vi vector<ll>
#define vii vector<pii>
#define mi map<ll,ll>
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define ... | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int P;
vector<int> pos(N+1),ans;
for(int i=1;i<=N;i++){
cin >> P;
pos.at(P)=i;
}
for(int i=pos.at(1)-1;i>=1;i--){
ans.emplace_back(i);
}
int ma=pos.at(1);
for(int i=2;i<=N;i++){
if(pos.at(i)<i){
}else if(... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll OO = 0x3f3f3f3f;
const ll mod = 1e9 + 7;
const double pi = 3.14159265359;
//freopen("window.in", "r", stdin);
//freopen("output.out", "w", stdout);
void skrrrt() {
ios_base::sync_with_stdio(0), cin.tie(0);
}
//#########################... | #include <bits/stdc++.h>
#define endl "\n"
#define int long long
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
static_assert(D >= 1, "Vector dimension must be greater than zero!");
template<... |
#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cassert>
#include <cctype>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <math.h>
#include <stack>
#include <map>... | #include <iostream>
using namespace std;
int main () {
int x;
cin >> x;
if (x > 0) {
cout << x;
}
else if (x <= 0) {
cout << 0 ;
}
return 0 ;
} |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define eps 1e-9
#define INF 2000000000 // 2e9
#define LLINF 2000000000000000000ll // 2e18 (llmax:9e18)
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#ifndef LOCAL
#define dmp(...) ;
#else
#d... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using _lint = int;
#define REP(i, n) for (_lint i = 0; i < (_lint)(n); i++)
#define FOR(i, a, b) for (_lint i = (_lint)(a); i < (_lint)(b); i++)
#def... |
#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 For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_b... |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int a, b;
cin >> a >> b;
double ret = 100 - 1.0 * b / a * 100;
printf("%.10f",ret);
return 0;
}
| #include <bits/stdc++.h>
#define N 1000000
#define MAX 1000000000
#define E 0.00000001
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define LEFT(x) (2 * x)
#define RIGHT(x) (2 * x + 1)
#define PAR 0
#define IMPAR 1
using namespace std;
long long pf[N+1];
bool radical[N+1];
void solve(){
int l, r; cin >> l >> r;... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
// #define LOCAL
#ifdef LOCAL
freopen("in.in", "r", stdin);
freopen("out.out", "w", stdout);
#endif
int n; scanf("%d", &n);
ll x = 1;
for(int i = 2; i <= n; ++i){
ll gcd = __gcd(x, 1ll * i);
ll m = ... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const ll Mod = 998244353;
const int MAX = 510000;
const double PI = 3.14159265358979;
const vector<int> dx = {1, 0};
const vector<int> dy = {0, 1};
// 最大公約数
ll gcd(ll ... |
#include <stdio.h>
#include <algorithm>
#include <string.h>
#define int long long
#define N 100005
using namespace std;
typedef long long ll;
const signed mo=1e9+7;
const int INF=0x3f3f3f3f;
inline int read(){
char ch=getchar();int x=0, f=1;
while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
while(ch>='0'&&ch<='... | #include <stdio.h>
long long n, z;
long long p = 1000000007;
long long a[100000];
long long f[100005];
long long g[100005];
int main() {
scanf("%lld", &n);
for (int i = 0; i < n; i++) {
scanf("%lld", a + i);
}
f[0] = 1;
g[0] = 2;
g[1] = 1;
for (int i = 2; i < n + 5; i++) {
f[i] = (f[i - 1] + f[i - 2]) % p;
... |
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
int n;char s[110];
int main()
{
scanf("%s",s+1);
n=strlen(s+1);
int l=1;bool flag=false;
for(int i=n;i>=l;i--)
{
if(!flag&&s[i]=='0')
continue;
if(s[i]!='0')
flag=true;
if(s[l]!=s[i])
{
printf("No");
return 0;
}
l... | #include <algorithm>
#include <iostream>
using namespace std;
int main()
{
int a[4];
for(int i = 0; i < 4; i++) cin >> a[i];
sort(a, a + 4);
if(a[0] + a[3] == a[1] + a[2] || a[0] + a[1] + a[2] == a[3]) cout << "Yes" << endl;
else cout << "No" << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
#define ll long long
set<ll> st;
void count(ll N) {
int k = (ll)sqrt(N);
for(int i = 1; i<=k; i++) {
if(N%i == 0){
st.insert(i);
st.insert(N/i);
}
}
}
int main(void) {
long long N;
cin >> N;
count(N);
for(auto i : st) {
cout << i << '\n';
}
... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define f(i,j,n) for(int i = j; i <= n; i++)
#define r(i,n,j) for(int i = n; i >= j; i--)
#define all(container) container.begin() , container.en... |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;++i)
#define per(i,a,b) for(int i=(a),i##end=(b);i>=i##end;--i)
//mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template<typename T>void chkmax(T&x,T y){if(x<y)x=y;}
template<typename T>v... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n;
string s;
cin>>n>>s;
if(s[0]!= s[n-1])
cout<<1<<"\n";
else
{
bool fg=0;
for(int i=n-2;i>=0;i--)
{
if(s[0]!= s[i] && s[i+1] != s[n-1])
fg =1;
}... |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int main(){
int n, nn; cin >> n; nn = 1 << n;
cout << nn-1 << "\n";
for(int bt=1; bt<nn; bt++){
rep(i,nn) cout << (char)(__builtin_parity(bt&i) + 'A');
cout << "\n";
}
} | #include <bits/stdc++.h>
using namespace std;
// figure out n and m by double counting partnerships
// solved the n = 2 case
// tried natural ways to extend a solution on n to 2n
// => how to "borrow" structure from the n solution
// => make a copy of each vertex, how do you link them together
// => link 1-2 of ea... |
#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define mes(a,b) memset((a),(b),sizeof((a)))
#define syio std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
#define lson l, mid, rt << 1
#define rson mid+1, r, rt << 1 | 1
#define lowbit(a) ((a)&-(a))
#define pb push_back
#define mkp... | #include <bits/stdc++.h>
using namespace std;
// #define LOCAL // 提出時はコメントアウト
#define DEBUG_
typedef long long ll;
const double EPS = 0.1;
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> usin... |
#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<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
#define pii pair<int,int>
... |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#includ... | #include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>
#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"z... |
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef long long ll;
#define f first
#define s second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define sz(x) (int)x.size()
#define all(x... | #include <bits/stdc++.h>
#include <numeric>
using namespace std;
// using mint = long double;
// using mint = modint998244353;
// using mint = modint1000000007;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> T;
typedef pair<ll, vector<ll>> Pd;
const ll INF = 4e18;
const ll fact_table = 3200008;
... |
#include <bits/stdc++.h>
using namespace std;
struct DSU {
vector<int> ps;
vector<vector<int>> children;
DSU(int n): ps(n), children(n) {
iota(ps.begin(), ps.end(), 0);
for (int i = 0; i < n; ++i) {
children[i].push_back(i);
}
}
int find(int i) {
if (ps[... | /* Immediate Gratification Is A Dream Killer */
#include<bits/stdc++.h>
using namespace std;
template <typename T>
void make_unique(vector<T>& vec) {
//sort(vec.begin(),vec.end());
vec.erase(unique(vec.begin(),vec.end()), vec.end());
}
#define ll long long int
#define ld long double
#define ff first
#define ss... |
//12252024832524
#include <cstdio>
#include <cstring>
#include <algorithm>
#define TT template<typename T>
#define int LL
using namespace std;
typedef long long LL;
const int MAXN = 25;
const int MAXM = MAXN * MAXN;
int n,m,d[MAXN],cnt[MAXN][4];
bool vis[MAXN][MAXN];
LL bei = 1,ans = 0;
LL Read()
{
LL x = 0,f = 1;ch... | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeo... |
#include<bits/stdc++.h>
using namespace std;
const int mod=10;
using ll=long long;
#define sz(v) (int)v.size()
#define all(v) v.begin(),v.end()
#define pr(s) cout<<s<<"\n"
void solve(){
int n;
cin>>n;
std::vector<int>a(n),b(n);
for (int i = 0; i < n; i++) {
cin>>a[i];
}
for (int i = 0;... | #include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<unordered_set>
#include<unordered_map>
#define ll long long
using namespace std;
template<typename t1>
void print(vector<t1>& arr){
for(t1 x:arr)
cout<<x<<" ";
cout<<"\n";
}
template<typen... |
#include<bits/stdc++.h>
using namespace std;
namespace Ruri{
#define ms(a,b) memset(a,b,sizeof(a))
#define repi(i,a,b) for(int i=a,bbb=b;i<=bbb;++i)//attention reg int or reg ll ?
#define repd(i,a,b) for(int i=a,bbb=b;i>=bbb;--i)
#define reps(s) for(int i=head[s],v=e[i].to;i;i=e[i].nxt,v=e[i].to)
#... | #include <bits/stdc++.h>
using namespace std;
#define Maxn 500007
int n;
char s1[Maxn],s2[Maxn];
int main()
{
scanf("%d",&n);
scanf("%s",s1+1);
scanf("%s",s2+1);
long long ans=0LL;
long long cnt=0;
for (int i=1;i<=n;i++)
{
if (cnt==0)
{
if (s1[i]==s2[i]) cnt=0; el... |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1000000007;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<string> vstr;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
#define vint2(v,n,m,init) v... | #include<bits/stdc++.h>
//#include <atcoder/all>
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(fm, ...) do{std::printf("%s:%d(%s)", __FILE__, __LINE__, __func__);std::cout << "DEBUG PRINT ";std::printf(fm, __VA_ARGS__);}while(0)
#define DEBUG_VAL(a, b) do{std::printf("%s:... |
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
const int A_MAX = 200;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
ll ans = 0;
vector<int>A(N);
vector<int>K(A_MAX*2+1);
for (int i = 0; i < N; i++){
cin >> A[i];
}
for (int... | #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... |
#include <cstdio>
#include <cstring>
#include <algorithm>
#define N 100010
using namespace std;
int n, a[N];
int main(){
// freopen("funny.in", "r", stdin);
scanf("%d", &n);
a[1]=1;
for (int i=1; i<=n; i++)
for (int j=2; j<=n/i; j++)
a[i*j]=max(a[i*j], a[i]+1);
for (int i=1; i<=n; i++) printf("%d ", a[i]);
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll n;
cin >> n;
vector<vector<int>> seen(n + 1, vector<int>(500, 0));
vector<ll> ans;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <... |
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<int, int>;
using PL = pair<lint, lint>;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#d... | #include <bits/stdc++.h>
//#pragma GCC optimize ("03")
#define FastIO ios_base::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
#define FILES freopen("in" , "r" , stdin) , freopen("out" , "w" , stdout)
#define ll long long
#define ld long double
#define pii pair < ld , ll >
#define pb push_back
using namespace std;
... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int x, y;
cin >> x;
y = x % 100;
y = 100-y;
cout << y;
return 0;
}
| #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define N 200100
#define MOD 1000000007 //998244353
#define ll long long
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rep2(i, a, b) for(int i = a; i <= b; ++i)
#define rep3(i, a, b) for(int i = a; i >= b; --i)
#define eb emplace_back
#de... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
int main() {
ll si,sj;cin>>si>>sj;
vector<vector<ll>> t(50, vector<ll>(50));
vector<vector<ll>> p(50, vector<ll>(50));
for(ll i=0;i<50;i++){
for(ll j=0;j<50;j++){
cin>>t[i][j];
}
}
... | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define chmin(x,y) x = min((x),(y))
#define chmax(x,y) x = max((x),(y))
#define popcount(x) __builtin_popcount(x)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
const int INF = 1e9;
const ... |
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#if defined(DAIJOBU)
#include "/home/ichigo/includes.hpp"
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif
#define mp make_pair
#define mt make_tuple
#define... | #include <bits/stdc++.h>
using namespace std;
bool eq(int a[], int b[], int c[], int n){
pair<int,int> x[n],y[n];
for(int i=0; i<n; i++) x[i]={a[i],i}, y[i]={b[i],i};
sort(x,x+n);
sort(y,y+n);
for(int i=0; i<n; i++)
if(x[i].first!=y[i].first)
return false;
for(int i=0; i<n;... |
//Quizzes
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define rrep(i,x,y) for(ll i=x-1;i>=y;i--)
#define nvarep(n,a) ll n;cin>>n;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define vecrep(n,a,type) vector<type>a(n);rep(i,0,n)cin>>a[i]
#define ... | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_fast32_... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using i128 = __int128_t;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vector<T>>;
#define rep(i, n) for (int i = 0; i ... | #include "bits/stdc++.h"
using namespace std;
#ifdef DEBUG
#include <dbprinter.hpp>
#define ios_base freopen("input.txt", "r", stdin);ios_base
#define o cerr << "Line " << __LINE__ << ": "; debug
#endif
#define endl '\n'
constexpr int N = 5001;
constexpr int INF = numeric_limits<int>::max() >> 1;
void solve() {
... |
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repp(i, n, m) for(int (i) = (n); (i) < (m); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint... | /* Author: rrrr_wys
**/
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define fi first
#define se second
typedef double db;
typedef long long ll;
using namesp... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int A, B;
vector<int> vec_a;
vector<int> vec_b;
for(int i = 0; i < N; i++) {
cin >> A >> B;
vec_a.push_back(A);
vec_b.push_back(B);
}
vector<int>::iterator a_iter = min_element(vec_a.begin(), vec_a.end());
size... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long int;
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
int main() {
int N;
cin >> N;
vector<pair<int, int>> T(N... |
//雪花飄飄北風嘯嘯
//天地一片蒼茫
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se seco... | #include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e5+100;
typedef long long LL;
const int mod=998244353;
inline LL ksm(LL x,LL a){
LL ret=1,... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long A, B;
cin >> A >> B;
cout << A * 1.0 * B / 100 << endl;
}
| #include <bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-')w=-1;ch=getchar();
}
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;
}
inline bool read(int& a){
int s=0,w=1;
... |
#include <bits/stdc++.h>
// #include <atcoder/modint>
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define INF 2000000000000000000
#define ll long long
#define ld long double
#define pll pair<ll, ll>
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; }... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
double eval(double x,const vector<int> &a){
double ret=0;
for(int amt:a){
double d=amt;
ret+=x+d-min(d,x*2);
}
return ret;
}
int main(){
int n;
cin>>n;
vector<int> a(n);
for(int &x:a)
cin>>x;
... |
#include<bits/stdc++.h>
using namespace std;
const double eps=1e-5;
int n,fa[110];
struct POINT
{int x,y;}p[110];
inline int read()
{
int x=0,w=0;char ch=0;
while(!isdigit(ch)){w|=ch=='-';ch=getchar();}
while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
return w?-x:x;
}
int getfa(int x)
{return fa[x]==x?x:fa... | // Skyqwq
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
typedef long long LL;
const int N = 2e5 + 5;
int n, k, mid, cnt, h[N];
vector<int> g[N];
int dfs(int u, int fa) {
int s = 0, w = 0; h[u] = -2e9;
for (int i = 0; i < g[u].size(); i++) {
int v = g[u][i];
if (v == fa) continu... |
#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;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a)
#define dumparr(a,n)
#endif
#... | #include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <functional>
#include <cstdlib>
#include <list>
#include <iomanip>
#define ll long long
using namespace std;
int main() {
ll N, W;
cin >> N >> W;
... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool cmp(pair<string, int>& a,
pair<string, int>& b)
{
return a.second < b.second;
}
// Function to sort the map according
// to value in a (key-value) pairs
void sort(map<string, int>& M, int n)
{
// Declare vector of pairs
... | #include <bits/stdc++.h>
#define PB push_back
#define MP(x,y) make_pair(x,y)
#define F first
#define S second
#define LOOP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define lp(i,n) LOOP(i,0,n)
using namespace std;
typedef long long int lli;
typedef pair<int,int> pii;
int main(){
// freopen("in.txt", "r", st... |
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = m... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define SZ(x) ((int)(x).size())
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, leng... |
#include <bits/stdc++.h>
using namespace std;
#define rep(a,b,c) for(int a=(b);a<=(c);a++)
#define per(a,b,c) for(int a=(b);a>=(c);a--)
#define pb push_back
const int N=5e5+5e4+5;
template<class T>inline void read(T &x) {
T f=1;x=0;char s=getchar();
while(s<'0'||s>'9'){if(s=='-')f=-1;s=getchar();}
while(s>='0'&&s<='... | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int MAXN = 101;
const int MAXSUM = 50 * 99 * 50 + 1;
int dp[MAXN][MAXSUM];
signed main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
int N, K, M;
cin >> N >> K >> M;
dp[0][0] = 1;
for (int n(1); n < MAXN; ++n)
for (in... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL<<60;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define rep(i, n) for(... | #include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define REP(i, n) for(int i = 0; i < n; ++i)
using namespace std;
using LLONG = long long;
const LLONG M... |
#include <iostream>
using namespace std;
typedef long long ll;
int main() {
ll b, c;
cin >> b >> c;
if (b == 0) {
cout << c << endl;
}
else if (b > 0) {
if (c < 3) cout << min(2 * b, c) + 1 << endl;
else cout << min(2 * b, c) + c - 1 << endl;
}
else {
if (c ... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author Kein Yukiyoshi
*/
// clang-format off
#include <bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx")
#define int long long
using namespace std;
#define stoi stoll
#define fi first
#define se secon... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<stdlib.h>
#include<utility>
#include<functional>
#include<cfenv>
#include<cmath>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<array>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int ma... | // CPP
#include<bits/stdc++.h>
using namespace std;
//include <ext/pb_ds/assoc_container.hpp>
//include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#def... |
#include <bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
//#include<boost/multiprecision/cpp_dec_float.hpp>
//#include <atcoder/all>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#d... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a >... |
// YATIN KWATRA
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ar array
#define sz(v) (int)(v.size())
#define inf 1e18
#define int... | //#include <tourist>
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0,... |
#include <iostream>
using namespace std;
#define FOR(i, j, k, in) for ( i = j; i < k; i += in)
#define RFOR(i, j, k, in) for (int i = j; i >= k; i -= in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define INF (int)1e9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
type... | #include<bits/stdc++.h>
using namespace std;
// for loop
#define rep(i,a,n) for(int i=(a);i<(n);++i)
#define repe(i,a,n) for(int i=(a);i<=(n);++i)
#define rrep(i,n,a) for(int i=(n);n>(a);--i)
#define rrepe(i,n,a) for(int i=(n);n>=(a);--i)
// abbreviati
#define PB(v) push_back(v)
#define MP(A,B) make_pair(A,B)
#define... |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i < n;i++)
typedef long long ll;
int main(){
int n;
cin >> n;
vector<long long> a(n);
rep(i,n){
cin >> a[i];
}
vector<vector<bool>> dp(n,vector<bool>(100001,false));... | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int INF = 2e9;
int l[N], r[N];
long long f[N], g[N];
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; ++i)
{
l[i] = INF, r[i] = -INF;
}
for (int i = 1; i <= n; ++i)
{
int x, c;
cin >> x >> c;
l[c] = min(l[c], x);
r[c] = ... |
/** @BY_KUTBILIM **/
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
using ll = long long;
using ld = long double;
const long double pi = acos((ld) - 1.0);
const double eps = (double)1e-9;
const int inf = 1e9 + 7;
int main(){
int n;
cin >> n;
string... | ///////////////////////////////
////ACくれなきゃ悪戯しちゃうぞ!////
///////////////////////////////
//include
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <utility>
#include <functional>
#include <cstdlib>
#include <map>
#include <utili... |
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <array>
#include <queue>
#include <stack>
#include <map>
#include <set>
using namespace std;
int main()
{
int N, Q;
cin >> N >> Q;
vector<long long> A(N), B(N);
for (auto... | #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... |
#include <vector>
#include <array>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#inc... | #include <bits/stdc++.h>
#define pb push_back
#define sz size()
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <long long> vll;
const int MOD = 1e9 + 7;
const int maxn = 1e6 + 7;
ll inv[maxn+3];
ll fac[maxn+3];
ll qpow(ll x,ll n)
{
ll res = 1;
... |
#include <bits/stdc++.h>
using namespace std;
const int maxN = 1e6 + 10;
int n;
char s[maxN + 1];
vector<int> v0, v1;
int main()
{
scanf("%d", &n);
scanf("%s", s + 1);
for(int i = 1; i <= n; i++)
if(s[i] == '0') v0.push_back(i);
scanf("%s", s + 1);
for(int i = 1; i <= n; i++)
if(s[i] == '0') v1.push_back(i... | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) begin(x),end(x)
#define F(i,n) for (int i = 0; i < n; ++i)
#define F1(i,n) for (int i = 1; i <= n; ++i)
#define dbg(x) cerr << #x << " = " << x << endl
#define dbgg(x) cerr << #x << " = " << x << ' '
#de... |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
constexpr int kN = int(1E5 + 10);
int a[kN], b[kN], y[kN], x[kN];
int main() {
int n, l, idx = -1, now = 0, lst = 0;
ll ans = 0;
scanf("%d%d", &n, &l);
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
for (int i = 1; i <= n; i++) scanf("%d"... | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ldb double
template<typename T>void ckmn(T&a,T b){a=min(a,b);}
template<typename T>void ckmx(T&a,T b)... |
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
long long m;
int l;
string x;
bool check(long long d){
long long tmp=0,base=1;
for (int i=l-1;i>=0;i--){
if (base>m) return false;
tmp+=base*(x[i]-'0');
if (tmp>m) return false;
if (base>(m/d)&&i!=0) r... | using namespace std;
#include <bits/stdc++.h>
int A,B;
int main(){
scanf("%d%d",&A,&B);
int sum=max(A,B)*(max(A,B)+1)/2;
if (A<B){
for (int i=1;i<=B;++i)
printf("%d ",-i);
for (int i=1;i<A;++i)
printf("%d ",i),sum-=i;
printf("%d\n",sum);
}
else{
for (int i=1;i<=A;++i)
printf("%d ",i);
for (int i... |
#include <bits/stdc++.h>
#define rep(i, x, y) for (int i = x; i <= y; i++)
using namespace std;
typedef long long ll;
const int N = 1e5 + 10, M = (1 << 20) + 2;
int n, m, a[N], cnt[N];
char s[N][22];
int main() {
cin >> n >> m;
rep(i, 1, n) {
scanf("%s", s[i]);
rep(j, 0, m - 1) {
a... | #include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
using namespace std;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (... |
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define debug(x) cout << #x << ": " << (x) << endl
#else
#define debug(x)
#endif
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const int maxn=1e6+7,inf=0x3f3f3f3f,mod=998244353;
int fa[maxn];
int find(int x)
{
return fa[x]==x?fa[x]:fa[x]=find(fa[x]... | // Parasparopagraho Jīvānām
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace __gnu_pbds ;
using namespace __gnu_cxx ;
using namespace std ;
typedef long long ll ;
t... |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int n; cin >> n;
vector<vector<ll>> v(n);
for(int i = 0; i < n; i++){
for(int j = 0; j < 5; j++){
int x; cin >> x;
v[i].push_back(x);
}
}
auto check = [&](int x){
set<int> ... | #include "bits/stdc++.h"
using namespace std ;
const int mxN =800 ;
int n,k,a[mxN+1][mxN+1],p[mxN+1][mxN+1] ;
// ask if we can have median as atleast x or not ?
bool ok(int x){
for(int i=1;i<n+1;i++)
for(int j=1;j<n+1;j++)
p[i][j]=p[i-1][j]+p[i][j-1]-p[i-1][j-1]+(a[i][j]>x) ;
for(int i=1;i<n+2-k;i++){
... |
/*
JAI JAGANNATH!
*/
//@Author : zanj0
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ff first
#define ss second
#define pb push_back
#define MOD 1000000007
#define inf 1e18
#define ps(x,y) fixed<<setprecision(... | /**
* author: zakhio (mttk1528)
* created: 19.12.2020 21:02:51
**/
// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#ifdef _LOCAL_
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
#define name(x) #x
#define dump(x) cout << name(x) <<... |
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <st... | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
int ok;
int n, q;
string s;
int f(int i) {
if(ok)
return i;
if(i < n)
return n + i;
else
return i - n;
}
int32_t main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n >> s >> q;
ok = 1;
while(q--) {
int t, a, b;... |
#include<bits/stdc++.h>
typedef int LL;
typedef double dl;
#define opt operator
#define pb push_back
#define pii std::pair<LL,LL>
const LL maxn=1e6+9,mod=998244353,inf=0x3f3f3f3f;
LL Read(){
LL x(0),f(1); char c=getchar();
while(c<'0' || c>'9'){
if(c=='-') f=-1; c=getchar();
}
while(c>='0' && c<='9'){
x=(x<<3ll... | #include<bits/stdc++.h>
#include<bits/extc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t){
while(*sdbg != ',') { ce... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s; cin >> s;
reverse(s.begin(), s.end());
for (char& c : s) {
switch (c) {
case '6':
c = '9'; break;
case '9': c = '6'; break;
}
}
cout <<... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
using P=pair<ll,ll>;
int main() {
string s;
cin >> s;
map<ll,ll>ok;
for(ll i=0;i<10;i++){
if(s[i]=='o') ok[i]++;
}
ll ans=0;
for(ll i=0;i<10;i++){
if(s[i]=='x') continue;
for... |
#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(),... | #include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <sstream>
#include <utility>
using namespace std;
typedef long long ll;
class Graph {
unordered_map<int, vector<int> > nodes;
unordered_map<int, ll> sums;
vector<pair<int, int> > edges;
unordered... |
#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ll long long
#define all(x) (x).begin(), (x).end()
#define ff first
#define ss second
#define deb(x) cout << #x << " : " << x << " "
template<class X>
void input(X *arr, int n){
for(in... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n, q;
cin >> n >> q;
vector<ll> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<ll> c(n);
for (int i = 0; i < n; i++) {
c[i] = a[i] - (i + 1);
}
while(q--) {
ll k... |
#include <bits/stdc++.h>
#define eps 1e-8
#define PI 3.141592653589793
#define bsize 512
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define bs 1000000007
using namespace std;
ll int fact(ll int a){
ll ... | #include<bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<lint, lint>;
const int mod = 1000000007;
#define all(a) (a).begin(),(a).end()
#define rep(i, n) for (lint i = 0; i < (lint)(n); i++)
inline lint fcl(lint num){
return (num == 1 ? 1 : (num * fcl(num - 1)));
}
int main(){
lint k;
... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define pii pair <int, int>
long long GCD(long long a, long long b)
{
if (!b) return a;
return GCD(b, a % b);
}
int main()
{
ll a,b,w;
ll x, y;
scanf("%lld %lld %lld", &a, &b, &w);
ll bet = b - a;
ll count = 1000 * w;... | #include <bits/stdc++.h>
#define ll long long int
#define db double
#define pb push_back
#define mpr make_pair
#define andl "\n"
#define f first
#define s second
#define mset(x,y) memset(x,y,sizeof(x))
#define fr(i,n) for(long long int i=0;i<n;i++)
#define trace(it,x) for(auto it = (x).begin(); it != (x).end(); it++)
#... |
#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>
... | /*
@uthor: Amit Kumar
user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#def... |
#include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
#define ldouble long double
using namespace std;
const int maxN = 100; int n, m, x, y;
char mat[maxN][maxN + 1];
int di[4] = {0, 0, -1, 1}, dj[4] = {1, -1, 0, 0};
int main()
{
while (~scanf("%d %d %d %d", &n, &m, &x, &y))
{
x--, y--;
f... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, x, y, cnt = 1;
cin >> h >> w >> x >> y;
vector<string> s(h);
for (int i = 0; i < h; i++) cin >> s.at(i);
for (int i = 1; i < 100; i++) {
if (x - 1 + i >= h) {
break;
}
if (s.at(x - 1 + i).at(y - 1) == '.')
cnt++;
... |
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
using P = pair<int,int>;
using vp=vector<P>;
int main(){//cout<<fixed<<setprecision(20);
int n;
cin>>n;
vp a(n);
rep(i,0,n)cin>>a[i].first>>a[i].second;
int ans=0;
rep(i,0,n-1)rep(... | // �Experience is the name everyone gives to their mistakes.� � Oscar Wilde
// Take care of mod becoming -ve
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define fro(i, s, e) for (auto i = s; i <= e; ++i)
#define int long long
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.