akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(),(x).end())
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
template<class T>bool maxi(T &a,const T &b){if(a<b){ a=b; return 1;} return 0;}
template<class T>bool mini(T &a,const T &b){if(b<a){ a=b; return 1;} return 0;}
#define y0 y3487465 //j0
#define y1 y1347829 //j1
#define INF2 4000000000000000037
#define INF 1000000007
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;

void Main(){

  int N;
  cin>>N;

  cout<< N/3<<"\n";
}

//-----------------------------------
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}
//-----------------------------------


Measured memory_bytes: 256
def areDistinct(arr) : 
  
    n = len(arr) 
    s = set() 
    for i in range(0, n):  
        s.add(arr[i]) 
    return (len(s) == len(arr)) 
N = int(input())
S =  [int(x) for x in input().split()]
  
if (areDistinct(S)):  
    print("YES") 
  
else :  
    print("NO")

Measured memory_bytes: 25168
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


V,E = map(int,input().split())

in_num = [0]*V
G = [[] for i in range(V)]

for loop in range(E):
    tmp_from,tmp_to = map(int,input().split())
    G[tmp_from].append(tmp_to)
    in_num[tmp_to] += 1

Q = deque()

for i in range(V):
    if in_num[i] == 0:
        Q.append(i)

while len(Q) > 0:
    node_id = Q.popleft()
    print("%d"%(node_id))
    for adj in G[node_id]:
        in_num[adj] -= 1
        if in_num[adj] == 0:
            Q.append(adj)




Measured memory_bytes: 9408
#include <bits/stdc++.h>
        #define ll long long
        #define ld long double
        #define pb push_back
        #define fi first
        #define se second
        #define end "\n"
        #define fast ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
        #define GCD(x,y)          (__gcd((x), (y)))
        #define LCM(x,y)          (((x)/__gcd((x), (y)))*(y))
        #define mem(x,y) memset(x,y,sizeof(x))
        using namespace std;
        long long n,i,t,j,l,y,k,r,a[301301],b[301000],k1,k2,ma,mi,sum, s1,in,jm,f,xx,cur,x,jj,ii,m,z,mia,mib,ans,sum1;
        string s,s2;
        double te;
        char c[101][101];
        long long power(long long x, unsigned long long y)
{
    if (y == 0)
        return 1;
    else if (y % 2 == 0)
        return power(x, y / 2) * power(x, y / 2);
    else
        return x * power(x, y / 2) * power(x, y / 2);
}
        map<long long ,long long>mr;
         map<long long ,long long>mc;

        int main()
        {
            ans=0;

            fast;
           // cin>>t;
           // while(t--){
           cin>>n;
           cin>>a[0];
          for(i=1;i<n;i++){cin>>a[i];if(a[i-1]>a[i])sum+=(a[i-1]-a[i]),a[i]+=(a[i-1]-a[i]);}
          cout<<sum;



        }









Measured memory_bytes: 5132
N,K = map(int, input().split())

arr=[]
arr1=[]
for i in range(1, N+1):
  arr1.append(i)

for i in range(K):
  d=input()
  A=list(map(int, input().split()))
  arr = arr+A
print(len(set(arr1) - set(arr)))

Measured memory_bytes: 9284
#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;

int main(){
	
 	double a,b;
	double s;
	while(cin>>a){
		s=a;
		for(int i=2;i<=10;i++){
		if(i%2==0)
			a=a*2;
		else
			a=a/3;
		s+=a;
		
	}
		printf("%.8f\n",s);
	
}
}

Measured memory_bytes: 1236
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#define MN 100005
#define INF 1000000007
using namespace std;
long long n, a, b;
int main() {
	scanf("%lld%lld%lld", &n, &a, &b);
	if (a > b) {
		long long t = a; a = b; b = t;
	}
	if ((b - a) % 2 == 0) {
		printf("%lld", (b - a) / 2);
	}
	else {
		long long left = a - 1+(b-a)/2+1;
		long long right = n - b + (b - a) / 2+1;
		printf("%lld", min(left, right));
	}
	return 0;
}

Measured memory_bytes: 128
class Solution:
    def solve(self, A: int, B: int, C: int) -> str:

        tmp = sorted([A, B, C])

        if tmp[0] == tmp[1] and tmp[1] != tmp[2]:
            return "Yes"

        if tmp[0] != tmp[1] and tmp[1] == tmp[2]:
            return "Yes"

        return "No"


if __name__ == '__main__':

    # standard input
    A, B, C = map(int, input().split())

    # solve
    solution = Solution()
    print(solution.solve(A, B, C))


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	static int Merge(int A[],int left,int mid,int right){
		int n1=mid-left;
		int n2=right-mid;
		int i,j,k;
		int[] L=new int[n1+1];
		int[] R=new int[n2+1];

		for(i=0;i<n1;i++)L[i]=A[left+i];
		for(i=0;i<n2;i++)R[i]=A[mid+i];
		L[n1]=1000000000;
		R[n2]=1000000000;

		i=j=0;
		for(k=left;k<right;k++){
			if(L[i]<=R[j]){
				A[k]=L[i];
				i++;
			}else{
				A[k]=R[j];
				j++;
			}
		}
		return right-left;
	}

	static int Merge_Sort(int A[],int left,int right){
		int mid,res=0;
		if(left+1<right){
			mid=(left+right)/2;

			res+=Merge_Sort(A,left,mid);
			res+=Merge_Sort(A,mid,right);
			res+=Merge(A,left,mid,right);

		}
		return res;
	}

	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			int n=sc.nextInt();
			int[] S=new int[n+1];
			for(int i=0; i<n; i++) {
				S[i]=sc.nextInt();
			}
			int x=Merge_Sort(S,0,n);

			for(int i=0;i<n;i++){
				if(i>0) System.out.print(" ");
				System.out.print(S[i]);
			}
			System.out.println();
			System.out.println(x);
		}

	}
}


Measured memory_bytes: 169252
import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static void solve() {
		char[] c = in.next().toCharArray();
		Arrays.sort(c);

		int min = 0, max = 0;
		for (int i=0; i<c.length; i++) {
			min += (c[i]-'0')*Math.pow(10,c.length-i-1);
			max += (c[c.length-1-i]-'0')*Math.pow(10,c.length-i-1);
		}

		out.println((max - min));
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		int n = in.nextInt();
		while(n-- > 0) solve();
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}

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

int main()
{
	int H, W;
	cin >> H >> W;
	int c[10][10];
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			cin >> c[i][j];
		}
	}
	int A[50000];
	for (int i = 0; i < H*W; i++) {
		cin >> A[i];
	}
	int num[10] = { 0,0,0,0,0,0,0,0,0,0 };
	for (int i = 0; i < H*W; i++) {
		switch (A[i]) {
		case 0:
			num[0]++;
			break;
		case 2:
			num[2]++;
			break;
		case 3:
			num[3]++;
			break;
		case 4:
			num[4]++;
			break;
		case 5:
			num[5]++;
			break;
		case 6:
			num[6]++;
			break;
		case 7:
			num[7]++;
			break;
		case 8:
			num[8]++;
			break;
		case 9:
			num[9]++;
			break;
		}
	}

	int d[10][10];

	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			d[i][j] = c[i][j];
		}
	}


	for (int k = 0; k < 10; k++) {
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				if (i == j) d[i][j] = 0;
				else d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}

	int mind[10];

	mind[1] = 0;
	for (int i = 0; i < 10; i++) {
		if (i == 1) continue;
		mind[i] = d[i][1];
	}
	int ans = 0;
	for (int i = 0; i < 10; i++) {
		if (i == 1) continue;
		ans += mind[i] * num[i];
	}
	cout << ans << endl;
    return 0;
}



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

int main() {
  int n;
  cin >> n;
  vector<vector<int>> v(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    v[a - 1].push_back(b - 1);
    v[b - 1].push_back(a - 1);
  }
  vector<int> c(n);
  for (auto& e : c) cin >> e;
  sort(begin(c), end(c));

  int s = -c.back();
  for (auto e : c) s += e;

  vector<int> r(n, -1);
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int i = q.front();
    q.pop();
    r[i] = c.back();
    c.pop_back();
    for (auto e : v[i]) {
      if (r[e] != -1) continue;
      q.push(e);
    }
  }

  cout << s << endl;
  for (auto e : r) cout << e << " ";
  cout << endl;
}


Measured memory_bytes: 1024
#define _GIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double EPS = 1e-10;


int main(void) {
  int N, Y;
  cin >> N >> Y;

  for (int x = 0; x <= N; ++x) {
    for (int y = 0; y <= N; ++y) {
      int z = N - x - y;
      if (z < 0) continue;
      int yen = x * 10000 + y * 5000 + z * 1000;
      if (yen == Y) {
        cout << x << " " << y << " " << z << endl;
        return 0;
      }
    }
  }

  cout << "-1 -1 -1" << endl;
  
  return 0;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll x,y;cin>>x>>y;
  if(x<y){
    if(0<=x||y<=0){
      cout<<y-x<<endl;
    }else{
      cout<<min(1+abs(abs(x)-abs(y)),y-x)<<endl;
    }
  }else{
    if(x<0||0<y){
      cout<<2+x-y<<endl;
    }else{
      cout<<1+abs(abs(x)-abs(y))<<endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
l = list(map(int, input().split()))
a = l[0]+l[1]

if l[0] % 3 == 0:
    print("Possible")
elif l[1] % 3 == 0:
    print("Possible")
elif a % 3 == 0:
    print("Possible")
else:
    print("Impossible")


Measured memory_bytes: 2940
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(void){
long long int a,b,k;
scanf("%lld %lld %lld",&a,&b,&k);
if(k==0){printf("%lld %lld\n",a,b);return 0;}
if(a<k){k=k-a;a=0;}
else{a=a-k;printf("%lld %lld\n",a,b);return 0;}
if(b<k){k=k-b;b=0;}
else{b=b-k;printf("%lld %lld\n",a,b);return 0;}
printf("%lld %lld\n",a,b);return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>

using namespace std;

struct Node {
    int key;
    Node *right, *left, *parent;
};

Node *root, *NIL;

void insert(int k) {
    Node *y = NIL;
    Node *x = root;
    Node *z = (Node *)malloc(sizeof(Node));

    z->key = k;
    z->left = NIL;
    z->right = NIL;

    while (x != NIL) {
        y = x;
        if (z->key < x->key) {
            x = x->left;
        } else {
            x = x->right;
        }
    }

    z->parent = y;

    if (y == NIL) {
        root = z;
    } else {
        if (z->key < y->key) {
            y->left = z;
        } else {
            y->right = z;
        }
    }
}

void inorder(Node *u) {
    if (u == NIL) return;
    inorder(u->left);
    printf(" %d", u->key);
    inorder(u->right);
}

void preorder(Node *u) {
    if (u == NIL) return;
    printf(" %d", u->key);
    preorder(u->left);
    preorder(u->right);
}

int main() {
    int n, x;
    string com;

    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> com;
        if (com == "insert") {
            cin >> x;
            insert(x);
        } else if (com == "print") {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }

    return 0;
}


Measured memory_bytes: 26644
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 2
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	h := getNextInt64(scanner)
	var ans int64
	ans = 0
	bit := 0
	for h > 0 {
		h >>= 1
		ans += 1 << uint(bit)
		bit++
	}
	fmt.Fprintln(writer, ans)
}


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

int main(){
  int i,n,o;
  int a[25];

  while(1){
    cin >> n;
    if(!n)break;

    for(i=0;i<n;i++)cin >> a[i];

    o = 32;
    i = 0;
    while(1){
      o -= (o-1)%5;
      cout << o << endl;
      if(!o)break;

      o -= a[i];
      if(o<0)o=0;
      i++;
      if(i==n)i=0;
      cout << o << endl;
      if(!o)break;
    }
  }
}

Measured memory_bytes: 0
#include <iostream>
#include<cstdio>
#include <algorithm>
#include<string>
#include<queue>
using namespace std;
const int N=2020;
long long ans[N][N],sum;
int n;
struct node{
    int val,id;
}a[N];
bool cmp(node x,node y){
    return x.val>y.val;
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i].val),a[i].id=i;
    sort(a+1,a+n+1,cmp);
    for(int i=0;i<=n;i++){
        for(int j=0;j<=n;j++){
            if(i+j>=n)continue;
            int num=i+j+1;
            ans[i][j+1]=max(ans[i][j+1],1ll*(n-j-a[num].id)*a[num].val+ans[i][j]);
            ans[i+1][j]=max(ans[i+1][j],1ll*(a[num].id-1-i)*a[num].val+ans[i][j]);
        }
    }
    for(int i=0;i<=n;i++)
        if(ans[i][n-i]>sum)sum=ans[i][n-i];
    cout<<sum<<endl;
}

Measured memory_bytes: 26356
#include <stdio.h>

int main(void)
{
	int a,b,c,d,e,k,s,l;
	
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&k);
	
	l=a;
	if(l<b)l=b;
	if(l<c)l=c;
	if(l<d)l=d;
	if(l<e)l=e;
	
	s=a;
	if(s>b)s=b;
	if(s>c)s=c;
	if(s>d)s=d;
	if(s>e)s=e;
	
	if(l-s<=k)printf("Yay!\n");
	else printf(":(\n");
	
  return 0;
}


Measured memory_bytes: 128
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(Math.abs(a - b) <= w) System.out.println(0);
		else System.out.println(Math.abs(a - b) - w);
	}
}

Measured memory_bytes: 21972
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
#define INF 1e9

int main(void){

  //変数の準備
  int big = 0, small = INF, N;
  
  //入力
  cin >> N;
  
  //配列の受け取り
  int A[N];
  for(int i = 0; i < N; i++){
    cin >> A[i];
    big = max(big, A[i]);
    small = min(small, A[i]);
  }
  
  cout << big - small << endl;

  return 0;
}


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

#define REP(i,s,n) for(int i=s; i<n; ++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

typedef long long ll;
typedef pair<int, int> ii;

int main(){

  int a, b, c;
  cin >> a >> b >> c;
  int ans = 3;
  if(a == b || a == c) ans--;
  if(b == c) ans--;

  cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#include<math.h>
#define INF 2e9
#define rep(i,m) for(int i=0;i<m;i++)
#define repn(i,n,m) for(int i=n;i<m;i++)


using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<long long int> a(n);
	rep(i, n)cin >> a[i];

	long long int ans=1;
	rep(i, n)
	{
		if (a[i] == 0)
		{
			cout << 0 << endl;
			return 0;
		}
	}
	rep(i, n)
	{
		if (a[i] >1000000000000000000 / ans)
		{
			cout << -1 << endl;
			return 0;
		}
		ans = ans * a[i];
	}
	cout << ans << endl;
	return 0;
}
	

Measured memory_bytes: 4052
n = int(input())
a = [int(input()) for _ in range(n)]

ans = 0

for i in range(n):
    if i == 0:
        now = a[0]-1
        ans += 1
    else:
        now = a[now]-1
        ans += 1
    if now == 1:
        print(ans)
        break
if i+1 == n:
    print(-1)


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

using namespace std;

using ll = long long;
using P = pair<int, ll>;

const ll INF = 1000000000000000LL;

vector<P> g[100005];
vector<ll> val;

bool dfs(int cur) {
    for (P& p : g[cur]) {
        if (val[p.first] != INF) {
            if (val[cur] + p.second != val[p.first]) return false;
        } else {
            val[p.first] = val[cur] + p.second;
            if (!dfs(p.first)) return false;
        }
    }
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int l, r;
        ll d;
        cin >> l >> r >> d;
        l--; r--;
        g[l].emplace_back(r, d);
        g[r].emplace_back(l, -d);
    }
    val.assign(n, INF);
    for (int i = 0; i < n; i++) {
        if (val[i] == INF) {
            val[i] = 0;
            if (!dfs(i)) {
                cout << "No" << endl;
                return 0;
            }
        }
    }

    ll vmin = INF, vmax = -INF;
    for (int i = 0; i < n; i++) {
        vmin = min(vmin, val[i]);
        vmax = max(vmax, val[i]);
    }

    cout << (vmax - vmin > 1000000000 ? "No" : "Yes") << endl;
    return 0;
}

Measured memory_bytes: 16512
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
ll gcd(ll a, ll b)
{
	if (b == 0)return a;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region LCM
ll lcm(ll a, ll b)
{
	return a / gcd(a, b) * b;
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion


int main()
{
	int n; cin >> n;
	map<int, int> mp;
	for (int x = 1; x*x <= n; ++x)
	{
		for (int y = 1; y*y <= n; ++y)
		{
			for (int z = 1; z*z <= n; ++z)
			{
				++mp[x*x + y * y + z * z + x * y + y * z + z * x];
			}
		}
	}
	for (int i = 1; i <= n; ++i)cout << mp[i] << endl;
}

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

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

map<int, int> prime_factor(int n) {
  map<int, int> res;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        res[i]++;
        n /= i;
      }
    }
  }
  if (n != 1)
    res[n] = 1;
  return res;
}

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

  int C = gcd(A, B);

  map<int, int> mp = prime_factor(C);

  cout << mp.size() + 1 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <functional>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 1145141919
#define ll long long
//#define scanf scanf_s

int v, e;
struct edge{ int from, to, cost; };
edge ed[100001];
int par[10001];

bool comp(const edge& e1, const edge& e2)
{
	return e1.cost < e2.cost;
}

int find(int x)
{
	if (par[x] == x) return x;
	else return par[x] = find(par[x]);
}

void unite(int x, int y)
{
	x = find(x);
	y = find(y);
	par[x] = y;
}

bool same(int x, int y)
{
	return (find(x) == find(y));
}

int main()
{
	cin >> v >> e;
	int a, b, c;
	REP(i, e)
	{
		cin >> a >> b >> c;
		ed[i] = { a, b, c };
	}
	sort(ed, ed + e, comp);
	int sum = 0;
	REP(i, 10001) par[i] = i;
	REP(i, e)
	{
		if (!same(ed[i].from,ed[i].to))
		{
			unite(ed[i].from, ed[i].to);
			sum += ed[i].cost;
		}
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 2388
# Some Integers
li = sorted(list(map(int, input().split())))
count = 0
while li[1] < li[2]:
    li[0] += 1
    li[1] += 1
    count += 1
while li[0] < li[1]:
    li[0] += 2
    count += 1
if li[0] > li[1]:
    li[1] += 1
    li[2] += 1
    count += 1
print(count)


Measured memory_bytes: 3060
/*input
4 3
1 2
2 3
2 4
2 10
1 100
3 1
*/

#include <bits/stdc++.h>
using namespace std;

vector<int> to[200005];
vector<int> counter;

void add_count(int cur, int parent = -1) {
    for (int x: to[cur]) {
        if (x != parent) {
            counter[x] += counter[cur];
            add_count(x, cur);
        }
    }
}

int main() {
    int n, q;
    cin >> n >> q;
    for (int i = 0; i < n-1; ++i) {
        int a, b;
        cin >> a >> b;
        --a;
        --b;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    counter.resize(n);
    for (int i = 0; i < q; ++i) {
        int p, x;
        cin >> p >> x;
        --p;
        counter[p] += x;
    }
    add_count(0);
    for (int x: counter) {
        cout << x << endl;
    }
}

Measured memory_bytes: 23552
#include<stdio.h>

int main(void){

	int a,b,c,d;
	int n;
	int sum;

	while(scanf("%d",&n)!=EOF){

		sum = 0;

		for(a=0;a<10;a++){
			for(b=0;b<10;b++){
				for(c=0;c<10;c++){
					for(d=0;d<10;d++){
						if(a+b+c+d == n)
							sum++;
					}
				}
			}
		}

		printf("%d\n",sum);
	}

	return 0;
}

Measured memory_bytes: 596
import sys, heapq
input = sys.stdin.readline
n, q = map(int, input().split())
c = [int(x) - 1 for x in input().split()]

que = []
for i in range(q):
    l, r = map(int, input().split())
    que.append((l, r, i))



class SegTree(object):
    def __init__(self, n):
        self.BIT = [0] * (n + 1)
        self.num = n

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.BIT[i]
            i -= i & (-i)
        return s

    def add(self, i, x):
        while i <= self.num:
            self.BIT[i] += x
            i += i & (-i)
    

que.sort(key=lambda x: -x[1])
ans = [None] * q
last = [-1] * n
BIT = SegTree(n)

for i in range(1, n+1):
    if last[c[i-1]] != -1:
        BIT.add(last[c[i-1]], -1)
    last[c[i-1]] = i
    BIT.add(i, 1)

    while que and que[-1][1] == i:
        l, r, x = que.pop()
        ans[x] = BIT.sum(r) - BIT.sum(l-1)

print(*ans, sep='\n')


Measured memory_bytes: 196004
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define ll unsigned long long
using namespace std;
int main(){
    int N,K,ans=0;
    cin>>N>>K;
    while(N>0){
        N /= K;
        ans++;
    }
    cout<<ans<<endl;
}

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

vector<string> input(int height)
{
	int i;
	vector<string> inp(height);

	for (i = 0; i < height; i++) {
		cin >> inp[i];
	}

	return inp;
}

int main(int argc, char *argv[])
{
	int i, j;
	int h, w;
	cin >> h >> w;
	vector<string> org;
	string::iterator it;
	org = input(h);
	int flags[w];
	string white(w, '.');
	for (i = 0; i < w; i++) 
		flags[i] = 0;
	
	auto result = remove_if(org.begin(), org.end(),
							[&white](string s) { return s == white; });

	org.erase(result, org.end());
	org.shrink_to_fit();	

	for (i = 0; i < w; i++) {
		if ((org.front())[i] == '.') {
			for (j = 0; j < org.size(); j++) {
				if ((org[j])[i] != '.')
					break;
			}
			if (j == org.size()) 
				flags[i] = 1;
		}
	}
	
	for (i = w - 1; i >= 0; i--) {
		if (flags[i] == 1) {
			for (j = 0; j < org.size(); j++) 
				org[j].erase(org[j].begin() + i);
		}
	}
	
	for (i = 0; i < org.size(); i++) 
		cout << org[i] << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
//#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}

inline void solve(){

    ll h, w;
    cin >> h >> w;
    bool a = true;
    

    ll mini = INF;

 LOOP:
    for(int i = 0; i < h; i++) {
        ll a1 = i * w;
        ll a2 = w*((h-i)/2);
        ll a3 = w*(h-i-(h-i)/2);
        chmin(mini,max({a1,a2,a3})-min({a1,a2,a3}));
        a2 = (h-i) * (w / 2);
        a3 = (h-i) *  (w-w/2);
        chmin(mini,max({a1,a2,a3})-min({a1,a2,a3}));
    }

    if(a){ a = false; swap(h,w); goto LOOP;}

    cout << mini << endl;
    
}
struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;signed main(){solve();return 0;}


Measured memory_bytes: 256
/**
 * auther: moririn_cocoa
 */
// #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
// #define BEGIN_STACK_EXTEND(size) void * stack_extend_memory_ = malloc(size);void * stack_extend_origin_memory_;char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);*stack_extend_dummy_memory_ = 0;asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
// #define END_STACK_EXTEND asm volatile("mov %%rax, %%rsp"::"a"(stack_extend_origin_memory_));free(stack_extend_memory_)

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define fi first
#define se second

int main(int argc, char* argv[]) {
  
  int a;
  int b;
 
  cin >> a;
  cin >> b;
  
  if ( b >= a ) {
    
    cout << a << endl;
  }
  
  else {
    
    cout << a - 1 << endl;
  }
    
    return 0;
}

Measured memory_bytes: 3608
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long 

// fact(n)
int fact(int n){
	if(n == 1)	return 1;
	else return (n * fact(n - 1));
}

// combination(n,r)
int combination(int n, int r){

	if(r == 0 || r == n)	return 1;
	else if(r == 1)	return n;
	return (combination(n - 1, r - 1) + combination(n - 1, r));
}

// gcd(a,b)
int gcd(int a,int b){
	int ret;
	ret = (b == 0) ? a : gcd(b, a % b);
	return ret;
}

// lcm(a.b)
int lcm(int a,int b){
	return (a * b) / gcd(a,b);
}

// qsort(array, size, sizeof(int),comp);
int comp(const int *a,const int *b){
	return (*a - *b);
}

// append(array,*size,addNum)
void append(int *array,int *size,int num){
	realloc(array, sizeof(int) * (*size + 1));
	array[(*size)] = num;
	++(*size);
}

// pop(array,*size) & nongetpop(array,*size)
int pop(int *array,int *size){
	int temp = array[(*size - 1)];
	realloc(array,sizeof(int) * (*size - 1));
	--(*size);
	return temp;
}

void nongetpop(int *array,int *size){
	realloc(array,sizeof(int) * (*size - 1));
	--(*size);
}

int main(int argc, char const *argv[]){
	int a,b,c;
	scanf("%d%d%d", &a,&b,&c);
	if(a == b)	printf("%d\n",c);
	else if(a == c)	printf("%d\n",b);
	else printf("%d\n",a);
	return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
#define ll long long int
#define hell 1000000007LL
using namespace std;
ll power(ll x, ll y){ 
    if(y==0)
     return 1;
    else
    {
        ll p=power(x,y/2);
        if(y%2==0)
         return (p*p)%hell;
        else
        return (x*((p*p)%hell))%hell;
    }}
ll gcd(ll x,ll y)
{
    if(y==0)
     return x;
    else
    return gcd(y,x%y);
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(20);
    ll n;
    cin>>n;
    ll x=0;
    for(int i=1;i<=n;i++)
    {
        ll y=n/i;
        x=x+i*((y*y+y)/2);
    }
    cout<<x;}

Measured memory_bytes: 3648
#include<iostream>
using namespace std;
int main() {
	int i, n;
	for (i = 1; i <= 9; i++) {
		for (n = 1; n <= 9; n++) {
			cout << i << 'x' << n << '=' << i*n << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1116
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<ll>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}



int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int D;
    cin >> D;
    vi c(26);
    rep(i, 26) cin >> c[i];
    vvi s(D, vi(26));
    rep(i, D) rep(j, 26) {
        cin >> s[i][j];
    }

    vi t(D);
    vi last(26);
    rep(d, D) {
        int ma = INT_MIN, nn = 23;
        rep(i, 26) {
            int ggh = 0;
            ggh += s[d][i];
            rep(j, 26) {
                if(i == j) continue;
                ggh -= c[j]*(d+1-last[j]);
            }
            if(chmax(ma, ggh)) {
                nn = i;
            }
        }
        last[nn] = d+1;
        t[d] = nn;
    }
    last.assign(26, 0);
    vector<set<int> > se(26);
    rep(i, 26) {
        se[i].insert(D);
    }
    ll gh = 0;
    rep(d, D) {
        se[t[d]].insert(d);
        gh += s[d][t[d]];
        last[t[d]] = d+1;
        rep(j, 26) {
            gh -= c[j]*(d+1-last[j]);
        }
    }

    vvi bits(26, vi(D+1));
    auto add = [&](int al, int d, int x) {
        while(d <= D) {
            bits[al][d] += x;
            d += d&-d;
        }
    };
    auto sum = [&](int al, int d) {
        if(d == 0) return 0;
        int res = 0;
        while(d) {
            res += bits[al][d];
            d &= d-1;
        }
        return res;
    };


    rep(i, D) {
        rep(j, 26) {
            add(j, i+1, 1);
        }
    }

    rep(i, D) {
        int now = sum(t[i], i+1);
        add(t[i], i+1, -now);
    }
    
    int X = 100000;
    while(X--) {
        int nowd = 38*X%D;
        int nowal = 41*X%26;
        if(t[nowd] == nowal) continue;
        ll nowgh = gh;
        nowgh += s[nowd][nowal]-s[nowd][t[nowd]];
        auto itr = se[nowal].lower_bound(nowd);
        nowgh += (*itr - nowd)*sum(nowal, nowd+1) * c[nowd];
        itr = se[t[nowd]].upper_bound(nowd);
        nowgh -= (*itr-nowd)*(sum(t[nowd], nowd)+1) * c[t[nowd]];
        if(nowgh > gh) {
            add(t[nowd], nowd+1, sum(t[nowd], nowd)+1);
            add(nowal, nowd+1, -sum(nowal, nowd+1));
            se[t[nowd]].erase(nowd);
            se[nowal].insert(nowd);
            t[nowd] = nowal;
            gh = nowgh;
        }
    }

    rep(i, D) {
        cout << t[i]+1 << endl;
    }
}

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

int main() {
	vector<int> a(3);
	cin >> a[0] >> a[1] >> a[2];
	sort(a.begin(), a.end());
	cout << a[0] << " " << a[1] << " " << a[2] << endl;
	return 0;
}

Measured memory_bytes: 1212
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <iomanip>
#include <fstream>
#include <ctime>
using namespace std;
using ll = long long;
using ull = unsigned long long;

int main() {
    int l, r, d;
    cin >> l >> r >> d;
    int ans = 0;
    for (int i = l; i <= r; i++)
        if (i % d == 0)
            ans++;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const long long INF = 1001001001;
const long long MOD = 1000000007;
const double EPS = 1e-10;

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

    int x;
    cin>>x;
    for(int i=1800,j=1;i>=400;i-=200,j++){
        if(x>=i){
            cout<<j<<endl;
            return 0;
        }
    }
}

Measured memory_bytes: 3664
n = int(input())
str_list = [input()for _ in range(n)]
a = 0
b= 0
c = 0
d = 0
for i in range(n):
    if str_list[i]=="AC":
        a+=1
    elif str_list[i]=="WA":
        b+=1
    elif str_list[i]=="TLE":
        c+=1
    elif str_list[i]=="RE":
        d+=1
print("AC x",a)
print("WA x",b)
print("TLE x",c)
print("RE x",d)

Measured memory_bytes: 82348
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007LL;
const int INF = LLONG_MAX;

signed main(){
    
    int n, m; cin >> n >> m;
    vector<int> a(n);
    vector<int> b(n);
    for(int i = 0; i < n; i++) cin >> a[i] >> b[i];
    vector<int> c(m);
    vector<int> d(m);
    for(int i = 0; i < m; i++) cin >> c[i] >> d[i];

    for(int i = 0; i < n; i++){
        int dis = INF;
        int idx;
        for(int j = 0; j < m; j++){
            int tmp = (int)abs(a[i] - c[j]) + (int)abs(b[i] - d[j]);
            
            if(dis > tmp){
                dis = tmp;
                idx = j;
            }
        }

        cout << idx + 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int MOD = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct edge{
    ll to, cost;
};


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

ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 素数
vector<bool> IsPrime;
void sieve(size_t max){
    if(max+1 > IsPrime.size()){
        IsPrime.resize(max+1,true);
    } 
    IsPrime[0] = false;
    IsPrime[1] = false;

    for(size_t i=2; i*i<=max; ++i){
        if(IsPrime[i]){
            for(size_t j=2; i*j<=max; ++j){
                IsPrime[i*j] = false;
            }
        }
    }
}

// べき乗の余り
ll modpow(ll a, ll n, ll mod){
    ll res = 1;
    while(n){
        if(n & 1){
            (res *= a) %= mod;
        }else{
            (a *= a) %= mod;
        }
        n >>= 1;
    }
    return res;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

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

    queue<ll> q;
    for(ll i=1;i<=9;++i){
        q.push(i);
    }
    ll num = 1;
    ll ans = 0;
    while(true){
        ll x = q.front();
        q.pop();
        if(num == k){
            ans = x;
            break;
        }
        if(x % 10 != 0){
            q.push(x * 10 + x % 10 - 1);
        }
        q.push(x * 10 + x % 10);
        if(x % 10 != 9){
            q.push(x * 10 + x % 10 + 1);
        }
        num++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 5172
H, W, K = map(int, input().split())
S = [list('#'*(W+2))] + [list('#' + input() + '#') for _ in range(H)] + [list('#'*(W+2))]
arr = []
for y, s in enumerate(S[1:-1]):
    for x, c in enumerate(s[1:-1]):
        if c == '#':
            arr.append((y+1, x+1))

ans = [[None] * W for _ in range(H)]
for i, a in enumerate(arr):
    y, x = a
    #S[y][x] = '.'
    top = bottom = y
    left = right = x
    # 横方向に行けるだけ伸ばす
    while S[y][left-1] == '.':
        left -= 1
    while S[y][right+1] == '.':
        right += 1
    # 縦方向に行けるだけ伸ばす
    while '#' not in S[top-1][left:right+1]:
        top -= 1
    while '#' not in S[bottom+1][left:right+1]:
        bottom += 1

    for y in range(top, bottom+1):
        for x in range(left, right+1):
            S[y][x] = '#'
            ans[y-1][x-1] = i+1

for line in ans:
    print(' '.join(map(str, line)))

Measured memory_bytes: 53720
s = gets.rstrip.split("")

dp = Hash.new(0)
dp[0] = 1

MOD = 2019
digit = 1
modulo = 0
s.reverse.each do |i|
  modulo = modulo % MOD + i.to_i * digit % MOD
  modulo %= MOD
  dp[modulo] += 1
  digit = digit % MOD * 10 % MOD % MOD
end

cnt = 0
dp.each do |k, v|
  cnt += v*(v-1)/2
end
p cnt

Measured memory_bytes: 26588
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define pie 3.141592653589793238462643383279
#define int long long
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}

int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1)*x%mod;
}

int mod_pow(int x, int y, int mood) {
	int res = 1;
	while (y > 0) {
		if (y & 1)res = res * x%mood;
		x = x * x%mood;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int a;
string s;

signed main() {
	cin >> a >> s;
	if (a < 3200)cout << "red" << endl;
	else cout << s << endl;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
#define ll  long long
#define mp make_pair
#define pb  push_back
#define ALL(_a)   _a.begin(), _a.end()
#define PI acos(-1.0)
#define MAX 200005
#define MOD 1000000007
#define nl '\n'
#define pqmin(x) priority_queue<x, vector<x>, greater<x>>
#define pqmax(x) priority_queue<x>
#define testCase(x) int x; cin>>x; for(int tc=1;tc<=x;tc++)
#define int ll
void c_p_c() {
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
}
//............................................................
//   A'udhu Billaahi min ash-shaitwanir rajeem
//       Bismillah-ir Rahman-ir Raheem
//           Rabbi zidnee 'ilmaa
//............................................................
void solve() {
   string s;
   cin >> s;
   if (s == "ABC")cout << "ARC" << nl;
   else cout << "ABC" << nl;
}
int32_t main() {
   c_p_c();
   //testCase(t)
   solve();
   return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

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

using namespace std;

namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

using ll = long long;
ll mod = pow(10, 9) + 7;

template <typename T> void output(T, ll);
ll gcd(ll, ll);
ll lcm(ll, ll);
Bint comb(Bint, Bint);
void prime_map(map<ll, ll> &, ll);

int main() {
    // source
    int n;
    cin >> n;
    int ans = 1;
    repd(i, 2, n) {
        int num = 2;
        while (pow(i, num) <= n) {
            ans = max(ans, (int)pow(i, num));
            num++;
        }
    }
    cout << ans << endl;
    return 0;
}

Bint comb(Bint a, Bint b) {
    Bint ans = 1;

    if (a < b) {
        return 0;
    }

    rep(i, b) {
        ans *= a - i;
        ans /= i + 1;
    }

    return ans;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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

ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

void prime_map(map<ll, ll> &m, ll num) {
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }

    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }
        return;
    } else {
        prime_map(m, num);
    }
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

struct node
{
  node* nxt;
  node* prv;
  int val;
};

int idx=0;
node resorce[2000000];

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

  node* start=&resorce[idx++];
  node* end=&resorce[idx++];
  start->nxt=end; start->prv=NULL;
  start->val=-1;
  end->prv=start; end->nxt=NULL;
  end->val=-1;

  int q;
  cin>>q;
  while(q--){
    string com;
    int x;
    cin>>com;
    if(com=="insert"){
      cin>>x;
      node* crt=&resorce[idx++];
      crt->val=x;
      crt->nxt=start->nxt;
      crt->prv=start;
      start->nxt=crt;
      crt->nxt->prv=crt;
    }else if(com=="delete"){
      cin>>x;
      node* crt=start;
      while(crt!=end&&crt->val!=x)crt=crt->nxt;
      if(crt==end)continue;
      node* prev=crt->prv;
      node* next=crt->nxt;
      prev->nxt=next;
      next->prv=prev;
    }else if(com=="deleteFirst"){
      node* crt=start->nxt;
      start->nxt=crt->nxt;
      crt->nxt->prv=start;
    }else if(com=="deleteLast"){
      node* crt=end->prv;
      end->prv=crt->prv;
      crt->prv->nxt=end;
    }
  }
  vector<ll> res;
  node* crt=start->nxt;
  while(crt!=end){
    res.push_back(crt->val);
    crt=crt->nxt;
  }
  cout<<res[0];
  repl(i,1,res.size()){
    cout<<" "<<res[i];
  }
  cout<<endl;
	return 0;
}

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

#define ll long long

ll n,m,k;
ll a[3000][3000];
ll dp[3000][3000][4];

ll solve(int i,int j,int rem){
	if(i==n-1 && j==m-1){
		if(a[i][j]!=0 && rem>=1) return a[i][j];
		else return 0;
	}
	if(dp[i][j][rem]!=-1LL) return dp[i][j][rem];
	ll req = 0;
	if(j+1<m){
		req = max(req,solve(i,j+1,rem));
		if(rem>0 && a[i][j]!=0) req = max(req,a[i][j] + solve(i,j+1,rem-1));
	}
	if(i+1<n){
		req = max(req,solve(i+1,j,3));
		if(rem>0 && a[i][j]!=0) req = max(req,a[i][j] + solve(i+1,j,3));
	}
	dp[i][j][rem] = req;
	return req;
}

int main() {
	memset(a,0,sizeof(a));
	memset(dp,-1LL,sizeof(dp));
	cin>>n>>m>>k;
	for(ll i=0;i<k;i++){
		ll r,c,v;
		cin>>r>>c>>v;
		r--;c--;
		a[r][c] = v;
	}
	cout<<solve(0,0,3)<<"\n";
	return 0;
}

Measured memory_bytes: 355732
import java.util.*;

class Main {

    //再帰的に1の個数を探すメソッド
    public static int useRecursionToCountChars (String str, char key, int index){
        if (index >= str.length()) {
            return 0;
        }
        
        //文字列とキーが一致したらcountに1を入れる、そうでなければ0
        int count = str.charAt(index) == key? 1:0;
        //カウントに数を足して再帰処理、インデックスが文字列の長さを超えたらリターン
        return count + useRecursionToCountChars(str,key,index + 1);

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int result = useRecursionToCountChars (str,'1', 0);
        System.out.println(result);
    }
}

Measured memory_bytes: 20948
n = int(input())
a = []
t = []
for i in range(n):
    b = int(input())
    a.append(b)
    if b % 10 != 0:
        t.append(b)

if sum(a) % 10 != 0:
    print(sum(a))
else:
    if len(t) > 0:
        print(sum(a) - min(t))
    else:
        print(0)

Measured memory_bytes: 3064
N = int(input())
T = list(map(int, input().split()))
M = int(input())
PX = [list(map(int, input().split())) for i in range(M)]

total_time = sum(T)

for i in range(M):
    t = PX[i][0]-1

    print(total_time - (T[t] - PX[i][1]))




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

int main() {
  int N;
  cin >> N;
  int flag = 0;
 // int X = N*100/108-10;
  
  for(int i = 0 ; i <= N; i++){
  	if(N==8*i/100+i){
      cout << i << endl;
      flag = 1;
      break;
    } 
  }
  if(flag == 0){
  	cout << ":(" << endl;
  }

  return 0;
}


Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
#define ff          first
#define ss          second
#define ll         	long long int
#define pb          push_back
#define ar 			array
#define mp 			make_pair
#define f(i,n)   	for(ll i =0;i<n;i++)
#define inf 		INT_MAX
#define pll 		pair<ll, pair<ll,ll>>
const ll INF = 1e18;
void init(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE 
		freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#endif
}

void solve(){
	
	ll n;
	cin>>n;
	vector<ll> a(n);
	for(ll i = 0; i<n; i++){
		cin>>a[i];
	}

	string s;
	cin>>s;
	vector<ll> basis;
	int res = 0;

	for(ll i = n-1; i>=0; i--){

		for(auto b : basis){
			a[i] = min(a[i] , a[i] ^ b);
		}
		if(a[i]){
			if(s[i] == '0'){
				basis.push_back(a[i]);
			}
			else{
				res = 1;
			}
		}
	}
	cout<<res<<endl;


}
int main(){
	init();
	ll t = 1;
	cin>>t;
	for(ll i=1;i<=t;i++){
		//cout<<"Case #"<<i<<": ";
		solve();
	}
}


Measured memory_bytes: 3660