akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define _sel(_1, _2, x, ...) x
#define repn(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, ...) _sel(__VA_ARGS__, reps, repn)(i, __VA_ARGS__)
#define reppn(i, n) for (ll i = 1; i <= (n); i++)
#define repps(i, a, b) for (ll i = (a); i <= (b); i++)
#define repp(i, ...) _sel(__VA_ARGS__, repps, reppn)(i, __VA_ARGS__)
#define rrepn(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rreps(i, a, b) for (ll i = (b) - 1; i >= (a); i--)
#define rrep(i, ...) _sel(__VA_ARGS__, rreps, rrepn)(i, __VA_ARGS__)
#define rreppn(i, n) for (ll i = (n); i >= 1; i--)
#define rrepps(i, a, b) for (ll i = (b); i >= (a); i--)
#define rrepp(i, ...) _sel(__VA_ARGS__, rrepps, rreppn)(i, __VA_ARGS__)

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define rng(v) (v).begin(), (v).end()
#define rrng(v) (v).rbegin(), (v).rend()
#define _shwv(v) for (auto _t1 : v) cerr << _t1 << " "; cerr << endl;
#define dbg(x) cerr << #x << ": " << (x) << endl;
#define dbgv(v) cerr << #v << ": "; _shwv(v);
#define dbgm(m) cerr << #m << ":" << endl; for (auto _t2 : m) { _shwv(_t2); }

using namespace std;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;

const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
const int DX[4] = {1, 0, -1, 0};
const int DY[4] = {0, 1, 0, -1};

template<typename T> inline void prt(T x) { cout << x << endl; }
template<typename T> inline void getv(T& v) { for (auto& t : v) cin >> t; }
template<typename T> inline int siz(T& x) { return x.size(); }
template<typename T> inline ll pow2(T n) { return 1ll << n; }
template<typename T, typename U> inline int bit(T x, U n) { return x >> n & 1; }
template<typename T, typename U>
inline bool umax(T& m, U x) { if (m < x) { m = x; return true; } return false; }
template<typename T, typename U>
inline bool umin(T& m, U x) { if (m > x) { m = x; return true; } return false; }


int main() {
    double pi = acos(-1);
    int a, b, h, m;
    cin >> a >> b >> h >> m;
    double ma = (m / 60.0) * 2 * pi;
    double mx = b * cos(ma);
    double my = b * sin(ma);
    double ha = ((h / 12.0) + (m / 60.0 / 12.0)) * 2 * pi;
    double hx = a * cos(ha);
    double hy = a * sin(ha);
    dbg(ma);
    dbg(ha);
    dbg(mx);
    dbg(my);
    dbg(hx);
    dbg(hy);
    cout << fixed << setprecision(15) << (sqrt(pow(mx - hx, 2) + pow(my - hy, 2))) << endl;

    return 0;
}


Measured memory_bytes: 4132
import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner scanner = new Scanner(System.in);
    int in1 = scanner.nextInt();
    int in2 = scanner.nextInt();
    int in3 = scanner.nextInt();

    if(in1<in2){
      if(in2<in3){
        System.out.println("Yes");
      }else{System.out.println("No");}
    }else{System.out.println("No");}
  }
}

Measured memory_bytes: 26300
def main():
    from functools import reduce

    def gcd(a, b):
        return a if b == 0 else gcd(b, a % b)

    def lcm(a, b):
        return (a // gcd(a, b)) * b

    N, M = map(int, input().split())
    *a, = map(int, input().split())

    p = -1
    b = []
    for x in a:
        cnt = 0
        while x % 2 == 0:
            x //= 2
            cnt += 1
        if ~p and p != cnt:
            print(0)
            return
        p = cnt
        b.append(x)

    if p == 0:
        print(0)
        return

    t = pow(2, p - 1) * reduce(lcm, b)
    ans = (M // t) - (M // (t * 2))

    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())


Measured memory_bytes: 14748
import java.util.Scanner;
 
class Main {
	int r;
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}
 
	Main(Scanner sc) {
		r = sc.nextInt();
	}
 
	void solve() {
		System.out.println(2*Math.PI*r);
	}
}

Measured memory_bytes: 35944
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
//const int N = 1000000;
const ll mod = 1000000007;
//using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dh[8] = {0, 0, 1, 1, 1, -1, -1, -1};
const int dw[8] = {1, -1, 0, 1, -1, 0, 1, -1};
  
ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * (B / gcd(A, B));
}
using Graph = vector<vector<int>>;
Graph G;
  
/*------------------------------------------------------------------*/
int main(){
    int n; cin >> n;
    int max_a = 0;
    vector<int> a(n);
    rep(i, n){
        cin >> a[i];
        max_a = max(max_a, a[i]);
    }
    int half = max_a / 2;
    int ans = max_a;
    int diff_min = max_a;

    rep(i, n){
        if(abs((max_a - a[i]) - half) < diff_min and max_a != a[i]){
            diff_min = abs(max_a - a[i] - half);
            ans = a[i];
        }
    }
    cout << max_a << " " << ans << endl;
}

Measured memory_bytes: 640
fn main() {
    let sc = std::io::stdin();
    let mut sc = Scanner { reader: sc.lock() };
    let l: usize = sc.read();

    let mut r = 0;
    while (1 << (r + 1)) <= l {
        r += 1;
    }

    let n = r + 1;
    let mut graph = vec![vec![]; n];
    for i in 0..r {
        graph[i].push((i + 1, 1 << i));
        graph[i].push((i + 1, 0));
    }

    if (1 << (n - 1)) != l {
        let mut l = l;
        for i in (0..(n - 1)).rev() {
            if l >= (1 << r) + (1 << i) {
                graph[i].push((n - 1, l - (1 << i)));
                l -= 1 << i;
            }
        }
    }

    let mut ans = vec![];
    for i in 0..n {
        for &(next, w) in graph[i].iter() {
            ans.push((i, next, w));
        }
    }

    println!("{} {}", n, ans.len());
    for &(i, next, w) in ans.iter() {
        println!("{} {} {}", i + 1, next + 1, w);
    }
}

pub struct Scanner<R> {
    reader: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <bitset>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...)
#endif

#define TIMESTAMP(x) eprintf("["#x"] Time : %.3lf s.\n", clock()*1.0/CLOCKS_PER_SEC)
#define TIMESTAMPf(x,...) eprintf("[" x "] Time : %.3lf s.\n", __VA_ARGS__, clock()*1.0/CLOCKS_PER_SEC)

using namespace std;

#ifdef LOCAL
static struct __timestamper {
  string what;
  __timestamper(const char* what) : what(what){};
  __timestamper(const string& what) : what(what){};
  ~__timestamper(){
    TIMESTAMPf("%s", what.data());
	}
} __TIMESTAMPER("end");
#else 
struct __timestamper {};
#endif

typedef long long ll;
typedef long double ld;

//"AAABAAABAAABAAABAA"

void solve() {
  ll a, b;
  int l, r;
  scanf("%lld%lld%d%d", &a, &b, &l, &r);
  ll k = (a + b) / (min(a, b) + 1);

  // AAB

  ll lf = 0;
  ll rg = a + 1;
  while (rg - lf > 1) {
    ll m = (lf + rg) / 2;
    ll totb_min = m * 1LL * k + (a - m + 1) / k;
    if (totb_min > b) {
      rg = m;
    } else {
      lf = m;
    }
  }

  ll AKB = (a - lf) / k;
  ll BKA = lf;
  ll midA = a - AKB * k - BKA;
  ll midB = b - AKB - BKA * k;
  assert(midA <= k);
  assert(midB <= k);

  int cnt[2];
  cnt[0] = cnt[1] = 0;

  int last = 'A';
  int last_cnt = 0;

  for (ll i = l - 1; i < r; i++) {
    char c;
    if (i < AKB * (k + 1)) {
      c = (i % (k + 1) == k) ? 'B' : 'A';
    } else if (i < AKB * (k + 1) + midA) {
      c = 'A';
    } else if (i < AKB * (k + 1) + midA + midB) {
      c = 'B';
    } else {
      c = ((i - AKB * (k + 1) - midB - midA) % (k + 1) == 0) ? 'A' : 'B';
    }
    printf("%c", c);
    if (c == last) {
      last_cnt++;
      assert(last_cnt <= k);
    } else {
      last_cnt = 1;
      last = c;
    }
    cnt[c - 'A']++;
  }
  printf("\n");
  if (l == 1 && r == a + b) {
    assert(cnt[0] == a);
    assert(cnt[1] == b);
  }
}

int main() {
#ifdef LOCAL
  freopen("d.in", "r", stdin);
  freopen("d.out", "w", stdout);
#endif

  int t;
  scanf("%d", &t);
  while (t-->0)
    solve();
  return 0;
}


Measured memory_bytes: 384
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <mutex>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <thread>
#include <vector>
#define int long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define SQR(x) (x) * (x)
#define itn int

using namespace std;
const int MOD = (int)(1e9 + 7);
const int INF = (int)(1e13 + 7);

vector<int> prime_factor;
void prime_factorization(int n) {
  while (n % 2 == 0) {
    n /= 2;
    prime_factor.push_back(2);
  }
  for (int i = 3; i < (int)(sqrt((double)n)) + 2; i += 2) {
    if (n % i == 0) {
      while (n % i == 0) {
        n /= i;
        prime_factor.push_back(i);
      }
    }
  }
  if (n != 1) {
    prime_factor.push_back(n);
  }
}

signed main() {
  int n;
  cin >> n;
  prime_factorization(n);
  cout << n << ":"
       << " ";
  for (int i = 0; i < prime_factor.size() - 1; i++) {
    cout << prime_factor[i] << " ";
  }
  cout << prime_factor[prime_factor.size() - 1] << endl;
}



Measured memory_bytes: 3168
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  ll a, b, x;
  cin>>a>>b>>x;
  a += (x-a%x)%x;
  b -= b%x;
  cout<<(b-a)/x+1<<endl;
}



Measured memory_bytes: 3548
#include <bits/stdc++.h>

using namespace std;

int mapData[21][21];

void init(int n) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			mapData[i][j] = 1001;
		}
	}
}

void solve(int n) {
	for (int k = 1; k < n; k++) {
		for (int i = 1; i < n; i++) {
			for (int j = 1; j < n; j++) {
				if (mapData[i][j] > mapData[i][k] + mapData[k][j]) {
					mapData[i][j] = mapData[i][k] + mapData[k][j];
				}
			}
		}
	}
}

int main(void) {
	int n, m, u, v, V, P;

	cin >> n >> m;
	init(n+1);
	for (int i = 0; i < m; i++) {
		scanf("%d,%d,%d,%d", &u, &v, &V, &P);
		mapData[u][v] = V;
		mapData[v][u] = P;
	}
	scanf("%d,%d,%d,%d", &u, &v, &V, &P);

	solve(n+1);
	cout << V - P - mapData[u][v] - mapData[v][u] << endl;

	return 0;
}


Measured memory_bytes: 3160
import numpy as np
a, b, h, m = (int(i) for i in input().split())
theta = np.radians(30 * h + 0.5 * m)
phi = np.radians(6 * m)
ax = np.sin(theta) * a
ay = np.cos(theta) * a
bx = np.sin(phi) * b
by= np.cos(phi) * b
ans = np.sqrt((ax-bx)**2 + (ay-by)**2)
print(ans)

Measured memory_bytes: 27180
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
            solve(in);
        }
    }

    private static void solve(BufferedReader in) throws IOException {
        StringTokenizer st = new StringTokenizer(in.readLine());
        int N = Integer.parseInt(st.nextToken()), M = Integer.parseInt(st.nextToken());
        int[] l = new int[N + 1], r = new int[N + 1];
        for (int i = 1; i < N + 1; i++) {
            st = new StringTokenizer(in.readLine());
            l[i] = Integer.parseInt(st.nextToken());// 1 <= l <= r <= M
            r[i] = Integer.parseInt(st.nextToken());
        }

        @SuppressWarnings("unchecked")
        List<Integer>[] nByLen = new List[M + 1];
        for (int n = 1; n < N + 1; n++) {
            int len = r[n] - l[n] + 1;
            if (nByLen[len] == null) {
                nByLen[len] = new ArrayList<>();
            }
            nByLen[len].add(n);
        }

        int accum = N;

        int[] fenwick = new int[M + 1];
        for (int d = 1; d < M + 1; d++) {
            int sum = accum;
            for (int e = d; e < M + 1; e += d) {
                sum += faccum(e, fenwick);
            }
            System.out.println(sum);
            if (nByLen[d] != null) {
                accum -= nByLen[d].size();
                for (int i : nByLen[d]) {
                    fadd(l[i], 1, fenwick);
                    fadd(r[i] + 1, -1, fenwick);
                }
            }
        }
    }

    private static int faccum(int i, int[] fenwick) {
        int sum = 0;
        for (; i > 0; i -= i & -i) {
            sum += fenwick[i];
        }
        return sum;
    }

    private static void fadd(int i, int a, int[] fenwick) {
        for (; i < fenwick.length; i += i & -i) {
            fenwick[i] += a;
        }
    }
}

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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

#define bit(b, i) (((b) >> (i)) & 1)

template<typename T> T mod(T x, T y) { return (x % y + y) % y; }

string f(LL n) {
	if(n == 0) { return "0"; }
	
	LL x = 0;
	string s;
	inc(i, 35) {
		if(x == n) { break; }
		if(bit(x, i) != bit(n, i)) {
			x += (1LL << i) * (i % 2 == 0 ? +1 : -1);
			s += "1";
		} else {
			s += "0";
		}
	}
	reverse(ALL(s));
	
	return s;
}

int main() {
	LL n;
	cin >> n;
	
	cout << f(n) << endl;
	
	return 0;
}


Measured memory_bytes: 256
/*------------------GZ:-)------------------*/
//#pragma GCC optimize "trapv"
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//find_by_order(k)  returns iterator to kth element starting from 0;
//order_of_key(k) returns count of elements strictly smaller than k;
//erase,insert same as normal set

//#define      ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define        fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define        f first
#define        s second
#define        pb push_back
#define        eb emplace_back
#define        mp  make_pair
#define        forn(i,n) for(int i=0;i<n;++i)
#define        show(b) for(auto const&x: b) cout<<x<<" "
#define        sshow(b) for(auto x:b) cout<<x<<" "
#define        fix(b,val)   memset(b,val,sizeof(b))
#define        pill(b,n,v)  fill(b,b+n,v)
#define        itn          int
#define        w(t)     int t;cin>>t;while(t--)
#define        mx(a,b,c) max(a,max(b,c))
#define        mn(a,b,c) min(a,min(b,c))
#define        intmax    INT_MAX
#define        intmin    INT_MIN
#define        nl        "\n"
#define        prt(val)  cout<<val<<"\n"
#define        all(v)    v.begin(),v.end()
#define        trace1(x)                cerr<<#x<<": "<<x<<endl
#define        trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define        trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define        trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define        trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define        trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

typedef       long long int ll;
typedef       long double LD;
typedef       unsigned long long int LL;
typedef       pair<int,int> pii;
typedef       pair<long long int,int> pli;
typedef       pair<int,long long int> pil;
typedef       pair<long long int,long long int> pll;
const int N=1e5+5;
const int mod=1e9+7;
//mt19937 rnd(time(NULL));

/*-----Functions------*/
template<typename T>
void show2d(const vector<vector<T>>& adj)
{
    for(auto x:adj)
    {
        for(auto y:x)
        { 
           cout<<y<<" ";
        }
    cout<<"\n";
    }
}

ll modexp(ll a,ll b,ll mod)
{
    ll x=1;
    while(b)
    {
        if(b&1)
        x = ((x%mod) * (a%mod))%mod;
        a = ((a%mod) * (a%mod))%mod;
        b = b / 2;
    }
    return x;
}

void rf()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

int32_t main()
{
    fast;
    //rf();
    int a[6];
    forn(i,6)
    a[i] = 1;
    forn(i,5){
        int ch;
        cin>>ch;
        a[ch]--;
    }
    forn(i,6){
        if(a[i] == 1){
            cout<<(i)<<nl;
            return 0;
        }
    }
}


Measured memory_bytes: 3592
#include <algorithm>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <iostream>
#include <map>
#include <random>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
/*---------------------------------------*/

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n, h; cin >> n >> h;
  vector<pair<int, int>> ab(n);
  int maximum = -INF;
  REP(i, n) {
    cin >> ab[i].second >> ab[i].first;
    maximum = max(maximum, ab[i].second);
  }

  sort(ALL(ab));
  reverse(ALL(ab));
  long long ans = 0;
  REP(i, n) {
    if (ab[i].first > maximum) {
      h -= ab[i].first;
      ++ans;
    }
    if (h <= 0) {
      cout << ans << "\n";
      return 0;
    }
  }
  while (h > 0) {
    h -= maximum;
    ++ans;
  }
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 1024
h, w, n = map(int, input().split())
cnts = [0] * 10
cnts[0] = (h-2)*(w-2)

points = dict()
for _ in range(n):
    a, b = map(lambda x: int(x)-1, input().split())
    for i in (-1, 0, 1):
        for j in (-1, 0, 1):
            ai, bj = a+i, b+j
            if 1 <= ai < h-1 and 1 <= bj < w-1:
                ab = (a+i, b+j)
                points.setdefault(ab, 0)
                cnts[points[ab]] -= 1
                points[ab] += 1
                cnts[points[ab]] += 1
for c in cnts:
    print(c)


Measured memory_bytes: 250684
#include <stdio.h>

int N, M, D;
char d[101][101];

int main() {
	int i, j, k, o=0;
	scanf("%d%d%d", &N, &M, &D);
	for (i=0; i<N ;i++) {
		scanf("%s", d[i]);
		for (j=0; j<M ;j++) {
			for (k = 0; k < D && j-k >= 0 && d[i][j-k] != '#';k++);
			if (k == D) o++;

			for (k = 0; k < D && i-k >= 0 && d[i-k][j] != '#';k++);
			if (k == D) o++;
		}
	}
	printf("%d\n", o);
	return 0;
}

Measured memory_bytes: 608
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define yn(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YN(ans) if(ans)printf("YES\n");else printf("NO\n")
#define vector1d(type,name,...) vector<type>name(__VA_ARGS__)
#define vector2d(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
ll modpow(ll a, ll b, ll p){ ll ans = 1; while(b){ if(b & 1) (ans *= a) %= p; (a *= a) %= p; b /= 2; } return ans; }
ll updivide(ll a,ll b){if(b==1) return a;else if(a%b==0) return a/b;else return (a/b)+1;}

int main(){
    INT(n);
    string s;
    cin>>s;
    int front=0,end=0,a=0;
    rep(i,n){
        a+=(s[i]==')');
        a-=(s[i]=='(');
        front=max(front,a);
    }
    a=0;
    for(int i=n-1;i>=0;i--){
        a-=(s[i]==')');
        a+=(s[i]=='(');
        end=max(end,a);
    }
    while(front--){
        s.insert(s.begin(),'(');
    }
    while(end--){
        s.push_back(')');
    }
    cout<<s<<endl;
}

Measured memory_bytes: 3684
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 < b");
		} else if (a > b) {
			System.out.println("a > b");
		} else {
			System.out.println("a == b");
		}

	}

}


Measured memory_bytes: 26220
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <cassert>

using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define vc vector
int n,pos[100005];
int main(){
	cin >> n;
	repn(i,n){ int a; cin>>a; pos[a] = i; }
	ll ans = 0;
	multiset<int>S; S.insert(0); S.insert(n+1); S.insert(0); S.insert(n+1); S.insert(pos[n]);
	for(int i=n-1;i>=0;i--){
		auto it = S.lower_bound(pos[i]);
		int nxt = *it; it++; int nxt2 = *it;
		it = S.lower_bound(pos[i]); it--;
		int pre = *it; it--; int pre2 = *it;
		ans += 1LL * (pos[i]-pre) * (nxt2-nxt) * i;
      	ans += 1LL * (pre-pre2) * (nxt-pos[i]) * i;
		S.insert(pos[i]);
	}
	cout << ans << endl;
}


Measured memory_bytes: 5376
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back

using namespace std;
const long long MOD = (long long)1e9 + 7;

string s;
set<int> st = { 'A', 'C', 'G', 'T' };
int ans, cnt;
int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> s;
	s = s + "#";
	for (int i = 0; i < (int)s.length(); i++) {
		if (st.count(s[i])) {
			cnt++;
		}
		else {
			ans = max(ans, cnt);
			cnt = 0;
		}
	}
	cout << ans << "\n";
	//system("pause");
	return 0;
}

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

int main() {
	int n, m;							//調査時間n、トンネル内の台数mを定義
	cin >> n >> m;

	int x = m;							//トンネル内の最大台数xを定義
	int y = 0;							//トンネル内の0以下台数yを定義

	for (int i = 0; i < n; i++) {
		int in, out;					//入口in、出口outを定義
		cin >> in >> out;
		m = m + in - out;				//[トンネル内の台数]＝[トンネル内の台数]＋[入って来た台数]ー[出て行く台数]
		x = max(x, m);
		y = min(y, m);
	}

	if (y < 0) cout << 0 << endl;
	else cout << x << endl;

	return 0;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define F first
#define S second
#define ll long long
#define N 100010
using namespace std;
ll n,k,h[N],dp[N];
int main(){
	ll i,j;
	cin>>n>>k;
	for(i=0;i<n;i++)
	{
		cin>>h[i];
	}
	memset(dp,127,sizeof(dp)); 
	dp[0]=0;
	for(i=1;i<n;i++)
	{
		for(j=1;j<=min(i,k);j++)
		{
			dp[i]=min(dp[i],dp[i-j]+abs(h[i]-h[i-j]));
		}
	}
	cout<<dp[n-1]<<endl;
	return 0;
}

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

int main() {
    int m1,d1,m2,d2;
    cin >> m1 >> d1 >> m2 >> d2;
    if(d2 == d1+1){
        cout << 0;
    }
    else{
        cout << 1;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

#define REP(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

typedef long long LL;

const int oo = 0x3f3f3f3f;

int main()
{
#ifdef matthew99
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	LL a, b, c;
	cin >> a >> b >> c;
	if ((a & 1) && (b & 1) && (c & 1)) cout << min(min(a * b, b * c), c * a) << endl;
	else cout << 0 << endl;
	return 0;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
int i,j,k,count1=0,count2=0;

int main(void){
    long long int h,w;
    cin>>h>>w;
    if(w==1||h==1)cout<<1<<endl;
    else if(h*w%2==0)cout<<h*w/2<<endl;
    else cout<<(h*w+1)/2<<endl;
}

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

int main()
{
    string t;
    string w;
    int cnt = 0;

    cin >> w;
    for (int i = 0; i < w.size(); i++)
    {
        if ('A' <= w[i] && w[i] <= 'Z')
            w[i] += 'a' - 'A';
    }

    cin >> t;
    while (t != "END_OF_TEXT")
    {
        for (int i = 0; i < t.size(); i++)
            if ('A' <= t[i] && t[i] <= 'Z')
                t[i] += 'a' - 'A';
        if (w == t)
            cnt++;
        cin >> t;
    }
    cout << cnt << endl;
}



Measured memory_bytes: 3208
#include<iostream>
using namespace std;
#define MAX 2000000
#define INTFY (1<<30)
int H,A[MAX+1]; 
void maxHeapify(int i){
	int left=2*i;
	int right=2*i+1;
	int largest;
	if(left<=H&&A[left]>A[i])
		largest=left;
	else
		largest=i;
	if(right<=H&&A[largest]<A[right])
		largest=right;
	
	if(largest!=i){
		swap(A[largest],A[i]);
		maxHeapify(largest);
	} 
} 
void increaseKey(int i,int key){
	if(key<A[i])
		return ;
	A[i]=key;
	while(i>1&&A[i/2]<A[i]){
		swap(A[i/2],A[i]);
		i=i/2;
	}
}
void insert(int key){
	H++;
	A[H]=-INTFY;
	increaseKey(H,key);
	
}
int extractMax(){
	if(H<1)
		return -INTFY;
	int maxv;
	maxv=A[1];
	A[1]=A[H--];
	maxHeapify(1);
	return maxv;
}
int main(){
	char com[10];
	int x;
	while(1){
		cin>>com;
		if(com[0]=='i'){
			cin>>x;
			insert(x);	
		}	
		if(com[0]=='e'&&com[1]=='n'){
			break;
		}
		if(com[1]=='x'){
			cout<<extractMax()<<endl;
		}
	
	}
	return 0;
}


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

int main() {
  int N, M;
  cin >> N >> M;
  
  int sum = 0;
  
  vector<int> data(M);
  for (int i = 0; i < M; i++) {
    cin >> data.at(i);
    sum += data.at(i);
  }
  
  if (N - sum <= -1) {
    cout << -1 << endl;
  } else {
    cout << N - sum << endl;
  }
}

Measured memory_bytes: 3636
while True:
    n = int(input())
    if n == 0:
        break
    data = input().split()
    import math
    sum = 0
    for i in range(n):
        sum = sum + int(data[i])
    average = sum / n
    a = 0
    for i in range(n):
        a = a + (int(data[i]) - average)**2
    print('{}'.format(math.sqrt(a/n)))


Measured memory_bytes: 5696
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedHashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = getSc();
		Integer N = sc.nextInt(); // 参加者の数
		Integer K = sc.nextInt(); // 初期ポイント
		Integer Q = sc.nextInt(); // 正解した数
		LinkedHashMap<Integer, Integer> score = new LinkedHashMap<Integer, Integer>();
		// 初期の点数をセット
		for (int i = 0; i < N; i++) {
			score.put(i, K);
		}
		for (int i = 0; i < Q; i++) {
			Integer winner = sc.nextInt() - 1;
			score.put(winner, score.get(winner) + 1);
		}
		for (int i : score.values()) {
			System.out.println(i <= Q ? "No" : "Yes");
		}
	}

	public static BufferedReader getStdin() {
		return new BufferedReader(new InputStreamReader(System.in));
	}

	public static Scanner getSc() {
		return new Scanner(System.in);
	}
}

Measured memory_bytes: 69196
#include <iostream>
#include <map>
#include <utility>

using namespace std;

int main(){

    int n, num;
    map<int, int> aluno;
    pair<int, int> aux;

    cin >> n;

    for(int i = 1; i <= n; i++){
       cin >> num; 
       aluno.insert( make_pair(num, i) );
    }
    
    for(int i = 1; i <= n; i++){
        cout << " " << aluno[i];
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 5504
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n:usize,
        s:[chars; n],
    }
    let mut group = vec![0;5];
    for i in s {
        match i[0] {
            'M' => group[0]+=1,
            'A' => group[1]+=1,
            'R' => group[2]+=1,
            'C' => group[3]+=1,
            'H' => group[4]+=1,
            _ => {},
        }
    }
    let mut ans:i64=0;
    for i in 0..5 {
        for j in 0..5 {
            for k in 0..5 {
                if i<j && j<k {
                    ans+=group[i]*group[j]*group[k];
                }
            }
        }
    }
    println!("{}", ans);
}
/*
MAR
MAC
MAH
MRC
MRH
MCH
ARC
ARH
ACH
RCH
*/

Measured memory_bytes: 12540
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
int main() {
	ll n,count,a;
	cin >> n;
	int c = sqrt(n);
	for (int i = c;; i--) {
		if (n%i == 0) { count = i; goto loop; }
	}
loop:;
	count = max(count, n / count);
	for (int i = 0;; i++) {
		if (count / 10 == 0) { a = i; goto loop2; }
		count /= 10;
	}
loop2:;
	cout << a + 1 << endl;
	getchar();
	getchar();
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt();
        int res = 0;
        int[][] L = new int[n][2];
        for(int i = 0; i < n; i++) L[i][1] = 1;
        L[0][0] = 1;
        for(int i = 0; i < m; i++) {
            int x = Integer.parseInt(sc.next())-1, y = Integer.parseInt(sc.next())-1;
            if(L[x][0] == 1) {
                L[y][0] = 1;
            }
            L[x][1]--;
            L[y][1]++;
            if(L[x][1] == 0) L[x][0] = 0;
        }
        for(int i = 0; i < n; i++) res += L[i][0];
        System.out.println(res);
    }
}


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

#define int long long
#define ll long long
#define f1(i,a,b) for(int i=a;i<b;i++)
#define f2(i,a,b) for(int i=a;i>=b;i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair
#define ld long double

const int mod = 1000000007;
const ld PI = acosl(-1.0);
ll temp;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    f1(i, 0, n)
    cin>>a[i];

    int suf[n];
    suf[n - 1] = a[n - 1];
    f2(i, n - 2, 0)
    {
        suf[i] = suf[i + 1] + a[i];
        suf[i] %= mod;
    }
    int ans = 0;
    f1(i, 0, n - 1)
    {
        ans += (a[i] * suf[i + 1]) % mod;
        ans %= mod;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 6732
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cmath>
using namespace std;

int main() {
    string s,t;
    cin >> s >> t;
    int ans = 0;
    for (int i = 0; i < 3; i++) {
        if (s[i]==t[i]) {
            ans++;
        }
    }
    cout << ans << endl;
}


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

            #define FOR(i,a,b) for (int i = (a); i < (b); i++)
            #define rep(i,n) FOR(i,0,n)
            #define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)
            #define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
            #define FILL(a,value) memset(a, value, sizeof(a))

            #define SZ(a) (int)a.size()
            #define ALL(a) a.begin(), a.end()
            #define PB emplace_back
            #define P push
            #define IN insert
            #define ER erase

            #define MP make_pair
            #define sc second
            #define fs first

            typedef long long LL;
            typedef vector<int> VI;
            typedef vector<LL>VL;
            typedef vector <bool >VB;
            typedef vector<vector<int>>WI;
            typedef vector<vector<LL>>WL;
            typedef pair<int, int> PII;
            typedef pair<double, double> PDD;

            const double PI = acos(-1.0);
            const int INF = int(1e9);
            const LL LINF = LL(1e18);
            const int MAS = int(1e6+10);
            const double EPS = 1e-7;
            const LL MAX = 4294967296;
            const LL MOD =LL(1e9+7);



            int main()
            {
                ios_base::sync_with_stdio(false);
                cin.tie(0);
                cout.tie(0);
                int n;
                cin >> n;
                int ok = -1;
                FOR(i,1,10)
                {
                    FOR(j,1,10)
                    {
                        if(i*j == n)ok = 1;
                    }
                }
                if(ok == -1)cout << "No";
                else cout << "Yes";
            }


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
 
int main ()
{
   long long int a,b,c,i=0;
  cin>>a>>b>>c;
 if (a==c && b==c && c==a){
 if(a%2==0 && c%2==0 && c%2==0){cout<<-1<<endl;}
   else if (a%2!=0 && c%2!=0 && c%2!=0){cout << 0<<endl;}}
  else{
  while ( a%2 != 1  &&  b%2 != 1  &&  c%2 !=1)
        {
            long long int  x = a , y = b , z = c;
            a = ( y + z )/2;
            b = ( x + z )/2;
            c = ( x + y )/2;
            i++;
        }
        cout<<i<<endl;}
 
 
    
	return 0;
 
}

Measured memory_bytes: 256
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
// dfmt on

void main()
{
    long N, M;
    scan(N, M);
    auto A = aryread();
    auto B = new long[M];
    auto C = new long[M];
    foreach (i; 0 .. M)
        scan(B[i], C[i]);

    A.sort();
    zip(C, B).sort!"b<a"();

    long sum = A.sum();
    long ans = sum;
    long i, j;
    foreach (x; 0 .. N)
    {
        if (B[i] == j)
        {
            j = 0;
            i++;
        }
        if (B.length <= i)
            break;
        sum -= A[x];
        sum += C[i];
        ans = max(ans, sum);
        j++;
    }
    writeln(ans);
}


Measured memory_bytes: 8244
#include<bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define nmax 100001
const int inf=INT_MAX;
const int mod=1e9+7;
typedef long long ll;
using namespace std;
long n,m,a,b,i,ans[nmax];
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
    cin>>n>>m;
    for(i=1;i<=m;i++)
	{
		cin>>a>>b;
		if(a>b)swap(a,b);
		ans[a+1]++;
		ans[b+1]--;
	}
	for(i=2;i<=n;i++)
	{
		ans[i]+=ans[i-1];
		if(ans[i]&1)rc("NO");
	}
	cout<<"YES"<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define per(i,n) for(int i = n-1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
const long long mod = 1000000007LL;

int main() {
  int k;
  cin >> k;
  string s;
  cin >> s;
  int n = s.size();
  if(n<=k) cout << s << endl;
  else {
    string t = "";
    rep(i,k) t += s[i];
    cout << t << "..." << endl;
  }
  return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int h, w;
  cin >> h >> w;
  
  for (int i = 0; i<w+2; i++){
    cout << "#";
  }
  cout << endl;
 
  for (int i = 0; i<h; i++){
    string a;
    cin >> a;
    cout << "#" << a << "#" << endl;
  }
  
  for (int i = 0; i<w+2; i++){
    cout << "#";
  }
  cout << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define REP1(i, n) for(int i=1; i<=(n); i++)
#define RREP1(i, n) for(int i=(n); i>=1; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define out(...) printf(__VA_ARGS__)

int dxy[] = {0, 1, 0, -1, 0};

void solve();
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 2123450
#else
#define SIZE 2123450
#endif

int N;

void solve() {
    cin>>N;
    vector<int> A(N + 1);
    REP1(i,N)cin>>A[i];
    vector<int> ans;
    vector<int> B(N + 1, 0);
    for (int i = N; i >= 1; i--) {
        int sum = 0;
        for (int j = i; j <= N; j += i) sum += B[j];
        
        if ((sum + A[i]) % 2 == 1) {
            B[i]++;
            ans.push_back(i);
        }
    }
    cout << ans.size() << endl;
    for(auto x: ans) cout << x << " ";
    cout << endl;
}

Measured memory_bytes: 5108
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<typename T> using rev_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<class S, class T> void map_init(map<S, T> &m, S k, T v){if(!m.count(k)) m[k] = v;}
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
int main() {
    set<int> s = {3, 5, 7};
    int X;
    cin >> X;
    R_YESNO(s.count(X));
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxN=200005;
int n,cnt;
int c[maxN],b[maxN];
map <int,int> m;

vector <int> a[maxN];
int tree[4*maxN+5];
int ans[maxN];
int dp[maxN];
void update(int node,int l,int r,int pos,int val)
{
    if (pos<l||pos>r) return;
    if (l==r)
    {
        tree[node]=val;
        return;
    }
    int mid=(l+r)/2;
    update(node*2,l,mid,pos,val);
    update(node*2+1,mid+1,r,pos,val);
    tree[node]=max(tree[node*2],tree[node*2+1]);
}
int query(int node,int l,int r,int u,int v)
{
    if (u>r||v<l) return 0;
    if (u<=l&&r<=v) return tree[node];
    int mid=(l+r)/2;
    int ml=query(node*2,l,mid,u,v);
    int mr=query(node*2+1,mid+1,r,u,v);
    return max(ml,mr);
}
void dfs(int u,int p)
{
    int pre=query(1,1,cnt,c[u],c[u]);
    dp[u]=query(1,1,cnt,1,c[u]-1)+1;
    ans[u]=max(dp[u],ans[p]);
    bool check=false;
    if (dp[u]>query(1,1,cnt,c[u],c[u])) update(1,1,cnt,c[u],dp[u]),check=true;
    for (int v:a[u])
        if (v!=p) dfs(v,u);
    if (check) update(1,1,cnt,c[u],pre);
}
int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    for (int i=1; i<=n; i++)
    {
        int x;
        cin>>c[i];
        b[i]=c[i];
    }
    for (int i=1; i<n; i++)
    {
        int x,y;
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    sort(b+1,b+1+n);
    for (int i=1; i<=n; i++)
        if (!m[b[i]]) m[b[i]]=++cnt;
    for (int i=1; i<=n; i++)
        c[i]=m[c[i]];
    dfs(1,0);
    for (int i=1; i<=n; i++)
        cout<<ans[i]<<endl;
    return 0;
}


Measured memory_bytes: 46832
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=(b);++i)
#define per(i,a,b) for(int i=a;i>=(b);--i)
#define mem(a,x) memset(a,x,sizeof(a))
#define pb push_back

#define mk make_pair
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
const double pi=acos(-1);
const ll mod=1e9+7;
map< pair<int,ll> ,ll>mp,mp1;
int n,k;
const int N=2e5+10;
ll a[N];
void solve()
{
    scanf("%d%d",&n,&k);
    ++n;
    rep(i,1,n) a[i]=i-1;

    rep(i,1,n)
    {
        a[i]+=a[i-1];
    }
    //rep(i,1,n) printf("i:%d a:%lld\n",i,a[i]);



    ll ans=0;
    rep(i,k,n)
    {
        ll mi=a[i];
        ll mx=a[n]-a[n-i];
        ans=(ans+mx-mi+1)%mod;
        //printf("i:%d v:%lld mi:%lld mx:%lld \n",i,mx-mi+1,mi,mx);

    }

    cout<<ans<<endl;

}
int main()
{
	//int _;cin>>_;while(_--)
	solve();
}


Measured memory_bytes: 5248
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n,q = LI()
    a = [LI() for _ in range(n)]
    b = [LI() for _ in range(q)]
    rr = []

    def k(a,b):
        return sum([(a[i]-b[i]) ** 2 for i in range(3)]) ** 0.5

    def f(a,b,c,r):
        ab = k(a,b)
        ac = k(a,c)
        bc = k(b,c)
        if ac <= r or bc <= r:
            return True
        at = (ac ** 2 - r ** 2)
        bt = (bc ** 2 - r ** 2)
        t = max(at,0) ** 0.5 + max(bt,0) ** 0.5
        return ab >= t - eps

    for x1,y1,z1,x2,y2,z2 in b:
        tr = 0
        ta = (x1,y1,z1)
        tb = (x2,y2,z2)
        for x,y,z,r,l in a:
            if f(ta,tb,(x,y,z),r):
                tr += l
        rr.append(tr)

    return '\n'.join(map(str,rr))


print(main())




Measured memory_bytes: 9112
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

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

    int x, a, b;
    cin >> x >> a >> b;
    b -= a;
    if (b <= 0) cout << "delicious\n";
    else if (b <= x) cout << "safe\n";
    else cout << "dangerous\n";

    return 0;
}


Measured memory_bytes: 256