akhauriyash/Code-Regression huggingface dataset:
#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i=(ll)(r);i<(ll)(n);++i)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define pb(n) push_back(n)
#define endl '\n'
#define debug(x) cout << #x << " = " << (x) << endl
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c
#define VIN(V) for(int ii = 0; ii < (V).size(); ii++) {cin >> (V).at(ii);}
#define OUT(n) cout << n << endl
#define OUT2(n1,n2) cout << n1 << " " << n2 << endl
#define OUT3(n1,n2,n3) cout << n1 << " " << n2 << " " << n3 << endl
#define VOUT(V) REP(ii,(V).size()){cout << (V)[ii] << " ";} cout<<endl;
#define VOUT2(V) REP(jj,(V).size()){VOUT(V[jj])}
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<vi > vvi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = numeric_limits<ll>::max();
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
ll n, m, k, ans, sum, cnt = 0; string s; char c; bool flg;

int main(){
  cin.tie(0);ios::sync_with_stdio(false);
  IN2(n,k);

  ll a,b;
  unordered_map<ll, set<ll>> edges;
  FOR(i,0,n) {
    IN2(a,b);
    edges[a].insert(b);
    edges[b].insert(a);
  }

  queue<P > q;
  q.push(P(1,0));
  vector<bool> visited(n+1);
  FOR(i,0,n+1) visited[i] = false;
  visited[1] = true;
  ans=1;
  while (!q.empty()) {
    P now = q.front(); q.pop();
    // debug(now.first);

    set<ll> now_edges = edges[now.first];
    ll now_gensui = now.second;
    ans = ans * (k-now_gensui) % MOD;

    if (now_gensui < 2) now_gensui++;
    else now_gensui = 2;

    ll bunki_count = 0;
    for(auto x : now_edges) {
      if (visited[x]) continue;
      q.push(P(x,now_gensui + bunki_count));
      bunki_count++;
      visited[x] = true;
    }
  }

  OUT(ans);
}


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

int main(){
  int n;
  cin>> n;
  vector<int> p(n),right(n);
  for (int i=0; i<n; i++) {cin>> p.at(i); right.at(i)=i+1;}
  
  string ans="YES";
  int wrong=0;
  for (int i=0; i<n; i++){
    if (p.at(i)!=right.at(i)) wrong++;
    if (wrong>2) {ans="NO"; break;}
  }
  cout<< ans << endl;
}

Measured memory_bytes: 256
import sys
from collections import Counter
from collections import deque
import math
import fractions
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,r=mp()
if n>=10:
    print(r)
else:
    print(100*(10-n)+r)

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> X(M);
  for (int i = 0; i < M; i++) cin >> X[i];
  sort(X.begin(), X.end());
  vector<int> dis(M - 1);
  for (int i = 0; i < M - 1; i++) dis[i] = X[i + 1] - X[i];
  sort(dis.begin(), dis.end(), greater<int>());
  long long ans = 0;
  for (int i = N - 1; i < M - 1; i++) ans += dis[i];
  cout << ans << endl;
}

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

using namespace std;

template <typename T> class FenwickTree {
  private:
    std::vector<T> ft;

  public:
    FenwickTree(int sz) : ft(sz + 1, 0) {}

    void add(int idx, T x) {
        for (int i = idx + 1; i < static_cast<int>(ft.size()); i += i & -i) {
            ft[i] += x;
        }
    }

    T operator()(int idx) const {
        T res = 0;
        for (int i = idx + 1; i > 0; i -= i & -i) {
            res += ft[i];
        }
        return res;
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, Q;
    cin >> N >> Q;
    vector<int> C(N);
    for (int i = 0; i < N; i++) {
        cin >> C[i];
        C[i]--;
    }
    vector<vector<pair<int, int>>> L(N);
    for (int i = 0; i < Q; i++) {
        int l, r;
        cin >> l >> r;
        l--, r--;
        L[r].emplace_back(make_pair(l, i));
    }
    vector<int> res(Q), A(N);
    FenwickTree<int> ft(N + 1);
    for (int i = 0; i < N; i++) {
        if (A[C[i]] > 0)
            ft.add(A[C[i]], -1);
        ft.add(i + 1, 1);
        A[C[i]] = i + 1;
        for (auto &x : L[i]) {
            res[x.second] = ft(i + 1) - ft(x.first);
        }
    }
    for (auto r : res) {
        cout << r << '\n';
    }
    return 0;
}


Measured memory_bytes: 33276
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x,a,b;
    string ans="dangerous";
    cin>>x>>a>>b;
    if(b-a<=0) ans="delicious";
    else if(b-a<=x) ans = "safe";

    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
using namespace std;
#define LL long long
LL n, ans;
map<LL,bool>mp;

bool check(LL y){
	LL x = n;
	while(x > 1){
		if(x % y == 0) x /= y;
		else{
			x %= y;
			break;
		}
		
	}
	if(x == 1) return 1;
	return 0;
}

int main(){ 
	cin>>n;
	for(LL i = 1; i * i <= n-1; i++) if((n - 1) % i == 0) ans += 2, mp[i] = mp[(n-1)/i] = 1;
	if( (LL)sqrt(n-1) * (LL)sqrt(n-1) == n - 1) ans--;
	for(LL i = 2; i * i <= n; i++) if(check(i) && mp[i] == 0) ans++;
	cout<<ans;
}

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

namespace cs_pro_0906
{
    class Program
    {
        static void Main(string[] args)
        {
            //これではスペース区切りに対抗できない
            //int a = int.Parse(Console.ReadLine());
            //int b = int.Parse(Console.ReadLine());
            string[] str = Console.ReadLine().Split(' ');//一行入力を、スペース区切りごとに受け入れる
            int a = int.Parse(str[0]);//０番目
            int b = int.Parse(str[1]);//１番目


            if(a*b%2 == 0)
            {
                Console.WriteLine("Even");
            }
            else Console.WriteLine("Odd");

        }
        
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <vector>
#include <limits>

using namespace std;
typedef long long ll;

int main(){
    ll n, m;
    cin >> n >> m;
    vector<ll> a(m), b(m), c(m, 0);
    for(int i = 0; i < m; ++i){
        cin >> a.at(i) >> b.at(i);
        for(int j = 0; j < b.at(i); ++j){
            ll tmp;
            cin >> tmp;
            tmp--;
            c.at(i) |= (1 << tmp);
        }
    }

    vector<ll> price(1 << n, numeric_limits<ll>::max());
    price.at(0) = 0;
    for(ll i = 0; i < price.size(); ++i){
        if(price.at(i) == numeric_limits<ll>::max()){
            continue;
        }
        for(ll j = 0; j < m; ++j){
            const ll k = i | c.at(j);
            price.at(k) = min(
                price.at(k),
                price.at(i) + a.at(j)
            );
        }
    }

    if(price.back() != numeric_limits<ll>::max()){
        cout << price.back() << endl;
    }else{
        cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(ll i=0; i<(n); ++i)
#define rep1(i,n) for(ll i=1; i<=(n); ++i)
#define repi(i,a,b) for(ll i=a; i<=(b); ++i)
#define rrep(i,n) for(ll i=(n-1); i>=0; --i)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define print(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
using Edge = pair<ll,ll>;
using Graph = vector<vector<Edge>>;
typedef pair<ll,ll> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
ll MOD = 1e9 + 7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
ll devc(ll x, ll y){return 1 + (x-1)/y;}
ll modpow(ll x, ll y, ll m) {
    if (y == 0) return 1;
    ll res = modpow(x, y / 2, m);
    return res * res % m * (y & 1 ? x : 1) % m;
}
ll modinv(ll x) { return modpow(x, MOD - 2, MOD); }

int main(){
    ll N,R; cin >> N >> R;
    if(N >= 10) print(R);
    else{
        print(R+100*(10-N));
    }
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
typedef pair<int,int> P;
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define rep(i, n) for (lint i = 0; i < (n); i++)
#define INF LLONG_MAX
#define all(x) (x).begin(),(x).end()
#define pb push_back
int main(){
    string s;
    cin>>s;
    int w;
    cin>>w;
    for(int i=0;i<s.size();i+=w){
        cout<<s[i];
    }
    cout<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int x,y,a,b,c;
    scanf("%d%d",&x,&y);
    a=x+y;
    b=x-y;
    c=x*y;
    if(a>b && a>c)
    printf("%d\n",a);
    else if(b>a && b>c)
    printf("%d\n",b);
    else if(c>a && c>b)
    printf("%d\n",c);
    else printf("%d",a);
    return 0;
}


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

int a[45];
int n;
int main()
{
    cin>>n;
    int i;
    for(i=0;i<=n;i++){
        if(i==0||i==1)a[i]=1;
        else{
            a[i]=a[i-1]+a[i-2];
        }
    }
    cout<<a[n]<<endl;
    return 0;
}

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}

const ll MOD = (ll)(1e9 + 7);

const int MAX_N = 212345;
ll fact[MAX_N];
ll fact_inv[MAX_N];
ll inv[MAX_N];

ll f(ll a, ll b, ll c, ll d) {
  int n = c - a;
  int m = d - b;
  ll res = fact[n+m] * fact_inv[n] % MOD * fact_inv[m] % MOD;
  return res % MOD;
}

int main2() {
  ll H = nextInt();
  ll W = nextInt();
  ll A = nextInt();
  ll B = nextInt();

  ll ans = 0;
  for (int i = 0; i < max(H, W) + 1; i++) {
    int h = H - A - i;
    int w = B + i + 1;
    if (w > W || h <= 0) break;
    ans += f(1, 1, h, w) * f(h, w, H, W) % MOD;
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}


int main() {
  inv[0] = inv[1] = 1;
  for (int i = 2; i < MAX_N; i++) inv[i] = inv[(int) (MOD % i)] * (MOD - MOD / i) % MOD;
  fact[0] = 1;
  for (int i = 1; i < MAX_N; i++) fact[i] = fact[i-1] * i % MOD;
  fact_inv[0] = 1;
  for (int i = 1; i < MAX_N; i++) fact_inv[i] = fact_inv[i-1] * inv[i] % MOD;

  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 5248
#[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, usize1) => {
        read_value!($next, usize) - 1
    };

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

use std::cmp::Ordering;

#[derive(Debug, Copy, Clone, Eq, PartialEq)]
struct Rev(usize);

impl Ord for Rev {
    fn cmp(&self, other: &Rev) -> Ordering {
        other.0.cmp(&self.0)
    }
}

impl PartialOrd for Rev {
    fn partial_cmp(&self, other: &Rev) -> Option<Ordering> {
        Some(other.0.cmp(&self.0))
    }
}


#[allow(unused_imports)]
use std::cmp::{min, max};
#[allow(unused_imports)]
use std::io::{stdout, stdin, BufWriter, Write};

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      n: usize,
      m: usize,
      abcs: [(usize1,usize1,usize); m],
    }

    const INF: usize = 1 << 50;
    let mut dist = vec![vec![INF; n]; n];
    for &(a, b, c) in abcs.iter() {
        dist[a][b] = c;
        dist[b][a] = c;
    }
    for i in 0..n {
        dist[i][i] = 0;
    }
    for k in 0..n {
        for i in 0..n {
            for j in 0..n {
                dist[i][j] = min(dist[i][k] + dist[k][j], dist[i][j]);
            }
        }
    }

    let mut ans = 0;
    for &(a, b, c) in abcs.iter() {
        if dist[a][b] == c {
            ans += 1;
        }
    }
    puts!("{}\n", m-ans);
}


Measured memory_bytes: 4352
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[M];
        int[] b = new int[M];
        for (int i = 0; i < M; ++i) {
            a[i] = sc.nextInt() - 1;
            b[i] = sc.nextInt() - 1;
        }

        System.out.println(solve(N, a, b));

        sc.close();
    }

    static String solve(int N, int[] a, int[] b) {
        int[] counts = new int[N];
        for (int i = 0; i < a.length; ++i) {
            ++counts[a[i]];
            ++counts[b[i]];
        }

        return Arrays.stream(counts).mapToObj(String::valueOf).collect(Collectors.joining("\n"));
    }
}

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

using namespace std;

int dp[3001][3001];
int idx[3001][3001];
bool already[3001][3001];
string a, b;

int Solve(int x = 0, int y = 0) {
    if(already[x][y])
        return dp[x][y];
    already[x][y] = true;
    if(x == a.size() || y == b.size())
        dp[x][y] = 0;
    else {
        dp[x][y] = Solve(x + 1, y);

        int i = y;
        for (; i < b.size(); ++i)
            if (b[i] == a[x])
                break;
        idx[x][y] = i;
        if(i != b.size() && Solve(x + 1, i + 1) + 1 > dp[x][y])
            dp[x][y] = 1 + dp[x + 1][i + 1];
    }
    return dp[x][y];
}

void Print(int x = 0, int y = 0) {
    if(dp[x][y] == 0)
        return;
    int i = idx[x][y];
    if(i != b.size() && dp[x + 1][i + 1] + 1 > dp[x + 1][y]){
        cout << a[x];
        Print(x + 1, i + 1);
    }
    else
        Print(x + 1, y);
}

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

    cin >> a >> b;
    Solve();
    Print();
    cout << "\n";

    return 0;
}//RUL0

Measured memory_bytes: 79616
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	ll k,a,b;
	cin>>k>>a>>b;
	FOR(i,a,b+1){
		if(i%k==0){
			cout<<"OK"<<endl;
			return 0;
		}
	}
	cout<<"NG"<<endl;
}

Measured memory_bytes: 3652
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

use std::f64::consts::PI;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let a: f64 = sc.get();
    let b: f64 = sc.get();
    let x: f64 = sc.get();
    if x / a > a * b / 2. {
        let h = 2. * (a * a * b - x) / (a * a);
        let ans = (h as f64).atan2(a as f64) / PI * 180.;
        println!("{}", ans);
    } else {
        let h = 2. * x / (a * b);
        let ans = (b as f64).atan2(h as f64) / PI * 180.;
        println!("{}", ans);
    };
}


Measured memory_bytes: 4352
#include<cstdio>

int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    int d = a / b;
    int r = a % b;
    double f = (double)a / b; 
    printf("%d %d %f\n",d,r,f);
    
    return 0;
}


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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll x,a,b;
  cin >> x >> a >> b;

  if(abs(a-x) > abs(b-x))
    cout << "B" << endl;
  else
    cout << "A" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
    string str,aoki;
    int q,a,b;
    cin>>str>>q;
    for(int i=0;i<q;++i){
        cin>>aoki>>a>>b;
        if(aoki=="print"){
            for(int i=a;i<=b;++i){
                cout<<str[i];
            }
            cout<<endl;
        }
        else if(aoki=="reverse"){
            string rina=str;
            for(int i=a;i<=b;++i){
                str[i]=rina[b-(i-a)];
            }
        }
        else if(aoki=="replace"){
            string yazawa;
            cin>>yazawa;
            for(int i=a;i<=b;++i){
                str[i]=yazawa[i-a];
            }
        }
    }
    return 0;
}



Measured memory_bytes: 3232
// copied from https://atcoder.jp/contests/abc110/submissions/8089381

#include<bits/stdc++.h>

using namespace std;

#define MAX_COMB_F 100100 

long long MOD = pow(10,9)+7;
long long comb[MAX_COMB_F][50];

main(){
  long long n, m, temp;
  //n=100000;
  //m=536870912;
  cin>>n>>m;
  vector<long long> p;
  temp=m;

  for(int i=2;i<MAX_COMB_F;i++){
    long long count=0;
    while (temp%i==0){
      temp /= i;
      count++;
    }
    p.push_back(count);
  }

  // for(int i=0;i<MAX_COMB_F;i++){
  //   cout<<p[i]<<' ';
  // }
  // cout<<endl;
  // cout<<endl;
  // cout<<endl;

  if(temp!=1){p.push_back(1);}

  comb[0][0]=1;

  for(int i=1;i<MAX_COMB_F;i++){
    for(int j=0;j<50;j++){

      if(j-1>=0){
        comb[i][j] = comb[i-1][j-1]+comb[i-1][j];
      }else{
        comb[i][j] = comb[i-1][j];
      }
      comb[i][j] %= MOD;
    }
  }

  long long ans = 1;
  for(int i=0;i<p.size();i++){
    long long m;
    m=p[i];
    if(n-1+m>MAX_COMB_F){

      cout<<n<<endl;
      cout<<m<<endl;
      cout<<(n-1+m)<<endl;
    }
    ans *= comb[n-1+m][m];
    ans %= MOD;
  }

  cout << ans << endl;

}


Measured memory_bytes: 40308
#include<bits/stdc++.h>
using namespace std;
#define LL long long

int main(){
	// sengen
	int n,l;
	// nyuryoku
	cin >> n >> l;
	int mi,ma;
	mi = l;
	ma = l + n -1;
	int sum = n*(mi + ma)/2;
	if(mi <= 0 && ma >= 0){
		cout << sum << endl;
	}else if(abs(mi) >= abs(ma)){
		cout << sum - ma << endl;
	}else{
		cout << sum - mi << endl;
	}
	// keisan

	// syutsuryoku
}

Measured memory_bytes: 3476
import java.util.*;

public class Main {
    public static void main(String[] args) {
        String[] weather = {"Sunny", "Cloudy", "Rainy"};
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();

        TommorowWeather(0, weather, S);
    }
    public static void TommorowWeather(int index, String[] weather, String S) {
        if (index >= 3) {
            return;
        }
        if (S.equals(weather[index])) {
            int ans = index + 1;
            if (ans >= 3) {
                ans = 0;
            }
            System.out.println(weather[ans]);
            return;
        }
        TommorowWeather(index + 1, weather, S);
    }
}


Measured memory_bytes: 21972
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<iostream>

using namespace std;

int main()
{
	string s;
	while(cin>>s){
		int l=s.size();
		for(int i=0;i<l;i+=2){
			cout<<s[i];
		}
		cout<<endl;
	}
	return 0;
}


Measured memory_bytes: 512
// B - K個のケーキ

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

int main() {
	int K, T;
	cin >> K >> T;

	int max_a = 0;
	for (int i=0; i<T; i++) {
		int a;
		cin >> a;
		max_a = max(max_a, a);
	}

	int ans = max(0, max_a - (K - max_a) - 1);

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using intl = long long;
using itnl = long long;//typo用
using itn = int;//typpo用
using ld = long double;
using namespace std;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define rrep(i, n) for(intl i = (intl)(n) - 1; i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define rrepi(i, a, b) for(intl i = (intl)(a); i > (intl)(b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,1,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define alength(a) (sizeof(a) / sizeof(a[0]))
#define debug(x) cout << #x << ":" << x << endl
#define rdebug(i,x) rep(i, alength(x))cout << #x << "[" << i << "]:" << x[i] << endl//1次元配列の出力
#define rrdebug(i, j, x) rep(i, alength(x))rep(j, alength(x[i]))cout << #x << "[" << i << "][" << j << "]:" << x[i][j] << endl//二次元配列の出力
#define pb push_back
#define mp make_pair
#define pii pair<intl,intl>
const intl INF = 1e9;
const intl MOD = 1e9+7;
const ld EPS = 1.0e-14;//-9
const ld PI = acos(-1);
void fp(bool f){cout << (f ? "Yes" : "No") << endl;}
void fp(bool f, string s, string t){cout << (f ? s : t) << endl;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) {a = b; return true;} return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) {a = b; return true;} return false; }
intl gcd(intl a, intl b){ if(!b)return a; return gcd(b, a % b); }
intl lcm(intl a,intl b){ return a / gcd(a, b) * b; }
intl kai(intl k){//k!を求める関数
    intl a = 1;
    for(int i = 2; i <= k; i++){
        a *= i;
    }
    return a;
}
intl digit10(intl a){//aを10進数で表したときの桁数を求める関数
    intl b = 0;
    do{
        a /= 10;
        b++;
    }while(a);
    return b;
}

//--------------入力受け取る場所----------------------------------------------------

intl a,b;

void input_var(){
    cin >> a >> b;
}
//-------------------------------------------------------------------------------


signed main(){
    cout << fixed << setprecision(10);
    input_var();
    intl c = gcd(a,b);
    intl cnt = 0;
    for(intl i = 2; i * i <= c; i++){
        if(!(c % i))cnt++;
        while(!(c % i))c /= i;
    }
    if(c != 1)cnt++;
    cout << cnt + 1 << endl;
}

Measured memory_bytes: 256
#include<iostream> 
#include<algorithm> 
using namespace std; 
#define N 100010 

int main(){
  int n,m,h[N],ma[N]; 
  cin>>n>>m;
  for(int i=1;i<=n;i++){
    cin>>h[i];
    ma[i]=0;
  }
  for(int i=0;i<m;i++){ 
    int a,b;
    cin>>a>>b;
    ma[a]=max(ma[a],h[b]);
    ma[b]=max(ma[b],h[a]);
  }
  
  int ans=0;
  for(int i=1;i<=n;i++){
    ans+=h[i]>ma[i]; 
  }
    cout<<ans<<endl; 
}

Measured memory_bytes: 4416
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;

struct NODE
{
    int l;
    int r;
}g[100010];

int cmp(struct NODE a,struct NODE b)
{
    if(a.r == b.r)
        return a.l < b.l;
    return a.r < b.r;
}

int main()
{
    int n,m,i;
    scanf("%d%d",&n,&m);
    for(i = 0;i < m;i++)
        scanf("%d%d",&g[i].l,&g[i].r);
    sort(g,g + m,cmp);
    int mm = g[0].r;
    int ans = 1;
    for(i = 0;i < m;i++)
    {
        if(g[i].l >= mm)
        {
            mm = g[i].r;
            ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 1024
#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
#define CRP(t, x) const t &x
#define OPL(t, x) bool operator<(CRP(t, x)) const
#define FIL(x, v) memset(x, v, sizeof(x))
#define CLR(x) FIL(x, 0)
#define NE1(x) FIL(x, -1)
#define INF(x) FIL(x, 0x3f)
#ifndef _DEBUG
#define _DEBUG 0
#endif // !_DEBUG
#define IFD if (_DEBUG)
typedef long long ll, i64;
const int N = 1050;
ll a[N], b[N], c[N], id[N];
int main()
{
    ll ans = 0;
    int n, m;
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; i++) scanf("%lld%lld%lld", a + i, b + i, c + i), id[i] = i;
    for (int i : {-1, 1})
        for (int j : {-1, 1})
            for (int k : {-1, 1})
            {
                sort(id, id + n, [&](ll l, ll r) {
                    return i * a[l] + j * b[l] + k * c[l] > i * a[r] + j * b[r] + k * c[r];
                });
                ans = max(ans, accumulate(id, id + m, 0ll, [&](ll pre, int cur) {
                              return pre + i * a[cur] + j * b[cur] + k * c[cur];
                          }));
            }
    printf("%lld", ans);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define fst first
#define snd second
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e20;
const int INF = 1e9;
const double EPS = 0.000000001;
struct edge {ll to, cost; };
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
 
bool pC(const P& pair1, const P& pair2) {
    return pair1.second > pair2.second;
}
 
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  VI a(n), b(n);
  unordered_map<int, ll> hash;
  REP(i, n){
    cin >> a[i];
  }
  b[0] = a[0] % m;
  hash[b[0]] = 1;
  REP(i, n-1){
    b[i+1] = (b[i] % m + a[i+1] % m) % m;
    b[i+1] = b[i+1] % m;
    auto itr = hash.find(b[i+1]);
    if(itr != hash.end()) itr->second++;
    else hash[b[i+1]] = 1;
  }
  ll ans = 0;
  for(auto itr = hash.begin(); itr != hash.end(); ++itr) {
    if(itr->first == 0) ans += itr->second;
    ans += (itr->second) * (itr->second - 1) / 2;
  }
  out(ans);
  return 0;
}

Measured memory_bytes: 4492
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++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 ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using lint = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL << 60;

int main()
{
    double n;
    cin >> n;
    vector<double> x(n),y(n);

    rep(i,n) cin >> x[i] >> y[i];

    double dis = 0;

    rep(i,n-1){
        for(int j = i+1;j < n;j++){
            dis+=sqrt((x[j] - x[i])*(x[j] - x[i])+(y[j] - y[i])*(y[j] - y[i]));
        }
    }

    double ans = (2*dis)/n;

    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n = int(input())
    L = sorted(list(map(int,input().split())))
    ans = 0
    for i in range(n-2):
        for j in range(i,n-1):
            if L[i] == L[j]: 
                continue
            for k in range(j,n):
                if L[j] == L[k]:
                    continue
                if L[i]+L[j] <= L[k]:
                    break
                ans+=1
    print(ans)

if __name__=='__main__':
    main()

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

int main(){
  int k;
  cin >> k;
  string ret="";
  for(int i=0;i<k;i++) ret += "ACL";
  cout << ret << endl;
  return 0;
}

Measured memory_bytes: 3624
n = int(input())
a = [int(input()) for i in range(n)]
sum_a = sum(a)
MOD = 998244353

dp = [0] * (sum_a + 1)
dp[0] = 1
for i in range(n):
    for j in range(sum_a + 1)[::-1]:
        # 選ばないとき
        dp[j] += dp[j]
        if j - a[i] >= 0:
            dp[j] += dp[j - a[i]]
        dp[j] %= MOD
        
dq = [0] * (sum_a + 1)
dq[0] = 1
for i in range(n):
    for j in range(sum_a + 1)[::-1]:
        # 選ぶとき
        if j - a[i] >= 0:
            dq[j] += dq[j - a[i]]
            dq[j] %= MOD
        else:
            break

ans = 0
for j in range(sum_a + 1):
    if sum_a <= j * 2:
        ans += dp[j] * 3
        ans %= MOD

if sum_a % 2 == 0:
    ans -= dq[sum_a // 2] * 3

print((3 ** n - ans) % MOD)

Measured memory_bytes: 43612
//warota!w

#include <stdio.h>
 
int N = 1000;
 
void out(int A[], int n){
  int i;
  for (i=1;i<=n;i++){
    if (i>1) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

void intertionSort(int* A, int n){
  int i, j, key=0;
  for(i = 1; i <= n; i++){
    key = A[i];
    j = i-1;
    while(j >= 0 && A[j] > key){
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = key;
    out(A,n);
  }
}
 
int main(void){
  int n, i;
  int A[N+1];
  scanf("%d", &n);
 
  for (i=1;i<=n;i++) scanf("%d", &A[i]); //data input
  intertionSort(A, n);
 
  return 0;
}

Measured memory_bytes: 608
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <functional>
#include <map>
#include <set>
#include <tuple>
#include <cassert>
#include <bitset>

using namespace std;
int main(){
    int N,i,K,A;
    cin >> N;
    int D[N];
    for(i = 0;i < N;i++) cin >> D[i];
    sort(D,D + N);
    A = 0;
    for(K = D[(N / 2) - 1] + 1;K <= D[N / 2];K++) A++;
    cout << A << endl;
}

Measured memory_bytes: 4024
/*
        karmany evadhikaras te
        ma phalesu kadacana 
        ma karma-phala-hetur bhur
        ma re sango'stv akarmani (B.G.-2.47)
 
Translation:
        Lord Krsna to Arjuna.
You have a right to perform your prescribed duty, 
but you are not entitled to the fruits of action. 
Never consider yourself the cause of the results of your activities, 
and never be attached to not doing your duty.    
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 200005;
const ll mod = 1e9+7;
#define ld long double
#define PI 3.14159265358979323846
const int X = 1000;

void flash()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(12);
}

//3. Structure or classes
//3. Ends here

//1. Data structures declaration here
//1. Ends here

//2. Extra Functions here
//2. Ends here


void solve();
int32_t main()
{
    flash();
    int t;
    t = 1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

void solve()
{
    int n;
    cin>>n;
    map<string,int>mp;
    string y;
    for(int i=0;i<n;i++){
        cin>>y;
        mp[y]++;
    }
    cout<<"AC x "<<mp["AC"]<<"\n";
    cout<<"WA x "<<mp["WA"]<<"\n";
    cout<<"TLE x "<<mp["TLE"]<<"\n";
    cout<<"RE x "<<mp["RE"]<<"\n";
    return;
}

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

#define int long long
#define vi vector <int>
#define endl "\n"
#define vvi vector <vector<int> >
#define vii vector <pair<int,int> >
#define rep(i,a,b) for (int i=a;i<b;i++)
#define repD(i,a,b) for (int i=a;i>=b;i--)
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define init(i,k) memset(i,k,sizeof i)
#define pb push_back
#define pii pair <int,int>
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
const int N=1e5+5 , MOD=1e9+7;

//---------------------------------------------------------------


void solve()
{
    int h,a;
    cin >> h >> a;
    int ans = h/a;
    h %= a;
    if(h) ans++;
    cout << ans << endl;
}

signed main()
{
    speed;
    
 //    int t; cin >> t;
 //    rep(tt,1,t+1)
 //    {
	// cout <<"Case #"<<tt<<": ";
	solve();
 //    }
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
int main(){
    int a,b,c;
    int i;
    int count=0;
    scanf("%d%d%d",&a,&b,&c);
    for(i=1;;i++){
        if(i%7==0){
            count += b;
        }
        count += a;
        if(count>=c){
            break;
        }
    }
    printf("%d\n", i);
    return 0;
    
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
ll factorial(int i) {       //階乗
    if (i == 0) return 1;
    return (factorial(i - 1)) * i;
}

int main() {
    int n, m, c;
    cin >> n >> m >> c;
    vector<int> b(m);
    rep(i, m) cin >> b[i];
    vector<vector<int>> a(n, vector<int> (m));
    rep(i, n) {
        rep(j, m) cin >> a[i][j];
    }
    int count = 0;
    int sum;
    rep(i, n) {
        sum = 0;
        rep(j, m) {
            sum += a[i][j] * b[j];
        }
        sum += c;
        if(sum > 0) count++;
    }
    cout << count << endl;
}

Measured memory_bytes: 3544
#include <cstdio>
#include <algorithm>
#include <cmath>

int main() {
	int N, x[100], y[100], v[100];
	std::scanf("%d", &N);
	for (int i = 0; i < N; ++i) {
		std::scanf("%d %d", x + i, y + i);
		v[i] = i;
	}
	std::sort(v, v + N, [&](int a, int b) {
		return std::atan2((double) y[a], (double) x[a]) < std::atan2((double) y[b], (double) x[b]);
	});

	long long max = 0;
	for (int i = 0; i < N; ++i) {
		for (int j = i + 1; j <= i + N; ++j) {
			long long x_sum = 0, y_sum = 0;
			for (int k = i; k < j; ++k) {
				x_sum += x[v[k % N]];
				y_sum += y[v[k % N]];
			}
			long long value = x_sum * x_sum + y_sum * y_sum;
			if (value > max) {
				max = value;
			}
		}
	}
	std::printf("%.16lf", std::sqrt(max));
}

Measured memory_bytes: 256
#include <stdio.h>
 
#define N 100000
 
int partition(int, int);
 
int A[N];
 
int main(){
 
  int n,i,x;
 
  scanf("%d",&n);
 
  for(i=0 ; i<n ; i++){
    scanf("%d",&A[i]);
  }
 
  x=partition(0,n-1);
 
  for(i=0 ; i<n ; i++){
    if(i==x) printf("[%d]",A[i]);
    else printf("%d",A[i]);
    if(i<n-1) printf(" ");
  }
 
  printf("\n");
 
  return 0;
}
 
int partition(int p, int r){
 
  int x,i,j,temp;
 
  x=A[r];
  i=p-1;
 
  for(j=p ; j<r ; j++){
  if(A[j]<=x){
    i++;
    temp=A[i];
    A[i]=A[j];
    A[j]=temp;
  }
}
  temp=A[i+1];
  A[i+1]=A[r];
  A[r]=temp;
 
return i+1;
 
}


Measured memory_bytes: 2128
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;} 
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        ll ans = a == c ? 0 : 1;
        cout << ans << endl;
}


Measured memory_bytes: 3632
//#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define MAX_INT 2100000000
#define ex5 (100000+10)
using namespace std;
typedef long long int ll;
#ifdef COMPILE_IN_VCPP
#include <windows.h>
HWND GetConsoleHwnd(void)
{
#define MY_BUFSIZE 1024 // Buffer size for console window titles.
	HWND hwndFound;         // This is what is returned to the caller.
	char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated// WindowTitle.
	char pszOldWindowTitle[MY_BUFSIZE]; // Contains original// WindowTitle.
	ULARGE_INTEGER nt;
	nt.QuadPart = GetTickCount64();
	GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
	wsprintf(pszNewWindowTitle, "%d%d/%d",nt.HighPart,nt.LowPart,GetCurrentProcessId());
	SetConsoleTitle(pszNewWindowTitle);
	Sleep(40);
	hwndFound = FindWindow(NULL, pszNewWindowTitle);
	SetConsoleTitle(pszOldWindowTitle);
	return(hwndFound);
}
#endif
int main()
{
#ifdef COMPILE_IN_VCPP
	SetWindowPos(GetConsoleHwnd(), HWND_TOPMOST, 0, 0, 0, 0,
		(SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW));
#endif
	int x, a,ans;
	cin >> x >> a;
	if (x < a) ans = 0;
	else ans = 10;
	cout << ans << endl;
}


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

#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}


constexpr ll MOD = (ll)1e9 + 7LL;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 100;

class Flow
{
public:
    using T = ll;
    struct Edge {
        Edge(const int from_, const int to_, const int reverse_, const T capacity_, bool is_reverse = false) : from{from_}, to{to_}, reverse{reverse_}, capacity{capacity_}, flow{0}, is_reverse(is_reverse) {}
        int from;
        int to;
        int reverse;
        T capacity;
        T flow;
        bool is_reverse;
    };

    Flow(const int v) : V{v}
    {
        edge.resize(v);
    }
    void addEdge(const int from, const int to, const T capacity)
    {
        edge[from].push_back(Edge{from, to, (int)edge[to].size(), capacity, false});
        edge[to].push_back(Edge{to, from, (int)edge[from].size() - 1, 0, true});
    }

    T FordFulkerson(const int s, const int t)
    {
        vector<bool> checked(V);
        T flow = 0;
        while (true) {
            for (int i = 0; i < V; i++) {
                checked[i] = false;
            }
            const T f = dfs_ff(s, t, INF<T>, checked);
            if (f == 0) {
                break;
            }
            flow += f;
        }
        return flow;
    }

    const int V;
    vector<vector<Edge>> edge;

private:
    T dfs_ff(const int pos, const int t, const T flow, vector<bool>& checked)
    {
        if (pos == t) {
            return flow;
        }
        checked[pos] = true;
        for (auto& e : edge[pos]) {
            if (not checked[e.to]) {
                const T res = e.capacity - e.flow;
                if (res > 0) {
                    const T d = dfs_ff(e.to, t, min(flow, res), checked);
                    if (d > 0) {
                        e.flow += min(d, res);
                        edge[e.to][e.reverse].flow -= min(d, res);
                        return d;
                    }
                }
            }
        }
        return 0;
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    constexpr ll MAX = (ll)1e10;
    vector<ll> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }
    const ll sum = accumulate(a.begin(), a.end(), 0);

    Flow flow(N + 2);
    const int s = 0;
    const int t = N + 1;
    for (int i = 1; i <= N; i++) {
        flow.addEdge(s, i, MAX);
        for (int j = 1; i * j <= N; j++) {
            flow.addEdge(i * j, i, (ll)1e13);
        }
        flow.addEdge(i, t, MAX - a[i - 1]);
    }

    const ll min_loss = MAX * N - flow.FordFulkerson(s, t);
    cout << min_loss << endl;

    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

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

	int N;
	string A, B, C;
	cin >> N >> A >> B >> C;
	
	int rsl = 0;
	rep(i, 0, N) {
		if(A[i] == B[i] and B[i] == C[i]) continue;

		if(A[i] != B[i] and B[i] != C[i] and C[i] != A[i]) rsl += 2;

		else if(A[i] != B[i]) rsl += 1;

		else if(A[i] == B[i]) rsl += 1;

		else if(A[i] != C[i]) rsl += 1;
	}

	cout << rsl << endl;

}


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



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)


const int MAX = 100002;

int main(void){

	int N, M; cin >> N >> M;
	vector<int> a(MAX, 0);

	REP(i,M){
		int L, R; cin >> L >> R;
		a[L]++;
		a[R+1]--;
	}
	
	FOR(i,1,MAX){
		a[i] += a[i-1];
	}

	int ans = 0;
	REP(i,MAX){
		if(a[i] == M) ans++;
	}

	cout << ans << endl;
	return 0;

}


Measured memory_bytes: 640