akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <math.h>
#include <limits>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <map>
#include <utility>
using namespace std;
#define rep(i, n) for (int i =0; i < (int)(n); i++)
typedef pair<int, string> P;
 
 
 
 
int main() {
    int x;
    cin >> x;
    long long ans = 0;
    for (int i = -1000; i <= 1000; i++) {
        for (int j = -1000; j <= 1000; j++) {
        
        ans = pow(i, 5) - pow(j, 5);
        if (ans == x) {
            cout << i << " " << j << endl;
            return 0;
        }
        }
    }
   
 
}

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

using namespace std;

int main() {
    int N ;
    vector<int> A;
    cin >> N;
    for (int i = 0; i < N ; ++i) {
        int tmp;
        cin >> tmp;
        A.push_back(tmp);
    }
    vector<int> Anorm;
    for (int j = 0; j <N ; ++j) {
        Anorm.push_back(A.at(j) - j-1);
    }
    sort(Anorm.begin(),Anorm.end());

    auto middleVal = Anorm.at((Anorm.size())/2);
    long ans = 0;
    for (int k = 0; k < N; ++k) {
        ans+= abs(Anorm[k] - middleVal);
    }
    cout << ans <<endl;
}

Measured memory_bytes: 2548
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;cin>>s;
    int s0=0, s1=0;
    for(int i=0;i<s.size();i++){
        if(s[i] == '0'){
            s0++;
        }else{
            s1++;
        }
    }
    cout << min(s0, s1)*2;
    return 0;
}

Measured memory_bytes: 512
// by newbiechd
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <vector>

// DELETE the debugging information!
#define debug(x) std::cerr << #x << " = " << (x) << std::endl

const int N_MAX = 100003;
char s[N_MAX];

int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  std::map<char, int> mp;
  mp['N'] = 0, mp['S'] = 1, mp['E'] = 2, mp['W'] = 3;
  int ext[4] = {0, 0, 0, 0};
  for (int i = 1; i <= n; ++i)
    ext[mp[s[i]]] = 1;
  printf(((ext[0] ^ ext[1]) == 0) && ((ext[2] ^ ext[3]) == 0) ?
         "Yes\n" : "No\n");
  return 0;
}


Measured memory_bytes: 256
s = input()
s_sum = []
for i in range(2**(len(s)-1)):
    sj = 0
    a = 0
    for j in range(len(s)-1):
        if ((i>>j) & 1):
            a += int(s[sj:j+1])
            sj = j+1
    a += int(s[sj:])
    s_sum.append(a)
print(sum(s_sum))  

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

int main(){
  int a,b;
  cin >> a >> b;
  string s_a="",s_b="";
  for(int i=0;i<b;i++){
    s_a.push_back('0'+a);
  }
  for(int i=0;i<a;i++){
    s_b.push_back('0'+b);
  }
  if(s_a < s_b){
    cout << s_a << endl;
  }
  else{
    cout << s_b << endl;
  }
}

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

void convert(int x, int b){
    if ( x == 0 ) return;
    int p, l = x%10;
    if ( l < 0 ) l *= -1;
    if ( l == 0 ){
	p = 0;
    } else if ( x*b < 0 ){
	p = 10-l;
	x -= b*10;
    } else {
	p = l;
    }
    convert(x/10, b*(-1));
    cout << p;
}

main(){
    int x;
    while(1){
      cin >> x;
      if ( x== 0 ) break;
	convert(x, 1);
	cout << endl;
    }
}

Measured memory_bytes: 0
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
typedef long long ll;

int n;
int sx, sy, gx, gy, bx, by; 
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double dp[3][3][16];

// 残りk回動けて今x, yにいるとき最後充電スペースにいける確率
double dfs(int x, int y, int k) {
    if (dp[x][y][k] >= 0) return dp[x][y][k];
    if (k == 0) {
        if (x == gx && y == gy) return 1;
        else return 0;
    }
    double ret = 0;
    for (int i = 0; i < 4; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if (nx < 0 || nx >= 3 || ny < 0 || ny >= 3) ret += dfs(x, y, k-1) / 4;
        else if (nx == bx && ny == by) ret += dfs(x, y, k-1) / 4;
        else ret += dfs(nx, ny, k-1) / 4;
    }
    return dp[x][y][k] = ret;
}

int main(void) {
    while (1) {
        cin >> n;
        if (n == 0) break;
        char s, t, b;
        cin >> s >> t >> b;
        sx = (int)(s-'A') % 3; sy = (int)(s-'A')/3;
        gx = (int)(t-'A') % 3; gy = (int)(t-'A')/3;
        bx = (int)(b-'A') % 3; by = (int)(b-'A')/3;
        for (int i = 0; i < 3; i++)
            for (int j = 0; j < 3; j++)
                for (int k = 0; k < 16; k++)
                    dp[i][j][k] = -1;
        printf("%.10f\n", dfs(sx, sy, n));
    }
    return 0;
}

Measured memory_bytes: 1188
import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val X, Y = sc.nextInt

  val a = 2 * X
  val b = Y - a
  val c = b / 2
  val d = X - c
  val z = if (c < 0 || d < 0 || c + d != X || c * 4 + d * 2 != Y) "No" else "Yes"
  println(z)
}


Measured memory_bytes: 55384
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
while(cin>>s){
for(int i=0;i<s.size();i++){
int a=s[i]-'A';
a-=3;
if(a<0) a+=26;
a%=26;
char p='A'+a;
cout<<p;
}
cout<<endl;
}
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int n,a,b;
    bool Awin=false;
    cin>>n>>a>>b;

    if((b-a)%2==0){
        Awin=true;
    }else{
        Awin=false;
    }

    //boolean A can move
    // if(a==1)Awin=false;

    if(a+1==b)Awin=false;



    if(Awin){
        cout<<"Alice"<<endl;
    }else{
        cout<<"Borys"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <fstream>
#include <sstream>
#include <math.h>
#include <map>
using namespace std;

int main()
{
	int N,G=0,max;
	vector<int> A;
	cin >> N;
	for(int i=0;i<N;i++)
	{
		int a;
		cin >> a;
		A.push_back(a);
		G=G+a;
	}
	sort(A.begin(),A.end());
	G=G-A[N-1];

	if(A[N-1]<G)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

}

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

const int N = 200000;
string s[2] = {"ABC", "ARC"};

 
int main(){
    string t;
    cin >> t;
    if (t == s[0]) cout << s[1] << endl;
    else cout << s[0] << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ep emplace_back

using namespace std;

const int  mod = 1e9 + 7;
const int e = 2e5 + 69;
const int base = 311;

ll a[e];

int main()
{
    ll k, n;
    cin >> k >> n;
    ll ans1 = 0;
    ll ans2 = 0;
    for(int i=1; i<=n; i++)
    {
        cin >> a[i];
    }
    ll maxx = 0;
    ll vt;
    for(int i=1; i<=n; i++)
    {

        ll cur;
        if(i < n)
        {
            cur = a[i + 1] - a[i];
        }
        else
        {
            cur = k - a[n] + a[1];
        }
        if(cur > maxx)
        {
           maxx = cur;
            vt = i;
        }
    }
    ll dem = 0;
    cout << k - maxx;

}


Measured memory_bytes: 1792
import java.util.*;

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

		while(scan.hasNextInt()){
			int ans = 0;
			int n = scan.nextInt();
			int p[] = new int[100];

			for(int i=0;i<n;i++){
				p[i] = scan.nextInt();
			}
			Arrays.sort(p,0,n);

			for(int i=0,tmp=0;i<n;i++){
				tmp += p[i];
				ans += tmp;
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 12000
package main

import (
	"bufio"
	"fmt"
	"os"
	"regexp"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	var i int
	if sc.Scan() {
		if num, err := strconv.Atoi(sc.Text()); err == nil {
			i = num
		}
	}
	return i
}

func nextString() string {
	var s string
	if sc.Scan() {
		s = sc.Text()
	}
	return s
}

func checkRegexp(reg, str string) bool {
	return regexp.MustCompile(reg).Match([]byte(str))
}

func main() {
	sc.Split(bufio.ScanWords)
	var gachaMap = map[string]bool{}
	n := nextInt()
	for i := 0; i < n; i++ {
		gachaMap[nextString()] = true
	}
	fmt.Println(len(gachaMap))
}


Measured memory_bytes: 14280
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    string s; cin>>s;
    if((int)s.size()==3) reverse(all(s));
    cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main {
        public static void main(String args[]) {
                Scanner sc = new Scanner(System.in);
                long N = sc.nextLong();
                long ans = 0L;
                long prev = 0L;
                for (long i = 0L; i < N; i++) {
                        long now = sc.nextInt();
                        ans += Math.min(prev, now);
                        now -= Math.min(prev, now);
                        ans += now / 2;
                        now %= 2;
                        prev = now;
                }
                System.out.println(ans);
        }
}

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

int main()
{int A,B,C;
 cin >> A >> B >>C;
 
 bool flag = false;
 
 for(int i = 1; i <= B ; i++)
 {if(i*A % B == C){ flag = true;

}}
 if(flag){cout<<"YES"<<endl;}
 else{cout<<"NO"<<endl;}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
    cout << fixed << setprecision(10);
    ll ans = 0;
    ll now = 0;
    string s;
    cin >> s;
    rep(i, s.size()){
        if(s[i] == 'B') now++;
        else ans += now;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
    int N,A,B;
    int res=0,sum=0;
    int temp;
    cin>>N>>A>>B;
    for(int i=1;i<=N;i++){
        temp=i;
        do{
            sum+=temp%10;
        }while((temp=(temp/10))!=0);
        if(sum>=A&&sum<=B)
            res+=i;
        sum=0;
    }
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;
int a[200100];

void solve() {
    int x = 0;
    for (int i = 0; i < n; i++) x ^= a[i];
    for (int i = 0; i < n; i++) {
        cout << (x ^ a[i]);
        if (i == n-1) cout << endl;
        else cout << " ";
    }
}

void input() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    solve();
}


Measured memory_bytes: 4404
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}

		long[] r = new long[n];
		long[] l = new long[n];

		l[0] = a[0];
		r[n - 1] = a[n - 1];
		for (int i = 1; i < n; i++) {
			l[i] = gcd(l[i - 1], a[i]);
		}
		for (int i = n - 2; i >= 0; i--) {
			r[i] = gcd(r[i + 1], a[i]);
		}

		// 一つ好きな数値に変換 == その値を無視したときの Max の GCD の値
		long answer = Math.max(r[1], l[n - 2]);
		for (int i = 1; i < n - 1; i++) {
			answer = Math.max(answer, gcd(r[i + 1], l[i - 1]));
		}

		System.out.println(answer);
	}

	private static long gcd(long a, long b) {
		if (b == 0) return a;
		return gcd(b, a % b);
	}
}


Measured memory_bytes: 51004
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>

using namespace std;

int main(){

    long long int a,b,c,k;

    cin >> a >> b >> c >> k;
    
    if(k<a)cout << k << endl;
    else if(k<=a+b)cout << a << endl;
    else cout << a+(-1)*(k-a-b) << endl; 

}

Measured memory_bytes: 3632
// BEGINNING WITH THE NAME OF ALMIGHTY GOD ALLAH
// AUTHOR:: MOHAMMAD FAISAL
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.flush();
	int a,b;
    cin >> a >> b;
    cout<<(2*b)-a;
	return 0;
	// BYE BYE 
}


Measured memory_bytes: 256
import Control.Applicative
import Control.Monad
import Data.List

main = do
  s <- sort <$> getLine
  if (s !! 0 == s !! 1) && (s !! 1 /= s !! 2) && (s !! 2 == s !! 3)
    then putStrLn "Yes"
    else putStrLn "No"


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

typedef long long ll;
ll n, p, ans;
vector<ll> v, w;

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	cin >> n >> p;
	ll q = p;
	for(ll i=2; i*i<=p; ++i){
		if(q % i == 0){
			v.push_back(i);
			w.push_back(1);
			q /= i;
			while(q % i == 0){
				++w[w.size()-1];
				q /= i;
			}
		}
	}
	if(q > 1){
		v.push_back(q);
		w.push_back(1);
	}
//	for(int i=0; i<v.size(); ++i)
//		cout << v[i] << " " << w[i] << "\n";
	ans = 1;
	for(int i=0; i<v.size(); ++i)
		for(ll j=n; j<=w[i]; j+=n)
			ans *= v[i];
	cout << ans << "\n";
}

Measured memory_bytes: 256
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var n=r(1);r(2)(n.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";var n=r(3),i=r(5);t.exports=function(t){var e=new n(t);i(e)}},function(t,e,r){"use strict";var n=r(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new n(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,r){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,r){"use strict";var n=1000000007;function i(){for(var t=arguments,e=t[0],r=t.length;--r;)e=((e>>16)*t[r]%n*65536+(65535&e)*t[r])%n;return e}var o=[],s=[],u=[];function c(t){o.length=t+1,o[0]=o[1]=1;for(var e=2;e<=t;)o[e]=i(o[e-1],e++);for(s.length=t+1,s[0]=s[1]=1,s[t]=function(t){for(var e,r=n,i=0,o=1;t;o=e)i-=(e=r/t|0)*o,e=r-=e*t,r=t,t=e,e=i,i=o;return(i%=n)<0?i+n:i}(o[t]),e=t;2<e;)s[e-1]=i(s[e],e--);for(u.length=t+1,u[0]=u[1]=1,e=2;e<=t;)u[e]=i(o[e-1],s[e++])}t.exports=function(t){var e,r,u=t.in(),f=t.in(),a=0;c(1e6);for(var l=0;l<=1e6;l++){if((u-l)%2==0){var p=(u-l)/2;2*l+p==f&&(a+=(r=l,i(o[e=l+p],s[r],s[e-r])),a%=n)}}console.log(a)}}]);

Measured memory_bytes: 63024
#include<stdio.h>
#define M 250000
int main(){
  int i,j,n,c[M]={0};
  char p[M]={1,1};
  for(i=0;i*i<M;i++){
    if(p[i])continue;
    for(j=i*i;j<M;j+=i)p[j]=1;
  }
  for(i=1;i<M;i++)c[i]=c[i-1]+1-p[i];
  while(scanf("%d",&n),n)printf("%d\n",c[n*2]-c[n]);
  return 0;
}

Measured memory_bytes: 1828
#include <cstring>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <fstream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <algorithm>
#include <vector>
#include <set>
#include <complex>
#include <list>
#include <climits>
#include <cctype>
#include <bitset>
using namespace std;

#define PI 3.14159265359
#define all(v) v.begin(),v.end()
#define sortva(v) sort(all(v))
#define sortvd(v) sort(v.rbegin(),v.rend())
#define sortaa(a,n) sort(a,a+n)
#define sortad(a,n) sort(a,a+n),reverse(a,a+n)
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1,v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1,v2,v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define sfstr(v) scanf("%s", v);
#define sz(v) (int)v.size()
#define ndl puts("")
#define SS stringstream
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

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

ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

void PLAY() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	cout << fixed << setprecision(10);
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}


int c[1000];
int s[1000];
int f[1000];

vector<pair<int, int>> adj[1000];
int n;
ll calc(int start) {

	ll res = s[start];
	ll cur = start;
	ll cur_time = s[start];
	while (cur != n) {
		res += c[cur];
		cur_time += c[cur];
		ll nxt = cur + 1;
		if (nxt == n - 1) break;
		ll tmp = s[nxt];
		while (tmp < cur_time)
			tmp += f[nxt];
		res += tmp - cur_time;
		cur_time = tmp;
		cur = nxt;
	}
	return res;
}

int main() {
	//PLAY();

	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> c[i] >> s[i] >> f[i];

	for (int i = 0; i < n; i++)	
		cout << calc(i) << endl;
	

	return 0;
}

Measured memory_bytes: 256
while True:
    m,f,r = map(int,input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print("F")
    elif m+f >= 80:
        print("A")
    elif m+f >= 65:
        print("B")
    elif m+f >= 50:
        print("C")
    elif m+f >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")


Measured memory_bytes: 5592
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(_v) for(auto _x:_v){cout<<_x<<" ";}cout<<endl
#define printVS(_vs) for(auto _x : _vs){cout << _x << endl;}
#define printVV(_vv) for(auto _v:_vv){for(auto _x:_v){cout<<_x<<" ";}cout<<endl;} cout << endl;
#define printP(_p) cout << _p.first << " " << _p.second << endl
#define printVP(_vp) for(auto _p : _vp) printP(_p);

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<Pii> vp;
const int inf = 1e9;
const int mod = 1e9 + 7;
typedef vector<vector<int>> Graph;

int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}

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

    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if (a == c || b == d) {
        cout << 0 << endl;
        return 0;
    }

    if (a > c) {
        swap(a, c);
    }
    if (b > d) {
        swap(b, d);
    }

    c -= a;
    d -= b;
    int x = c, y = d;
    int g = gcd(x, y);
    x /= g;
    y /= g;
    cout << g * (x + y - 1) << endl;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define what_is(x) cerr << #x << " is " << x << endl;
#define MT make_tuple
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define REP(i,a,b) for (int i = a; i <= b; i++)
#define FOR(i,n) for (int i=0;i < n ; i++)
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

int main(){
	int n,k;
	cin >> n >> k;
	int a[n];
	FOR(i,n) cin >> a[i];
	sort(a,a+n);
	int sum=0;
	for(int j=n-1;j >= n-k;j--)sum+=a[j];
	cout << sum;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(var,cnt) for(int (var)=0; (var)<(int)(cnt); ++(var))
#define Rep(var,init,cnt) for(int (var)=(init); (var)<(cnt); ++(var))
#define ran(var,vec) for(auto &(var):(vec))
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define SORT(v) sort(all(v))
#define RSORT(v) sort(rall(v))
#define SUM(v) accumulate(all(v),0)
#define tget(tp,idx) get<idx>(tp)
#define TF(flag) (flag)?1:0
#define yn(f) cout<<(f?"yes":"no")<<endl
#define Yn(f) cout<<(f?"Yes":"No")<<endl
#define YN(f) cout<<(f?"YES":"NO")<<endl
#define COUT(x) cout<<(x)<<endl
using namespace std;

using ll = long long;
using ull = unsigned long long;
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using ti = tuple<int,int,int>;
using tl = tuple<ll,ll,ll>;

template<typename T>
using vec = vector<T>;
template<typename T>
using mat = vector<vec<T>>;
template<typename T>
using cub = vector<mat<T>>;
template<typename T>
using val = valarray<T>;

template<typename T>
using pq = priority_queue<T>;
template<typename T>
using rpq = priority_queue<T,vec<T>,greater<T>>;

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

template<typename T1,typename T2>
istream &operator>>(istream &is, pair<T1,T2> &p){
  is>>p.first>>p.second;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  cout<<"V{";
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  cout<<"}";
  return os;
}

template<typename T>
istream &operator>>(istream &is, vector<T> &v){
  for(T &in:v) is>>in;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const valarray<T> &v){
  cout<<"V{";
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  cout<<"}";
  return os;
}

template<typename T>
istream &operator>>(istream &is, valarray<T> &v){
  for(T &in:v) is>>in;
  return is;
}

// Usual Template End ================================================

// Template End ======================================================

constexpr int MOD=1e9+7;

int main(void){
  int a,b; cin>>a>>b;
  if(a>8||b>8) COUT(":(");
  else COUT("Yay!");
}













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

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

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

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

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define UB upper_bound
#define LB lower_bound
#define PQ priority_queue

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

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

// ---- ----

LL d;

LL ex(LL x) {
	LL v = 1;
	inc(i, x) { v *= 10; }
	return v;
}

LL t[20], u[20];

LL search(int L, int i, LL v) {
	if(i == L / 2) { return (v == 0 ? (L % 2 == 0 ? 1 : 10) : 0); }
	
	LL ans = 0;
	incII(j, -9, 9) {
		LL Z = v - j * (ex(L - 1 - i) - ex(i));
		if(Z > ex(L - 1 - i)) { continue; }
		LL X = search(L, i + 1, Z);
		LL Y = (i == 0 ? u : t)[j + 10];
		ans += X * Y;
		if(Z < -ex(L - 1 - i)) { break; }
	}
	return ans;
}

int main() {
	cin >> d;
	
	incII(i, 0, 9) {
	incII(j, 0, 9) {
		t[ i - j + 10 ]++;
	}
	}
	incII(i, 1, 9) {
	incII(j, 1, 9) {
		u[ i - j + 10 ]++;
	}
	}
	
	LL ans = 0;
	incII(L, 2, 18) {
		ans += search(L, 0, d);
	}
	
	cout << ans << endl;
	
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>

int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	
	if(a<b)printf("a < b\n");
	if(a>b)printf("a > b\n");
	if(a==b)printf("a == b\n");
	
	return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

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; }

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

  return 0;
}

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

namespace atcorder
{
    class Program
    {
        static void Main(string[] args)
        {
            string[]  str = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(str[0]);
            int b = Convert.ToInt32(str[1]);
            int c = Convert.ToInt32(str[2]);
            
            Console.WriteLine(c >= a && c <= b ? "Yes" : "No");
        }
    }
}


Measured memory_bytes: 11220
#include <cstdio>
#include <cstring>
#include <cstdlib>

char s[8192];
int H[100000];
struct Path {
  int A;
  int B;
} path[100000];
int r[100000];

int main() {
  int N;
  int M;

  fgets(s, sizeof(s), stdin);
  sscanf(s, " %d %d", &N, &M);
  for (int i = 0; i < N; ++i) {
    scanf(" %d", &H[i]);
  }
  fgets(s, sizeof(s), stdin);
  for (int i = 0; i < M; ++i) {
    fgets(s, sizeof(s), stdin);
    sscanf(s, " %d %d", &path[i].A, &path[i].B);
  }

  for (int i = 0; i < M; ++i) {
    if (H[path[i].A - 1] <= H[path[i].B - 1]) {
      r[path[i].A - 1] = 1;
    }
    if (H[path[i].A - 1] >= H[path[i].B - 1]) {
      r[path[i].B - 1] = 1;
    }
  }

  int result = 0;
  for (int i = 0; i < N; ++i) {
    result += (1 - r[i]);
  }

  printf("%d\n", result);
  return 0;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

ll A,B;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>A>>B;
	cout<<A*B/__gcd(A,B)<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define N 300000
int lc[N], rc[N], lb[N], rb[N];
int tot;
vector <int> bi[N];
int intr[N], inS[N];
struct pI
{
    int a, b;
} S[N];
int compa(pI a, pI b) {return a.a < b.a;}

int build_tree(int l, int r)
{
    int t = ++ tot;
    lb[t] = l; rb[t] = r;
    if (l < r)  lc[t] = build_tree(l, (l + r) / 2),
                rc[t] = build_tree((l + r) / 2 + 1, r);
    else intr[S[l].b] = t;
    return t;
}
void put(int t, int l, int r, int d)
{
    if (l > r) return;
    if (l <= lb[t] && rb[t] <= r)
    {
        bi[d].push_back(t);
        return;
    }
    if (l <= rb[lc[t]]) put(lc[t], l, r, d);
    if (r >= lb[rc[t]]) put(rc[t], l, r, d);
}


int dfsnum, dfn[N], low[N], shed[N], inshed[N], top, cnt;
int ini[N];
void init()
{
    dfsnum = 0;
    for (int i = 1; i <= tot * 2; ++ i)
        dfn[i] = low[i] = shed[i] = inshed[i] = ini[i] = 0;
    top = cnt = 0;
}
void dfs(int t)
{
    dfn[t] = low[t] = ++ dfsnum; shed[++ top] = t; inshed[t] = 1;
    for (int i = 0; i < (int)bi[t].size(); ++ i)
        if (!dfn[bi[t][i]])
        {
            dfs(bi[t][i]);
            low[t] = min(low[bi[t][i]], low[t]);
        }
        else if (inshed[bi[t][i]])
            low[t] = min(dfn[bi[t][i]], low[t]);

    if (low[t] == dfn[t])
    {
        int p; cnt ++;
        do
        {
            p = shed[top --];
            inshed[p] = 0;
            ini[p] = cnt;
        }
        while (p != t);
    }
}

int n;
int ai[N];
int main()
{
    cin >> n;
    for (int i = 1; i <= n; ++ i)
        cin >> ai[i] >> ai[i + n];
    for (int i = 1; i <= n * 2; ++ i)
        S[i] = (pI){ai[i], i};

    sort(S + 1, S + n * 2 + 1, compa);
    for (int i = 1; i <= n * 2; ++ i) inS[S[i].b] = i;

    build_tree(1, n * 2);
    int l = 0, r = S[n * 2].a;
    while (l < r)
    {
        int md = (l + r + 1) / 2;

        for (int i = 1; i <= tot * 2; ++ i) bi[i].clear();
        for (int i = 1; i <= tot; ++ i)
        {
            if (lc[i] || rc[i])
                bi[i].push_back(lc[i]),
                bi[i].push_back(rc[i]);
        }

        for (int i = 1; i <= n * 2; ++ i)
        {
            int r = lower_bound(S + 1, S + n * 2 + 1, (pI){ai[i] + md, 0}, compa) - S - 1,
                l = upper_bound(S + 1, S + n * 2 + 1, (pI){ai[i] - md, 0}, compa) - S;

            put(1, l, inS[i] - 1, intr[i <= n? i + n: i - n]);
            put(1, inS[i] + 1, r, intr[i <= n? i + n: i - n]);
        }

        init();
        for (int i = 1; i <= tot * 2; ++ i)
            if (!ini[i]) dfs(i);
        int ok = 1;
        for (int i = 1; i <= n; ++ i)
            if (ini[intr[i]] == ini[intr[i + n]]) ok = 0;

        if (ok) l = md; else r = md - 1;
    }
    cout << l;
}


Measured memory_bytes: 29184
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);

int main() {
    int n;
    cin>>n;
    vector<int> v(n);
    int sum=0;
    rep(i,n){
        cin>>v[i];
        sum+=v[i];
    }
    sort(v.rbegin(),v.rend());
    sum-=v[0];
    if(v[0]<sum){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
 
int main(){
    int N;
    cin>>N;
    bool b = false;
    REP(i,1,10)
        REP(j,1,10)
            if(i*j==N){
                cout << "Yes" << endl;
                return 0;
            }
    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <list>
#include <numeric>
#include <map>
#include <cmath>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
//================================================

int a = 0, b = 0, c, d, n, k = 0;
string s, t;



int main()
{
	cin >> k;
	a = k / 2;
	b = (k + 1) / 2;
	cout << a * b << endl;
	return 0;
}

Measured memory_bytes: 256
let a = Array.init 6 (fun _ -> Scanf.scanf " %d" pred)
let b = Array.init 4 @@ fun i ->
  Array.fold_left (fun v e -> if e = i then v+1 else v) 0 a
let () =
  Array.sort (-) b;
  print_endline (if b = [|1; 1; 2; 2|] then "YES" else "NO")

Measured memory_bytes: 384
n,m,k = map(int,input().split())

def hantei(n,m,k):
    for i in range(n+1):
        for j in range(m+1):
            if i*m + j*(n-2*i)==k:
                return True
    return False

print("Yes" if hantei(n,m,k) else "No")


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

int main() {
  int n,m;
  cin >> n >> m;
  
  vector<int> vec(m*2);
 
  for (int i=0; i<m*2; i++) {
    int a,b;
    cin >> a >> b;
    vec.at(i) = a;
    i++;
    vec.at(i) = b;
  }
  
  for (int j=1; j<=n; j++) {
    int A = 0;
    for (int i=0; i<m*2; i++) {
      if (vec.at(i) == j) A++;
    }
    cout << A << endl;
  }
 }
 

Measured memory_bytes: 256
from math import factorial
 
M = 10**9 + 7
n, a, b = map(int, input().split())
r = pow(2, n, M) - 1
c = 1
for i in range(b):
  c = c * (n - i) % M
  if i + 1 == a:
    r -= c * pow(factorial(a), M - 2, M)
    a = b
print(r % M)


Measured memory_bytes: 5440
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#pragma region Macros
#define FOR(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define rep(i, n) FOR(i, 0, n)

template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

template <class T> string join(const T &v, const string delim = ",")
{
    if (v.empty())
        return "";

    ostringstream res;
    res << v[0];
    for (int i = 1; i < v.size(); i++)
    {
        res << delim << v[i];
    }
    return res.str();
}

#pragma endregion Macros

int main()
{
    ll A;
    string B;
    cin >> A >> B;

    cerr << B << endl;
    ll b1 = stoi(B.substr( 0, 1));
    ll b2 = stoi(B.substr( 2, 2));

    ll c = b1 * 100 + b2;
    ll ans = A * c / 100;

    cout << ans << endl;
}


Measured memory_bytes: 3632
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc := NewScanner()
	X, K, D := abs(sc.NextInt()), sc.NextInt(), sc.NextInt()
	if X/K >= D {
		fmt.Println(X - (K * D))
		return
	}
	T := (X / D) - K
	if T%2 == 0 {
		fmt.Println(X % D)
	} else {
		fmt.Println(D - X%D)
	}
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func min(a int, b int) int {
	if a < b {
		return a
	}
	return b
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 1776
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

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

    for(;;){
        int w, h;
        cin >> w >> h;
        if(w == 0)
            return 0;

        vector<string> s(h+2);
        s[0] = s[h+1] = string(w+2, ' ');
        int y0, x0;
        for(int i=1; i<=h; ++i){
            cin >> s[i];
            s[i] = ' ' + s[i] + ' ';
            int j = s[i].find('&');
            if(j != string::npos){
                y0 = i;
                x0 = j;
                s[i][j] = '.';
            }
        }

        vector<vector<int> > check(h+2, vector<int>(w+2, INT_MAX));
        check[y0][x0] = 0;
        multimap<int, pair<int, int> > mm;
        mm.insert(make_pair(0, make_pair(y0, x0)));
        for(;;){
            int cost = mm.begin()->first;
            int y = mm.begin()->second.first;
            int x = mm.begin()->second.second;
            mm.erase(mm.begin());

            if(s[y][x] == ' '){
                cout << cost << endl;
                break;
            }

            for(int i=0; i<4; ++i){
                int y1 = y + dy[i];
                int x1 = x + dx[i];
                int c = cost;
                if(s[y][x] == '.' && s[y1][x1] == '#')
                    ++ c;
                if(c < check[y1][x1]){
                    mm.insert(make_pair(c, make_pair(y1, x1)));
                    check[y1][x1] = c;
                }
            }
        }
    }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<ll> A(N);
  rep(i,N) cin >> A[i];
  ll S=A[0]+A[1],X=0;
  REP(i,2,N) X ^= A[i];
  if((S-X)&1) {
    cout << -1 << "\n";
    return 0;
  }
  ll D = (S-X) >> 1;
  if(D > A[0]) {
    cout << -1 << "\n";
    return 0;
  }
  vector<ll> d(40);
  {
    int i = 0;
    while(X > 0) {
      d[i] = X&1;
      if(d[i] && (D>>i)&1) {
        cout << -1 << "\n";
        return 0;
      }
      X >>= 1;
      i++;
    }
  }
  rrep(i, 45) {
    if((D^(d[i]<<i)) > A[0]) continue;
    D ^= (d[i]<<i);
  }
  cout << (D==0 ? -1 : A[0]-D) << "\n";
  return 0;
}


Measured memory_bytes: 3640
s = input()
cnt = 0
ans = []

for i in range(len(s)):
    if (s[i] == 'A') or (s[i] == 'T') or (s[i] == 'C') or (s[i] == 'G'):
        cnt += 1
    else:
        cnt = 0
    ans.append(cnt)
print(max(ans))

Measured memory_bytes: 3060
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
#include<stack>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<ll, bool> pib;

typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;

typedef vector<double> vf;

typedef long double ld;

#define mp make_pair
#define pb push_back

#define rep(i, N) for(ll i = 0; i < N; i++)
#define repa(i, a, N) for(ll i = a; i < N; i++)
#define repr(i, N) for(ll i = N-1; i >= 0; i--)

#define drep(i, N, j, M) rep(i, N) rep(j, M)
#define trep(i, N, j, M, k, L) rep(i, N) rep(j, M) rep(k, L)

#define all(A) A.begin(), A.end()

#define printItr(A) for(auto itr = A.begin(); itr != A.end(); ++itr){cout << * itr << ", ";}cout << endl;

const double PI = 3.141592653589793;

const ll mod = 1e9 + 7;
// const ll mod = 998244353;

const ll LLMAX = numeric_limits<long long>::max();

void No() {
	cout << "No" << endl;
}

void Yes() {
	cout << "Yes" << endl;
}

ll id(char c) {
	return c - 'a';
}

bool isOK(vi& a, ll k, ll index) {
	return a[index] < k * (index + 1);
}

ll binary_search(vi& a, ll k) {
	ll left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
	ll right = (ll)a.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		ll mid = left + (right - left) / 2;

		if (isOK(a, k, mid))
			right = mid;
		else left = mid;
	}

	/* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
	return right;
}

template<class t, class u>
ostream& operator<<(ostream& os, const pair<t, u>& p) {
	return os << "{" << p.first << "," << p.second << "}";
}

template<class t> ostream& operator<<(ostream& os, const vector<t>& v) {
	os << "{";
	for (auto e : v)os << e << ",";
	return os << "}";
}

bool eq(vi P, vi Q) {
	rep(i, P.size()) {
		if (P[i] != Q[i]) {
			return false;
		}
	}
	return true;
}

ll gcd(ll a, ll b)
{
	if (a%b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a%b));
	}
}
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}

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

	ll M;
	cin >> M;

	vi A(N);
	rep(i, N) {
		cin >> A[i];
		
		if (A[i] % 2 == 1)
		{
			cout << 0 << endl;
			return 0;
		}

		A[i] /= 2;
	}

	ll n = 1;
	ll a0 = A[0];
	while (a0 % 2 == 0) {
		a0 /= 2;
		n*=2;
	}

	rep(i, N) {
		if (A[i] % n != 0) {
			cout << 0 << endl;
			return 0;
		}
		if ((A[i] / n) % 2 == 0) {
			cout << 0 << endl;
			return 0;
		}
	}

	rep(i, N - 1) {
		ll L = lcm(A[i], A[i + 1]);
		A[i + 1] = L;

		if (L > M) {
			cout << 0 << endl;
			return 0;
		}
	}

	ll m = M / A[N - 1];


	cout << (m + 1) / 2 << endl;
	/*
	ll N;
	cin >> N;

	vi A(N);
	vi B(N);
	rep(i, N) {
		cin >> A[i];
	}
	rep(i, N) {
		cin >> B[i];
	}

	sort(all(C), greater<ll>());

	vvi K(N, vi(0));

	rep(i, 30) {
		vi AA(N), BB(N);
		rep(i, N) {
		}
		
		ll a = A % 2;
		ll b = A % 2;
	}
	*/


	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

struct dice_{
	int up;
	int down;
	int left;
	int right;
	int forward;
	int back;
};

dice_ rot_N(dice_ d){
	dice_ res = d;
	res.up = d.back;
	res.back = d.down;
	res.down = d.forward;
	res.forward = d.up;
	return res;
}

dice_ rot_S(dice_ d){
	dice_ res = d;
	res.up = d.forward;
	res.back = d.up;
	res.down = d.back;
	res.forward = d.down;
	return res;
}

dice_ rot_E(dice_ d){
	dice_ res = d;
	res.up = d.left;
	res.left = d.down;
	res.down = d.right;
	res.right = d.up;
	return res;
}

dice_ rot_W(dice_ d){
	dice_ res = d;
	res.up = d.right;
	res.left = d.up;
	res.down = d.left;
	res.right = d.down;
	return res;
}

dice_ rot_R(dice_ d){
	dice_ res = d;
	res.forward = d.left;
	res.left = d.back;
	res.back = d.right;
	res.right = d.forward;
	return res;
}

dice_ rot_L(dice_ d){
	dice_ res = d;
	res.forward = d.right;
	res.left = d.forward;
	res.back = d.left;
	res.right = d.back;
	return res;
}

dice_ dice;

int main(){
	int n, ans;
	string str;
	while(true){
		cin >> n;
		if(n == 0){
			break;
		}
		dice.up = 1;
		dice.down = 6;
		dice.right = 3;
		dice.left = 4;
		dice.back = 2;
		dice.forward = 5;
		
		ans = 1;
		for(int i = 0; i < n; i++){
			cin >> str;
			if(str[0] == 'N'){
				dice = rot_N(dice);
			}else if(str[0] == 'S'){
				dice = rot_S(dice);
			}else if(str[0] == 'W'){
				dice = rot_W(dice);
			}else if(str[0] == 'E'){
				dice = rot_E(dice);
			}else if(str[0] == 'L'){
				dice = rot_L(dice);
			}else if(str[0] == 'R'){
				dice = rot_R(dice);
			}
			ans += dice.up;
		}
		printf("%d\n", ans);
	}
	
	return 0;
}

Measured memory_bytes: 1196