akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;

int main(void){
  int x, y, z;
  cin >> x >> y >> z;

  cout << (x-z)/(y+z) << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;

int main(){
    long long n;
    cin >> n;
    vector<long long> h(n);
    vector<long long> zero(n, 0);
    for(long long i = 0; i < n; i++) cin >> h[i];

    long long i = 0;
    long long cnt = 0;
    while(1){
        if(h == zero) break;
        
        if(h[i] != 0){
            long long start = i;
            long long minv = 100;
            while(i < n and h[i] != 0){
                minv = min(minv, h[i]);
                i++;
            }
            cnt += minv;
            long long goal = i-1;
            for(long long j = start; j <= goal; j++) h[j] -= minv;
            i = 0;
        }
        else{
            i++;
        }
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3632
x1, y1, x2, y2 = map(int, input().split())
ans = ('U'*(y2-y1),'R'*(x2-x1+1),'D'*(y2-y1+1),
      'L'*(x2-x1+1),'U','L','U'*(y2-y1+1),
      'R'*(x2-x1+1),'D'*(y2-y1+1),'L'*(x2-x1))
print(''.join(ans))

Measured memory_bytes: 3060
#include <iostream>
#include <string>
using namespace std;

int main(void){
  int a, b, k, t = 0;
  cin >> a >> b >> k;
  while(k > 0){
    if(t == 0){
      if(a % 2 != 0) a--;
      a /= 2;
      b += a;
      t++;
    }else{
      if(b % 2 != 0) b--;
      b /= 2;
      a += b;
      t--;
    }
    k--;
  }
  cout << a << " " << b << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N; cin >> N;
  vector<int> B(N);
  
  for(int i = 0; i < N; ++i){
    cin >> B.at(i);
  }
  
  int res = B.at(0) + B.at(N-2);
  
  for(int i = 0; i < N-2; ++i){
    res += min(B.at(i), B.at(i+1));
  }
  
  cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long int d,t,s;
    cin>>d>>t>>s;
    long long int x= t*s;
    if(x>=d)cout<<"Yes";
    else cout<<"No";
return 0;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lower_bound lowb
#define upper_bound upb
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a*b/gcd(a,b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	int a = n / 100;
	int b = n % 100;

	if(b > 5 * a) cout << 0 << endl;
	else cout << 1 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    char b; cin >> b;
    if (b == 'A')
        cout << 'T' << "\n";
    else if (b == 'C')
        cout << 'G' << "\n";
    else if (b == 'G')
        cout << 'C' << "\n";
    else
        cout << 'A' << "\n";
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int a[52][52];
int sima(int i,int j,int k){
	if(a[i-1][j-1] == 1){
		a[i-1][j-1] = k;
		sima(i-1,j-1,k);
	}
	if(a[i-1][j] == 1){
		a[i-1][j] = k;
		sima(i-1,j,k);
	}
	if(a[i-1][j+1] == 1){
		a[i-1][j+1] = k;
		sima(i-1,j+1,k);
	}
	if(a[i][j-1] == 1){
		a[i][j-1] = k;
		sima(i,j-1,k);
	}
	if(a[i][j+1] == 1){
		a[i][j+1] = k;
		sima(i,j+1,k);
	}
	if(a[i+1][j-1] == 1){
		a[i+1][j-1] = k;
		sima(i+1,j-1,k);
	}
	if(a[i+1][j] == 1){
		a[i+1][j] = k;
		sima(i+1,j,k);
	}
	if(a[i+1][j+1] == 1){
		a[i+1][j+1] = k;
		sima(i+1,j+1,k);
	}
}

int main() {
	int w,h,k;
	while(1){
		for(int i = 0;i < 52;i++){
			for(int j = 0;j < 52;j++){
				a[i][j] = 0;
			}
		}
		cin >> w >> h;
		if(w == 0)break;
		for(int i = 1;i <= h;i++){
			for(int j = 1;j <= w;j++){
				cin >> a[i][j];
			}
		}
		k = 2;
		for(int i = 1;i <= h;i++){
			for(int j = 1;j <= w;j++){
				if(a[i][j] == 1){
					sima(i,j,k);
					k++;
				}
			}
		}
		cout << k-2 <<endl;
	}
	return 0;
}

Measured memory_bytes: 1424
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
    int N;
    int ans = 0;
    cin >> N;
    map<int, int> count;
    for (int i = 0; i < N; ++i)
    {
        int a;
        cin >> a;
        ++count[a];
    }
    for (auto i = count.begin(); i != count.end(); ++i)
    {
        if (i->second % 2 == 1)
        {
            ++ans;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 8240
#include<bits/stdc++.h>
using namespace std;
#define nl printf("\n");

int main()
{
// #ifndef ONLINE_JUDGE
//   freopen("input.txt","r",stdin);
// #endif
    int n;
    cin>>n;
    string s,t;
    cin>>s>>t;
    for(int i = 0 ;i<n;i++)
    {
      cout<<s[i]<<t[i];
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int LL;
typedef unsigned long long int ULL;
using namespace std;

// 插入此處

LL pow5(LL x) {
    return x * x * x * x * x;
}

int main() {
    LL x;
    scanf("%lld", &x);
    map<LL, LL> m;
    for (int i = -1000; i <= 1000; i++) {
        m[pow5(i)] = i;
    }
    LL A, B;
    for (int i = -1000; i <= 1000; i++) {
        if (m.count(x + pow5(i))) {
            B = i, A = m[x + pow5(i)];
            break;
        }
    }
    printf("%lld %lld\n", A, B);
}


Measured memory_bytes: 3908
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <chrono>
#include <random>
#include <tuple>
#include <utility>
#include <fstream>
#include <complex>

const long INF = (1l << 30);
const long LINF = (1l << 60);

long n;
long p[200005];
long min = LINF;
long ans = 0;

int main(){
    scanf("%ld", &n);
    for(int i = 0; i < n; i++){
        scanf("%ld", &p[i]);
        if(p[i] <= min){
            ans++;
            min = p[i];
        }
    }
    printf("%ld\n", ans);
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string a;
    int i;
    cin>>a;
    for(i=0; i<4; i++)
    {
        cout<<a[i];

    }
    cout<<" ";
    for(i=4; i<12; i++)
    {
        cout<<a[i];

    }
    a[12]='\n';
    cout<<endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N; cin >> N;
  int A[300000];
  for(int i=0; i<3*N; i++){
    cin >> A[i];
  }
  sort(A,A+3*N);
  long long result=0;
  for(int i=0; i<N; i++){
    result+=(long long)(A[N+2*i]);
  }
  cout << result << endl;
}

Measured memory_bytes: 1408
#include<stdio.h>
int main(){
	int x,a[100],cnt=0;
	scanf("%d",&x);
	for(int i=1;i<=x;i++){
		scanf("%d",&a[i]);
	}
	for(int i=1;i<=x;i++){
		if(a[i]%2==1 && i%2==1){
			cnt++;
		}
	}
	printf("%d",cnt);
	return 0;
} 

Measured memory_bytes: 2152
#define _USE_MATH_DEFINES  
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>

using namespace std;

class Point{
public:
    double x;
    double y;

    void print(){
        cout << setprecision(9) << x << " " << y << endl;
    }
};

void kock(int n, Point p1, Point p2){
    if(n == 0){
        return;
    }

    Point s;
    Point t;
    Point u;

    s.x = (2*p1.x + p2.x) / 3;
    s.y = (2*p1.y + p2.y) / 3;

    t.x = (p1.x + 2*p2.x) / 3;
    t.y = (p1.y + 2*p2.y) / 3;

    double cos60 = cos(M_PI / 3);
    double sin60 = sin(M_PI / 3);

    u.x = (t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x;
    u.y = (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y;

    kock(n-1, p1, s);
    s.print();
    kock(n-1, s, u);
    u.print();
    kock(n-1, u, t);
    t.print();
    kock(n-1, t, p2);
};

int main(){
    int n;
    cin >> n;

    Point begin = {0,0};
    Point end = {100,0};

    begin.print();

    kock(n,begin,end);

    end.print();

    return 0;
}


Measured memory_bytes: 3240
#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 N;
  ll K;
  cin >> N >> K;
  vector<ll> d(K);
  set<ll> s;
  for (int i = 0; i < K; i++) {
    cin >> d[i];
    s.insert(d[i]);
  }
  for (int i = N; i < 100000; i++) {
    int x = i;
    bool flag = true;
    while (x > 0) {
      if (s.count(x % 10)) {
        flag = false;
        break;
      }
      x /= 10;
    }
    if (flag) {
      cout << i << endl;
      break;
    }
  }
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
#include "atcoder/all"
using namespace std;
using namespace atcoder;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////
using mint = modint998244353;
void solve(){
    ll n,m;
    cin >> n >> m;
    vector<mint> a(n,0),b(m,0);
    rp(i,n){
        int aa;
        cin >> aa;
        a[i] += aa;
    }
    rp(i,m) {
        int bb;
        cin >> bb;
        b[i] += bb;
    }
    vector<mint> c = convolution(a,b);
    for(auto& ci:c){
        princ(ci.val());
    }
    cout << endl;
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 19040
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <cassert>

#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
typedef long long int ll;
const int INF = 1000000000;
const double PI = acos(-1);
const ll mod = 1000000007;

int main()
{
    ll n;
    cin >> n;

    if (n % 2 != 0) {
        cout << 0 << endl;
        return 0;
    }
    ll ans = 0;
    ll den = 10;
    while (den <= n) {
        ans += n / den;
        den *= 5;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <vector>

int main() {
  int n;
  std::cin >> n;

  std::vector<int> d(n);
  for (auto&& di : d) std::cin >> di;

  int dsum = 0;
  int sum = 0;
  for (int i = n - 2; i >= 0; --i) {
    dsum += d[i + 1];
    sum += dsum * d[i];
  }

  std::cout << sum << std::endl;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val xs = readLine()!!.split(' ').map { it.toLong() }

    var min = Long.MAX_VALUE

    for (p in 1L..100L) {
        min = Math.min(xs.map { x -> (x - p).let { it * it } }.sum(), min)
    }

    println(min)
}


Measured memory_bytes: 36388
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int n = a -b;

        if (c - n > 0) {
            System.out.println(c - n);
        } else {
            System.out.println(0);
        }
    
    }
}

Measured memory_bytes: 22868
#include<bits/stdc++.h>
using namespace std;

int main(){
	int n;
	cin >> n;
	int b, f, r, v;
	int house[4][3][10];
	for(int i = 0; i < 4; i++){
		for(int j = 0; j < 3; j++){
			for(int k = 0; k < 10; k++){
				house[i][j][k] = 0;
			}
		}
	}
	for(int i = 0; i < n; i++){
		cin >> b >> f >> r >> v;
		b--;
		f--;
		r--;
		house[b][f][r] += v;
	}

	for(int i = 0; i < 4; i++){
		for(int j = 0; j < 3; j++){
			for(int k = 0; k < 10; k++){
				cout << " " << house[i][j][k];
			}
			cout << endl;
		}
		if(i < 3){
			for(int j = 0; j < 20; j++)cout << "#";
			cout << endl;
		}	
	}
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  int m;
  cin>>m;
  int ans=24-m+24;
  cout(ans);
  return 0;
}

Measured memory_bytes: 125568
<?php
$n = intval(fgets(STDIN));
$lArray = array_map("intval", explode(" ", trim(fgets(STDIN))));
sort($lArray);
//echo implode(" ", $lArray),"\n";
$map = [];
for($i = 1; $i <= 2000; $i++){
  $map[$i] = 0;
}
foreach($lArray as $l){
  $map[$l]++;
}
$sum = 0;
for($i = 1; $i <= 2000; $i++){
  $sum+=$map[$i];
  $accum[$i] = $sum;
}

$c = 0;
for($i = 0; $i < $n - 1; $i++){
  for($j = 0; $j < $i; $j++){
    $add = $accum[$lArray[$i] + $lArray[$j] - 1] - ($i + 1);
    $c+=max(0,$add);
//    echo "i=$i j=$j {$lArray[$i]} {$lArray[$j]} ".($lArray[$i]+$lArray[$j])."  add=$add\n";
  }
}
echo $c;


Measured memory_bytes: 4604
N = int(input())
D, X = map(int, input().split())
a = [int(input()) for i in range(N)]

ans = 0
for i in range(N):
    for j in range(D):
        if 1 + a[i] * j <= D:
            # print(1 + a[i] * j)
            ans += 1
        else:
            break
print(ans + X)

Measured memory_bytes: 3060
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;

class Node {
public:
  int location;
  int p, l, r;
  Node() {}
};

class Point {
public:
  int id, x, y;
  Point() {}
  Point(int id, int x, int y): id(id), x(x), y(y) {}
  bool operator < ( const Point &p) const {
    return id < p.id;
  }

  void print() {
    printf("%d\n", id);
  }
};

static const int MAX = 1000000;
static const int NIL = -1;

int N;
Point P[MAX];
Node T[MAX];
int np;

bool lessX(const Point &p1, const Point &p2) { return p1.x < p2.x; }
bool lessY(const Point &p1, const Point &p2) { return p1.y < p2.y; }

int makeKDTree(int l, int r, int depth) {
  if ( !(l < r) ) return NIL;
  int mid = ( l + r ) / 2;
  int t = np++;
  if ( depth % 2 == 0 )
    sort(P + l, P + r, lessX);
  else
    sort(P + l, P + r, lessY);
  T[t].location = mid;
  T[t].l = makeKDTree(l, mid, depth + 1);
  T[t].r = makeKDTree(mid + 1, r, depth + 1);

  return t;
}

void find(int v, int sx, int tx, int sy, int ty, int depth, vector<Point> &ans ) {
  int x = P[T[v].location].x;
  int y = P[T[v].location].y;

  if ( sx <= x && x <= tx && sy <= y && y <= ty )
    ans.push_back(P[T[v].location]);

  if ( depth % 2 == 0 ) {
    if ( T[v].l != NIL )
      if ( sx <= x ) find(T[v].l, sx, tx, sy, ty, depth + 1, ans);
    if ( T[v].r != NIL )
      if ( x <= tx ) find(T[v].r, sx, tx, sy, ty, depth + 1, ans);
  } else {
    if ( T[v].l != NIL )
      if ( sy <= y ) find(T[v].l, sx, tx, sy, ty, depth + 1, ans);
    if ( T[v].r != NIL )
      if ( y <= ty ) find(T[v].r, sx, tx, sy, ty, depth + 1, ans);
  }
}

int main() {
  int x, y;
  scanf("%d", &N);
  for ( int i = 0; i < N; i++ ) {
    scanf("%d %d", &x, &y);
    P[i] = Point(i, x, y);
    T[i].l = T[i].r = T[i].p = NIL;
  }

  np = 0;

  int root = makeKDTree(0, N, 0);

  int q;
  scanf("%d", &q);
  int sx, tx, sy, ty;
  vector<Point> ans;
  for ( int i = 0; i < q; i++ ) {
    scanf("%d %d %d %d", &sx, &tx, &sy, &ty);
    ans.clear();
    find(root, sx, tx, sy, ty, 0, ans);
    sort(ans.begin(), ans.end());
    for ( int j = 0; j < ans.size(); j++ )
      ans[j].print();
    printf("\n");
  }

  return 0;
}




Measured memory_bytes: 15856
#include <iostream>
#include <iostream>
#include <string.h>
#include <vector>
#include <queue>
#include <cstdio>
#include <math.h>
#include <map>
#include <algorithm>
#include <deque>
#include <stack>
#include<set>
//#include <bits/stdc++.h>
#define lson l,mid,rt<<1

#define rson mid+1,r,rt<<1|1

const int N=1e5+100;
using namespace std;

typedef long long ll;
const int inf=0x3f3f3f3f;

vector<int>ve[N];
int dis[N];
int vis[N];
int in[N],out[N];
int n,m,st;
int ans=0;
queue <int>q;
int tp()
{
    while(q.size()){
        int k=q.front();q.pop();
        for(auto v:ve[k]){
            in[v]--;
            if(!in[v]) {
             q.push(v);
             dis[v]=dis[k]+1;
             ans=dis[v];
            }
        }
    }
    return ans;
}
int main()
{
    scanf("%d%d",&n,&m);
    int x,y;
    for(int i=1; i<=m; i++){
        scanf("%d%d",&x,&y);
        ve[x].push_back(y);
        out[x]++,in[y]++;
    }
    for(int i=1;i<=n;i++)
         if(!in[i]) q.push(i);
    cout<<tp()<<endl;
    return 0;
}


Measured memory_bytes: 6912
#include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
	#define DBG(X) cout << #X << "=" << (X) << '\n';
	#define SAY(X) cout << (X) << '\n';
#else
	#define DBG(X)
	#define SAY(X)
#endif
 
using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld  = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF  = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for(auto el: v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for(auto& elem: ret) cin >> elem; return ret; }

int check(int n, ll k, vector<ll> A, vector<ll> F, ll mx) {
	for(int i = 0; i < n; ++i) {
		ll temp = mx / F[i];

		if(A[i] > temp) {
			ll take = A[i] - temp;

			if(take > k) {
				return 0;
			}

			k -= take;
		}
	}

	return 1;
}

void solve() {
	int n = fetch<int>();
	ll k = fetch<ll>();

	auto A = fetch_vec<ll>(n);
	auto F = fetch_vec<ll>(n);

	sort(A.begin(), A.end());
	sort(F.rbegin(), F.rend());

	ll low = 0, high = LL_INF;

	if(check(n, k, A, F, low)) {
		cout << low << '\n';
	} else {
		while(high - low > 1) {
			ll mid = (low + high) / 2;

			if(check(n, k, A, F, mid)) {
				high = mid;
			} else {
				low = mid;
			}
		}

		cout << high << '\n';
	}
}

int main() {
	fast_io();
	solve();

	return 0;
}


Measured memory_bytes: 6584
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;

	int a;
	vector<int> num(n);
	for (int i = 0; i < n; i++) {
		cin >> a;
		num.at(a - 1) = i + 1;
	}

	for (int i = 0; i < n; i++) cout << num.at(i) << endl;

	return 0;
}

Measured memory_bytes: 1152
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

template <typename TYPE>
void print_vec(const vector<TYPE>& v){
	for(int i=0; i<v.size(); i++){
		cout << v[i] << " ";
	}
	cout << endl;
}

template <typename TYPE>
void print_vec2(const vector<vector<TYPE>>& v){
  cout << endl; cout << "       ";
  for(int i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(int i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(int j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}


int main(){
	ll N;
	cin >> N;
	string s = to_string(N);
	ll num_digit = s.size();
	// cout << " s:  " << s << "    num_digit:  " << num_digit << endl;
	const int NUM = 11;
	ll dp[NUM][NUM][NUM][NUM][2];
	// dp[i][j][k][l][m]: 
	//上から(i-1)桁目まで数字を決定した時，
	// m=0: 今のところNと同じ値,  m=1:すでにNより小さいと確定
	// 3がj個,  5がk個, 7がl個　のみからなる整数の個数 (3,5,7以外の数字は使ってない整数だけ数える)

	dp[0][0][0][0][0] = 1;// まだ1桁も決定してない段階では 3,5,7以外の数字を使ってない
	for(int i=0; i<num_digit; i++){
		for(int j=0; j<num_digit; j++){
			for(int k=0; k<num_digit; k++){
				for(int l=0; l<num_digit; l++){
					if(j==0 && k==0 && l==0 ) dp[i+1][j][k][l][1] += dp[i][j][k][l][1];//上からi+1桁目を0にする 　これいれないと例えばN=3357が1になる(0357とかが数えられない)
					dp[i+1][j+1][k][l][1] += dp[i][j][k][l][1];//上からi+1桁目を3にする

					dp[i+1][j][k+1][l][1] += dp[i][j][k][l][1];//上からi+1桁目を5にする

					dp[i+1][j][k][l+1][1] += dp[i][j][k][l][1];//上からi+1桁目を7にする

					int nd = s[i]-'0';
					if(j==0 && k==0 && l==0 ) dp[i+1][j][k][l][1] += dp[i][j][k][l][0];//上からi+1桁目を0にする  これいれないと例えばN=3357が1になる(0357とかが数えられない)
					if(nd > 3)  dp[i+1][j+1][k][l][1] += dp[i][j][k][l][0];
					if(nd == 3) dp[i+1][j+1][k][l][0] += dp[i][j][k][l][0];
					if(nd > 5)  dp[i+1][j][k+1][l][1] += dp[i][j][k][l][0];
					if(nd == 5) dp[i+1][j][k+1][l][0] += dp[i][j][k][l][0];
					if(nd > 7)  dp[i+1][j][k][l+1][1] += dp[i][j][k][l][0];
					if(nd == 7) dp[i+1][j][k][l+1][0] += dp[i][j][k][l][0];
					// cout << "  i:  " << i <<  " (3, 5, 7) = (" << j << ", " << k << ", " << l << "):    nd: " << nd << endl;
				}
			}
		}
	}

	ll ans = 0;
	for(int j=1; j<num_digit; j++){
		for(int k=1; k<num_digit; k++){
			for(int l=1; l<num_digit; l++){
				// int l = num_digit - j - k;//これだと 3600とかで 0357といった数を数えられない
				// if(l <= 0) continue;
				ans += dp[num_digit][j][k][l][0];
				ans += dp[num_digit][j][k][l][1];
				// cout << " (3, 5, 7) = (" << j << ", " << k << ", " << l << "):   dp[num_digit][j][k][l][0]: " << dp[num_digit][j][k][l][0] << "  dp[num_digit][j][k][l][1] " <<  dp[num_digit][j][k][l][1] << endl;
			}
		}
	}
	

	// cout << "  dp[2][1][0][1][0]: " <<  dp[2][1][0][1][0]  << "  dp[2][1][1][1][0]: " <<  dp[2][1][1][1][0] << endl;
	cout << ans << endl;
}



Measured memory_bytes: 3904
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

#define NIL -1
#define MAX 100001

struct Node{
    int parent;
    int left;
    int right;
};

Node tree[MAX];
int n;
int depth[MAX];

void setdepth(int r,int i){
    depth[r]=i;
    if(tree[r].right != NIL)setdepth(tree[r].right,i);
    if(tree[r].left != NIL) setdepth(tree[r].left,i+1);
}

void print_ch(int r){
    int ch = tree[r].left;
    for(int i=0;ch!=NIL;i++){
        if(i)cout << ", ";
        cout << ch;
        ch = tree[ch].right;
    }
}

void print(){
    for(int i=0;i<n;i++){
        cout << "node " <<i;
        cout << ": parent = " << tree[i].parent;
        cout << ", depth = " << depth[i];
        if(tree[i].parent==NIL)cout << ", root";
        else if(tree[i].left ==NIL)cout << ", leaf";
        else cout << ", internal node";
        cout << ", [";
        print_ch(i);
        cout << "]\n";
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    int id,k,ch;
    int left;
    for(int i=0;i<n;i++)tree[i].parent=tree[i].left=tree[i].right=NIL;

    for(int i=0;i<n;i++){
        cin >> id >> k;
        for(int j=0;j<k;j++){
            cin >> ch;
            tree[ch].parent=id;
            if(!j)tree[id].left=ch;
            else tree[left].right=ch;
            left=ch;
        }
    }

    int r;
    for(int i=0;i<n;i++){
        if(tree[i].parent==NIL)r=i;
    }

    setdepth(r,0);
    print();

    return 0;

}



Measured memory_bytes: 7708
#include<bits/stdc++.h>
using namespace std;
#define LL long long int
#define DL double
#define MLL map<LL,LL>::iterator
#define MSL map<string,L>::iterator
#define MLS map<LL,string>::iterator
#define MSS map<string,string>::iterator
#define MCL map<char,LL>::iterator
#define SL set<LL>::iterator
#define SS set<string>::iterator sl
#define G getline
#define SZ size()
#define IN insert
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define MAX 1e18
#define MIN -1e18
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define endl "\n"
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
map<LL,LL>u,x,y;
V<pair<LL,LL> >v;
int main()
{
    FAST;
    LL n,m,i,j,k,p,q,o,l,s,t,z;
    string a,b;
    cin>>n;
    z=0;
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n;j++)
        {
            k=__gcd(i,j);
            for(l=1;l<=n;l++)
            {
                s=__gcd(k,l);
                z+=s;
            }
        }
    }
    cout<<z<<endl;
    return 0;
}


Measured memory_bytes: 3656
#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const ll INF=1000000000000001;
const double PI=3.141592653589;


int main(){
  int a,b; cin>>a>>b;
  if(a>8||b>8)
  cout<<":("<<endl;
  else
  cout<<"Yay!"<<endl;


  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<vector>
using namespace std;

static const int MAX=200000;
int ran[MAX],par[MAX];
int ran1[MAX],par1[MAX];

int n;

struct Unionfind{

    void init(){
        for(int i=1;i<=n;i++){
            ran[i]=0;
            par[i]=i;
        }
    }

    int find(int x){
        if(par[x]==x) return x;
        else{
            return par[x]=find(par[x]);
        }
    }

    void unite(int x,int y){
        x=find(x);
        y=find(y);
        if(x==y) return;
        else if(ran[x]<ran[y]){
            par[x]=y;
        }else{
            par[y]=x;
            if(ran[x]==ran[y]) ran[x]++;
        }
    }

    bool same(int x,int y){
        return find(x)==find(y);
    }
};

struct Unionfind2{

    void init(){
        for(int i=1;i<=n;i++){
            ran1[i]=0;
            par1[i]=i;
        }
    }

    int find(int x){
        if(par1[x]==x) return x;
        else{
            return par1[x]=find(par1[x]);
        }
    }

    void unite(int x,int y){
        x=find(x);
        y=find(y);
        if(x==y) return;
        else if(ran1[x]<ran1[y]){
            par1[x]=y;
        }else{
            par1[y]=x;
            if(ran1[x]==ran1[y]) ran1[x]++;
        }
    }

    bool same(int x,int y){
        return find(x)==find(y);
    }
};

int main(){
    int k,l;
    cin >> n >> k >> l;

    Unionfind road;
    Unionfind2 railway;

    road.init();
    railway.init();

    for(int i=0;i<k;i++){
        int p,q;
        cin >> p >> q;
        road.unite(p,q);
    }
    for(int i=0;i<l;i++){
        int r,s;
        cin >> r >> s;
        railway.unite(r,s);
    }
    
    map<pair<int,int>,int> map;
    for(int i=1;i<=n;i++) ++map[make_pair(road.find(i),railway.find(i))];
    for(int i=1;i<=n;i++){
        cout << map[make_pair(road.find(i),railway.find(i))] << endl;
    }

}

Measured memory_bytes: 15104
#include<stdio.h>
const int maxn=55;
int a[maxn];
int main() 
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	int ans=0;
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			ans+=a[i]*a[j];
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e8
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    int c1,c2,c3,c4,c5,c6,c7,c8,c9;
    cin >> c1;
    cin >> c2;
    cin >> c3;
    cin >> c4;
    cin >> c5;
    cin >> c6;
    cin >> c7;
    cin >> c8;
    cin >> c9;
    int a1=c1-c4;
    int a2=c2-c5;
    int a3=c3-c6;
    int a4=c4-c7;
    int a5=c5-c8;
    int a6=c6-c9;
    int b1=c1-c2;
    int b2=c4-c5;
    int b3=c7-c8;
    int b4=c2-c3;
    int b5=c5-c6;
    int b6=c8-c9;
    if(a1==a2 && a2==a3 && a4==a5 && a5==a6 && b1==b2 && b2==b3 && b4==b5 && b5==b6){
        cout << "Yes" << endl;
    }else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
// -*- coding:utf-8-unix -*-


use proconio::input;
use std::collections::HashSet;
// ABC086C - Traveling
// https://atcoder.jp/contests/abs/fasks/arc089_a

fn main() {
/*     input! {
        n: usize,
        mut plan: [(i32, i32, i32); n],  // Vec<(i32, i32, i32)>
    }
 */
    input! {
        s: String,
        t: String,
    }
    if s.len() > 0 &&
       s.len() <= 10 &&
       s == t[0..s.len()] &&
       t.chars().filter(|x| x.is_uppercase()).count() == 0 {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 2176
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main(){
    int N;
    cin >> N;
    ll ans = 0;

    for(int i = 1; i <= N; i++){
        if ((i % 3 != 0) && (i % 5 != 0)){
            ans += i;
        }
    }

   cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;

int main(){
  string s;
  cin >> s;
  string k="Yes";
  for(int i=0;i<s.size();i++){
    if(i%2==0){
      if(s.at(i)=='L'){
        k="No";
        break;
      }
    }
    else{
      if(s.at(i)=='R'){
        k="No";
        break;
      }
    }
  }
  cout << k << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

using static Input;
using static Util;
class Program
{
    static int[] N;
    static int[] M;
    static void INPUT()
    {
        N = LineInt();
        M = LineInt();
    }
    static void OUT()
    {
        var K = N[1];
        var a = M.Where(__ => __ >= K).Count();
        Console.WriteLine(a);
    }
    static void Main(string[] args)
    {
#if DEBUG  
        TESTINPUT();
        INPUT();
#else
        INPUT();
#endif
        OUT();
    }

    static void TESTINPUT()
    {
        
    }

}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

class Util
{

}




Measured memory_bytes: 19296
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ITP1_4_A
{
    public class Program

    {
        public static void Main(string[] args)
        {
            int[] line = ReadIntAr();
            int a = line[0];
            int b = line[1];
            Console.WriteLine("{0} {1} {2}",a/b,a%b,((double)a/(double)b).ToString("F8"));
        }

        static string ReadSt() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Console.ReadLine()); }
        static long ReadLong() { return long.Parse(Console.ReadLine()); }
        static double ReadDouble() { return double.Parse(Console.ReadLine()); }
        static string[] ReadStAr(char sep = ' ') { return Console.ReadLine().Split(sep); }
        static int[] ReadIntAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => int.Parse(e)); }
        static long[] ReadLongAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => long.Parse(e)); }
        static double[] ReadDoubleAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => double.Parse(e)); }

    }

}



Measured memory_bytes: 17984
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string S,T;
  cin>>S;
  cin>>T;
  int coun=0;
  for(int i=0;i<S.length();i++)
    if(S[i]!=T[i]) coun++;
  cout<<coun;
  return 0;
}

Measured memory_bytes: 3860
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if (a <= b) {
			System.out.println(a);
		} else {
			System.out.println(a-1);
		}
	}

}


Measured memory_bytes: 22612
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i < (n); i++)
using namespace std;
using ll = long long;

int main(){
    string s; cin>>s;

    bool flg = true;
    for(int i=0; i<s.size()-1; i++){
        if(s[i]==s[i+1]) flg = false;
    }

    if(flg){
        cout << "Good" << endl;
    }else{
        cout << "Bad" << endl;
    }

}


Measured memory_bytes: 3636
#include<stdio.h>

int main(void){
  int n;
  scanf("%d",&n);
  int num = n%10;
  if((num == 2)||(num==4)||(num==5)||(num==7)||(num==9)){
    printf("hon");
  }
  else if((num==0)||(num==1)||(num==6)||(num==8)){
    printf("pon");
  }
  else{
    printf("bon");
  }
  return 0;
}


Measured memory_bytes: 1728
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#include<bitset>
#include<stdio.h>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF = 100000000;

bool isOK(int a[],int index,int key){
    if(a[index] >= key){
        return true;
    }else{
        return false;
    }
}

int binary_search(int a[],int n,int key){
    int left = -1;
    int right = n;

    while(right-left>1){
        int mid = left + (right - left)/2;
        if(isOK(a,mid,key)){
            right = mid;
        }else{
            left = mid;
        }
    }
    return right;
}

int factrial(int n){
    if(n==0){
        return 1;
    }else{
        return n*factrial(n-1);
    }
}

int main(void){
    string n;
    cin >> n;
    bool flag = false;
    if(n[0]=='7' || n[1]=='7' || n[2]=='7'){
        flag = true;
    }
    if(flag){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3604
import math
A,B,H,M=map(int,input().split())

long_x=math.cos(math.radians((H%12)*30+0.5*M))
long_y=math.sin(math.radians((H%12)*30+0.5*M))

short_x=math.cos(math.radians(M*6))
short_y=math.sin(math.radians(M*6))


def get_distance(x1, y1, x2, y2):
    d = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
    return d

d = get_distance(long_x*A, long_y*A, short_x*B, short_y*B)
print(d)

Measured memory_bytes: 9520
#include <iostream>

int main()
{
	using namespace std;
	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;

	if (0 > (x - r) || W < (x + r) || 0 > (y - r) || H < (y + r))
		cout << "No" << endl;
	else
		cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 3100
import sys

N = int(input())
A_i = list(map(int, input().split()))
A_i = [i for i in A_i if 1 <= i and i <= 10**9]

if not 2 <= N or not N <= 2*10**5:
    print("error:N")
    sys.exit()
if len(A_i) != N:
    print("error")
    sys.exit()

if len(list(set(A_i))) == len(A_i):
    print("YES")
else:
    print("NO")

Measured memory_bytes: 26936
# rubyにはbsearchがありますが、lower_boundなどに使える機能はありません。よって実装します。
class Array
    def lower_bound(x)
        left=0
        right=self.length
        30.times{
            mid=(left+right)>>1
            if self[mid]<x
                left=mid
            else
                right=mid
            end
        }
        return right
    end

    def upper_bound(x)
        left=0
        right=self.length
        30.times{
            mid=(left+right)>>1
            if self[mid]<=x
                left=mid
            else
                right=mid
            end
        }
        return right
    end
end

# 入力
n=gets.to_i
# 面倒なので全部ソートします(そうするとコピペできる)
a=gets.split(" ").map(&:to_i).sort()
b=gets.split(" ").map(&:to_i).sort()
c=gets.split(" ").map(&:to_i).sort()

ret=0
# 各b[i]についてb[i]>aとなるaの個数xb[i]<cとなるcの個数を足していけばそれは答えです。
for i in 0...n
    anum = a.lower_bound(b[i])
    cnum = c.length - c.upper_bound(b[i])
    ret+=anum*cnum
end
puts ret

Measured memory_bytes: 24680
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PP;
//#define MOD 1000000007
#define MOD 998244353
#define INF 1145141919810893364
//#define INF 810114514
#define PI 3.141592653589
#define setdouble setprecision
#define REP(i,n) for(ll i=0;i<(n);++i)
#define OREP(i,n) for(ll i=1;i<=(n);++i)
#define RREP(i,n) for(ll i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << "0" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl
#define debug false
#define debug2 false

int main(void){
    ll A,B,C,D;
    cin >> A >>B >> C >> D;
    
    
    ll dp[3020][3020]={};
    dp[A][B]=1;
    
    for(ll i=A;i<=C;i++){
        for(ll j=B;j<=D;j++){
            dp[i][j]+=dp[i-1][j]*j;
            dp[i][j]%=MOD;
            dp[i][j]+=dp[i][j-1]*i;
            dp[i][j]%=MOD;
            
            ll r = dp[i-1][j-1];
            r*=(i-1);r%=MOD;
            r*=(j-1);r%=MOD;
            
            dp[i][j]+=(MOD-r);dp[i][j]%=MOD;
        }
    }
    cout << dp[C][D] << endl;
    
    /*
    REP(j,D+1){
        REP(i,C+1){
            cout << dp[i][j] << " ";
        }cout << endl;
    }
    */
    
    //メモリ！
    return 0;
}



Measured memory_bytes: 74884
import java.util.Scanner;
import static java.lang.Math.*;
class Main{
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int map[][] = new int [105][105];
        int x = 0;
        String temp [];
        while(true){  
            temp  = sc.next().split(",");
            for(int i = 0; i < temp.length; i++){
                map[x][i] = Integer.parseInt(temp[i]);
            }
            x++;
            if(!sc.hasNext())break;
        }
     
        int Memo[][] = new int [105][105];
        Memo[0][0] = map [0][0];
        for(int i = 0; i < 100; i++){
            if(x/2 > i){
                Memo[i + 1][0] =  max(Memo[i][0], Memo[i][0]) + map[i + 1][0];
                for(int j = 1; j < 100; j++){  
                    Memo[i + 1][j] = max(Memo[i][j], Memo[i][j - 1]) + map[i + 1][j];
                }
            }else {
                for(int j = 0; j  < 100; j++){
                    Memo[i + 1][j] = max(Memo[i][j],Memo[i][j + 1]) + map[i + 1][j];
                } 
                 
            } 
               
        }
        /******************************************
        for(int i = 0; i < 100; i ++){
            for(int j = 0; j < 100; j++){
                System.out.print(Memo[i][j] + "|"); 
            }
            System.out.println();
        }   /************************
        for(int i = 0; i < 100; i ++){
            for(int j = 0; j < 100; j++){
                System.err.print(map[i][j] + "|");
            }
            System.out.println();
        }
        **********************************************/
        System.out.println(Memo[100][0]);
    }
} 

Measured memory_bytes: 27876
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue> 
#include <tuple>
#include <map>
 
using namespace std;

typedef long long ll;

int main() {
	cin.tie(0);
    ios::sync_with_stdio(false);

    int N;

    cin >> N;

    if(N % 2 == 0) {
        cout << N / 2 << endl;
    } else {
        cout << N / 2 + 1 << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n, ans = 0; cin >> n;
    vector<int> p(n);
    for(int i = 0; i < n; i++){
        cin >> p[i]; ans += p[i];
    }
    sort(p.begin(), p.end());
    cout << ans - p[n-1]/2 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

//#define int long long
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

/* cpp template {{{ */

/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) REPS(i, 0, n)
#define REP0(i,n) for (ll i = 0; i <= (ll)(n); ++i)
#define REP1(i,n) for (ll i = 1; i <= (ll)(n); ++i)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

/* alias */
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline ll IN() {ll x; cin >> x; return x;}
inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << '\n';}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {rep(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) is >> x;
  //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいいです。
  return is;
}
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : " " );
  }
  return os;
}
/* }}} */

signed main() 
{
  int n,m;
  cin >> n >> m;
  print((n-1)*(m-1));
  return 0;
}

Measured memory_bytes: 256
import math
X, D = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(X)]
ans = 0
for i in range(X - 1):
    for j in range(1, X - i):
        total = 0
        for k in range(D):
            total += abs(x[i + j][k] - x[i][k])**2
        if math.sqrt(total).is_integer():
            ans += 1
print(ans)

Measured memory_bytes: 3064
K, N = map(int, input().split())
A = list(map(int, input().split()))

max_d = 0
for i in range(N-1):
  max_d = max(max_d, A[i + 1] - A[i])

max_d = max(max_d, K - A[N - 1] + A[0])

print(K - max_d)


Measured memory_bytes: 25840