akhauriyash/Code-Regression huggingface dataset:
package main

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

const (
	maxBufSize = 1024 * 1024
)

var (
	sc = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, maxBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
	out = bufio.NewWriter(os.Stdout)
)

type t struct {
	t int64
	f int64
	c byte
}

func solve(s []byte, q int64, qs []t) []byte {
	edges := make([][]byte, 2)
	edges[0] = make([]byte, 0, q)
	edges[1] = make([]byte, 0, q)
	frontIdx := 0

	reversed := false
	for _, tt := range qs {
		if tt.t == 1 {
			reversed = !reversed
			frontIdx = 1 - frontIdx
			continue
		}
		if tt.f == 1 {
			edges[frontIdx] = append(edges[frontIdx], tt.c)
		} else {
			edges[1 - frontIdx] = append(edges[1 - frontIdx], tt.c)
		}
	}

	ret := make([]byte, 0, len(s) + len(edges[0]) + len(edges[1]))
	for i := len(edges[frontIdx]) - 1; i >= 0; i-- {
		ret = append(ret, edges[frontIdx][i])
	}
	if reversed {
		for i := len(s) - 1; i >= 0; i-- {
			ret = append(ret, s[i])
		}
	} else {
		for _, b := range s  {
			ret = append(ret, b)
		}
	}
	for _, b := range edges[1 - frontIdx] {
		ret = append(ret, b)
	}
	return ret
}

func main() {
	defer out.Flush()

	s := nextStringAsBytes()
	q := nextInt()

	qs := make([]t, q)
	for i := int64(0); i < q; i++ {
		qs[i].t = nextInt()
		if qs[i].t == 2 {
			qs[i].f  = nextInt()
			qs[i].c  = nextStringAsBytes()[0]
		}
	}

	bytes := solve(s, q, qs)
	fmt.Fprintln(out, string(bytes))
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextStringAsBytes() []byte {
	sc.Scan()
	return []byte(sc.Text())
}

func nextInt() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int64) []int64 {
	ret := make([]int64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextFloats(n int64) []float64 {
	ret := make([]float64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextFloat()
	}
	return ret
}
func nextStrings(n int64) []string {
	ret := make([]string, n)
	for i := int64(0); i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func containStr(arr []string, target string) bool {
	for _, v := range arr {
		if v == target {
			return true
		}
	}
	return false
}

func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "orz")
	}
}

// mapからkeysとvaluesを返す
func splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {
	switch reflect.TypeOf(m).Kind() {
	case reflect.Map:
		s := reflect.ValueOf(m)
		for _, v := range s.MapKeys() {
			keys = append(keys, v)
			values = append(values, s.MapIndex(v))
		}
	default:
		fmt.Fprintln(out, "orz")
	}
	return
}


Measured memory_bytes: 10496
#include <iostream>
using namespace std;
int main(){
    int m,f,r;
    while(1){
        cin>>m>>r>>f;
        if(m==-1&&f==-1&&r==-1){
            break;
        }
        else{
            if(m>=0 && r>=0){
            if(m+r>=80){
                cout<<"A"<<endl;
            }
            else if(65<=m+r && m+r<80){
                cout<<"B"<<endl;
            }
            else if(50<=m+r && m+r<65){
                cout<<"C"<<endl;
            }
            else if(30<=m+r && m+r<50 && 50<=f){
                cout<<"C"<<endl;
            }
            else if(30<=m+r && m+r<50 && f<50){
                cout<<"D"<<endl;
            }
            else if(m+r<30){
                cout<<"F"<<endl;
            }
            }
            else {
                cout<<"F"<<endl;
            }
        }
    }
return 0;
}


Measured memory_bytes: 3068
#include<bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin>>H>>W;
char a[H][W];
for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
        cin>>a[i][j];
    }
}
for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
        cout<<a[i][j];
    }
    cout<<endl;
     for(int j=0;j<W;j++){
        cout<<a[i][j];
    }
    cout<<endl;

}
return 0;
}


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

#define loop(i,N) for(ll (i)=0; (i)<(N);++(i))
#define OMAZINAI cin.tie(0); ios::sync_with_stdio(false);
#define INF (1LL<<61)
typedef long long int ll;

int main() {
	string s, t, u;
	cin >> s >> t;
	loop(aaaa, s.size()+2) {
		if (s == t) {
			cout << "Yes" << endl;
			return 0;
		}
		char c = s[s.size()-1];
		s.pop_back();
		s = c + s;
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	int b=scan.nextInt();
	int c=scan.nextInt();
	if((c-b)%2==0) {
		System.out.println("Alice");
	}
	else {
		System.out.println("Borys");
	}
	}
}

Measured memory_bytes: 24276
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int target = sc.nextInt();
        for(int i = -200;i < 201;i++){
            for(int j = -200 ; j < 201;j++){
                if(Math.pow(i, 5) - Math.pow(j, 5) == target){
                    System.out.println(i + " " + j);
                    System.exit(0);
                }
            }
        }
    }
}

Measured memory_bytes: 38952
#include<iostream>
#include<stdio.h>
#include<vector>//s1.erase(n)=文字列s1の、n文字目以降削除
#include<algorithm>//辞書順=next_permutation
#include<set>
#include<string>//char 小文字のほうが32大きい
#include<sstream>
#include<string.h>
#include<complex>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<locale>
#include<utility>//swap=数値交換
#define rt "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define drop(i,n) for(int i=n;0<i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define sec(a,b,ans) if(ans)cout<<a<<rt;else cout<<b<<rt;
#define vcin(s,n) rep(i,n)cin>>s[i];//vcin(配列名),(繰り返し回数)
#define sort(s) sort(s.begin(),s.end())//標準=昇順
#define reve(s) reverse(s.begin(),s.end())
#define asas int ans=0
#define llcncn llint cnt=0
#define llasas llint ans=0
#define str string
#define please return
#define AC 0
#define Rapid cin.tie(0);ios::sync_with_stdio(false)
#define Pi 3.1415926535897932384626
#define nine 1000000000

using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<double> vdou;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<string>> vvstr;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}

unsigned GetDigit(unsigned num) {
	return std::to_string(num).length();
}

int tow(int n) {//2のn乗
	if (n == 0)return 1;
	int x = tow(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;//@domino
}

/*

 (char)toupper(a[n])=文字列のn文字目を大文字で出力

  pow(a,b)=aのb乗

  */


int main(void) {

	int x;
	cin >> x;
	if (x == 1) {
		cout << "Hello World" << rt;
	}
	else {
		int a, b;
		cin >> a >> b;
		cout << a + b << rt;
	}

	please AC;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		SC sc = new SC(System.in);
		int N=sc.nextInt();
		int[] muzu=new int[N];
		for(int i=0; i<N; i++) {
			muzu[i]=sc.nextInt();
		}
		Arrays.sort(muzu);
		pl(muzu[N/2]-muzu[N/2-1]);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
}

Measured memory_bytes: 35420
A,B,C,D,E,F = map(int,input().split())

waters = set()
for b in range(0, F+1, 100*B):
    for a in range(0, F-b+1, 100*A):
        waters.add(a+b)
waters.remove(0)

sugars = set()
for d in range(0, F+1, D):
    for c in range(0, F-d+1, C):
        sugars.add(c+d)

best_w = best_s = best_r = -1
for water in sorted(waters):
    for sugar in sorted(sugars):
        if water + sugar > F: break
        if water*E < sugar*100: break
        rate = sugar / (water + sugar)
        if rate > best_r:
            best_r = rate
            best_w = water
            best_s = sugar
print(best_s+best_w, best_s)

Measured memory_bytes: 3188
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;


int main() {
	int n;
	cin >> n;
	if (n == 1) {
		cout << "Hello World" << endl;
	} else {
		int a, b;
		cin >> a >> b;
		cout << a + b << endl;
	}
}


Measured memory_bytes: 3552
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define for1(i, a, b) for(i = a; i <= b; ++i)
#define for0(i, a, b) for(i = a; i < b; ++i)
#define forw1(i, a, b) for(i = a; i >= b; --i)
#define forw0(i, a, b) for(i = a - 1; i >= b; --i)
#define fora(v, a) for(auto v : a)
#define bp __builtin_popcount
#define bpll __builtin_popcountll

using namespace std;
using cd = complex<double>;

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<cd> vcd;
typedef vector<ii> vii;
typedef vector<vector<int> > vvi;

const int modd1 = 1e9 + 7, modd2 = 998244353, maxn = 2e5 + 40, K = 26, inf = 1e9, infll = 1e18;
const double pi = acos(-1);
int h, w, ans, a, b;
int fact[maxn], inv[maxn];

int binpow(int a, int b){
	int res = 1;
	while(b){
		if(b & 1) res = (res * a) % modd1;
		a = (a * a) % modd1;
		b >>= 1;
	}	
	return res;
}

void pre(){
	int i; fact[0] = inv[0] = 1;
	for0(i, 1, maxn){
		fact[i] = (fact[i - 1] * i) % modd1;
		inv[i] = (inv[i - 1] * binpow(i, modd1 - 2)) % modd1;
	}
}

int nCk(int k, int n){
	int res = fact[n];
	res = (res * inv[k]) % modd1;
	res = (res * inv[n - k]) % modd1;
	return res;	
}

void solve(){
	int i, j, k, l, r; cin >> h >> w >> a >> b;
	pre();
	for1(i, 1, h - a){
		j = h + b - a + 1 - i;
		if(j > w) continue;
		//cout << i << ' ' << j << '\n';
		ans = (ans + (nCk(i - 1, i + j - 2) * nCk(h - i, h + w - i - j)) % modd1) % modd1;
	}
	cout << ans;
}

signed main() {
    //freopen(".INP", "r", stdin);
    //freopen(".OUT", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    solve();
}


Measured memory_bytes: 6788
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define bitrep(X,N) for(ll X = 0; X < (1 << (N)); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end() 


using namespace std;

int main(){

    int n;
    cin >> n;

    string s,next;
    cin >> s;

    bool ans = true;
    set<string> se;

    se.insert(s);

    rep(i, n - 1){
        cin >> next;

        if(se.find(next) != se.end() || s[s.size() - 1] != next[0]){
            ans = false;
            break;
        }

        se.insert(next);
        s = next;
    }

    cout << (ans ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
	char str[1000];
	gets(str);
	if(strcmp(str,"Sunny")==0)
	{
		printf("Cloudy\n");
	}
	else if(strcmp(str,"Cloudy")==0)
	{
		printf("Rainy\n");
	}
	else if(strcmp(str,"Rainy")==0)
	{
		printf("Sunny\n");
	}
	return 0;
 } 


Measured memory_bytes: 128
#include <iostream>
#include <map>
#include <string>
#include <vector>

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

  std::map<std::pair<std::string, int>, int> SP;

  for (int i = 0; i < N; ++i) {
    std::string s;
    int p;
    std::cin >> s >> p;
    SP.insert(std::make_pair(std::make_pair(s, -p), i + 1));
  }

  for (auto &s : SP) {
    std::cout << s.second << std::endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<sstream>
#include<iomanip>
#include<stdlib.h>
#include<string>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<set>
#include<queue>
#include<stack>
#include<map>
#include<utility>
#include<algorithm>
#include<complex>
using namespace std;
#define loop(i,l,r) for(int (i)=(int)(l);(i)<(int)(r);(i)++)
#define rloop(i,l,r) for(int (i)=(int)(l);(i)>(int)(r);(i)--)
#define rep(i,n) loop(i,0,n)
#define rrep(i,n) rloop(i,n-1,-1)
#define INF 0x3f3f3f3f
#define mod 1000000007LL
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef complex<double> C;

vector<string> split(stringstream& ss){
	string str;
	vector<string> res;
	while(ss>>str)res.push_back(str);
	return res;
}

int _residue(int a,int b){
		return (a!=0 ? a%b!=0 ? a%b : b : 0);
}

int solve(int w,int a,int b){
	if(w%2==0){
			if(a>w/2)a++;
			if(b>w/2)b++;
			w++;
	}
	int s=abs(a-(w+1)/2),t=abs(b-(w+1)/2),u=(int)ceil((double)(_residue(w,6)/2.0)),res;
	res=u-max(s,t)%3;
	return (res>0 ? res : res+3);
}

int main(){
	enum color{RED,BLUE,YELLOW};
	int w,n,a,b;
	cin>>w>>n;
	rep(i,n){
			cin>>a>>b;
			cout<<solve(w,a,b)<<endl;
	}
/*	cin>>w;
	rep(i,w){
			rep(j,w)cout<<solve(w,i+1,j+1);
			cout<<endl;
	}*/
}	

Measured memory_bytes: 1168
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
	int A, B, C;
	cin >> A >> B >> C;

	if (A == B && A == C)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
package main

import(
	"fmt"
	"math"
)

func quickSort(values []int) (ret []int) {
	if len(values)<2 {
		return values
	}
	pivot := values[0]
	
	left := []int{}
	right := []int{}
	for _,v := range values[1:] {
		if v>pivot {
			right = append(right, v)
		} else {
			left = append(left, v)
		}
	}
	left = quickSort(left)
	right = quickSort(right)
	ret = append(left, pivot)
	ret = append(ret, right...)
	return 
}

func binarySearch(needle int, haystack []int) (int,bool) {
    low := 0
    high := len(haystack) - 1
    for low <= high{
        median := (low + high) / 2
 
        if haystack[median] < needle {
            low = median + 1
        }else{
            high = median - 1
        }
    }
    if low == len(haystack) || haystack[low] != needle {
        return -1,false
    }
    return low, true
}

func max(nums ...int) int {
    if len(nums) == 0 {
        panic("funciton max() requires at least one argument.")
    }
    res := nums[0]
    for i:=0; i<len(nums); i++ {
        res = int(math.Max(float64(res), float64(nums[i])))
    }
    return res
}

func main() {
	var x, n int
	fmt.Scan(&x,&n)
	p := make([]int, n)
	for i:=0;i<n;i++ {
		var tmp int
		fmt.Scan(&tmp)
		p[i] = tmp
	}
	if len(p)>0 {
		p = quickSort(p)
		idx,found := binarySearch(x,p)
		
		// tmp := max(idx,n-idx)
		if found {
			for i:=1; i<n+1; i++ {
				
				if idx-i>=0 {
					if p[idx-i]!=x-i {
						fmt.Println(x-i)
						break
					}
				} else {
					fmt.Println(p[0]-1)
					break
				}
				if idx+i<n {
					if p[idx+i]!=x+i {
						fmt.Println(x+i)
						break
					}
				} else {
					fmt.Println(p[n-1]+1)
					break
				}
			}
		} else {
			fmt.Println(x)
		}
	} else {
		fmt.Println(x)
	}
	
}

Measured memory_bytes: 1892
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

using namespace std;

int main() {
   int n;
   cin >> n;
   cout << 1110-n << endl;
}

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

int main()
{
    string s;
    cin >> s;
    long long N = s.size();
    long long p_num = 0;
    rep(i, N)
    {
        if (s[i] == 'p')
            p_num++;
    }
    long long ans = N / 2 - p_num;
    cout << ans << endl;
    return 0;
}

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

int main()
{
        ll A;
        ld B;
        cin >> A >> B;
        ll ans = (A * B * 100.0) + 0.4;
        cout << ans / 100 << endl;


}


Measured memory_bytes: 3624
#include <stdio.h>

int main()
{
    int n;
    int a[n];
    scanf("%d", &n);
    int i;
    for(i=0;i<n;i++) scanf("%d", &a[i]);
    
    int count = 0;
    int counteq = 1;
    
    for(i=1;i<n;i++){
        if(a[i]==a[i-1]){
            counteq++;
        } else {
            count += counteq / 2;
            counteq = 1;
        }
    }
    count += counteq / 2;
    
    printf("%d", count);

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
/* nichijou */
template<class T,class U>
bool cmax(T & a, const U & b) {return a < b ? a = b, 1 : 0;}
template<class T,class U>
bool cmin(T & a, const U & b) {return b < a ? a = b, 1 : 0;}
/* data type */
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define F first
#define S second
/* STL container */
typedef vector<int> vi;
typedef vector<ll> vll;
#define SZ(a) ((int)(a).size())
#define ALL(a) begin(a), end(a)
#define CLR(a) (a).clear()
#define BK(a) ((a).back())
#define FT(a) ((a).front())
#define DB(a) (a).pop_back()
#define DF(a) (a).pop_front()
#define PB push_back
#define EB emplace_back
/* I gave you my heart and then you turned around. */
void _BG(const char * s) {cerr<<s<<endl;}
template<class T, class ... TT>
void _BG(const char * s,T a, TT...b)
{
    for (size_t c = 0; *s && (c || *s != ','); cerr << *s++)
        c += count(ALL("([{"),*s) - count(ALL(")]}"),*s);
    cerr << " = " << a;
    if (*s) {
        cerr << ", ";
        ++s;
    }
    _BG(s,b...);
}
#ifdef PR3PONY
#define BG(...) do { \
    cerr << __PRETTY_FUNCTION__ << ':' << __LINE__ << ": "; \
    _BG(#__VA_ARGS__,__VA_ARGS__); \
} while(0)
#else
#define BG(...)
#endif
/* Good Luck && Have Fun ! */
const int N = 3087;
const int MOD = 998244353;
int n, s, a[N];
ll dp[N][N];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> s;
    for (int i = 1; i <= n; ++i)
        cin >> a[i];
    ll ans = 0;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j <= s; ++j) {
            dp[i][j] = dp[i - 1][j];
            if (j == a[i]) {
                dp[i][j] += i;
            } else if (j > a[i]) {
                dp[i][j] += dp[i - 1][j - a[i]];
            }
            dp[i][j] %= MOD;
        }
        (ans += (dp[i][s] - dp[i - 1][s] + MOD) * (n - i + 1)) %= MOD;
    }
    cout << ans << endl;
}


Measured memory_bytes: 73984
#include<bits/stdc++.h>
#define mx 10000010
using namespace std;
int main()
{
	long long int i,n,j,sum=0;
	vector<int> div(mx+1);
	cin>>n;
	for(i=1;i<=n;i++)
	{
		for(j=i;j<=n;j+=i)
		{
			div[j]++;
		}
			sum+=div[i]*i;
	}
	cout<<sum<<endl;
	return 0;
	
}

Measured memory_bytes: 42148
#include <bits/stdc++.h>
#define INF 2e9
using namespace std;
typedef long long llong;
typedef long double ldouble;

using Graph = vector<vector<int>>;

int main()
{
  llong N, A, B;
  cin >> N >> A >> B;
  llong q = N/(A+B);
  llong r = N%(A+B);
  if(r > A) r = A;
  cout << q * A + r << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int data[10];
	int dai1,dai2,wk;
	int i,j;
	for(i=0;i<10;i++){
		scanf("%d",&data[i]);
	}
	for(i=0;i<9;i++){
		for(j=i+1;j<10;j++){
			if(data[i]<data[j]){
				wk=data[i];
				data[i]=data[j];
				data[j]=wk;
			}
		}
	}
	dai1=data[0]+data[1]+data[2];
	for(j=0;j<10;j++){
		scanf("%d",&data[j]);
	}
	for(j=0;j<9;j++){
		for(i=j+1;i<10;i++){
			if(data[j]<data[i]){
				wk=data[j];
				data[j]=data[i];
				data[i]=wk;
			}
		}
	}
	dai2=data[0]+data[1]+data[2];
	printf("%d %d\n",dai1,dai2);
	return 0;
}



Measured memory_bytes: 2668
#include <iostream>
#include <queue>
#include <climits>
#include <algorithm>
using namespace std;
typedef unsigned long long int ll;
#define INFI LLONG_MAX
int main(){
	ll t=1;
	//cin>>t; 

	while(t--){
int n;
int k;
cin>>n;
cin>>k;
ll ar[n];
for(int i=0;i<n;i++)
cin>>ar[i];
sort(ar,ar+n);
ll sumtill=0;
ll totalsum=0;
for(int i=n-1;i>=0;i--){
if(n-i<=k)
{
	sumtill+=ar[i];}
	else
	totalsum+=ar[i];
	//cout<<sumtill<<" "<<totalsum;
}
cout<<totalsum;
}
	
}







   
    


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

using namespace std;

template <typename T> T gcd(T x, T y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}

template <typename T> T lcm(T x, T y) {
  if (x == 0 || y == 0)
    return 0;
  return x / gcd(x, y) * y;
}

int main() {
  int N;
  cin >> N;
  int nowX = 0, nowY = 0, nowT = 0;
  for (int i = 0; i < N; i++) {
    int t, x, y;
    cin >> t >> x >> y;
    nowX = abs(nowX - x);
    nowY = abs(nowY - y);
    nowT = abs(nowT - t);
    // cout << nowX << ' ' << nowY << endl;
    // cout << nowT - nowX - nowY << endl;
    if ((nowT - nowX - nowY) % 2 == 1 || nowT - nowX - nowY < 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int bit[200005];
int N = 200003;
int a[200005];
ll pre[200005];
void update(int pos)
{
    while(pos <= N)
    {
        bit[pos] ++;
        pos += pos & (-pos);
        }
    }
int query(int pos)
{
    int res = 0;
    while(pos > 0)
    {
        res += bit[pos];
        pos -= pos & (-pos);
        }
    return res;
}
int main()
{
    int n;
    ll k;
    scanf("%d%lld",&n,&k);
    int i;
    set<ll> s;
    map<ll,int> ran;
    int ra = 1;
    s.insert(0);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        pre[i] = pre[i-1] + a[i] - k;
        s.insert(pre[i]);
        }
    set<ll>::iterator I;
    for(I=s.begin();I!=s.end();I++)
    ran[*I] = ra++;
    
    ll ans = 0;
    for(i=0;i<=n;i++)
    pre[i] = ran[pre[i]];
    
    for(i=0;i<=n;i++)
    {
        ans += query(pre[i]);
      //  printf("ran is %d\n",pre[i]);
        update(pre[i]);
        }
    printf("%lld\n",ans);
    }
    

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
ll mod = 1000000007;

bool judge(vector<ll> &a, ll index, ll m, ll v, ll p) {
    ll n = a.size();
    if (n - index < p) {
        return true;
    }
    ll value = a[index] + m;
    auto lower = lower_bound(a.begin(), a.end(), value + 1);
    ll over_num = a.end() - lower;
    if (over_num > p - 1) {
        return false;
    }
    ll index_left = index + 1;
    ll index_right = n - (p - 1);

    ll rem_num = m * v;
    rem_num -= (index + 1 + (p - 1)) * m;
    repd(i, index_left, index_right) { rem_num -= value - a[i]; }
    if (rem_num <= 0) {
        return true;
    } else {
        return false;
    }
}

int main() {
source:
    ll n, m, v, p;
    cin >> n >> m >> v >> p;
    vector<ll> a(n);
    rep(i, n) { cin >> a[i]; }
    sort(a.begin(), a.end());

    if (judge(a, 0, m, v, p)) {
        cout << n << endl;
        return 0;
    }

    ll left = 0, right = n - 1;
    while (right - left > 1) {
        ll index = (left + right) / 2;
        if (judge(a, index, m, v, p)) {
            right = index;
        } else {
            left = index;
        }
    }

    cout << n - right << endl;
    return 0;
}



Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lld;
ll MOD = 998244353;
ll inf=1e17;
const int dr[] = {+1, -1, +0, +0, +1, -1, +1, -1};
const int dc[] = {+0, +0, +1, -1, +1, -1, -1, +1};
const int kx[] = {+1, +2, -1, -2, +1, +2, -1, -2};
const int ky[] = {+2, +1, +2, +1, -2, -1, -2, -1};
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
inline void fastIO(){
  ios_base::sync_with_stdio(0);cin.tie(0);
}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void debug_out() { cerr << endl; }
template<typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << ' ' << H; debug_out(T...); }

#ifdef LOCAL
#define debug(...) cerr << "(" << #__VA_ARGS__ << "):", debug_out(__VA_ARGS__)
#else
#define debug(...) 47
#endif

int main(){
  fastIO();
  ll n,k,start,beg,len=0,pos=0,pre=1;
  bool cycle=false;
  cin>>n>>k;
  ll tempK=k;
  vector<ll>a(n);
  map<ll,ll>rep;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  while(rep[pos]==0&&k>0){
    rep[pos]++;
    pos=a[pos]-1,start=pos;
    beg=pos,k--;
  }
  k=tempK;
  if(rep[pos]==1)cycle=true;
  if(cycle){
    pre=rep.size();
    rep.clear();
    while(rep[start]==0){
      rep[start]++;
      start=a[start]-1,len++;
    }
    pre-=len;
    ll modded=(k-pre+len)%len;
    for(int i=0;i<modded;i++){
      beg=a[beg]-1;
    }
  }
  cout<<beg+1<<endl;
  return 0;
}


Measured memory_bytes: 14784
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define pi 3.1415926535897
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define mod1 998244353
#define inf 1000000000000000000
#define inf1 1000000000
#define endl '\n'
ll arr[16][16];
ll val[1<<16];
ll dp[1<<16];
int main()
{
	fastio;
	#ifdef APNA_IO
		freopen("input.txt" , "rt" ,stdin);
		freopen("output.txt" , "wt" ,stdout);
	#endif
	ll n;
	cin>>n;
	for(ll i=0;i<n;i++)
		for(ll j=0;j<n;j++)
			cin>>arr[i][j];
	for(ll i=1;i<(1<<n);i++)
	{
		ll k=log2(i&(-i));
		val[i]=val[i&(~(1<<k))];
		for(ll j=0;j<n;j++)
			if((i&(1<<j))!=0)
				val[i]+=arr[j][k];
	}
	for(ll i=1;i<(1<<n);i++)
	{
		for(ll j=i;j>0;j=(j-1)&i)
		{
			ll k=(i&(~j));
			dp[i]=max(dp[i],dp[k]+val[j]);
		}
	}
	cout<<dp[(1<<n)-1]<<endl;
	return 0;
}

Measured memory_bytes: 1280
{-# LANGUAGE BangPatterns #-}
import Data.List
import Data.Char
import Data.Monoid
import Control.Monad
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector.Unboxed as U

spanWithLimit :: (U.Unbox a) => Int -> (a -> Bool) -> U.Vector a -> (U.Vector a, U.Vector a)
spanWithLimit !limit !f !vec | U.length vec <= limit = U.span f vec
                             | otherwise = U.splitAt (count 0) vec
  where count !i | i == limit || not (f (vec U.! i)) = i
                 | otherwise = count (i + 1)

main = do
  [n,m] <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  -- as: a が小さい順にソートする
  as <- U.fromListN n . sort . unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  -- bc: c が大きい順にソートする
  bc <- fmap (sortBy (\(b,c) (b',c') -> compare c' c <> compare b b')) $ replicateM m $ do
    [b,c] <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
    return (b,c)
  let f !s !cards [] = s + U.sum cards
      f !s !cards ((!b,!c):xs) = let (d1, d2) = spanWithLimit b (< c) cards
                                 in if U.null d1 then s + U.sum cards else f (s + U.length d1 * c) d2 xs
  print $ f 0 as bc


Measured memory_bytes: 42364
#include <stdio.h>

int main(void){
    char str[3];
    int day, count = 0;

    for(int i=0; i<3; i++){
        scanf("%c", &str[i]);
        if(str[i] == 'S') count++;
    }

    if(count == 0){
        printf("3\n");
    }
    else if(count == 1){
        if(str[1] == 'S'){
            printf("1\n");
        }
        else{
            printf("2\n");
        }
    }
    else if(count == 2){
        printf("1\n");
    }
    else{
        printf("0\n");
    }

    return 0;
}


Measured memory_bytes: 1584
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

int n;
int a[410];
long long int suma[410];
long long int result[410][410] = {};

long long int solve(int l, int r)
{
	if(result[l][r] > 0) return result[l][r];
	if(r - l == 1) return 0;
	result[l][r] = (long long int)mod * mod;
	long long int cost = suma[r] - suma[l];
	for(int i = l + 1; i < r; i++){
		result[l][r] = min(result[l][r], cost + solve(l, i) + solve(i, r));
	}
	return result[l][r];
}

int main()
{
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		if(i > 0) suma[i] = a[i - 1] + suma[i - 1];
	}
	suma[n] = suma[n - 1] + a[n - 1];
	cout << solve(0, n) << endl;

}



Measured memory_bytes: 1536
program match_matching
  implicit none
  integer              :: n, m, b(9), i, j, d, r
  integer, allocatable :: a(:), dp(:)
  character(16384)     :: answer
  read(*,*) n, m
  allocate(a(m),dp(0:n))
  read(*,*) a(:)
  b = (/2,5,5,4,5,6,3,7,6/)
  call reverse_sort(m,a)
  dp = -1
  dp(0) = 0
  do i = 2, n
    d = -1
    do j = 1, m
      if (i-b(a(j)) .ge. 0) then
        if (dp(i-b(a(j))) .gt. d) d = dp(i-b(a(j)))
      end if
      if (d .lt. 0) then
        dp(i) = -1
      else
        dp(i) = d + 1
      end if
    end do
  end do
  r = n
  i = 1
  answer = ''
  do while (r .gt. 0)
    do j = 1, m
      if (r-b(a(j)) .ge. 0) then
        if (dp(r-b(a(j))) .eq. dp(r)-1) then
          answer(i:i) = achar(48+a(j))
          r = r - b(a(j))
          i = i + 1
          exit
        end if
      end if
    end do
  end do
  deallocate(a,dp)
  write(*,'(a)') answer(1:i)
  stop

contains

  subroutine reverse_sort(m,a)
    implicit none
    integer, intent(in)    :: m
    integer, intent(inout) :: a(m)
    integer                :: i, j
    do i = m-1, 1, -1
      do j = 1, i
        if (a(j) .lt. a(j+1)) call swap(a(j),a(j+1))
      end do
    end do
    return
  end subroutine reverse_sort

  subroutine swap(a,b)
    implicit none
    integer, intent(inout) :: a, b
    integer                :: c
    c = a
    a = b
    b = c
    return
  end subroutine swap

end program match_matching

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		int inCnt = 0;
		while ((s = stdIn.readLine()) != null) {
			String[] se = s.split(" ");
			int in1 = Integer.valueOf(se[0]);
			int in2 = Integer.valueOf(se[1]);
			if (in1 == 0 && in2 == 0)
				break;
			doMain(++inCnt, in1, in2);
		}
		System.exit(0);
	}

	private static void doMain(int inCnt, int in1, int in2) {
		if (in1 < in2)
			System.out.println(in1 + " " + in2);
		else
			System.out.println(in2 + " " + in1);

	}
}

Measured memory_bytes: 27008
import sys
import math
import bisect
import heapq
from collections import Counter


def input():
    return sys.stdin.readline().rstrip()


def main():
    mod = 10 ** 9 + 7
    S = list(input())
    l = len(S)
    dp = [[0] * 13 for _ in range(l + 1)]

    dp[0][0] = 1
    for j in range(1, l + 1):
        if S[j - 1] == "?":
            for k in range(13):
                for q in range(10):
                    new_k = (k * 10 + q) %13
                    dp[j][new_k] += dp[j - 1][k]
            for k in range(13):
                dp[j][k] %= mod
        else:
            n = int(S[j - 1])
            for k in range(13):
                new_k = (k * 10 + n)%13
                dp[j][new_k] += dp[j - 1][k]
                dp[j][new_k] %= mod
    print(dp[l][5])

if __name__ == "__main__":
    main()


Measured memory_bytes: 98660
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,k;
	cin>>a>>b>>k;
	if(k==0) cout<<a<<' '<<b<<'\n';
	bool f=true;
	while(k--)
	{
		if(f)
		{
			b+=a/2;
			a/=2;
		}
		else
		{
			a+=b/2;
			b/=2;
		}
		f=1-f;
	}
	cout<<a<<' '<<b<<'\n';
	return 0;
}

Measured memory_bytes: 256
L=input().split( )
n=int(L[0])
m=int(L[1])
 
A=[[0 for i in range(m)] for j in range(n)]
b=[0 for i in range(m)]
x=0
y=0
while x<n:
    StrCollum = input().split( )
    for k in range(m):
        A[x][k] = int(StrCollum[k])
    x+=1
while y<m:
    StrVec = input()
    b[y] = int(StrVec)
    y+=1
c=[0 for i in range(n)]
for z in range(n):
    sum=0
    for u in range(m):
        sum = sum+(A[z][u]*b[u])
        c[z]=sum
for j in range(n):
    print(c[j])


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

int main(){
    int H, R;
    cin >> H >> R;

    if(H < 0){
        if(H+R == 0){
            cout << 0 << endl;
        }else{
            cout << -1 << endl;
        }
    }

    if(H >= 0){
        if(H >= R){
            cout << 1 << endl;
        }else if(H+R >= 0){
            cout << 1 << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 3084
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long m = sc.nextLong();


        if(n == 1 && m == 1) {
        	System.out.println("1");
        } else if(n == 1 || m == 1) {
        	System.out.println(Math.max(n, m) - 2);
        } else {
        	System.out.println((n-2) * (m-2));
        }
    }
}


Measured memory_bytes: 21972
import math
N = int(input())
S = str(input())
r=0
g=0
b=0
error=0
n=0
 
if N%2==0:
    n=(N//2)-1
else:
    n=N//2
 
for i in range(N):
    if S[i]=='R':
        r+=1
    if S[i]=='G':
        g+=1
    if S[i]=='B':
        b+=1
 
for p in range(n+1):
    for i in range(N-(p*2)):
        if S[i]==S[i+p] or S[i+p]==S[i+2*p] or S[i]==S[i+2*p]:
            continue
        else:
            error+=1
d=r*g*b
 
print(d-error)

Measured memory_bytes: 73688
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//Abdulhamid Han
//Bismillahirrahmanirrahim
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long lo;
typedef pair< int,int > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

int n,m,b[li],a[li],k,flag,t;
double cev;
string s;
vector<int> v;

int main(void){
	scanf("%d",&n);
	FOR{
		scanf("%d",&a[i]);
	}
	sort(a+1,a+n+1);
	cev+=a[1];
	cev+=a[2];
	cev=cev/2;
	for(int i=3;i<=n;i++){
		cev+=a[i];
		cev=cev/2;
	}
	printf("%.16lf\n",cev);
	return 0;
}


Measured memory_bytes: 256
#include <math.h>
#include <regex>
#include "bits/stdc++.h"
#define FOR(i, s, e) for (int i = int(s); i < int(e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define INF (INT_MAX / 2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX / 2)
const int MGN = 10;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vs = vector<string>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using psi = pair<string, int>;

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

  int N; cin >> N;
  vl D(N); REP(i,N) cin >> D[i];

  ll sum = 0;
  REP(i,N) {
    REP(j,i) {
      sum += D[i] * D[j];
    }
  }

  ll ans = sum;
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int popc(int n){
  int res = 0;
  while(n != 0){
    if(n % 2 == 1) res++;
    n /= 2;
  }
  return res;
}

void fc(string &x, int now, vector<int> &fi){
  int ans = 0;
  int nx = fi.at(now);
  ans++;
  if(nx == -1) ans = 0;
  while(nx != 0 && nx != -1){
    ans++;
    int pc = popc(nx);
    nx %= pc;
  }
  cout << ans << endl;
}

void make_in(string &x, vector<int> &fi){
  vector<int> pm(x.size()), pp(x.size());
  int pc = 0;
  rep(i, x.size()){
    if(x.at(i) == '1') pc++;
  }
  // cerr << pc << endl;
  int npp = 1, npm = 1;
  if(pc == 1) npm = -1;
  rep(i, x.size()){
    pm.at(i) = npm;
    pp.at(i) = npp;
    if(pc > 1) npm = (npm*2) % (pc-1);
    npp = (npp*2) % (pc+1);
  }
  
  int xp = 0, xm = 0;
  rep(i, x.size()){
    if(x.at(i) == '1'){
      xp += pp.at(i);
      xm += pm.at(i);
      xp %= (pc+1);
      if(pc > 1) xm %= (pc-1);
    }
  }
  rep(i, x.size()){
    if(x.at(i) == '1'){
      if(pc <= 1) fi.at(i) = -1;
      else fi.at(i) = (xm - pm.at(i) + pc-1) % (pc-1);
    }else{
      fi.at(i) = (xp + pp.at(i) + pc+1) % (pc+1);
    }
  }
}

int main(){
  int n;
  cin >> n;
  string x;
  cin >> x;
  reverse(ALL(x));
  vector<int> fi(x.size());
  make_in(x, fi);
  // rep(i, x.size()){
  //   cerr << fi.at(i) << " ";
  // }
  // cerr << endl;
  rrep(i, x.size()){
    fc(x, i, fi);
  }
  return 0;
}

Measured memory_bytes: 6016
x = int(input())
f = True
for i in range(200):
    for j in range(200):
        if f:
            if i > j:
                if i**5 + j**5 == x:
                    print(i,-j)
                    f = False
                    break
                elif i**5 - j**5 == x:
                    print(i,j)
                    f = False
                    break
            else:
                continue
        else:
            break
    

Measured memory_bytes: 65012
#include <stdio.h>
int main()
{
    long long a,h,n,w1,w2,f;
    while(~scanf("%ld",&a))
    {
        f=0;
        for(h=1;h<=3500;h++)
        {
            for(n=1;n<=3500;n++)
            {
                w1=a*h*n;
                w2=4*h*n-n*a-h*a;
                if(w1>0&&w2>0&&w1%w2==0)
                {
                    printf("%ld %ld %ld\n",h,n,w1/w2);
                    f=1;
                }
                if(f)   break;
            }
            if(f)   break;
        }
    }
    return 0;
}


Measured memory_bytes: 128
#![allow(unused_imports)]
#![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names))]

use std::borrow::Cow;
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::hash::Hash;
use std::io::{self, BufWriter, Read, Write};
use std::ops::{
    Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Deref,
    DerefMut, Div, DivAssign, Mul, MulAssign, Neg, Not, Sub, SubAssign,
};
use std::rc::Rc;
use std::str::{self, FromStr};
use std::{cmp, f32, f64, fmt, i16, i32, i64, i8, mem, u16, u32, u64, u8, usize};

fn main() {
    let a: Vec<u32> = {
        let mut sc = InputScanOnce::new(io::stdin(), 1024);
        let n = sc.next();
        sc.vec(n)
    };
    let mut r = 0;
    let mut n = 0;
    for p in a.windows(2) {
        if p[0] == p[1] {
            n += 1;
        } else {
            r += (n + 1) / 2;
            n = 0;
        }
    }
    r += (n + 1) / 2;
    println!("{}", r);
}

struct InputScanOnce {
    buf: Vec<u8>,
    pos: usize,
}

#[allow(dead_code)]
impl InputScanOnce {
    fn new<R: Read>(mut reader: R, estimated: usize) -> Self {
        let mut buf = Vec::with_capacity(estimated);
        let _ = io::copy(&mut reader, &mut buf).unwrap();
        InputScanOnce { buf: buf, pos: 0 }
    }

    #[inline]
    fn next<T: FromStr>(&mut self) -> T
    where
        T::Err: fmt::Debug,
    {
        let mut start = None;
        loop {
            match (self.buf[self.pos], start.is_some()) {
                (b' ', true) | (b'\n', true) => break,
                (_, true) | (b' ', false) | (b'\n', false) => self.pos += 1,
                (_, false) => start = Some(self.pos),
            }
        }
        let target = &self.buf[start.unwrap()..self.pos];
        unsafe { str::from_utf8_unchecked(target) }.parse().unwrap()
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T>
    where
        T::Err: fmt::Debug,
    {
        (0..n).map(|_| self.next()).collect()
    }

    fn pairs<T1: FromStr, T2: FromStr>(&mut self, n: usize) -> Vec<(T1, T2)>
    where
        T1::Err: fmt::Debug,
        T2::Err: fmt::Debug,
    {
        (0..n).map(|_| (self.next(), self.next())).collect()
    }

    fn trios<T1: FromStr, T2: FromStr, T3: FromStr>(&mut self, n: usize) -> Vec<(T1, T2, T3)>
    where
        T1::Err: fmt::Debug,
        T2::Err: fmt::Debug,
        T3::Err: fmt::Debug,
    {
        (0..n)
            .map(|_| (self.next(), self.next(), self.next()))
            .collect()
    }

    fn mat<T: FromStr>(&mut self, m: usize, n: usize) -> Vec<Vec<T>>
    where
        T::Err: fmt::Debug,
    {
        (0..m).map(|_| self.vec(n)).collect()
    }

    fn strings_as_mat<T, F: FnMut(u8) -> T>(&mut self, h: usize, mut f: F) -> Vec<Vec<T>> {
        (0..h)
            .map(|_| {
                let l = self.next::<String>();
                l.as_bytes().iter().cloned().map(&mut f).collect()
            })
            .collect()
    }
}


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

signed main() {
  string s, front, back;
  int q;
  cin >> s >> q;

  int rev = 0;
  for (int i = 0; i < q; i++) {
    int t, f; char c;
    cin >> t;
    if (t == 1) {
      rev = !rev;
    }
    else {
      cin >> f >> c;
      if (f == 1) {
        (rev ? back : front) += c;
      }
      else {
        (rev ? front : back) += c;
      }
    }
  }

  auto join = [](auto a, auto b, auto c, int r) {
    reverse(a.begin(), a.end());
    if (r) reverse(b.begin(), b.end());
    return a + b + c;
  };

  if (rev) {
    cout << join(back, s, front, rev) << endl;
  }
  else {
    cout << join(front, s, back, rev) << endl;
  }
}


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

#define ll long long
#define mk make_pair
#define pb push_back


using namespace std;


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

   string s; cin >> s;
   string ans = "Good";
   for(int i = 0; i < s.size()-1; i++){
      if(s[i] == s[i+1]){
        ans = "Bad";
        break;
      }
   }

   cout << ans;
   return 0;
}


Measured memory_bytes: 256
N, A = map(int, input().split())
x = list(map(int, input().split()))
dp = [[[0]*3000 for _ in range(N+1)] for _ in range(N+1)]
dp[0][0][0] = 1

for i in range(N):
    for j in range(N+1):
        for k in range(3000):
            dp[i+1][j][k] += dp[i][j][k]
            
            if j+1<=N and k+x[i]<3000:
                dp[i+1][j+1][k+x[i]] += dp[i][j][k]

ans = 0

for i in range(1, N+1):
    ans += dp[N][i][i*A]

print(ans)

Measured memory_bytes: 103388
int main()
{
  char s[11], t[11];
  scanf("%s", &s);
  scanf("%s", &t);
  int i, dig = 0;
  for (i = 0; s[i] != '\0'; i++)
    dig++;
  if (strncmp(s, t, dig) == 0)
    printf("Yes");
  else
    printf("No");
}

Measured memory_bytes: 1752
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
//C++11
#if __cplusplus == 201103L
#include <tuple>
#endif

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
bool cover(string s, string t){
  if(s.size() < t.size()) return false;
  if((s.size()-t.size()) % 2 != 0) return false;
  int r = (s.size() - t.size()) / 2;
  for(int i = 0; i< t.size(); i++){
    if(s[r+i] != t[i]) return false;
  }
  return true;
}

int main(){
  string s;
  while(getline(cin, s)){
    string t = "";
    REP(i, s.size()) if(isupper(s[i]) || islower(s[i])) t += toupper(s[i]);
    int N = t.size();
    set<string> ans;
    REP(i, N){
      string pal(t.substr(i,1));
      for(int k = 1; i - k >= 0 && i + k < N && t[i-k] == t[i+k]; k++){
        pal = t[i-k] + pal + t[i+k];
      }
      if(pal.size() > 2) ans.insert(pal);
      pal = "";
      for(int k = 1; i - k + 1>= 0 && i + k < N && t[i-k+1] == t[i+k]; k++){
        pal = t[i-k+1] + pal + t[i+k];
      }
      if(pal.size() > 2) ans.insert(pal);
    }
    vector<string> ans2;
    FORIT(it, ans) ans2.push_back(*it);
    vector<bool> ng(ans2.size());
    REP(i, ans2.size()) FOR(j, i+1, ans2.size()){
      string s1 = ans2[i], s2 = ans2[j];
      if(cover(s1, s2)) ng[j] = true;
      if(cover(s2, s1)) ng[i] = true;
    }
    REP(i, ans2.size())if(!ng[i]){
      cout<<ans2[i]<<" ";
    }
    cout<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <string>

using namespace std;

bool judge(string str) {
  if (str.at(0) != 'A') {
    return false;
  } else {
    int countC = 0;
    for (int pos = 2; pos < str.size() - 1; pos++) {
      if (str.at(pos) == 'C') {
        countC++;
      }
    }
    if (countC != 1) {
      return false;
    }

    int countLarge = 0;
    for (int pos = 0; pos < str.size(); pos++) {
      if (str.at(pos) >= 'A' && str.at(pos) <= 'Z') {
        countLarge++;
      }
    }

    if (countLarge == 2) {
      return true;
    } else {
      return false;
    }
  }
}

int main() {

  string str;
  cin >> str;

  if(judge(str)) {
    cout << "AC\n";
  } else {
    cout << "WA\n";
  }

}

Measured memory_bytes: 256