akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<algorithm>
#include<vector>
#define pll pair<long long,long long>
#define N_ 150000
using namespace std;
int w[N_][2], L[N_][2], C[N_], n;
vector<pll>D[N_];
long long dd;
void DFS(int a){
    D[a].clear();
    if(!C[a]){
        D[a].push_back(pll(0,0));
        return;
    }
    int u = w[a][0], v = w[a][1];
    DFS(u);
    DFS(v);
    int i, pv = 0, sz1 = D[u].size(), sz2 = D[v].size();
    vector<pll>T;
    for(i=0;i<sz1;i++){
        while(pv < sz2 && D[u][i].second + D[v][pv].first + L[a][0] + L[a][1] <= dd) pv++;
        if(!pv)continue;
        T.push_back(pll(D[u][i].first + L[a][0], D[v][pv-1].second + L[a][1]));
    }
    pv = 0;
    for(i=0;i<sz2;i++){
        while(pv < sz1 && D[v][i].second + D[u][pv].first + L[a][0] + L[a][1] <= dd) pv++;
        if(!pv)continue;
        T.push_back(pll(D[v][i].first + L[a][1], D[u][pv-1].second + L[a][0]));
    }
    if(T.empty())return;
    sort(T.begin(),T.end());
    long long MM = T[0].second;
    D[a].push_back(T[0]);
    for(i=1;i<T.size();i++){
        if(T[i].second >= MM)continue;
        MM = T[i].second;
        D[a].push_back(T[i]);
    }
}
bool Pos(long long mid){
    int i;
    dd = mid;
    DFS(1);
    if(D[1].empty())return false;
    return true;
}
int main(){
    scanf("%d",&n);
    int i, a, b;
    for(i=1;i<n;i++){
        scanf("%d%d",&a,&b);
        w[a][C[a]] = i+1;
        L[a][C[a]] = b;
        C[a]++;
    }
    long long bb, ee, mid, res;
    bb = 0, ee = 1e11;
    while(bb<=ee){
        mid = (bb+ee)/2;
        if(Pos(mid)){
            res = mid;
            ee = mid - 1;
        }
        else bb = mid + 1;
    }
    printf("%lld\n",res);
}

Measured memory_bytes: 30084
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n);(i)>=0;(i)--)
typedef long long lint;

int main(){
    lint N,P,s;
    s=P;
    lint ans=1;
    cin>>N>>P;
    s=P;
    vector <lint> prnum;
    prnum.resize(sqrt(s)+10);
    repp(i,2,sqrt(s)+5){
        if(P%i==0){prnum[i]++;
           P/=i;
        i--;  
    }   
}
  repp(i,2,sqrt(s)+5){
      ans*=pow(i,(int)prnum[i]/N);
}

    if(N==1)ans=s;
cout <<ans;

}


Measured memory_bytes: 8064
#include <algorithm>
#include <cstdio>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <cassert>
#include <cfloat>
#include <climits>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

signed main() {
	
	int N;
	cin >> N;
	vector <int> A(N);
	vector <int> B;
	map <int,int> C;

	
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		
	}
	B = A;

	sort(B.begin(), B.end());
	
	
	for (int i = 0; i < N; i++) {
		C[B[i]] = i;
	}
	for (int i = 0; i < N; i++) {
		A[i] = C[A[i]];
	}
	int cnt = 0;
	for (int i = 0; i < N; i++) {
		if ((A[i] - i) % 2 != 0) {
			cnt++;
		}
	}
	
	
	cout << (cnt+1) /2<< endl;
	
	return 0;
}

Measured memory_bytes: 5760
z = int(input())
a = [True] * 1001
a[0] = False
a[1] = False
b = []
for i in range(2, 1001):
    if a[i]:
        b.append(i)
        for j in range(i, 1001, i):
            a[j] = False
c = {}
for i in range(1, z + 1):
    d = i
    while True:
        if d == 1:
            break
        else:
            while d != 1:
                for j in b:
                    if d % j == 0:
                        d //= j
                        if j not in c:
                            c[j] = 1
                        else:
                            c[j] += 1
e = 1
for v in c.values():
    e = (e * (v + 1)) % (10 ** 9 + 7)
print(e)


Measured memory_bytes: 3064
#include<iostream>
#include<vector>
using namespace std;
typedef long int li;
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
#define Please return
#define AC 0

int next(vector<int>& vec,vector<int>& dict){
  int k=vec.size(),i=k;
  if(vec[i-1]==0){
    vec[i-1]=1;
    dict[0]--; dict[1]++;
    return 1;
  }
  while(i>=0){
    if(--dict[vec[--i]]) break;
  }
  if(i==-1)return 0;
  vec[i]++; dict[vec[i++]]++;
  while(i<k){
    vec[i++]=0; dict[0]++;
  }
  return 1;
}

void print(vector<int>& vec){
  int n=vec.size();
  rep(i,n) printf("%c",vec[i]+'a');
  printf("\n");
}

int main(){
  int k; cin >>k;
  if(k==1){
    printf("a");
    return 0;
  }
  vector<int> vec(k,0),dict(k,0);
  dict[0]=k;
  print(vec);
  while(next(vec,dict)){
    print(vec);
    if(df) {rep(i,k)printf("%d",dict[i]); printf("\n");}
  }
  
  Please AC;
}


Measured memory_bytes: 1536
def solve():
    from collections import defaultdict
    from fractions import Fraction
    n = int(input())
    d = defaultdict(int)
    for i in range(n):
        x = Fraction(input())
        x *= 10 ** 9
        cnt2, cnt5 = 0, 0
        while x % 5 == 0:
            x //= 5
            cnt5 += 1
        while x % 2 == 0:
            x //= 2
            cnt2 += 1
        d[(cnt2, cnt5)] += 1
    lis = list(d)
    ans_0 = 0
    ans_f = 0
    for a, b in lis:
        k = d[(a, b)]
        for x, y in lis:
            l = d[(x, y)]
            if a >= 9 and b >= 9 and (a, b) == (x, y):
                ans_0 += k * (k - 1)
            elif a + x >= 18 and b + y >= 18:
                ans_f += k * l
    print((ans_0 + ans_f) // 2)
    return


solve()


Measured memory_bytes: 96208
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,l;
  cin>>n>>m>>l;
  int matrixA[200][200]={0};
  int matrixB[200][200]={0};
  long long times[200][200]={0};
  for(int i=1;i<=n;i++){
    for(int k=1;k<=m;k++){
      cin>>matrixA[i][k];
    }
  }
  for(int i=1;i<=m;i++){
    for(int k=1;k<=l;k++){
      cin>>matrixB[i][k];
    }
  }
  for(int i=1;i<=n;i++){
    for(int k=1;k<=l;k++){
      for(int s=1;s<=m;s++){
        times[i][k]=times[i][k]+matrixA[i][s]*matrixB[s][k];
      }
    }
  }
  for(int i=1;i<=n;i++){
  for(int k=1;k<=l;k++){
    if(k<l){
      cout<<times[i][k]<<" ";
    }else{
      cout<<times[i][k];
    }
  }
  cout<<endl;
}
return 0;
}



Measured memory_bytes: 3736
#include <iostream>

int main()
{
	int h, w;

	while (std::cin >> h >> w) {
		if (h == 0 || w == 0) break;
		for (int j = 0; j < h; j++) {
			for (int i = 0; i < w; i++) {
				if( j==0 || j==(h-1) )
					printf("#");
				else if(i == 0 || i ==(w-1) )
					printf("#");
				else
					printf(".");
			}
			printf("\n");
		}
		printf("\n");
	}
	

	return 0;
}


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

int main() {
    ll n;
    cin >> n;
    if(floor(sqrt(n)) * float(sqrt(n)) == n) { //nが平方数の場合
        cout << (ll)sqrt(n) * 2 - 2 << endl;
        return 0;
    }
    for(int i = floor(sqrt(n)); i >= 1; i--) { //nが平方数でないときはしらみつぶし(10^6程度で終わるはず)
        if(i * (n / i) == n) {
            cout << (i - 1) + ((n / i) - 1) << endl;
            return 0;
        }
        continue;
    }
}



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

int main(void){
	int n,m,sum=0;//n行数、m列数
	cin>>n>>m;
	int a[n][m],v[m];
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++)cin>>a[i][j];
	}
	for(int i=0;i<m;i++)cin>>v[i];
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++)sum+=a[i][j]*v[j];
		cout<<sum<<endl;
		sum=0;
	}
}


Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,k;
  cin >> n >> m >> k;
  int n1=max(n,m),count=0;
  for(int i=n1;i>=1;i--){
    if(n%i==0 && m%i==0)count++;
    if(count==k){
      cout << i << endl;
      break;
    }
  }
}


Measured memory_bytes: 3604
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        String d = Integer.toString(N);
        char[] data = d.toCharArray();
        boolean answer = false;
        if (data[0] == data[1] && data[1] == data[2]) {
            answer = true;
        }
        if (data[1] == data[2] && data[2] == data[3]) {
            answer = true;
        }
        System.out.println(answer ? "Yes" : "No");
    }
}


Measured memory_bytes: 23764
#include<stdio.h>
#include<stdlib.h>

int main(){
    long int n,m;
    scanf("%ld%ld",&n,&m);
    
    long int a;
  a=n%m;

    if(a<m-a){
        printf("%ld",a);
    }else{
        printf("%ld",m-a);
    }

    return 0;
}

Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;

public class MainClass
{
	public static void Main(string[] args)
	{
		string[] inputs = Console.ReadLine().Split(' ');
		int a = int.Parse(inputs[0]);
		int b = int.Parse(inputs[1]);
		int k = int.Parse(inputs[2]);
		int i = 1;
		if(Math.Max(a, b) == 1)
		{
			Console.WriteLine(1);
			return;
		}
		List<int> s = new List<int>(Math.Max(a,b));
		for( ; Math.Min(a,b) >= i;i++)
		{
			if(a % i == 0 && b % i == 0)
			{
				s.Add(i);
				
			}
		}
		Console.WriteLine(s[s.Count - k]);
	}
}

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

typedef long long ll;

int N;
int R;
const int m = 1e9+7;
vector<int> factorial;
vector<int> word;

int bit[100010];
int sum(int i) {
	int s = 0;
	while(i > 0) {
		s += bit[i];
		i -= i & -i;
	}
	return s;
}
void add(int i, int x) {
	while(i <= N) {
		bit[i] += x;
		i += i & -i;
	}
}

int main() {
	while(cin >> N, N) {
		cin >> R;
		factorial.clear();
		word.clear();
		factorial.resize(N+10);
		word.resize(N);
		for(int i = 0; i < 100010; i++) bit[i] = 0;
		for(int i = 0; i < word.size(); i++)
			word[i] = i;
		factorial[0] = 1;
		for(int i = 1; i < factorial.size(); i++) {
			factorial[i] = ((ll)factorial[i-1] * i) % m;
		}
		for(int i = 0; i < R; i++) {
			int s, t;
			cin >> s >> t;
			s--; t--;
			swap(word[s], word[t]);
		}
		long long res;
		res = 0;
		for(int i = 0; i < word.size(); i++) {
			res = (res + (long long)factorial[word.size()-1-i] * (word[i] - sum(word[i]+1))) % m;
			add(word[i]+1, 1);
		}
		cout << res << endl;
	}
}

Measured memory_bytes: 3004
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a,b;cin >> n >> a >> b;
  int ans=0;
  for(int i=0;i<n;i++){
    int t;cin >> t;
    if(t>=a&&t<b){
      continue;
    }
    ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        var N = Integer.parseInt(scanner.next());
        var A = new TreeSet<Integer>();
        var duplicated = new TreeSet<Integer>();
        for (int i = 0; i < N; i++) {
            var A_i = Integer.parseInt(scanner.next());
            if (!A.add(A_i)) duplicated.add(A_i);
        }

        var A_MAX = A.last();
        var isPTable = new boolean[A_MAX + 1];
        Arrays.fill(isPTable, true);

        for (Integer value : A) {
            if (!isPTable[value]) continue;
            if (duplicated.contains(value)) isPTable[value] = false;

            for (int i = 2; ; i++) {
                var multiple = value * i;
                if (multiple > A_MAX) break;
                isPTable[multiple] = false;
            }
        }
        System.out.println(A.stream().filter(value -> isPTable[value]).count());
    }
}

Measured memory_bytes: 70704
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b ;
  cin >> a >> b;
  
  if ((a*b)%2 == 0){
    cout << "Even" << endl;
  }
  else {
    cout << "Odd" << endl;
  }
 
}
 


Measured memory_bytes: 256
<?php
list($N, $K) = ints();
$map = array_fill(1, $N, 0);
for($i = 0; $i < $K; $i++){
    $d = int();
    $list = ints();
    foreach($list as $num){
        $map[$num]++;
    }
}
$count = 0;
for($i = 1; $i <= $N; $i++)$count+=$map[$i]==0;
echo $count;

function str(){return trim(fgets(STDIN));}
function ints(){return array_map('intval',explode(' ',trim(fgets(STDIN))));}
function int(){return intval(trim(fgets(STDIN)));}
function chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}
function chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}
function popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}
function o(...$val){
    if(count($val)==1)$val=array_shift($val);
    echo debug_backtrace()[0]['line'].")";
    if(is_array($val)){
        if(count($val) == 0)echo "empty array";
        elseif(!is_array(current($val)))echo "array: ",implode(" ", addIndex($val)),"\n";
        else{
            echo "array:array\n";
            if(isCleanArray($val))foreach($val as $row)echo implode(" ", addIndex($row)),"\n";
            else foreach($val as $i => $row)echo "[".$i."] ".implode(" ", addIndex($row)),"\n";
        }
    }else echo $val."\n";
}
function addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.":".$v;}, array_keys($val), $val);}return $val;}
function isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}
// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]
function atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}
function gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}
function gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}
function lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}
function lcm($a, $b) {return $a / gcd($a, $b) * $b;}

function dfs($current, $from = -1, $d = 0){
  global $G, $distance;
  $distance[$current] = $d;
  foreach($G[$current] as $to){
    if($from != $to){
      dfs($to, $current, $d + 1);
    }
  }
}

function loadTree($N = false){
  if($N === false)$N = $GLOBALS['N'];
  return loadGraph($N, $N-1);
}
function loadGraph($N = false, $M = false, $both = true){
  if($N === false)$N = $GLOBALS['N'];
  if($M === false)$M = $GLOBALS['M'];
  $G = array_fill(1, $N, []);
  for($i = 0; $i < $M; $i++){
    $values = ints();
    if(count($values) == 2){
      list($a, $b) = $values;
      $G[$a][] = $b;
      if($both)$G[$b][] = $a;
    }else{
      list($a, $b, $d) = $values;
      $G[$a][] = [$b, $d];
      if($both)$G[$b][] = [$a, $d];
    }
  }
  return $G;
}


Measured memory_bytes: 16216
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

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

	if(K%2 == 0)
		cout << A - B << endl;
	else
		cout << B - A << endl;

	return 0;
}


Measured memory_bytes: 256
def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end
s = gets.chomp
k = inp[0]
count = 0
mae = ""
s.each_char do |c|
  if (c == mae)
    count += 1
    mae = ""
  else
    mae = c
  end
end
count2 = 0
s.each_char do |c|
  if (c == mae)
    count2 += 1
    mae = ""
  else
    mae = c
  end
end
count3 = 0
s.each_char do |c|
  if (c == mae)
    count3 += 1
    mae = ""
  else
    mae = c
  end
end
if(k <= 1)
  p count
elsif(k <= 2)
  p count+count2
elsif(k%2 == 0)
  p count+(count2+count3)*((k-2)/2)+count2
else
  p count+(count2+count3)*((k-1)/2)
end


Measured memory_bytes: 1788
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<bitset>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long int ll;
#define int long long
typedef pair<int,int> P;
struct edge{int to,cost;};
#define REP(i,n) for(int i=0;i<(n);i++)
const int INF=100000000000000000;

signed main(){
	int N;
	int count=0;
	set<int> U;
	map<int,int> H;
	cin>>N;
	for(int i=N;;){
		count++;
		if(U.find(i)!=U.end()){
			cout<<count<<endl;
			return 0;
		}
		U.insert(i);
		DEB(i)END
		if(i%2==0){
			i/=2;
		}
		else{
			i=i*3+1;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(){
    int tamA, tamB;
    char stringA[100], stringB[100], stringC[100];
    scanf("%s", stringA);
    scanf("%s", stringB);
    scanf("%s", stringC);
    tamA = strlen(stringA);
    tamB = strlen(stringB);
    if (stringA[tamA-1] == stringB[0]){
        if (stringB[tamB-1] == stringC[0]){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }
    }
    else{
        printf("NO\n");
    }
    return 0;
}


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

// iterator
#define REP(i,from, to) for(lli i=from;i<to;i++)
#define REPE(i,from, to) for(lli i=from;i<=to;i++)
#define REP_R(i,from, to) for(lli i=from;i>to;i--)
#define REPE_R(i,from, to) for(lli i=from;i>=to;i--)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

// input
#define cin1(x)             cin >> x
#define cin2(x, y)          cin >> x >> y
#define cin3(x, y, z)       cin >> x >> y >> z
#define ncin1(n, x)         REP(i, 0, n) { cin1(x[i]); }
#define ncin2(n, x, y)      REP(i, 0, n) { cin2(x[i], y[i]); }
#define ncin3(n, x, y, z)   REP(i, 0, n) { cin3(x[i], y[i], z[i]); }
#define ncinp(n, p)         REP(i, 0, n) { lli p1,p2; cin >> p1 >> p2; p[i] = P(p1, p2); }
#define ncin1_1(n, x)       REPE(i, 1, n) { cin1(x[i]); }
#define ncin2_1(n, x, y)    REPE(i, 1, n) { cin2(x[i], y[i]); }
#define ncin3_1(n, x, y, z) REPE(i, 1, n) { cin3(x[i], y[i], z[i]); }
#define ncinp_1(n, p)       REPE(i, 1, n) { lli p1,p2; cin >> p1 >> p2; p[i] = P(p1, p2); }

// output
#define cout1(x)         cout << #x << ": " << x << endl;
#define cout2(x, y)      cout << #x << ": " << x << ", " << #y << ": " << y << endl;
#define cout3(x, y, z)   cout << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;;
#define ncout1(n, x)     REP(i, 0, n) {cout << #x << "[" << i << "]: "<< x[i] << endl;}

#define coutp(p)         cout << #p << ":" <<  " (" << p.first << ", " << p.second << ")" << endl;

// sort
#define sort_r(x, y)        sort(x, y, greater<lli>()); // 降順(5,4,3,,,)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;
typedef tuple<lli, lli, lli> tup;
typedef vector<lli> vlli;

int main() {
    string s;
    cin1(s);

    lli len = s.length();

    lli ans = 0;
    REP(i,0,len/2) {
        if (s[i] != s[(len-1)-i])
            ans++;
    }
    cout << ans << endl;
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  string x, y;
  cin >> x >> y;
  char ans;

  if (x < y)
    ans = '<';
  else if (y < x)
    ans = '>';
  else
    ans = '=';

  cout << ans << endl;
  return 0;
}


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

namespace AtCorder
{
	public class Program
	{
		static void Main(string[] args)
		{
			Scanner cin = new Scanner();
			long a = cin.Long();
			long b = cin.Long();

			long gcd = GCD(a, b);
			var gp = GetPrimeFactor(gcd);
			gp.Add(1);

			Console.WriteLine(gp.Count());
		}

		public static HashSet<long> GetPrimeFactor(long value)
		{
			long temp = value;
			long max = (long)Math.Ceiling(Math.Sqrt(temp));
			var factors = new HashSet<long>();
			for (int i = 2; i <= max; ++i) {
				if (temp % i == 0) {
					factors.Add(i);
					while (temp % i == 0) {
						temp /= i;
					}
				}
			}

			if (temp != 1) {
				factors.Add(value);
			}

			return factors;
		}

		public static long GCD(long a, long b)
		{
			if (a > b) {
				if (b == 0) {
					return a;
				}

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

				return GCD(a, b % a);
			}
		}
	}

	public class Scanner
	{
		private readonly char[] delimiter_ = new char[] { ' ' };
		private string[] buf_;
		private int index_;

		public Scanner()
		{
			buf_ = new string[0];
			index_ = 0;
		}

		public string Next()
		{
			if (index_ < buf_.Length) {
				return buf_[index_++];
			}

			string st = Console.ReadLine();
			while (st == "") {
				st = Console.ReadLine();
			}

			buf_ = st.Split(delimiter_, StringSplitOptions.RemoveEmptyEntries);
			if (buf_.Length == 0) {
				return Next();
			}

			index_ = 0;
			return buf_[index_++];
		}

		public int Int() => int.Parse(Next());
		public long Long() => long.Parse(Next());
		public double Double() => double.Parse(Next());

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Int() + add;
			}
			return Array;
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Long() + add;
			}
			return Array;
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Double() + add;
			}
			return Array;
		}
	}
}

Measured memory_bytes: 13396
# coding: utf-8

# 入力
n = int(input())
s = [int(i) for i in input().split()]

# 奇数判定関数
def check(s):
    for i in s:
        if i % 2 != 0:
            return False
    return True

# リストの数値を 2 で割る関数
def calc(s):
    for i in range(n):
        s[i] = s[i] / 2
    return s

# カウント
count = 0
while True:
    if check(s):
        s = calc(s)
        count += 1
    else:
        break

# 出力
print(count)

Measured memory_bytes: 3064
#include<cstdio>
#include<algorithm>
int a[100010];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%d",&a[i]);
	std::sort(a,a+n);
	int ans=n;
	for(int i=0;i<n-1;)
	{
		if(a[i] == a[i+1])
		{
			ans-=2;
			i+=2;
		}
		else
			i++;
	}
	printf("%d",ans);
}

Measured memory_bytes: 512
#include <stdio.h>
#include <string.h>

long k[200100];
long kk[200100];
int main(){

	long i,N,j;
	long long sum=0;
	long max=-1,min=200100;
	scanf("%ld",&N);
	for(i=0;i<N;i++){
		scanf("%ld",kk+i);
		k[kk[i]]++;
		if(max<kk[i])max=kk[i];
		if(min>kk[i])min=kk[i];
	}
	
	for(i=min;i<=max;i++){
		if(k[i]>1)sum += k[i]*(k[i]-1)/2;
	}
	//printf("###%lld####\n",sum);
	long long tmp;
	for(i=0;i<N;i++){
	//	printf("###%ld####\n",k[kk[i]]);
		if(k[kk[i]]>=2){
			tmp = sum - (k[kk[i]]*(k[kk[i]]-1)/2)+((k[kk[i]]-1)*(k[kk[i]]-2)/2);
		}
		else tmp = sum;
		printf("%lld\n",tmp);
		tmp=0;
	}
		
	

 return 0;
 }

Measured memory_bytes: 4608
from itertools import combinations


def main():
    s, k = input(), int(input())
    l, tmp = len(s), s[:k]
    for i in range(l - k + 1):
        tmp = min(tmp, s[i:i + k])
    res = set()
    for i, j in combinations(range(min(k + 1, l + 1)), 2):
        res.add(tmp[i:j])
    ans = sorted(res)
    print(ans[k - 1])


if __name__ == '__main__':
    main()

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

int main(){
  int n;
  cin >> n;
  vector<int> h(n);
  for(int i = 0; i < n; i++){
    cin >> h.at(i);
  }
  int out = 0;
  for(int i = 1; i < 101; i++){
    int tmp = 0;
    for(int j = 0; j < n; j++){
      if(tmp == 0){
        if(h.at(j) - i >= 0){
          tmp++;
          out++;
        }
      }
      if(tmp == 1){
        if(h.at(j) - i < 0){
          tmp *= -1;
        }
      }else if(tmp == -1){
        if(h.at(j) - i >= 0){
          tmp *= -1;
          out++;
        }
      }
    }
  }
  cout << out;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll N;
    cin >>N;
    ll cnt=0;
    /*rep2(i,N){
        rep2(j,N){
            if(i*j>=N){
                break;
            }
            cnt++;
        }
    }*/
    ll ans=0;
    rep2(i,N){
        /*ll l=0,r=N;
        unordered_map<ll,ll>m;
        while(1){
            ll now=(l+r)/2;
            if(now*i<N){
                l=now+1;
                if(m[now]==1){
                    
                    ans+=now;
                    break;
                }
            }else{
                r=now-1;
            }
            m[now]=1;
        }*/

        ans+=(N-1)/i;
    }
    cout << ans << endl;


    return 0;
    

}

Measured memory_bytes: 3620
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
vector<int> children[100010];

int visit(int from)
{
    if(children[from].size() == 0){
        return 0;
    }
    vector<int> depth;
    for(int i = 0; i < children[from].size(); i++){
        depth.push_back(visit(children[from][i]));
    }
    sort(depth.begin(), depth.end(), greater<int>());
    int ans = 0;
    for(int i = 0; i < children[from].size(); i++){
        ans = max(ans, depth[i] + i + 1);
    }
    return ans;
}

int main() {
    //cout.precision(10);
    int n;
    cin >> n;
    for(int i = 2; i <= n; i++){
        int in;
        cin >> in;
        children[in].push_back(i);
    }
    cout << visit(1) << endl;;
    /*int ans = 0;
    for(int i = 1; i <= n; i++){
        ans = max(ans, games[i]);
    }
    cout << ans << endl;*/
    return 0;
}

Measured memory_bytes: 15104
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<map>
#include<iomanip>
#include<functional>

using namespace std;
using  ull = unsigned long long int;

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


int main() {


	int a, b;
	cin >> a >> b;
	if (10 <= a + b)cout << "error" << endl;
	else cout << a + b << endl;




	

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;
using vb = vector<bool>;
const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define mp make_pair
#define pb push_back
#define has(c, i) ((c).find(i) != end(c))
#define FOR(i,a,b) for (ll i=(a); i<(b); i++)
#define FORD(i,a,b) for (ll i=ll(b)-1; i >= a; i--)

int main() {
  cout << fixed << setprecision(12);

  ll n;
  cin >> n;

  vector<double> p(n);
  FOR(i,0,n) {
    cin >> p[i];
  }

  vector<vector<double>> s(n+10, vector<double>(n+10));
  s[0][0] = 1;
  FOR(i,0,n) {
    FOR(j,0,i+1) {
      s[i+1][j+1] += s[i][j] * p[i];
      s[i+1][j] += s[i][j] * (1 - p[i]);
    }
  }

  double res = 0.0;
  FOR(i,n/2+1,n+1) {
    res += s[n][i];
  }

  cout << res << endl;
}


Measured memory_bytes: 71168
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define inf 9223372036854775807
#define mini 9223372036854775807
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<double, null_type,less<double>, rb_tree_tag,tree_order_statistics_node_update>
pair<ll,ll>s4[4]={{-1,0},{1,0},{0,-1},{0,1}};
pair<ll,ll>s8[8]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,1},{1,0},{1,-1}};
ll power(ll a,ll b)
{
	if(b==0)
		return 1;
	ll c=power(a,b/2);
	if(b%2==0)
		return ((c%mod)*(c%mod))%mod;
	else
		return ((((c%mod)*(c%mod))%mod)*a)%mod;
}
ll n,k;
ll a[200005];
ll dp[200005];
ll func(ll i)
{
	if(dp[i]!=-1)
		return dp[i];
	ll ans1=inf;
	ll ans2=inf;
	if(i==n-1)
		return 0;
	for(ll j=1; j<=k; j++)
	{
		if((i+j)<n)
			ans1=abs(a[i+j]-a[i])+func(i+j);
		ans2=min(ans1,ans2);
	}
	dp[i]=min(ans1,ans2);
	return dp[i];
}
int main()
{
	boost
	cin>>n>>k;
	ll i;
	for(i=0; i<200005; i++)
		dp[i]=-1;
	for(i=0; i<n; i++)
		cin>>a[i];
	ll ans=func(0);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 7296
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
using namespace std;
typedef long long ll;
ll n;
int main()
{
    //while(1){
    scanf("%lld",&n);
    if(n<10){
        printf("%lld\n",n);
    }
    else{
        int flag=1;
        int cnt=0;
        while(n>=10){
            if(n%10!=9){
                flag=0;
            }
            cnt+=9;
            n/=10;
        }
        cnt+=n;
        if(flag){
            printf("%d\n",cnt);
        }
        else{
            printf("%d\n",cnt-1);
        }
    }
    //}
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(void){
  int n,i,j,k,x,key[2000000],s,l=1,f;
  char com[20];
  k=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%s",com);
    if(strcmp(com,"insert")==0){
      scanf("%d",&x);
      k++;
      key[k]=x;
      f=k;
    }
    else if(strcmp(com,"delete")==0){
      scanf("%d",&x);
      for(j=k;j>=1;j--){
	if(key[j]==x){
	  key[j]=-1;
	  break;
	}
      }
    }
    else if(strcmp(com,"deleteFirst")==0){
      for(j=f;j>=1;j--){
	if(key[j]!=-1){
	  key[j]=-1;
	  f=j;
	  break;
	}
      }
    }
    else if(strcmp(com,"deleteLast")==0){
      for(j=l;j<=k;j++){
	if(key[j]!=-1){
	  key[j]=-1;
	  l=j;
	  break;
	}
      }
    }
  }
  for(i=k;i>=1;i--){
    if(key[i]!=-1) s=i;
  }
  for(i=k;i>=s;i--){
    if(key[i]!=-1){
      printf("%d",key[i]);
      if(i>s) printf(" ");
    }
  }
  printf("\n");
  return 0;
}



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

int main()
{
    ll x;
    cin>>x;
    ll f=x/500;
    ll rem=(x%500)/5;
    //cout<<f<<" "<<rem<<endl; 
    ll ans=(f*1000)+(5*rem);
    cout<<ans<<'\n';


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep_1(i, n) for (int(i) = 0; (i) <= (n); (i)++)
#define rep_2(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

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: 3620
#include <stdio.h>

char c[1];
bool ans = false;

int main(void) {
	scanf("%c", &c);

	if (c[0] == 'a' || c[0] == 'e' || c[0] == 'i' || c[0] == 'o' || c[0] == 'u') {
		ans = true;
	}

	if (ans == true) { printf("vowel\n"); }
	else { printf("consonant\n"); }
	return 0;
}

Measured memory_bytes: 256
S = list(input())

false_flag = 0
N = len(S)
while N:
    if N >= 7:
        if S[-1] == 'r' and S[-2] == 'e' and S[-3] == 'm' and S[-4] == 'a' and S[-5] == 'e' and S[-6] == 'r' and S[-7] == 'd':
            for i in range(7):
                S.pop()
        elif S[-1] == 'r' and S[-2] == 'e' and S[-3] == 's' and S[-4] == 'a' and S[-5] == 'r' and S[-6] == 'e':
            for i in range(6):
                S.pop()
        elif S[-1] == 'm' and S[-2] == 'a' and S[-3] == 'e' and S[-4] == 'r' and S[-5] == 'd':
            for i in range(5):
                S.pop()
        elif S[-1] == 'e' and S[-2] == 's' and S[-3] == 'a' and S[-4] == 'r' and S[-5] == 'e':
            for i in range(5):
                S.pop()
        else:
            false_flag = 1
            break
    elif N >= 6:
        if S[-1] == 'r' and S[-2] == 'e' and S[-3] == 's' and S[-4] == 'a' and S[-5] == 'r' and S[-6] == 'e':
            for i in range(6):
                S.pop()
        elif S[-1] == 'm' and S[-2] == 'a' and S[-3] == 'e' and S[-4] == 'r' and S[-5] == 'd':
            for i in range(5):
                S.pop()
        elif S[-1] == 'e' and S[-2] == 's' and S[-3] == 'a' and S[-4] == 'r' and S[-5] == 'e':
            for i in range(5):
                S.pop()
        else:
            false_flag = 1
            break
    elif N >= 5:
        if S[-1] == 'm' and S[-2] == 'a' and S[-3] == 'e' and S[-4] == 'r' and S[-5] == 'd':
            for i in range(5):
                S.pop()
        elif S[-1] == 'e' and S[-2] == 's' and S[-3] == 'a' and S[-4] == 'r' and S[-5] == 'e':
            for i in range(5):
                S.pop()
        else:
            false_flag = 1
            break
    else:
        false_flag = 1
        break
    N = len(S)

if false_flag == 1:
    print('NO')
else:
    print('YES')

Measured memory_bytes: 4212
#include<iostream>
#include<string>
using namespace std;
int main() {
	string s,ss;
	cin >> s;
	int j = 0;
	for (int i = 0; i < s.size();i++) {
		if (i % 2 == 0) {
			ss.push_back(j);
			ss.at(j++) = s.at(i);
		}
	}
	cout << ss << endl;


}

Measured memory_bytes: 3652
i=61,f[],c,m,s;main(y){for(;~s?++f[y*12+*f+"=>?2J13IK<@V&"[--s+1]]:~scanf("%d,%d,%d",f,&y,&s)?s*=4:++i<180?i%12>1?(y=f[i])?y>m?m=y:1:++c:1:!printf("%d\n%d\n",c,m););}

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

using namespace std;

const int MX = 200001;

char s[MX];

int f[MX], g[MX];

int main() {
	ignore = scanf("%s", s);
	
	int n = strlen(s);
	for (int i = 0; i < n; i++) {
		f[i + 1] = g[i] + 1;
		if (i == 0 || s[i] != s[i - 1]) f[i + 1] = max(f[i + 1], f[i] + 1);
		
		if (i > 0) {
			g[i + 1] = f[i - 1] + 1;
			if (i >= 3 && (s[i] != s[i - 2] || s[i - 1] != s[i - 3])) {
				g[i + 1] = max(g[i + 1], g[i - 1] + 1);
			}
		}
	}
	
	printf("%d\n", max(f[n], g[n]));
	
	return 0;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define MOD 1000000007
//#define INF 1145141919810893//810114514
#define YES(s) s?cout << "YES" << endl:cout << "NO" << endl
#define Yes(s) s?cout << "Yes" << endl:cout << "No" << endl
#define Taka(s) s?cout << "Takahashi" << endl:cout << "Aoki" << endl
#define rollcall cout<<"I'm Sucu."<<endl
#define int long long 


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


Measured memory_bytes: 256
/*やったぜ。　投稿者：変態糞土方 (8月16日（水）07時14分22秒)

昨日の8月15日にいつもの浮浪者のおっさん（60歳）と先日メールくれた汚れ好きの土方のにいちゃん

（45歳）とわし（53歳）の3人で県北にある川の土手の下で盛りあったぜ。

今日は明日が休みなんでコンビニで酒とつまみを買ってから滅多に人が来ない所なんで、

そこでしこたま酒を飲んでからやりはじめたんや。

3人でちんぽ舐めあいながら地下足袋だけになり持って来たいちぢく浣腸を3本ずつ入れあった。

しばらくしたら、けつの穴がひくひくして来るし、糞が出口を求めて腹の中でぐるぐるしている。

浮浪者のおっさんにけつの穴をなめさせながら、兄ちゃんのけつの穴を舐めてたら、

先に兄ちゃんがわしの口に糞をドバーっと出して来た。

それと同時におっさんもわしも糞を出したんや。もう顔中、糞まみれや、

3人で出した糞を手で掬いながらお互いの体にぬりあったり、

糞まみれのちんぽを舐めあって小便で浣腸したりした。ああ～～たまらねえぜ。

しばらくやりまくってから又浣腸をしあうともう気が狂う程気持ちええんじゃ。

浮浪者のおっさんのけつの穴にわしのちんぽを突うずるっ込んでやると

けつの穴が糞と小便でずるずるして気持ちが良い。

にいちゃんもおっさんの口にちんぽ突っ込んで腰をつかって居る。

糞まみれのおっさんのちんぽを掻きながら、思い切り射精したんや。

それからは、もうめちゃくちゃにおっさんと兄ちゃんの糞ちんぽを舐めあい、

糞を塗りあい、二回も男汁を出した。もう一度やりたいぜ。

やはり大勢で糞まみれになると最高やで。こんな、変態親父と糞あそびしないか。

ああ～～早く糞まみれになろうぜ。

岡山の県北であえる奴なら最高や。わしは163*90*53,おっさんは165*75*60、や

糞まみれでやりたいやつ、至急、メールくれや。

土方姿のまま浣腸して、糞だらけでやろうや。*/
#include "bits/stdc++.h"
#include <unordered_set>
#define rep(i,n) for(ll i = 0; i < n; i++)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
#define ld long double
#define Sort(a) sort(a.begin(),a.end())
#define cSort(a,cmp) sort(a.begin(),a.end(),cmp)
#define reSort(a) sort(a.rbegin(), a.rend())
static const ll llMAX = numeric_limits<long long>::max();
static const int intMAX = numeric_limits<int>::max();
static const ll  llMIN = numeric_limits<long long>::min();
static const int intMIN = numeric_limits<int>::min();
static const ll d_5 = 100000;
static const ll d9_7 = 1000000007;
static const ll d_9 = 1000000000;
static const double PI=3.14159265358979323846;
//<<std::setprecision(30)
template<class T>
void Printvector(std::vector<T> a){
  int size = a.size();
  rep(i,size){
    cout<<a[i]<<" ";
  }
  cout<<endl;
}
template<class T>
void Printvector(std::vector<std::vector<T>> a){
  int size = a.size();
  rep(i,size){
    int size2=a[i].size();
    rep(j,size2){
      cout<<a[i][j]<<" ";
    }
    cout<<endl;
  }
  cout<<endl;
}
ll digitpower(ll a,ll b){//aのb乗を計算
  if(b==1){
    return a;
  }else if(b==0){
    return 1;
  }
  if(b%2==1){
    ll tmp = digitpower(a,(b-1)/2);
    tmp%=d9_7;
    tmp*=tmp;
    tmp%=d9_7;
    tmp*=a;
    return (tmp)%d9_7;
  }else{
    ll tmp = digitpower(a,(b)/2);
    tmp%=d9_7;
    tmp*=tmp;
    tmp%=d9_7;
    return (tmp)%d9_7;
  }
}

unordered_map<ll,ll> prime_factor(int64_t n) {
  unordered_map<ll,ll> ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}
/*struct datas{
  int num;
  int index;
};
bool cmp(const datas &a, const datas &b)
{
    return a.num < b.num;
}*/
template<class T>
vector<T> getaccum(vector<T> a){
  int size=a.size();
  vector<T> ans(size);
  ans[0]=a[0];
  for(int i=0;i<size-1;i++){
    ans[i+1]=ans[i]+a[i+1];
    ans[i+1]%=d9_7;
  }
  return ans;
}


int main(void){
  int n;
  string s;
  cin>>s;
  n=s.size();
  rep(i,n){
    cout<<"x";
  }
  cout<<endl;
  return 0;
}


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

#nを素因数分解したリストを返す
def prime_decomposition(n):
   i = 2
   table = []
   while i * i <= n:
       while n % i == 0:
           n /= i
           table.append(i)
       i += 1
   if n > 1:
       table.append(n)
   return table

from collections import defaultdict
dic = defaultdict(int)
for i in range(n+1):
    for k in prime_decomposition(i):
        dic[k] += 1

ans = 1
for i in dic.values():
    ans *= i+1
    ans %= 10**9+7

print(ans)

Measured memory_bytes: 3316
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<functional>
#include<math.h>
 
#define rep(i,n) for(ll i=0;i<(n);i++)
typedef long long ll;
using namespace std;

int main(void){
    ll N,K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(i,N){
        cin >> A.at(i);
    }
    rep(i,N-K){
        if(A.at(i)<A.at(i+K)){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }
}

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

#define fi first
#define se second
#define pb push_back
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define FOR(i, a, b) for (int i = a; i <= (b); i++)
#define ROF(i, a, b) for (int i = a; i >= (b); i--)

using pii = pair<int, int>; using vpii = vector<pii>;
using vi = vector<int>; using vvi = vector<vi>;
using ll = long long;
using pll = pair<ll, ll>; using vpll = vector<pll>;
using vll = vector<ll>; using vvll = vector<vll>;

const int N = 1005, INF = 0x3f3f3f3f;
char c[N][N];
pii ex[4] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};

int main() {
    ios::sync_with_stdio(0), cin.tie(0);
    int h, w; cin >> h >> w;
    int ch, cw; cin >> ch >> cw;
    int dh, dw; cin >> dh >> dw;
    vvi d(h + 1, vi(w + 1, INF));
    FOR(i, 1, h) FOR(j, 1, w) {
        cin >> c[i][j];
    }
    priority_queue <pair <int, pii> > pq;
    pq.push({0, {ch, cw}});
    d[ch][cw] = 0;
    while (!pq.empty()) {
        pair <int, pii> u = pq.top(); pq.pop();
        int x = u.se.fi, y = u.se.se, t = -u.fi;
        if (t != d[x][y]) continue;
        FOR(i, 0, 3) {
            int tx = x + ex[i].fi, ty = y + ex[i].se;
            if (tx < 1 || tx > h || ty < 1 || ty > w) continue;
            if (c[tx][ty] == '.' && t < d[tx][ty]) {
                d[tx][ty] = t;
                pq.push({-t, {tx, ty}});
            }
        }
        FOR(i, -2, 2) FOR(j, -2, 2) {
            int tx = x + i, ty = y + j;
            if (tx < 1 || tx > h || ty < 1 || ty > w) continue;
            if (c[tx][ty] == '.' && t + 1 < d[tx][ty]) {
                d[tx][ty] = t + 1;
                pq.push({-(t + 1), {tx, ty}});
            }
        }
    }
    if (d[dh][dw] == INF) cout << -1 << endl;
    else cout << d[dh][dw] << endl;
}

Measured memory_bytes: 8388
#include<iostream>
using namespace std;
int main()
{
    int i,a,b,c,cnt1=0,cnt2=0;
    for(i=0;i<3;i++)
    {
        cin>>a;
        if(a==5) cnt1++;
        else if(a==7) cnt2++;
    }
    if(cnt1==2&&cnt2==1)
        cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python
def func(x, y, z):
    ret = x**2 + y**2 + z**2 + x*y + y*z + z*x
    return ret

def main():
    n = int(input())
    cnt = [0 for _ in range(n+1)]

    for x in range(1, n):
        if func(x, x, x) > n:
            break
        for y in range(x, n):
            if func(x, y, y) > n:
                break
            for z in range(y, n):
                f = func(x, y, z)
                if f <= n:
                    if len({x, y, z}) == 1:
                        cnt[f] += 1
                    elif len({x, y, z}) == 2:
                        cnt[f] += 3
                    elif len({x, y, z}) == 3:
                        cnt[f] += 6
                else:
                    break

    for c in cnt[1:]:
        print(c)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9464
H, W = map(int, input().split(" "))
four, two, one = 0, 0, 0

four += ((H // 2)) * (W // 2)
if W % 2 == 1:
    two += (H // 2)
if H % 2 == 1:
    two += (W // 2)

one += (H * W) % 2

counter = {}
for _ in range(H):
    A = input()
    for a in A:
        if a in counter:
            counter[a] += 1
        else:
            counter[a] = 1

flag = True
for c in counter:
    if counter[c] >= 4 and four > 0:
        mk_four = min(four, counter[c] // 4)
        four -= mk_four
        counter[c] -= mk_four * 4
    if counter[c] >= 2 and two > 0:
        mk_two = min(two, counter[c] // 2)
        two -= mk_two
        counter[c] -= mk_two * 2
    if counter[c] >= 1 and one > 0:
        mk_one = min(one, counter[c])
        one -= mk_one
        counter[c] -= mk_one

    if counter[c] != 0:
        flag = False


if flag and (four == two == one == 0):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 38640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
const ll INF = 1LL<<61;
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; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll jou(ll N, ll P){if(P==0) return 1;
  if(P%2==0){ll t = jou(N, P/2);return t*t % mod;
  }return (N * jou(N, P-1)) % mod;}  //jou(n,mod-2)で逆元
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//  cout << fixed << setprecision (20);   小数点以下2０桁まで
//実行時間制約2秒では２×10^8回くらいまで計算できる



int main() {
  int n,k;
  cin>>n>>k;

  map<int,int> p;
  rep(i,n){
    int x;
    cin>>x;
    if(p.count(x)) p.at(x)++;
    else p[x]=1;
  } 

  if(p.size()<=k) {
    cout << 0 << endl;
    return 0;
  }

  else {
    vector<int> q;
    for(auto z : p) {
      q.pb(z.se);
    }
    sort(all(q));

    int cnt=q.size();
    int ans=0;
    rep(i,q.size()){
      ans+=q[i];
      cnt--;
      if(cnt<=k) break;
    }
    cout << ans << endl;
  }

}

Measured memory_bytes: 10748
#include <bits/stdc++.h>
#define ll long long int
#define forr(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define oo 10000000000000000
using namespace std;

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

ll get(ll i, ll j, ll k){
    if(i<1 || j<1) return -oo;
    else if(i==1 && j==1){
        if(k<3) return a[i][j];
        else return 0LL;
    }
    else{
        if(dp[i][j][k]!=-1) return dp[i][j][k];
        ll ans = -oo;
        ans = max({ans ,get(i,j-1,k) , get(i-1,j,0)});
        if(k<3 && a[i][j]>0) ans = max({ans , a[i][j] + get(i,j-1,k + 1) , a[i][j] + get(i-1,j,0)}) ;
        return dp[i][j][k] = ans;
    }
}


void _sol(){
    cin >> n >> m >> k;
    memset(a,0,sizeof(a));
    forr(i,k){
        ll r,c,v;  cin >> r >> c >> v;
        a[r][c] += v;
    }
    forr(i,n+1) forr(j,m+2) forr(p,4) dp[i][j][p]=-1;
    cout << get( n  , m , 0 );
}

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


Measured memory_bytes: 357264