akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
#include<set>
using namespace std;


const long long int mod=1000000007;
const long long int INF=99999999999999999;
const int pl=13000;

long long int n,a,b,turn[100005]={},color[100005]={};
bool used[100005]={};
vector<int>edge[100005];
stack<int>sta,col;
string str;
int main() {
	cout << fixed << setprecision(18);
    cin>>n;
    for(int i=0;i<n-1;i++){
        cin>>a>>b;
        a--;
        b--;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }
    sta.push(0);
    used[0]=true;
    while(!sta.empty()){
        int nownode=sta.top();
        sta.pop();
        for(int i=0;i<edge[nownode].size();i++){
            if(!used[edge[nownode][i]]){
                used[edge[nownode][i]]=true;
                turn[edge[nownode][i]]=turn[nownode]+1;
                sta.push(edge[nownode][i]);
            }
        }
        
    }
    //cout<<turn[n-1];
    sta.push(n-1);
    col.push(n-1);
    color[n-1]=2;
    while(!sta.empty()){
        int nownode=sta.top();
        sta.pop();
        for(int i=0;i<edge[nownode].size();i++){
            if(turn[nownode]==turn[edge[nownode][i]]+1){
                if(turn[edge[nownode][i]]>turn[n-1]/2){color[edge[nownode][i]]=2;}
                else{color[edge[nownode][i]]=1;}
                sta.push(edge[nownode][i]);
                col.push(edge[nownode][i]);
            }
        }
    }
    while(!col.empty()){
        int nownode=col.top();
        col.pop();
        for(int i=0;i<edge[nownode].size();i++){
            if(color[edge[nownode][i]]==0){
                color[edge[nownode][i]]=color[nownode];
                col.push(edge[nownode][i]);
            }
        }
    }

    int res=0;
    for(int i=0;i<n;i++){
        if(color[i]==2){res++;}
        else{res--;}

    }
    if(res>=0){cout<<"Snuke";}
    else{cout<<"Fennec"<<endl;}
    //for(int i=0;i<n;i++){cout<<turn[i]<<" ";}
    
} 


Measured memory_bytes: 7808
#include<iostream>

using namespace std;
int main(){
    int x,y;
    while(1){
        cin >> x >> y;
        if(x == 0 && y == 0){
            break;
        }
        if(x > y){
            cout << y << " " << x << endl;
        }else{
            cout << x << " " << y << endl;
        }
    }
}


Measured memory_bytes: 3012
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i, n) for (int i = 0; i < (n); i++)
using pint = pair<int, int>;
using Graph = vector<vector<int>>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

int main() {
    int n, k;
    cin >> n >> k;
    int ans = 1;
    rep (i, n) { ans = min (ans * 2, ans + k); }
    cout << ans << "\n";
}

Measured memory_bytes: 3584
inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
l = inp.shift().split(' ')
H = l.shift() * 1
N = l.shift() * 1 
a = inp.shift().split(' ').map(x => x - 0).reduce((c, a) => a + c, 0)
console.log(a >= H ? 'Yes' : 'No')

Measured memory_bytes: 21064
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	string s;
	int flag=0;
	cin>>s;
	for(int i=0;i<3;i++)
	{
		if(s[i]=='7')
		{
			cout<<"Yes"<<'\n';
			flag=1;
			break;
		}
	}
	if(flag==0)
		cout<<"No"<<'\n';
	return 0;
}

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

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long
#define ld long double

#define mod 1000000007
#define EULER 2.7182818284
#define INF 1000000000

#define pb push_back
#define ins insert
#define IT iterator
#define PQ priority_queue
#define    nl           "\n"
#define fi first
#define se second
#define maxe max_element
#define mine min_element
#define er erase
#define lb lower_bound
#define ub upper_bound

#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pi pair<int,int>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define mpi map<int,int>
#define mpl map<ll,ll>
#define umpi unordered_map<int,int>
#define umpl unordered_map<ll,ll>
#define si set<int>
#define sl set<ll>
#define msi multi_set<int>
#define msl multi_set<ll>

#define mem(v,i) memset(v,i,sizeof(v)) // v is array. To set all elements to 0 or -1 only. mem(arr,0);


#define repab(i,a,b) for(int i=(a);i<=(b);i++)
#define reprab(i,a,b) for(int i=(a);i>=(b);i--)
#define repll(i,a,b) for(ll i=(a);i<=(b);i++)
#define rep(i,n) for(int i=(0);i<(n);i++)
#define repr(i,n) for(int i=(n);i>=0;i--)
#define bs bitset
#define bpc(a) __builtin_popcount(a)
#define tc int t;cin>>t;while(t--)


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

ll max(ll a,ll b)
{
    if(a>b)return a;return b;
}
ll min(ll a,ll b)
{
    if(a<b)return a;return b;
}

ll mypow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll gcd(ll a,ll b)
{
    if(b==0)
    return a;
    return gcd(b,a%b);
}


int main()
{   
    
    fast
    int n;
    cin>>n;
    string s;
    cin>>s;
    int i=0;
    while(s[i]=='R'&&i<n){
        i++;
    }
    if(i==n){
        cout<<0<<nl;
        return 0;
    }
    int k=i;
    i=n-1;
    while(s[i]=='W'&&i>=0){
        i--;
    }
    if(i==-1){
        cout<<0<<nl;
        return 0;
    }
    int l=i;
    int ans=0;
    while(k<l){
        if(s[k]=='W'&&s[l]=='R'){
            swap(s[k],s[l]);
            k++;
            l--;
            ans++;
        }
        else if(s[k]=='R'){
            k++;
        }
        else if(s[l]=='W'){
            l--;
        }
    }
    cout<<ans<<nl;
    
    
    return 0;
}

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

int main() {
  int N;
  cin >> N;
  int X, Y, Z;
  X = N / 1.08;
  Y = X*1.08;
  Z = (X+1)*1.08;
  if(Y == N){
    cout << X;
  }
  else if(Z == N){
    cout << X+1;
  }
  else{
    cout << ":(";
  }
}




Measured memory_bytes: 256
//! ----------------------------------------------
//! Framework <https://github.com/vain0x/procon>
//!
//! See the bottom of file for solution.
//! ----------------------------------------------

#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Display, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

/// Print values to standard error if debug mode.
#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

/// Read from standard input and parse each word.
/// - `read!(T, U, ..)` parses a line as a tuple of words.
/// - `read![[T]]` parses a line as an array of words.
/// - `read![..; N]` parses `N` lines, using `read!(..)` repeatedly.
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

/// Read a line from standard input.
#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();

    #[allow(deprecated)]
    buf.trim_right().to_owned()
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

// Σ[i=0..n] Σ[j=i+1..n] Σ[k=0..m] Σ[l=k+1..m] (x(j) - x(i))(y(l) - y(k))
// =  (Σ[i=0..n] Σ[j=i+1..n] (x(j) - x(i)))
//  * (Σ[k=0..m] Σ[l=k+1..m] (y(l) - y(k)))

// Σ[i=0..n] Σ[j=i+1..n] (x(j) - x(i))
// = Σ[i=0..n] (i x(i) - (n - 1) x(i))
// = Σ[i=0..n] (2 i - N + 1) x(i)

const P: i64 = 1_000_000_007;

fn main() {
    let (N, M) = read!(usize, usize);
    let X = read![[i64]];
    let Y = read![[i64]];

    let mut s = 0;
    for i in 0..N {
        s += (2 * (i as i64) - (N as i64) + 1) * X[i] % P;
        s %= P;
    }

    let mut t = 0;
    for k in 0..M {
        t += (2 * (k as i64) - (M as i64) + 1) * Y[k] % P;
        t %= P;
    }

    println!("{}", (s * t) % P)
}


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

A_sum = sum(A)
A_sum_div = []
div = 1
while div ** 2 <= A_sum:
    if A_sum % div == 0:
        A_sum_div.append(div)
        if div ** 2 != A_sum:
            A_sum_div.append(A_sum // div)
    div += 1
A_sum_div.sort(reverse=True)

for i in range(len(A_sum_div)):
    M = A_sum_div[i]
    A_mod = [0] * N
    for j in range(N):
        A_mod[j] = A[j] % M
    A_mod.sort(reverse=True)
    A_mod_sum = sum(A_mod)
    need = 0
    if A_mod_sum != 0:
        for j in range(N):
            need += M - A_mod[j]
            A_mod_sum -= M
            if A_mod_sum == 0:
                break
    if need <= K:
        print(M)
        break


Measured memory_bytes: 42092
use std::io::{stdin, BufRead, BufReader};

fn main(){
    let input = BufReader::new(stdin());

    for line in input.lines(){
        
        let v: Vec<f32> = line.unwrap().split_whitespace().filter_map(|x| x.parse::<f32>().ok()).collect();
        
        println!("{:.3} {:.3}", (v[2]*v[4]-v[1]*v[5])/(v[0]*v[4]-v[1]*v[3]),(v[2]*v[3]-v[0]*v[5])/(v[1]*v[3]-v[0]*v[4]));
    }
}
    

// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
 
pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n {
        vs.push(readln());
    }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(
    String,
    bool,
    f32,
    f64,
    isize,
    i8,
    i16,
    i32,
    i64,
    usize,
    u8,
    u16,
    u32,
    u64
);
impl<T> FromLn for Vec<T>
where
    T: FromLn,
{
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);



Measured memory_bytes: 5060
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int num=0,ans=0;
    for(int i=0;i<n;i++)
        if(s[i]=='W') num++;
    for(int i=n-num;i<n;i++)
        if(s[i]=='R')
            ans++;
    cout<<ans;
    return 0;
}
 

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

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

    if(n==0)
      break;

    char c[100];
    for(int i=0; i<n; i++){
      cin >> c[i];
    }

    int cnt[26] = {0};

    for(int i=0; i<n; i++){
      cnt[(int)(c[i]-'A')]++;

      int max1=-1;
      int max2=-1;

      for(int j=0; j<26; j++){
        if(cnt[j]>max1){
          max2=max1;
          max1=cnt[j];
        }
        else if(cnt[j]>max2){
          max2=cnt[j];
        }
      }
      if(max1-max2>n-(i+1)){
        for(int j=0; j<26; j++){
          if(cnt[j]==max1){
            cout << (char)(j+'A') << ' ';
            break;
          }
        }
        cout << (i+1) << endl;
        break;
      }
      if(i==n-1){
        cout << "TIE" << endl;
        break;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3120
#include <bits/stdc++.h>
#define ll long long int
# define PI 3.14159265358979323846
using namespace std;
int main() {
		ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int r;
    cin>>r;
    double ans;
    ans = 2*PI*r;
    cout<<ans<<endl;
}


Measured memory_bytes: 3804
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>

#define _GLIBCXX_DEBAC
using namespace std;
	
int findx(int n) {
	int sum = 0;
	while (n > 0) {
		sum += n % 10;
		n /= 10;
	}

	return sum;
}

string divide[4] = { "dream","dreamer","erase","eraser" };

int main() {
	int n;
	cin >> n;
	int sum = 0;
	for (int i = 0; i <= n; i++) {
		if (i % 2 == 1) {
			sum += 1;
		}
	}
	cout << (double)sum / n;
	return 0;
}









Measured memory_bytes: 256
#include <bits/stdc++.h>
		using namespace std;
		#define pll pair<ll,ll>
		typedef long long ll;
		#define mod 1000000007
		#define fi first
		#define se second
		#define mp make_pair
		#define pb push_back
		#define INF 1e15
		
		long long binpow(long long a, long long b, long long m) {
			a %= m;
			long long res = 1;
			while (b > 0) {
				if (b & 1)
					res = res * a % m;
			a = a * a % m;
			b >>= 1;
			}
		return res;
		}
		ll modInverse(int A,int M)
		{
			return binpow(A,M-2,M);
		}
		int main()
		{
			
			
			ll n;
			cin>>n;
			vector<ll> v(n+1);
			ll prod=1;
			ll g=v[1];
			
			for(ll i=1;i<=n;i++)
				{cin>>v[i];}
			vector<ll> p(1000005);
			ll lcm=1;
			for(ll i=0;i<=1e6;i++)
				p[i]=1;
			for(ll i=1;i<=n;i++)
			{
				ll p1=v[i];
				for(ll j=2;j*j<=p1;j++)
				{
					ll cnt=1;
					if(p1%j==0)
					{
						while(p1%j==0)
						{
							p1/=j;
							cnt*=j;
						}
						p[j]=max(p[j],cnt);
						
					}
				
				}
				
					p[p1]=max(p1,p[p1]);
				
			}
			for(ll i=1;i<=1e6;i++)
			{
				
				lcm*=p[i];
				lcm%=mod;
			}
			
			
	
			ll ans=0;
			for(ll i=1;i<=n;i++)
			{
				ll ans1=lcm;
				ans1*=modInverse(v[i],mod);
				ans1%=mod;
				ans+=ans1;
				ans%=mod;
				
			}
			cout<<ans;
		}


Measured memory_bytes: 8192
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cassert>
using namespace std;

const int MAX_N = 100005;
typedef long long i64;

int A[MAX_N][3], N, ty;
int rev[2], swp[2];
int pos[MAX_N];

int main() {
  scanf("%d", &N);
  for (int i = 0; i < 3; ++i)
    for (int j = 1; j <= N; ++j)
      scanf("%d", &A[j][i]);

  bool flag = 1;
  
  for (int i = 1; i <= N; ++i) {
    int x = (A[i][0] + 2) / 3, num = x * 3;
    if ((x & 1) != (i & 1)) flag = 0;
    
    pos[x] = i;
    if (A[i][0] == num && A[i][1] == num - 1 && A[i][2] == num - 2) rev[x & 1] ^= 1;
    else if (A[i][0] == num - 2 && A[i][1] == num - 1 && A[i][2] == num) ;
    else flag = 0;
  }

  static bool vis[MAX_N];
  for (int i = 1; i <= N; ++i) {
    int nxt = i;
    while (!vis[nxt]) {
      vis[nxt] = 1;
      nxt = pos[nxt];
      if (!vis[nxt]) swp[i & 1] ^= 1;
    }
  }
  
  if (!flag) {
    puts("No");
    return 0;
  }

  if (swp[0] != rev[1] || swp[1] != rev[0]) puts("No");
  else puts("Yes");
  
  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <deque>
#include <numeric>
#include <utility>
#define sign(a) ((a>0)-(a<0))
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define LL long long
#define INF (LL)(1LL<<60)
#define all(a) a.begin(), a.end()
#define gr greater<LL>()

using namespace std;

long long gcd(long long a, long long b) {
  long long _max = a > b ? a : b;
  long long _min = a > b ? b : a;
  if (!(_max%_min)) return _min;
  else return gcd(_min, _max%_min);
}
 
long long lcm(long long a, long long b) {
  return a/gcd(a,b)*b;
}

const string YES = "YES";
const string NO = "NO";

void solve(long long N, std::vector<long long> p){
    auto pp(p);
    sort(all(pp));
    int cnt=0;
    rep(i,N){
        if(p[i]!=pp[i])cnt++;
    }
    cout << (cnt<=2 ? YES : NO) << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> p(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&p[i]);
    }
    solve(N, std::move(p));
    return 0;
}


Measured memory_bytes: 256
from fractions import gcd
n,k,*a=map(int,open(0).read().split())
x=a[0]
if k>max(a):
  print('IMPOSSIBLE')
  exit()
for a_i in a:
  x=gcd(x,a_i)
if k%x==0:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')

Measured memory_bytes: 16080
//D - Replacing

	#include <bits/stdc++.h>
	#include <cstdio>
	#include <cstring>
	#include <cmath>
	#include <cstring>
	#include <chrono>
	#include <complex>
	#define endl "\n"
	#define ll long long int
	#define vi vector<int>
	#define vll vector<ll>
	#define vvi vector < vi >
	#define pii pair<int,int>
	#define pll pair<long long, long long>
	#define mod 1000000007
	#define inf 1000000000000000001;
	#define all(c) c.begin(),c.end()
	#define mp(x,y) make_pair(x,y)
	#define mem(a,val) memset(a,val,sizeof(a))
	#define eb emplace_back
	#define f first
	#define s second
	
	using namespace std;
	int main()
	{
		std::ios::sync_with_stdio(false);
		ll n;
		cin>>n;
		ll sum =0;
		map<ll, ll> m;
		for (int i = 0; i < n; ++i)
		{
			ll x; cin>>x;
			m[x]++;
			sum += x;
		}
		int q; cin>>q;
		for (int i = 0; i < q; ++i)
		{
			ll a,b;
			cin>>a>>b;
			ll rem = 0;
			if(m[a]) rem= m[a];
			m[a]= 0;
			m[b]+=rem;
			sum -= rem*a;
			sum+= rem*b;
			cout<<sum<<endl; 
		}
		return 0;
	}


Measured memory_bytes: 9492
let nil = -1

type node = {
  mutable parent : int;
  mutable left : int;
  mutable right : int;
  mutable depth : int;
  mutable height : int;
}

let make () = { parent = nil; left = nil; right = nil; depth = nil; height = nil }

let search_root t n =
  let rec doit i =
    if i = n then nil
    else if t.(i).parent = nil then i
    else doit (i + 1) in
  doit 0

let set_depth t n =
  let rec doit i d =
    if i = nil then ()
    else begin
      t.(i).depth <- d;
      doit t.(i).left (d + 1);
      doit t.(i).right (d + 1)
    end in
  doit (search_root t n) 0

let set_height t n =
  let rec doit i =
    let hl = ref 0 in
    let hr = ref 0 in
    if t.(i).left <> nil then begin
      doit t.(i).left;
      hl := t.(t.(i).left).height + 1
    end;
    if t.(i).right <> nil then begin
      doit t.(i).right;
      hr := t.(t.(i).right).height + 1
    end;
    t.(i).height <- (max !hl !hr) in
  doit (search_root t n)

let print t =
  let sibling i =
    if t.(i).parent = nil then nil
    else if t.(t.(i).parent).left <> i && t.(t.(i).parent).left <> nil then t.(t.(i).parent).left
    else if t.(t.(i).parent).right <> i && t.(t.(i).parent).right <> nil then t.(t.(i).parent).right
    else nil in
  let degree i = 0 + (if t.(i).left <> nil then 1 else 0) + (if t.(i).right <> nil then 1 else 0) in
  t |> Array.iteri (fun i _ ->
    "node " ^ string_of_int i
    ^ ": parent = " ^ string_of_int t.(i).parent
    ^ ", sibling = " ^ string_of_int (sibling i)
    ^ ", degree = " ^ string_of_int (degree i)
    ^ ", depth = " ^ string_of_int t.(i).depth
    ^ ", height = " ^ string_of_int t.(i).height
    ^ (if t.(i).parent = nil then ", root"
       else if t.(i).left = nil && t.(i).right = nil then ", leaf"
       else ", internal node")
    ^ "\n"
    |> print_string)

let () =
  let n = read_int () in
  let t = Array.init n (fun _ -> make ()) in
  for _ = 0 to n - 1 do
    let (id, l, r) = Scanf.scanf "%d %d %d\n" (fun id l r -> (id, l, r)) in
    t.(id).left <- l;
    t.(id).right <- r;
    if l <> nil then t.(l).parent <- id;
    if r <> nil then t.(r).parent <- id;
  done;
  set_depth t n;
  set_height t n;
  print t

Measured memory_bytes: 2400
package main
 
import (
  "fmt"
)
 
func main() {
  var H, W int
  var str string
  fmt.Scan(&H)
  fmt.Scan(&W)
  
  for i := 0; i < W+2; i++ {
  	fmt.Printf("#")  
  }
  fmt.Printf("\n")
  for i := 0; i < H; i++ {
  	fmt.Scan(&str)
  	fmt.Printf("#%s#\n", str)  
  }  
  for i := 0; i < W+2; i++ {
  	fmt.Printf("#")  
  }
}

Measured memory_bytes: 1848
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl '\n'
#define mod 1000000007
int main() {
    fio;
    int s1 = 0, r = 0;
    string s;
    cin >> s;
    int ans = 0;
    if (s != "SRR" and s != "SSR" and s != "SRS") {
        for (int i = 0; i < 3; i++) {
            if (s[i] == 'R') {
                r++;
            }
            else {
                r--;
            }
            ans = max(ans, r);
        }

        cout << ans;
    }
    else {
        if (s == "SRR")
            cout << "2";
        else {
            cout << "1";
        }

    }
    return 0;
}

Measured memory_bytes: 3608
if ARGV[0]=="LOCAL_DEV"
  define_method("debug") do |var|
    p var
  end
else
  define_method("debug") do |var|
  end
end

a=STDIN.gets.strip.to_i
ans=0
(1..1000).each do |i|
  (2..10).each do |j|
    t=i**j
    if t<=a && ans<t
      ans=t
    end
  end
end
puts ans



Measured memory_bytes: 1916
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String contestName = sc.nextLine();
		if (contestName.charAt(1) == 'B') {
			System.out.println("ARC");
		} else {
			System.out.println("ABC");
		}
		sc.close();
	}
}


Measured memory_bytes: 35540
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;

public class Main {


    public static void main(String[] args) {
        try (CustomReader in = new CustomReader()) {
            new Main().execute(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


    public void execute(CustomReader in) throws IOException {
        int[] nm = in.readLineAsIntArray();
        final int N = nm[0];
        final int M = nm[1];

        City[] cities = new City[M];
        for (int i = 0; i < M; i++) {
            int[] py = in.readLineAsIntArray();
            cities[i] = new City(i, py[0], py[1]);
        }

        Arrays.parallelSort(cities, (City c1, City c2) -> (c1.pref == c2.pref) ? (c1.year - c2.year) : (c1.pref - c2.pref));
        int idx = 1;
        for (int i = 0; i < M - 1; i++) {
            cities[i].idName = String.format("%06d%06d", cities[i].pref, idx);
            if (cities[i].pref == cities[i + 1].pref) {
                idx++;
            } else {
                idx = 1;
            }
        }
        cities[M - 1].idName = String.format("%06d%06d", cities[M - 1].pref, idx);

        Arrays.parallelSort(cities, (City c1, City c2) -> c1.number - c2.number);

        for (int i = 0; i < M; i++) {
            System.out.println(cities[i].idName);
        }

    }

    class City {
        final int number;
        final int pref;
        final int year;
        String idName;

        public City(int num, int pref, int year) {
            this.number = num;
            this.pref = pref;
            this.year = year;
        }
    }

    static class CustomReader extends BufferedReader {
        public CustomReader() throws IOException {
            super(new InputStreamReader(System.in));
        }

        public int readLineAsInt() throws IOException {
            return Integer.parseInt(readLine());
        }

        public int[] readLineAsIntArray() throws IOException {
            String[] strArray = this.readLine().split(" ");
            int[] intArray = new int[strArray.length];
            for (int i = 0, n = strArray.length; i < n; i++) {
                intArray[i] = Integer.parseInt(strArray[i]);
            }
            return intArray;
        }

        public int[][] readAsIntMatrix(int rows, int columns) throws IOException {
            int[][] matrix = new int[rows][columns];
            for (int i = 0; i < rows; i++) {
                String[] r = this.readLine().split(" ");
                for (int j = 0; j < columns; j++) {
                    matrix[i][j] = Integer.parseInt(r[j]);
                }
            }
            return matrix;
        }

        public char[][] readAsCharMatrix(int rows) throws IOException {
            char[][] matrix = new char[rows][];
            for (int i = 0; i < rows; i++) {
                matrix[i] = this.readLine().toCharArray();
            }
            return matrix;
        }

    }

}

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

int main() {
  int N,K;
  cin >> N >> K;
  
  int x = 1;
  
  for (int i = 0; i < N; i++) {
  	if (x < K)
      x *= 2;
    else
      x += K;
  }
  
  cout << x << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
const ld EPS = 1e-10;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

int main(){
    int N; ll A, B;
    cin >> N >> A >> B;
    int p[N], id[N];
    rep(i, N){
        cin >> p[i]; p[i]--;
        id[p[i]] = i;
    }
    int ord[N];
    rep(i, N){
        ord[i] = 1;
        rep(j, i) if(id[j] < id[i]) ord[i]++;
    }
    ll dp[N+1][N+1];
    fill(dp[0], dp[N+1], INF);
    dp[0][0] = 0;
    rep(i, N){
        rep(j, ord[i]) dp[i+1][j] = dp[i][j];
        rep2(j, ord[i], i+1){
            dp[i+1][j] = min(dp[i][j-1]+A, dp[i][ord[i]-1]+B*(j-ord[i]));
        }
    }
    cout << dp[N][N] << endl;
}

Measured memory_bytes: 199040
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn main(){
    let v:Vec<char> = read::<String>().chars().collect();
    let mut sub = vec![];
    let mut count:i64 = 0;
    for c in &v {
        if *c == 'B'{
            count += 1;    
        }
        sub.push(count);
    }
    let ans = v.into_iter().enumerate().fold(0,|y,x| {
        if x.1 == 'W' {
            let t = y + sub[x.0 as usize];
            t
        } else {
            y
        }
    });
    println!("{:?}",ans);
}

Measured memory_bytes: 8444
class Dice:
    def __init__(self, data):
        self.data = data

    def __eq__(self, value):

            
        for i in range(4):
            if self.data[0] == value.data[0]:
                for j in range(4):
                    if self.data == value.data:
                        return True
                    self.move('R')
            self.move('E')

        for i in range(4):
            if self.data[0] == value.data[0]:
                for j in range(4):
                    if self.data == value.data:
                        return True
                    self.move('R')
            self.move('N')
        return False

    def move(self, direction):
        if direction == 'E':
            self.data[0],self.data[3], self.data[5], self.data[2] = \
                self.data[3],self.data[5], self.data[2], self.data[0] 
        elif direction == 'N':
            self.data[0],self.data[1], self.data[5], self.data[4] = \
                self.data[1],self.data[5], self.data[4], self.data[0]
        elif direction == 'S':
            self.data[0],self.data[1], self.data[5], self.data[4] = \
                self.data[4],self.data[0], self.data[1], self.data[5]
        elif direction == 'W':
            self.data[0],self.data[2], self.data[5], self.data[3] = \
                self.data[2],self.data[5], self.data[3], self.data[0]
        elif direction == 'R':
            self.data[1],self.data[2], self.data[4], self.data[3] = \
                self.data[2],self.data[4], self.data[3], self.data[1]

a = []
for i in range(int(input())):
    a += [Dice(input().split())]

p = 'Yes'
for i in range(len(a) - 1):
    for j in range(i + 1,len(a)):
        if a[i] == a[j]:
            p = 'No'
            break
print(p)

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

vector<int> forintinput(int n) {
	vector<int> x(100000);
	for(int i = 0;i < n;i++) cin >> x[i];
	return x;
}
int main(){
	string s,t;
	int cnt = 0;
	cin >> s >> t;
	for(int i = 0;i < 3;i++){
		if(s[i] == t[i]){
			cnt++;
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 3592
/*
    @uthor: Amit Kumar
    user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"Case #"<<x<<":"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}

vector<pair<ll,ll>> factor_arr;

void myfactor(ll num){ 
    ll count = 0;   
    while (!(num % 2)) { 
        num >>= 1; count++; 
    }  
    if (count) factor_arr.push_back({2,count}); 
    for (auto i = 3; i <= sqrt(num); i += 2) { 
        count = 0; 
        while (num % i == 0) { 
            count++; 
            num /= i; 
        } 
        if (count) factor_arr.push_back({i,count}); 
    } 
    if (num > 2) factor_arr.push_back({num,1});
}

void virus(){
        ll a,b;
        cin>>a>>b;
        cout<<(6) - (a+b);
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t=1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

Measured memory_bytes: 3548
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int k; scanf("%d", &k);

	std::vector<int> a = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	printf("%d\n", a[k - 1]);
	return 0;
}


Measured memory_bytes: 256
using System;

namespace b
{
    class Program
    {
        static void Main(string[] args)
        {
            var _ = Console.ReadLine().Split();
            var a = int.Parse(_[0]);
            var b = int.Parse(_[1]);
            var k = int.Parse(_[2]);

            var count = 0;
            for(var i = 100; i >= 1; i--){
                if(a % i == 0 && b % i == 0){
                    count++;

                    if(count == k){
                        Console.WriteLine(i);
                        break;
                    }
                }
            }
        }
    }
}


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

int main() {
    int n;
    string a, b;
    cin >> n;
    int t = 0;
    int h = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a >> b;
        if (a > b) t += 3;
        else if (a == b) {
            t++;
            h++;
        }
        else h += 3;
    }
    cout << t << " " << h << endl;
}



Measured memory_bytes: 3164
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

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

ll K;

int main() {
  //
  cin >> K;

  if (K % 2 == 0) {
    cout << -1;
    return 0;
  }

  ll cur = 7 % K;
  ll ans = 1;
  for (;;) {
    if (cur == 0) {
      cout << ans;
      return 0;
    }

    cur = (10 % K) * (cur % K) + 7 % K;
    cur %= K;
    ++ans;

    if (ans > 10000000) {
      cout << -1;
      return 0;
    }
  }
}


Measured memory_bytes: 3628
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<ctime>
#include<set>
#include<vector>
#include<map>
#include<queue>

#define N 100005
#define M 8000005

#define ls (t<<1)
#define rs ((t<<1)|1)
#define mid ((l+r)>>1)

#define mk make_pair
#define pb push_back
#define fi first
#define se second

using namespace std;

int i,j,m,n,p,k,cnt,a[N],ans;

int main()
{
		scanf("%d",&n);
		for (i=1;i<=n;++i) scanf("%d",&a[i]);
		for (i=29;i>=0;--i)
		{
				int cnt=0;
				for (j=1;j<=n;++j)
					if (a[j]>(1<<i))
				{
					if (a[j]==(1<<(i+1))) ans+=1-cnt,cnt=1;
					else ans+=1-cnt,cnt^=1;
					a[j]=(1<<i);
				}
				else cnt=0;
		}
		printf("%d\n",ans);
}

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

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

namespace Q1
{
    class Program
    {
        static void Main(string[] args)
        {
            string line = Console.ReadLine();
            string[] strs = line.Split(' ');
            int A = int.Parse(strs[0]);
            int B = int.Parse(strs[1]);
            int C = int.Parse(strs[2]);
            if (A == B && A == C) Console.WriteLine("Yes");
            else Console.WriteLine("No");
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>

#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define RREP(i,a,n) for(int i=n-1;i>=a;i--)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,a,n) for(int i=a;i<n;i++)
#define all(a) (a).begin(),(a).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define sz(x) ((int)(x).size())
#define uniq(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define fs first
#define sc second

#define MOD 1000000007
#define INF 1LL<<55

#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)

using namespace std;

using ll = long long;

template<typename T1,typename T2> using P = pair< T1, T2 >;
using Pii = P<int,int>;
using Pll = P<ll,ll>;
using Pdd = P<double,double>;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<ll>;
using Vs = V<string>;

template<typename T1,typename T2> using M = map< T1, T2>;
using Mii = M<int, int>;
using Mll = M<ll, ll>;
using Msi = M<string, int>;

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> istream& operator >>(istream &is, vector<T> &v){for(T &e:v)is>>e;return is;}
template<class T> ostream& operator <<(ostream &os, vector<T> v){os<<"{";for(T &e:v)os<<e<<(v.size()-(int)(&e-&v[0])>1?", ":"");os<<"}";return os;}

void _DEBUG(){}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<(sizeof...(b)?",":"\n");_DEBUG(b...);}

inline void in(){}
template<typename H,typename... T>void in(H &a, T&... b){cin>>a;in(b...);}
inline void out(){}
template<typename H,typename... T> void out(H a, T... b){cout<<a<<(sizeof...(b)?" ":"\n");out(b...);}

template<class T> void resz(int n,T& v){v.resize(n);}
template<class H,class... T> void resz(int n,H& a,T&... b){a.resize(n);resz(n,b...);}

// please declaration dx[8], dy[8]
#define DX {-1,0,1,0,-1,-1,1,1}
#define DY {0,-1,0,1,-1,1,1,-1}
#define DX2 {-1,0,1,0}
#define DY2 {0,-1,0,1}


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);}// 最大公倍数
int factorial(int n){if(n > 1)return n * factorial(n - 1);else return 1;} // 階乗
struct io{io(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}io;// io 高速化

signed main() {
  ll n, k;
  in(n, k);
  Vi vec(n);
  in(vec);

  ll ans = 0;
  rep(i, n) {
    if (vec[i] >= k) {
      ans++;
    }
  }
  out(ans);

  return 0;
}



Measured memory_bytes: 640
#define  _CRT_SECURE_NO_WARNINGS
#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144*2LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

unsigned long xor128() {
	static unsigned long x = 123456789, y = 362436069, z = 521288629, w = time(NULL);
	unsigned long t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

void init() {
	iostream::sync_with_stdio(false);
	cout << fixed << setprecision(20);
}
#define int ll
int n, m;

vector<vector<int>> mult(vector<vector<int>> a, vector<vector<int>> b) {
	vector<vector<int>> ans;
	REP(i, n) {
		ans.push_back(vector<int>());
		REP(q, n) {
			ans.back().push_back(0);
			REP(j, n) {
				ans.back().back() += a[i][j] * b[j][q];
				ans.back().back() %= m;
			}
		}
	}
	return ans;
}

void solve(){
	while (true) {
		int a, b, c, t;
		cin >> n >> m >> a >> b >> c >> t;
		if (n == 0) return;
		vector<int> inputs;
		REP(i, n) {
			int a;
			cin >> a;
			inputs.push_back(a);
		}
		vector<vector<int>> bases;
		vector<vector<int>> ans;
		REP(i, n) {
			bases.push_back(vector<int>());
			ans.push_back(vector<int>());
			REP(q, n) {
				if (q == i - 1) {
					bases.back().push_back(a);
				}
				else if (q == i) {
					bases.back().push_back(b);
				}
				else if (q == i + 1) {
					bases.back().push_back(c);
				}
				else {
					bases.back().push_back(0);
				}
				if (q == i) {
					ans.back().push_back(1);
				}
				else {
					ans.back().push_back(0);
				}
			}
		}
		while (t) {
			if (t % 2) {
				ans = mult(ans, bases);
			}
			bases = mult(bases, bases);
			t /= 2;
		}
		REP(i, n) {
			if (i != 0) cout << " ";
			ll now = 0;
			REP(j, n) {
				now += ans[i][j] * inputs[j];
				now %= m;
			}
			cout << now;
		}
		cout << endl;
	}
}

#undef int
int main() {
	init();
	solve();
}


Measured memory_bytes: 3264
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
   int a,b,c;cin>>a>>b>>c;
   if (c-(a-b)<0)
   {
       /* code */
       cout<<0<<endl;
   }
   
   else{
  cout<<c-(a-b)<<endl;}
}

Measured memory_bytes: 256
/*
 * 1142.c
 *
 *  Created on: 2013/06/17
 *      Author: icchyr
 */

#include <set>
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(){

	string sam, a, b, c, d;

	int m, l;

	cin >> m;

	for(int i = 0; i < m; i++){
		cin >> sam;
		set<string> str;

		for(int j = 1; j < sam.length(); j++){
			a = sam.substr(0, j);
			b = sam.substr(j);

			c = a, d = b;
			reverse(c.begin(), c.end());
			reverse(d.begin(), d.end());

			str.insert(a + b);
			str.insert(b + a);
			str.insert(a + d);
			str.insert(d + a);
			str.insert(c + b);
			str.insert(b + c);
			str.insert(c + d);
			str.insert(d + c);
		}
		cout << str.size() << endl;
	}
	return 0;
}

Measured memory_bytes: 1292
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  bool A=false;
  cin>>a>>b>>c;
  for(int i=b;i<=c;i++){
    if(i%a==0){
      cout<<"OK"<<endl;
      A=true;
      break;
    }
  }
  if(A==false)cout<<"NG"<<endl;
}

Measured memory_bytes: 3636
n = int(input())

taro = 0
hanako = 0

for _ in range(n):
    left, right = input().split()

    if left > right:
        taro += 3
    elif left < right:
        hanako += 3
    else:
        taro += 1
        hanako += 1

print(taro, hanako)



Measured memory_bytes: 5596
#include <bits/stdc++.h>
using namespace std;
int main(){
  string a;
  cin >> a;
  if (a[0] == a[1] || a[0] == a[2] || a[1] == a[2]) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  
  return 0;
}
    

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
using namespace std;

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;
#define mp make_pair
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 200200;
char s[N];
int n, a, b, c, d;

bool check(int l, int r) {
	if (s[l] == '#' || s[r] == '#') return false;
	for (int i = l; i < r; i++)
		if (s[i] == '#' && s[i + 1] == '#') return false;
	return true;
}
bool solve() {
	if (!check(a, c)) return false;
	if (!check(b, d)) return false;
	if (d > c) return true;
	for (int i = b; i <= d; i++) {
		if (s[i - 1] == '.' && s[i] == '.' && s[i + 1] == '.')
			return true;
	}
	return false;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);
	a--;b--;c--;d--;
	scanf("%s", s);
	if (solve())
		printf("Yes\n");
	else
		printf("No\n");

	return 0;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int main(){

	int N,M;

	scanf("%d %d",&N,&M);

	ll A_sum = 0,B_sum = 0,tmp;

	for(int loop = 0; loop < N; loop++){

		scanf("%lld",&tmp);
		A_sum += tmp;
	}

	for(int loop = 0; loop < M; loop++){

		scanf("%lld",&tmp);
		B_sum += tmp;
	}

	printf("%lld\n",A_sum*B_sum);

	return 0;
}



Measured memory_bytes: 3232
using System;
using System.Collections.Generic;

namespace test
{
	class MainClass
	{

		public static int cnt;
		public static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			int[] A = new int[n];
			for (int i = 0; i < n; i++)
			{
				A[i] = int.Parse(Console.ReadLine());
			}
			cnt = 0;
			int m = (int)Math.Pow(n, (double)1 / (double)3);
			int[] G = new int[m];
			G[0] = n/ 3;
			G[m - 1] = 1;
			for (int i = 1; i < m - 1; i++)
			{
				G[i] = Math.Max(1, G[i - 1] / 3);
			}
			for (int i = 0; i < m; i++)
			{
				InsertionSort(A, n, G[i]);
			}
			Console.WriteLine(m);
			for (int i = 0; i < m; i++)
			{
				Console.Write(G[i]);
				Console.Write(i != m - 1 ? " " : "\n");
			}
			Console.WriteLine(cnt);
			for (int i = 0; i < A.Length; i++)
			{
				Console.WriteLine(A[i]);
			}

		}

		public static void InsertionSort(int[] A, int n, int g)
		{
			for (int i = g; i < n; i++)
			{
				int v = A[i];
				int j = i - g;
				while (j >= 0 && A[j] > v)
				{
					A[j + g] = A[j];
					j = j - g;
					cnt++;
				}
				A[j + g] = v;
			}
		}
	}
}

Measured memory_bytes: 16740
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[100005];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	cout<<a[n/2+1]-a[n/2]<<endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
    using namespace std;
    #define FOR(i,n) for(int i=0;i<n;i++)
    #define why(n,x) int n;while(cin >>n,n!=x)
    #define iFOR(i,x,n)for(int i=x;i<n;i++)
    #define unless(flg) if ( !(flg) )
    #define read cin<<
    #define echo cout<<
    #define fin <<'\n'
    #define __ <<" "<<
    #define ___ <<" "
    #define bash push_back
    #define ALL(x) x.begin(),x.end()
    #define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
    #define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
    #define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
    #define memmin(x) memset((x),-1,sizeof((x)))
    #define memzer(x) memset((x), 0,sizeof((x)))
    #define meminf(x) memset((x),0x3f,sizeof((x)))
    #define int long long
    typedef long long ll;
    typedef pair < int , int > pii;
    typedef vector < int > vit;
    typedef map < string , int > mstit;
    typedef vector < pii > vpi ;
    typedef greater < pii > gpi;
    typedef priority_queue < pii , vpi , gpi > dijk ;
    static const signed int INF = 0x3f3f3f3f;
    static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
    static const signed int SMOD = 1000000007;
    static const signed int NMOD = 1000000009;
    static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
    static const signed int dy[]={0,-1,0,1,-1,1,-1,1};
     
    bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
    template<class T>T abs(T &x){return x<0 ? -x : x;}
    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; }
    int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
    int gcd(int a,int b){return b?gcd(b,a%b):a;}
     
     
     
    signed main(){
    int n;
    int ans = 0;
    bool hoge = true;
    string str[105];
    cin >> n;
    FOR(i,n){
    cin >> str[i];
    FOR(j,i){
    if(str[i] == str[j]) hoge = false;
    }
    if(i){
    int blen = str[i-1].length();
    if(str[i-1][blen-1] != str[i][0]) hoge = false;
    }
    }
    if(hoge) cout <<"Yes\n";
    else cout << "No\n";
    return 0;
    }
     
     
     
    struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;
     

Measured memory_bytes: 256