code1 stringlengths 54 12k | code2 stringlengths 71 12k | similar int64 0 1 | __index_level_0__ int64 0 101M |
|---|---|---|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n,m,d;
cin>>n>>m>>d;
cout << fixed << setprecision(8);
double ans=1.000000*(n-d)/n*(m-1)/n;
if(d!=0)ans*=2;
cout<<ans<<endl;
} | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"
using ll = long long;
using P = pair<int,int>;
using mp = map<string,int>;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
int main(void){
int n, h;
cin >> n >>... | 0 | 64,914,771 |
#include <iostream>
#include <map>
using namespace std;
int main() {
map<string, int> words;
string word, largestWord, mostFrequentWord;
int maxLength = 0, mode = 0;
while (cin >> word) {
words[word]++;
}
for (map<string, int>::iterator it = words.begin(); it != words.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>
... | 0 | 14,143,865 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll power(ll x, ll y);
#define repp(I, A, B) for(ll I = A; I <= B; I++)
#define rep(I, A, B) for(ll I = A; I < B; I++)
#define rrep(I, B, A) for(ll I = B; I >= A; I--)
#define pb emplace_back
#define ff first
#define ss second
#... | #include<iostream>
#include<algorithm>
using namespace std;
const int INF=100000010;
int main(){
string s,t;
cin>>s>>t;
int ans=INF;
for(int i=0;i<s.size()-t.size()+1;i++){
int count=0;
for(int j=0;j<t.size();j++){
if(s.at(i+j)!=t.at(j)){
count++;
}
}
ans=min(ans,count);
}
cout<<ans<<endl;
} | 0 | 57,642,332 |
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b)... | #include <bits/stdc++.h>
#include <algorithm>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <stack>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i, m, n) for (ll(i) = (ll)(m); i < (ll)(n); ++i)
#define REP2(i, m, n) for (ll(i) = (ll)(n)-1; i >= (... | 0 | 71,759,765 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
map<int, int> cnt;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
cnt[a[i]]++;
if (cnt[a[i]] == 2) {
cout << "NO" << '\n';
return 0;
}
}
cout <... | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
using P = pair<int ,int>;
const int INF = 1001001001;
const int MOD... | 0 | 46,717,009 |
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
int bomber(int H, int W, int M, vector<int>& h, vector<int>& w) {
int max_bombs, r, c;
set<int> seen;
vector<int> rows(H), cols(W);
for (int i = 0; i < M; i++) {
rows[h[i]]++;
cols[w[i]]++;
}
r = distance(rows.begin... | #include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e9+7;
void add(int64_t& a, int64_t b){
a = (a+b) % MOD;
}
void mul(int64_t& a, int64_t b){
a = a*b % MOD;
}
int main(){
int N, M, S[2000], T[2000];
cin >> N >> M;
for(int i=0; i<N; i++) cin >> S[i];
for(int i=0; i<M; i++) cin >> ... | 0 | 58,592,423 |
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
const ll LINF=0x1fffffffffffffff;
const int INF=0x3fffffff;
const int MOD=1000000007;
#define VAR(type,...) type __VA_A... | #include <iostream>
#include <vector>
#include <set>
#include <utility>
#include <algorithm>
struct paircomp {
using T = std::pair<long long, long long>;
bool operator()(const T& l, const T& r) const {
return l.first > r.first || (!(r.first > l.first) && l.second < r.second);
}
};
int main() {
l... | 0 | 97,487,287 |
#include<bits/stdc++.h>
#define ll long long
#define INF 1000000ll
using namespace std;
signed main(){
int n,m;
cin >> n >> m;
vector<string> a(n);
vector<string> b(m);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < m; i++){
cin >> b[i];
}
for (int i = 0; i+(m-1) < n; i++) {
... | #include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)n; i++)
#define REPll(i, n) for(ll i = 0; i < (ll)n; i++)
#define REPvec(itr, mp) for(auto itr = mp.begin();itr != mp.end(); itr ++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef vector<bool> ... | 0 | 25,901,790 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mdl = 1e9 + 7;
int main() {
ll n, k;
cin >> n >> k;
ll ans[n + 1][k + 1];
ll a[n];
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i <= k; i++) {
ans[1][i] = (i <= a[0]) ? 1 : 0;
}
for (int i = 2; i <= n; i++) {
for (int j... | #include<iostream>
using namespace std;
int main() {
int x, y, z, count = 0;
while( cin >> x >> y >> z ) {
for(int i=x;x<=y;x++)
if(z % x == 0)
count++;
cout << count << "\n";
count = 0;
}
return 0;
} | 0 | 63,842,311 |
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
void ABC40(void);
void ABC41(void);
void ABC42(void);
void ABC43(void);
void ABC44(void);
void ABC45(void);
void ABC46(void);
void ABC47(void);
void ABC48(void);
void ABC49(void);
int main(void){
ABC48();
}
void ABC48(){
int h,w,i,j;
cin>>h>>w;... | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <numeric>
#include <bitset>
#include <math.h>
#include <iomanip>
#include <sstream>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=... | 0 | 83,340,862 |
#include <iostream>
using namespace std;
int main(){
int n,i,ans=1;
char s,spre;
cin >> n;
cin >> spre;
for(i=1;i<n;++i){
cin >> s;
if(s==spre) continue;
else{
++ans;
spre = s;
... | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#define rep(i, n) for(int i = 0; i < (i... | 0 | 92,545,127 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define contains(v, t) (find(v.begin(), v.end(), t) != v.end())
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;
int main() {
ull n,a,b;
cin>>n>>a>>b;
if (n == 1) {
if (a == b) {
cou... | #include <bits/stdc++.h>
using namespace std;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ", "; os << "]"; return os; }
template<type... | 0 | 82,171,293 |
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>
#define int64 l... | #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
while (true) {
long long n, m;
cin >> n >> m;
if (n == 0)
break;
vector<pair<lon... | 0 | 19,978,677 |
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
int n, sum = 0;
double memo[40005] = {0};
int t[105] = {0};
int v[105] = {0};
int bf[105] = {0};
int af[105] = {0};
double now = 0, ans = 0;
vector<pair<int, pair<int, int>>> data;
int main() {
cout << fixed << setprecision(10);
cin >>... | #include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int power(int x, int y) {
long long p = 1;
for (long long b = x; y > 0; y >>= 1, b = b * b % mod) {
if (y & 1)
p = p * b % mod;
}
return p;
}
int main() {
string l;
cin >> l;
int n = l.size();
int leftPopBit = 0;
int sum = 0;
for (int i... | 0 | 49,322,185 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
char c; cin>>c;
c++;
cout<<c<<endl;
} | #include<bits/stdc++.h>
using namespace std;
#define li long long int
#define rep(i,to) for(li i=0;i<((li)(to));i++)
#define repp(i,start,to) for(li i=(li)(start);i<((li)(to));i++)
#define pb push_back
#define sz(v) ((li)(v).size())
#define bgn(v) ((v).begin())
#define eend(v) ((v)... | 0 | 62,199,533 |
#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.at(i);
}
long long res=1000;
for(int i=0;i<N-1;i++){
int S=A.at(i);
int T=A.at(i+1);
if(S<T){
long long C=res/S;
res%=S;
res+=C*T;
}
}
cout <... | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N... | 0 | 98,539,909 |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<set>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if(a == 1 && b != 1){
cout << "Alice";
}
else if(b == 1 && a != 1){
cout << "Bob";
}
else if(b > a){
... | #include "bits/stdc++.h"
#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int... | 0 | 62,968,670 |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
const int maxn = 1e3 + 5;
const int dir[4][2] = {{1,0},{0,1},{-1,0},{0,-1}};
int mp[maxn][maxn];
int d[maxn][maxn];
struct point{
int x,y;
};
int h,w,n;
int dis = 0;
void bfs(point &p,int cnt)
{
memset(d, 0, sizeof(d... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int n, pos[60];
ll p[60];
ll a[100005], b[100005];
ll sum = 0, occ = 0, ans = 0;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; ++i)
scanf("%lld", a + i), sum ^= a[i], occ |= a[i];
int m = 0;
for (int i = 59; i >= 0; --i) {... | 0 | 75,677,190 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll a,b,c;
cin>>a>>b>>c;
ll ans=ceil((a*1.0)/(b*1.0));
cout<<ans*c<<endl;
return 0;
} | #include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i... | 0 | 77,143,055 |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x,y;
cin >> x >> y;
int j = 0;
for (int i = x; i >= 0 ; i--)
{
j = x - i;
if ((i*2 + j*4) == y)
{
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
vector<int> twoadd(vector<int> v, int N){
v[N-1]+=1;
int ind = N-1;
int j=N-1;
for(j=N-1;j>=1;j--){
if(v[j]>1){
v[j-1]+=1;
v[j]=0;
}
}
return v;
}
long long f... | 0 | 47,242,956 |
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()
int main(){
string a,b,c;cin>>a>>b>>c;
if(a.at(a.size()-1)==b.at(0) &&... | #include <iostream>
#include <stack>
#include <math.h>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#define rep(i,n) for(int i=0; i < n; i++)
using ll = long long;
using namespace std;
int main()
{
int type_ref, type_mic, type_dis;
cin >> type_ref >> type_mic >> type_dis;
vec... | 0 | 51,884,987 |
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>
#include<bitset>
#include <sstream>
#include<queue>
#include<set>
#define rep(i,n) for(ll i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const ll mod = 1e9+7;
const ll INF = 1e9;
con... | #include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<(n);i++)
#define inf (int)(3e18)
#define int long long
#define mod (int)(1000000007)
#define intt long long
#define P pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
using namespace std;
int modpow(int x, int y, int m = mod... | 0 | 66,647,899 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll power(int a, int times) {
ll ans = 1;
for (int i = 0; i < times; i++) {
ans *= a;
}
return ans;
}
void solve() {
int a, b;
cin >> a >> b;
int ans = 1900*b+100*(a-b);
cout << ans*power(2, b) << "\n";
}
int main() {
ios::sync_with_stdio(0);
... | #include <bits/stdc++.h>
typedef long long ll;
const ll oo = 0x3f3f3f3f;
int const N = 1e6+5;
int const mod = 1e9+7;
using namespace std;
int fact[1000005];
bool f=false;
void gcd(int x){
if(f==true)
return;
for(int i=1;i*i<=x;i++){
if(x%i==0){
int a=i;
... | 0 | 23,197,731 |
#include <iostream>
using namespace std;
int main() {
int h, w, a, b;
cin >> h >> w >> a >> b;
if (w / 2 < a || h / 2 < b) {
cout << -1 << endl;
return 0;
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
int x = 0, y = 0;
if (i < b) {
y = 1;
}
if (j < a... | #include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rep1(i,n) for(int i = 1; i < (n); i++)
int main(){
int n;
cin >> n;
vector<int> a(n);
vector<int> b(n);
rep(i,n-1) cin >> b[i];
... | 0 | 26,813,736 |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,T;cin>>n>>T;
int t[n],x=T;
for(int i=0;i<n;i++){
cin>>t[i];
if(i==0)continue;
if(T<=t[i]-t[i-1])x+=T;
else x+=t[i]-t[i-1];
}
cout<<x;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a... | 0 | 18,418,255 |
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#inc... | #include<bits/stdc++.h>
using namespace std;
int main(){
string o, e;
cin >> o >> e;
string pass="";
for(int i=0; i<o.length(); i++){
pass.push_back(o.at(i));
if(o.length() == e.length()){
pass.push_back(e.at(i));
}else{
if(i != o.length()-1){
... | 0 | 1,541,753 |
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
if(a<=8&&b<=8)
cout<<"Yay!\n";
else
cout<<":(\n";
} | #include <bits/stdc++.h>
using namespace std;
#pragma region
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {c... | 0 | 87,597,111 |
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
const int N = 100010;
const double eps = 1e-6;
int n, k;
int main()
{
cin >> n >> k;
if(k & 1)
{
LL res = n / k;
cout << res * res * res << endl;
}
else
... | #include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#defi... | 0 | 54,455,196 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
constexpr ll mod = 1e9+7;
int main(){
int n;
cin >> n;
string s;
cin >> s;
vector<ll> cnt(26,0);
for (int i = 0; i < n; i++) {
cnt[s[i] - ... | #pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
cin >> first;
ci(rest...);
return;
}
inline void co(void){
cout << endl;
return;
}
template <typename First, typename... Rest>
void c... | 0 | 11,862,531 |
#include <cstdio>
int compute_fibonacci(int num)
{
int prev_num = 1;
int current_num = 1;
for(int i = 2; i <= num; i++) {
int tmp = current_num;
current_num = current_num + prev_num;
prev_num = tmp;
}
return current_num;
}
int main()
{
int num;
scanf("%d", &num);
... | #include <bits/stdc++.h>
using namespace std;
#define X ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FIXED_FLOAT(x) std::fixed <<std::setprecision(2)<<(x)
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __pr... | 0 | 5,629,001 |
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag,
tree_order_statistics_node_update>
indexed_set;
typedef long long ll;
const int N = 1e4 + 10, OO = 0x3f3f3f3f, mo... | 0 | 21,087,134 |
#include <bits/stdc++.h>
using namespace std;
#if DEBUG && !ONLINE_JUDGE
#include "header.h"
#else
#define debug(args...)
#endif
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef long long lli;
typedef long double ld;
#define pb push_back
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x).size()
#defin... | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb push_back
#define ld long double
#define f first
#define s second
#define in insert
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define speed io... | 0 | 36,732,362 |
#include <cstdio>
int a, b, c;
int cnt[201];
void solve()
{
cnt[a+100]++;
cnt[b+100]++;
cnt[c+100]++;
for (int i = 0; i < 201; i++) {
if (cnt[i] == 1) {
printf("%d\n", i-100);
}
}
}
int main()
{
scanf("%d%d%d", &a, &b, &c);
solve();
return 0;
} | #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
#define ld long double
#define fr(i, n) for (auto i = 0; i < n; i++)
#define ff first
#define pf pop_front()
#define... | 0 | 71,091,930 |
#include <iostream>
using namespace std;
int main(){
int n,k;
while(1){
cin >> n >> k;
int N[n],sum[n-k+1];
if(n==0 && k==0) break;
for(int i=0; i<n-k+1; i++){
sum[i] = 0;
}
for(int i=0; i<n; i++){
cin >> N[i];
}
for(int i=0... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PLL> VP;
#define rep(i,n) for (ll i=0; i<(ll)(n); i++)
#define repd(i,n) for (ll i=n-1; i>=0; i--)
#define rept(i,m,n) for(ll i=m; i<n; i++)
#define all(x) (x).b... | 0 | 74,757,723 |
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
using ll = long long;
using d = double;
int main(){
ll n,a,b;
cin >> n >> a >> b;
ll x = n/(a+b);
ll y = n%(a+b);
ll ab = min(y,a);
ll ans = x*a+ab;
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uni... | 0 | 91,956,911 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll
signed main() {
string S; cin >> S;
int N = S.size();
rep(i, 7) {
string T = S.... | #include <string>
#include <sstream>
#include <iostream>
#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second
using namespace std;
typedef pair<int ,int > P;
struct Node {
int value;
Node *nex... | 0 | 28,806,956 |
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 8;
long long x[N], m[N] , w[N] , tmp , p , q , cnt , n , l , t;
int main()
{
ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
cin >> n >> l >> t;
for(int i = 0 ; i < n ; i++)
cin >> x[i] >> w[i];
for(int i = 1 ; i < n ; i++)
{
if(w[i] != w[0])... | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespac... | 0 | 67,089,812 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
string a,b;
cin>>a>>b;
int ans =0;
for(int i=0;i<a.length();i++){
if(a[i]!=b[i])
ans++;
}
cout << ans << endl;
return 0;
} | #include <iostream>
using namespace std;
const long long INF = 9223372036854775807;
struct datum {
long long min, max;
datum &update(long long x) {
if (x < min) min = x;
if (x > max) max = x;
return *this;
}
long long diff() const { return max - min; }
};
datum operator^(const datum &a, const datum ... | 0 | 50,381,434 |
#include<bits/stdc++.h>
#define rep(i,a) for(int (i)=0; (i)<(a); (i)++)
#define rep2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define all(v) v.begin(), v.end()
#define m0(x) memset(x,0,sizeof(x))
#define chmax(a,b) if(b>a) a = b
#define chmin(a,b) if(b<a) a = b
#define LINF 1e9+10
typedef long lon... | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
using Graph = vector<vector<int> >;
using GraphC = vector<vector<char> >;
typedef pair<int, int> P;
const int MAX_N = 10000;
const int MAX_L = 100000000;
const int MAX_SQRT_B = 10000;
const int INF = 1000000000;
typedef int64_t ll;... | 0 | 67,882,741 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define x first
#define y second
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tr... | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
string s;
cin>>s;
int ansa = -1;
int ansb = -1;
if(s.length() == 2){
if(s[0] == s[1])
ansa = 1 , ansb = 2;
}else if(s.length() > 2){
for(int i=0;i<s.length()-2;i++){
if(s[i] == s[i+1] || s[i] == s[i+2] || s[i+1] == s[i+2]... | 0 | 64,057,667 |
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<sstream>
#include<map>
#include<cmath>
using namespace std;
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1;i <=n;i++)
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
#define ALL(a) a.begin(),a.end(... | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <math.h>
#include <string>
#include <sstream>
#include <stack>
#include <deque>
#define pb push_back
#define make ... | 0 | 47,460,163 |
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int a,b,k;
cin>>a>>b>>k;
if(k>a){
k=k-a;
a=0;
}
else{
a=a-k;
k=0;
}
if(k!=0){
if(k>b){
k=k-b;
b=0;
}
else{
b-=k;
... | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define int ll
#define PI 3.1415926535897932384626433832795
#define pb push_back
#define rep0 for(int i=0;i<n;i++)
#define rep1 for(int i=1;i<=n;i++)
#define inputar0(ar) for(int i=0;i... | 0 | 70,367,345 |
#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
cout << (180.0-360.0/N)*N << endl;
return 0;
} | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
int n,i;
cin>>n;
ll pow[33];
pow[0]=1;
for(i=1;i<33;i++){
pow[i]=pow[i-1]*2;
}
ll z[n],w[n];
int flag=-1;
for(i=0;i<n;i++){
ll x,y;
cin>>x>>y;
z[i]=... | 0 | 18,952,658 |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b;
string x;
cin >> a >> b;
if(a > b){
x = ">";
}
else if(a < b){
x = "<";
}
else{
x = "==";
}
cout << "a " << x << " b" << endl;
return 0;
} | #include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
#define NIL (-1)
char ans[1046527][14];
int o=1046527;
int getChar(char i)
{
switch(i)
{
case 'A':return 1;
case 'C':return 2;
case 'G':return 3;
case 'T':return 4;
}
}
long long getKey(char a[])
{
... | 0 | 53,429,225 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
string s;
cin >> s;
for (int i = 0; i < 3; i++) {
if (s.at(i) == '1')cout << 9;
else if (s.at(i) == '9')cout << 1;
else cout << s.at(i);
}
cout << endl;
} | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>... | 0 | 84,761,967 |
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <cmath>
#include <cstdio>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
... | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int nums[n];
for(auto i = 0; i < n; ++i){
cin >> nums[i];
}
int safe = 0;
int find = 1;
for(auto &x: nums) {
if(x == find){
safe++;
find++;
}
}
if(safe){
... | 0 | 19,112,099 |
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define piii pair<int,pii>
#define pll pair<ll,ll>
#define plii pair<ll,pii>
#define vi vector<int>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define SORT(x) sort(x.begin(), x.end())... | #include <iostream>
#include <vector>
int main() {
int n; std::cin >> n;
std::vector<unsigned int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
std::vector<int> t(n);
unsigned int k = 0;
for (int i = 0; i < n; i++) {
int h = 0;
if (i != 0) {
h ... | 0 | 5,989,357 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);
template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;
constexpr long long MOD = (long long)... | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>
using namespace std;
bool solve(){
double x[4],y[4];
for(int i=0;i<4;i++){
cin>> ... | 0 | 7,537,193 |
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
typedef long long ll;
int main() {
string s; cin >> s;
ll cnt = 0;
for(int i = 1; i < s.size(); i++){
if(s[i - 1] != s[i]) cnt++;
}
cout << cnt << endl;
} | #include<iostream>
#include<queue>
#include<cmath>
using namespace std;
class vec {
public:
double x;
double y;
vec(double nx, double ny) :x{nx}, y{ny} {}
};
class segment {
public:
vec start;
vec end;
segment(vec start, vec end) :start{start}, end{end} {}
};
vec operator+(vec v1, vec v2) {
return vec(v1.... | 0 | 78,142,956 |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int MAX = 105;
int main() {
int X, N;
cin >> X >> N;
if (N == 0) {
cout << X << endl;
return 0;
}
vector<int> cnt(MAX);
for (int i = 0; i < N; i++) {
int x;
cin >> x;
cnt[x]++;
}
int ans;
int y = 200;
for (int i = 0; ... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int INF_INT = 1e9;
template<class T> inline bool chmin(T& a, T b){
if(a > b){
a = b;
return true;
}
return false;
}
template<class T... | 0 | 37,124,711 |
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
int main(){
int N, M;
cin >> N >> M;
set<int> E[N];
rep(i, M){
int a, b;
cin >> a >> b;
a--; b--;
E[a].insert(b);
E[b].insert(a);
}
int A[N], ans = 0;
rep(i, N) A... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<... | 0 | 13,276,179 |
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
int main() {
ll A,B,C,D;
cin>>A>>B>>C>>D;
if(B<=C||D<=A) {
cout<<0<<endl;
return 0;
}
vector<ll> vec(4);
vec[0]=A;
vec[1]=B;
vec[2]=C;
vec[3]=D;
sort(all(vec));
cout<<vec[2]-vec[1]<<endl;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x;
int main()
{
int n,k,i,j;
cin>>x;
if(x<=599)
cout<<8<<endl;
else if(x<=799)
cout<<7<<endl;
else if(x<=999)
cout<<6<<endl;
else if(x<=1199)
cout<<5<<endl;
else if(x<=1399)
cout<<4<<endl;
else if(x<=1599)
cout<<3<<endl;
else if(x<=17... | 0 | 76,773,359 |
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>
#define rep(i,n) for (int i = 0;... | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()
struct UnionFind{
vec... | 0 | 89,102,668 |
#include <bits/stdc++.h>
#define INF 1e7
#define dsec 86400
using namespace std;
typedef long long int ll;
typedef tuple<int,int,int> tii;
typedef tuple<long long int,long long int,long long int> tll;
typedef tuple<double,double,double> tdd;
int main()
{
ll N; cin >> N;
cout << N*(N-1)/2 << endl;
} | #include <iostream>
using namespace std;
using ll = long long;
const ll MOD = 1e9+7;
ll powMod(ll a, ll p, ll mod){
if(p==1) return a;
if(p%2) return (a*powMod(a, p-1, mod))%mod;
ll t = powMod(a, p/2, mod);
return (t*t)%mod;
}
int main(){
ll x,y,m,n,k,pre=1,cnt=1;
cin >> ... | 0 | 67,985,542 |
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main(){
string s;
int N;
char bot[10][20]={"0",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
int count=0,flag=0;
while(cin>>N){
for(int i=0;i<N;i++){
count=0;
s.clear();
cin>>s;
for(int j=... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;
int main(){
int n, m;
cin >> n >> m;
vector<int> broken(n+1);
rep(i,m){
int a;
cin >> a;
broken[... | 0 | 91,485,026 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
const int N = 200005;
const ll mod = 2000000011;
#define ld long double
#define PI 3.14159265358979323846
const int INF = 10000000;
void flash()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cout.setf... | #include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod 1000000007
#define FT() int t; scanf("%d",&t); while(t--)
#define pb push_back
#define nl printf("\n")
#define fi(i,start,end) for(int i=start; i < (int)end ; ++i)
#define ip(n) scanf("%d",&n)
#defi... | 0 | 38,760,143 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans) cout << ans << endl;
double kaijyo(int n){
int k(1);
for(int i=n;i>0;i--){
k *= i;
}
return k;
}
double distance(int x[],int y[],int i,int j){
int dx = (x[i] - x[j]) ... | #include <bits/stdc++.h>
using namespace std;
struct Fast {
Fast() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
}
} fast;
template <typename A, size_t N, typename T> void Fill(A (&array)[N], const T& val) {
std::fill((T*)array, (T*)(array + N), val);
... | 0 | 92,027,788 |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n & 1) cout << (n + 1) / 2 - 1 << '\n';
else cout << n / 2 - 1 << '\n';
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;
int main(){
string s; cin>>s;
int ans=0;
while(s.size()>1){
char f=s.front(),b=s.back();
if(f==b... | 0 | 41,563,849 |
#include <iostream>
#include <cmath>
bool checkInputParameter(const int& val, bool isCircle) {
if(isCircle) {
if ((-100 <= val) && (val <= 100)) {
return true;
}
return false;
}
if ((0 < val) && (val <= 100)) {
return true;
}
return false;
}
int main(int a... | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;i++)
int zeta(int a,int b){
if(a>=b) return a-b;
else return b-a;
}
int main(){
int h1,h2,m1,m2,k;
cin>>h1>>m1>>h2>>m2>>k;
int len=(h2-h1)*60+(m2-m1);
int ans=0;
ans=len-k;
cout<<ans<<endl;
return 0;
} | 0 | 47,412,540 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
co... | #pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include... | 0 | 78,248,323 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int W, H, x, y;
cin >> W >> H >> x >> y;
double ans = (double)W * H / 2;
cout << fixed << setprecision(15);
cout << ans << " " << (x * 2 == W && y * 2 == H) << endl;
} | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int base = 400;
int answer =8;
for(int g=0;g<8;g++)
{
base = base + 200;
if(n<base)
{
break;
}
answer --;
}
cout<<answer<<endl;
} | 0 | 26,428,221 |
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
double a, b, C;
cin >> a >> b >> C;
double S, L, h;
S = a*b/2*sin(C*M_PI/180);
L = a + b + sqrt(a*a+b*b-2*a*b*cos(C*M_PI/180));
h = 2*S/a;
cout << fixed << setprecision(10) << S << endl
<< L << endl
<< h <... | #include<iostream>
#include<vector>
#include<string>
#include<map>
using ll = long long;
int main(){
ll n;
std::cin >> n;
std::map<ll, ll, std::greater<ll>> mp;
for(int i = 0; i < n; i++){
ll a;
std::cin >> a;
mp[a]++;
}
std::vector<ll> ans;
for(auto m : mp){
... | 0 | 73,180,568 |
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
char number[1001]; ... | #include<bits/stdc++.h>
using namespace std;
int n,k;
const int INF = numeric_limits<int>::max();
int h[100005];
int dp[200005];
int main(){
cin>>n>>k;
for(int i=1; i<=n; i++) cin>>h[i];
for(int i=1; i<=n; i++) dp[i] = INF;
dp[1] = 0;
for(int i=1; i<=n; i++){
for(int j=1; j<=k; j++){
dp[i+j] = min(dp[i+j],abs... | 0 | 34,151,521 |
#include <bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
... | #include<bits/stdc++.h>
using namespace std;
#define O_O ios_base::sync_with_stdio(0); cin.tie(NULL)
#define endl '\n'
#define PI acos(-1.0)
#define CASE(n) cout << "Case " << n << ": "
#define CASE_(n) cout << "Case " << n << endl
#define FIXED(n) cout << fixed << setprecision(n)
#define MOD 1000000007
inline void nor... | 0 | 70,348,965 |
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostr... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, n, cont;
cin >> N;
while (true) {
cont=0;
n=N;
while (n>=10) {
if (n%10==n%100/10) {
n/=10;
continue;
}
cont=1;
break;
}
if (cont==0) {break;}
N++;
}
cout << N << endl;
} | 0 | 35,717,226 |
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
#define vec(s) vector<s>;
#define vvec(s) vector<vector<s>> ;
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YN(x) cout<<(... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
const double pi = 3.141592653589793238462643383279;
const int INF = 1000000000;
const ll LINF = 100000000000000000;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZABC";
const string abc = "abcdefghijkl... | 0 | 91,332,757 |
#include<stdlib.h>
#include<stdio.h>
int compare(const void* s,const void *t ){
return (*((int*)t) - *((int*)s));
}
int main(){
int height[10];
int i=0;
while(~scanf("%d",&height[i++]));
qsort(height, 10, sizeof(height[0]), compare );
for( i = 0; i < 3 ; i++ )
printf("%d\n",height[i]);
return 0;
} | #pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
using namespace std;
#include <bits/stdc++.h>
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb(X) push_back(X)
#define x first
#define y second
#define all(x) (x).begin(), (x).end()
#define INIT std::ios:... | 0 | 54,238,526 |
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <deque>
#include <map>
#include <set>
#include <complex>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <chrono>
#define ft first
#define sc second
#define pb push_back
#define len(v) (in... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI acos(-1)
#define vi vector<int>
#define pi pair<int, int>
#define pl pair<ll, ll>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is... | 0 | 68,773,378 |
#include <iostream>
int main()
{
while(1) {
int H,W;
std::cin >> H >> W;
if (H == 0 && W == 0){
break;
}
for (int j = 0; j < H; j++) {
for (int i = 0; i < W; i++) {
if (j == 0 || j == H - 1) {
std::cout << "#";
... | #include <bits/stdc++.h>
#define nl '\n'
using namespace std;
typedef long long ll;
void solve() {
int n, k;
cin >> n >> k;
int p[n], c[n];
for (int& i : p) {
cin >> i;
i--;
}
for (int& i : c)
cin >> i;
ll ans = -1e9 - 1;
for (int i = 0; i < n; i++) {
int square = i, cycleSize = 0;
l... | 0 | 41,998,661 |
#include <stdio.h>
#include <queue>
using namespace std;
int main(){
int temp;
priority_queue<int> q;
char a[1000];
while(1){
scanf("%s",a);
if(a[2]=='d')return 0;
scanf("%d",&temp);
if(a[2]=='s'){
q.push(temp);
}
if(a[2]=='t'){
printf("%d\n",q.top());
q.pop();
}
}
} | #include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
const double pi = 3.141592653589793238462643383279;
const int INF = 1000000000;
const ll LINF = 100000000000000000;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZABC";
const string abc = "abcdefghijkl... | 0 | 90,135,814 |
#include<cmath>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
long long x,y;
scanf("%lld%lld",&x,&y);
if(abs(x-y)<=1) puts("Brown");
else puts("Alice");
} | #include <bits/stdc++.h>
using namespace std;
int A[3][3];
int is_bingo(){
int i,j;
for(i=0;i<3;i++){
if(A[i][i]!=0)break;
if(i==2)return 1;
}
for(i=0;i<3;i++){
if(A[i][2-i]!=0)break;
if(i==2)return 1;
}
for(i=0;i<3;i++){
for(j=0;j<3;j++){
if(A... | 0 | 85,240,159 |
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <set>
#include <map>
#include <iterator>
#include <stack>
#include <string.h>
#include <cstdlib>
#include <queue>
#include <list>
#include <string>
using names... | #include <iostream>
#include <vector>
using namespace std;
const int MAX_N = 200000;
int n, m;
vector<vector<int>> G(MAX_N);
bool used[MAX_N];
int dfs(int v) {
used[v] = true;
int d = 1;
for (int i = 0; i < G[v].size(); i++) {
int next = G[v][i];
if (!used[next]) {
d += dfs(next);
}
}
retu... | 0 | 36,992,588 |
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <ctype.h>
#include <stdlib.h>
#include <map>
using namespace std;
int main()
{
int K;
cin >> K;
string S;
cin >> S;
if (S.length() <= K) {
cout << S << endl;
}
else {
string ans = "";
for (int i = 0; i < ... | #include<stdio.h>
#define MAX 100005
#define NIL -1
struct Node {int p,l,r;};
struct Node T[MAX];
int n,D[MAX],H[MAX];
void print(int u){
int i,c;
printf("node %d: ",u);
printf("parent = %d, ",T[u].p);
printf("depth = %d, ",D[u]);
if(T[u].p==NIL)printf("root, ");
else if(T[u].l==NIL)printf("leaf, ");
else... | 0 | 62,718,848 |
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1001001001;
const int mod = 1000000007;
ll pow(ll base, ll order) {
ll ans = 1;
rep(i,order - 1) ans *= base;
return ans;
}
int gcd(int a, int b) {
if (a < b) {
int c = a;
a = b;
... | #include <stdio.h>
using namespace std;
int main(void) {
int sum;
while (scanf("%d", &sum)+1) {
int count = 0;
int a = 0;
int b = 0;
int c = 0;
int d = 0;
for (a = 0; a <= 9; a++) {
for (b = 0; b <=9; b++) {
for (c = 0; c <= 9; c++) {
for (d = 0; d <= 9; d++) {
... | 0 | 70,808,705 |
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<util... | #include<bits/stdc++.h>
using namespace std;
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#de... | 0 | 99,106,054 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;
cin >> n >> k;
vector<int> a(n+1);
for ( int i=0; i<n; i++ ) {
cin >> a[i];
}
for ( int i=0; i<k; i++ ) {
vector<int> b(n+1);
for ( int i=0; i<n; i++ ) {
int l=max(0,i-a[i]);
int r... | #include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
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; } retu... | 0 | 37,836,727 |
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
int64_t MOD=10000007;
int main() {
int64_t H,W;
cin>>H>>W;
int64_t a=H*W;
if(a%2==0)a/=2;
else a=(a+1)/2;
if(H!=1&&W!=1)cout<<a;
else cout<<1;
} | #include <stdio.h>
int main(void) {
int a;
while (scanf("%d", &a) != EOF) {
int count = 0;
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
for (int k = 0; k < 10; k++) {
for (int l = 0; l < 10; l++) {
if (a == i + j + k + l) count++;
}
}
}
}
printf("%d\n", count);
... | 0 | 99,845,410 |
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;
int calc(int ab, int b, int a) {
int ret = 0;
if (ab) {
ret += ab - 1;
ab = 1;
}
if (ab && b) {
b--... | #include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
int main(){
int A,B,K;cin>>A>>B>>K;
REP(i,K){
if(i&1){
if(B&1) B--;
A+... | 0 | 86,107,655 |
#include <iostream>
#include <cmath>
#include <cstdio>
constexpr double PI = 3.14159265359;
using namespace std;
int main(){
ios::sync_with_stdio(false);
double a, b, C;
cin >> a; cin >> b; cin >> C;
double h = b * sin(PI * C / 180);
double S = 0.5 * a * h;
double hoge = a - b * cos(C * PI / 180);
double ... | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int V, E;
vector<int> G[10010];
vector<int> ans;
int indeg[10010];
bool used[10010];
void bfs(int s) {
queue<int> que;
que.push(s);
used[s] = true;
while (!que.empty()) {
int u = que.front(); que.pop();
ans.push_... | 0 | 1,434,570 |
#include<bits/stdc++.h>
using namespace std;
int main()
{
char ch;
cin>>ch;
if(ch=='A')
cout<<'T'<<endl;
else if(ch=='T')
cout<<'A'<<endl;
else if(ch=='C')
cout<<'G'<<endl;
else if(ch=='G')
cout<<'C'<<endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
typedef long double ld;
#define rep(i,a,b) for(ll i=a ; i<b ; i++... | 0 | 18,307,718 |
#include <bits/stdc++.h>
using namespace std;
int solve(int n) {
int cnt = 0;
while (n%2==0) {
n /= 2;
cnt++;
}
return cnt;
}
int main() {
int n, check=0,out=1;
cin >> n;
for (int i = 1; i <= n; i++) {
if (check != max(check, solve(i))) {
out = i;
check = ... | #include<bits/stdc++.h>
using namespace std;
const int max_n=2e5+10;
int p[max_n];
int cnt[max_n];
int find(int x) {
if (p[x] != x) p[x] = find(p[x]);
return p[x];
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; ++i) {p[i] = i,cnt[i]=1... | 0 | 16,233,348 |
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i < n; i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define all_acc(x) (x).begin(), (x).end(), 0LL
#define int long long
#define double long double
#define absSort(v) sort(a.begin(), a.end(), [](int i, int j) -> bool {... | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
ll a,b,c,k,sum=0;
cin>>a>>b>>c>>k;
if(k<=a){
cout<<k<<endl;
}
else{
sum+=a;
k-=a;
if(k<=b){
cout<<sum<<endl;
}
else{
k-=b;
cout<<sum-min(k... | 0 | 99,299,134 |
#define rep(i,n) for (int i=0;i<n;i++)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll N,M;
cin >> N >> M;
if(N>=2 && M>=2){
cout << (N-2)*(M-2) << endl;
}else if(N==1 && M!=1){
cout << M-2 << endl;
}else if(N!=1 && M==1){
cout << N-2 << endl;
}else{
cout <... | #pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using vi = vector<int>;
constexpr char newl = '\n'... | 0 | 59,694,619 |
#include <iostream>
#include <string>
using namespace std;
int main(){
int a[101]={0},b,i,saihin[100]={0},c=0,saidai=0;
while(cin>>b){
a[b]=a[b]+1;
}
for(i=1;i<=100;i++){
if(saidai<a[i]){
saidai=a[i];
}
}
for(i=1;i<=100;i++){
if(a[i]==saidai){
... | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vecto... | 0 | 38,134,640 |
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>... | #include <iostream>
#include <vector>
static void rec(int bit, int prev, int sum, int R, const std::vector<int>& r,
const std::vector<std::vector<int>>& G,
const std::vector<std::vector<int>>& memo,
int& min)
{
if (bit == ((1 << R) - 1)) {
if (min == -1) {
min = sum;
} else {... | 0 | 22,094,343 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
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,... | #include <bits/stdc++.h>
using namespace std;
void my_dbg() { cout << endl; }
template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B)
{ cout << ' ' << A; my_dbg(B...); }
#define dbg(...) cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)
#define scn(n) scanf("%d", &n)
#define lscn(n) scanf("%lld"... | 0 | 69,884,222 |
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <bitset>
#include <math.h>
typedef long long ll;
typedef unsigned long long ull;
#define vi std::vector<int>
#define vl std::vector<ll>
#define floop(n) for(int i = 0; i < n; ++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<ll,ll>;
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_elemen... | 0 | 22,306,714 |
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int ans[100010];
vector <int> v[100010];
int main(){
int n;
while(cin>>n){
ll tmp=1;
memset(ans, -1, sizeof ans);
ans[1]=2;
for(int i=3; tmp<100010; ++i... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repn(i,n) for(int i = 0; i <= (int)(n); i++)
#define srep(i,l,n) for(int i = l; i < (int)(n); i++)
#define srepn(i,l,... | 0 | 66,823,185 |
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end... | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
using namespace std;
typedef long long ll;
vector<ll> node[100005];
bool used[100005]={false};
ll grundy(ll pos){
ll cnt=0;
for(int i=0;i<node[pos].size();i++){
ll to=node[pos][i];
if(!used[to]) cnt++;
}
if(cnt==0) ... | 0 | 84,675,579 |
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define debug freopen("in.txt","r",stdin),freopen("out.txt","w",stdout);
#define pb push_back
#define all(x) x.begin(),x.end()
#define fs first
#define sc second
using namespace std;... | #include "algorithm"
#include "iostream"
#include "numeric"
#include "queue"
#include "set"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
using namespace std;
typedef long long ll;
template <typename T>
using V = vector<T>;
using VL = V<ll>... | 0 | 5,202,986 |
#include <stdio.h>
int main(){
int n,j, i=0;
int set[12000] = { 0};
while (1){
scanf("%d", &set[i]);
if (set[i] == 0){
break;
}
i++;
}
for (j = 0; j < i; j++){
printf("Case %d: %d\n", j+1, set[j]);
}
return 0;
} | #include <bits/stdc++.h>
#include <vector>
using namespace std;
typedef long long ll;
const ll MAX = 110000;
const ll 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 (... | 0 | 61,848,785 |
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b)... | #include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
#include <cmath>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
const ll INF =1001001001;
ll gcd(ll a, ll b){
if (a%b==0){
return(b);
}else{
... | 0 | 24,227,933 |
#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 INF 2e9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
int main()
{
l... | #include<bits/stdc++.h>
using namespace std;
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout<<fixed; cout<<setprecision(12);
#define randomINT mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define newl cout<<"\n"
#define DISP(as) for(auto it : as) cout<<it<<" ";n... | 0 | 40,231,696 |
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int count0=0, count1=0;
for(int i=0; i<s.size(); i++){
if(s.at(i)=='0') count0++;
if(s.at(i)=='1') count1++;
}
cout << 2*min(count0,count1) << endl;
} | #include<bits/stdc++.h>
using namespace std;
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define ff first
#define ss second
#define int long long
#define pb emplace_back
#define mp make_pair
#define pii pair<int,int>
#define v... | 0 | 83,024,281 |
#include<bits/stdc++.h>
using namespace std;
int main ()
{
char s[2];
cin>>s;
s[0]++;
cout<<s<<endl;
} | #include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll INF=1000000010;
const ll MOD=1000000007;
const ll LINF=4000000000000000000;
const long double EPS=1e-9;
typedef pair<int,int> P;
int main(){
int n;cin>>n;
ll ans=0;
int s=2;
for(int i=0;i<n;i++){... | 0 | 89,206,236 |
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;
int main() {
ll A, B;
cin >> A >> B;
ll ans = 0;
f... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
int main(){
ll N, D, A;
cin >> N ... | 0 | 49,672,691 |
#include <iostream>
#include <numeric>
#include <algorithm>
using namespace std;
int main(){
int n;
while(cin >> n && n > 0){
int lst[n];
for(int i=0;i<n;i++){
cin >> lst[i];
}
int max;
max = lst[0];
for(int i=1;i<n;i++){
if(max < lst[i]){
... | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
using namespace std; using ll = long long; using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using ... | 0 | 84,279,505 |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif
void d_err() {
cerr << endl;
}
template <typename H, typename... T>
void d_err(H h, T... ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define eb emplace_back
#defi... | 0 | 86,335,355 |
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N,M,answer=0;
cin >> N >> M;
long long x[N],y[N],z[N],X[N];
for (int i = 0; i < N; i++) {
cin >> x[i] >> y[i] >> z[i];
}
for (int n = 0; n < 8; n++) {
for (int i = 0; i < N; i++) {
int m = n;
if (m%2) {
X[i] = x... | 0 | 62,417,112 |
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#de... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
bool is_square(int n)
{
for (int i = 0; i <= n; i++)
{
if (i * i == n)
{
return true;
}
}
return false;
}
double distance(double x1, double y1, double x2, double y2)
{
return sqrt((x1 - x2) * (x1 -... | 0 | 2,769,869 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.