akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
//using Edge = Pair<long, int>;
using System.Text;
class Program
{ 
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static void Solve()
    {
        var nk = Input.ar;
        var s = ReadLine();
        if (nk[1] == 1) s = s.Substring(0, 1).ToLower() + s.Substring(1);
        else if (nk[1] == nk[0]) s = s.Substring(0, nk[0] - 1) + s.Substring(nk[0] - 1, 1).ToLower();
        else s = s.Substring(0, nk[1] - 1) + s.Substring(nk[1] - 1, 1).ToLower() + s.Substring(nk[1]);
        WriteLine(s);
    }
}

public class Input
{
    public static string read => ReadLine().Trim();
    public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();
    public  static int num => ToInt32(read);
    public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h) 
        => Enumerable.Repeat(0, h).Select(_ => read.ToCharArray()).ToArray();
    public static int[] ar1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => num).ToArray();
    public static long[] arL1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => numL).ToArray();
    public static int[][] ar2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => ar).ToArray();
    public static long[][] arL2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => arL).ToArray();
    public static T getValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}


Measured memory_bytes: 13268
# -*- coding: utf-8 -*-

import sys
from collections import deque

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

S=input()

S2=S.replace('x', '')
for i in range(len(S2)//2):
    if S2[i]!=S2[-(1+i)]:
        print(-1)
        exit()

que=deque(S)
i=cnt=0
while len(que)>1:
    if que[0]!=que[-1]:
        cnt+=1  
        if que[0]=='x':
            que.popleft()
        elif que[-1]=='x':
            que.pop()
    else:
        que.popleft()
        que.pop()
print(cnt)


Measured memory_bytes: 4336
#include <stdio.h>
#include <math.h>

int main(int argc, char *argv[])
{
    double x1, y1, x2, y2;
    scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2);
    double distance = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
    printf("%.8lf\n", distance);
    return 0;
}



Measured memory_bytes: 2120
#include <stdio.h>
#include <math.h>

int digit(int n) {
	return (int)log10(n);
}

int main() {
	int N;
	long long int ans = 0;
	scanf("%d", &N);
	for (int i = 1; i <= 9; i++) {
		for (int j = 1; j <= 9; j++) {
			int A = 0;
			for (int a = 1; a <= N; a++) {
				if (a % 10 == j && a / (int)pow(10, digit(a)) == i){
					A++;
				}
			}
			int B = 0;
			for (int b = 1; b <= N; b++) {
				if (b % 10 == i && b / (int)pow(10, digit(b)) == j) {
					B++;
				}
			}
			ans = ans + (long long int)A * B;
		}
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main{
  static int sx, sy;
  static int tx, ty;

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

    sx = sc.nextInt();
    sy = sc.nextInt();
    tx = sc.nextInt();
    ty = sc.nextInt();

    StringBuilder sb = new StringBuilder();
    for(int u = sy; u < ty; u++){
      sb.append("U");
    }
    for(int r = sx; r < tx; r++){
      sb.append("R");
    }
    for(int d = ty; d > sy; d--){
      sb.append("D");
    }
    for(int l = tx; l > sx; l--){
      sb.append("L");
    }
    sb.append("L");
    for(int u = sy; u < ty + 1; u++){
      sb.append("U");
    }
    for(int r = sx - 1; r < tx; r++){
      sb.append("R");
    }
    sb.append("D");
    sb.append("R");
    for(int d = ty; d > sy - 1; d--){
      sb.append("D");
    }
    for(int l = tx + 1; l > sx; l--){
      sb.append("L");
    }
    sb.append("U");

    System.out.println(sb);
  }
}


Measured memory_bytes: 25812
import sys


if __name__ == "__main__":
    n = int(input())
    ab = []
    for i in range(n):
        a,b = map(int,input().split())
        ab.append([a,b])
    ab.sort(key= lambda x:x[1])
    time = 0
    for i in range(n):
        if time + ab[i][0] <= ab[i][1]:
            time += ab[i][0]
        else:
            print("No")
            sys.exit()
    print("Yes")

Measured memory_bytes: 38060
n, k = map(int, input().split())
if n % k == 0:
    print(0)
elif n < k and n <= k / 2:
    print(n)
elif n < k and n > k / 2:
    print(abs(n - k))
elif n % k <= k / 2:
    print(n % k)
else:
    print(k - (n % k))

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>

using namespace std;

#define ALL(c) c.begin(),c.end()
#define RALL(c) c.rbegin(),c.rend()
#define REP(i,x,y) for(int i=(x);i<(y);++i)
#define MP(a,b) make_pair((a),(b))
#define F_ first
#define S_ second

typedef long long int lli;
typedef pair<int,int> Pi;

const int INF=100000000;
const long long int INF_=1000000000000000000;

int main(){
	int N;
	cin >> N;
	long long int ans=-INF_;
	vector<vector<int> > A(N,vector<int>(N));
	REP(y,0,N){
		REP(x,0,N){
			cin >> A[y][x];
		}
	}
	vector<vector<int> > s(N,vector<int>(N));
	REP(y,0,N) s[y][0]=A[y][0];
	REP(y,0,N){
		REP(x,1,N){
			s[y][x]=s[y][x-1]+A[y][x];
		}
	}
	vector<vector<int> > s_(N,vector<int>(N));
	REP(x,0,N) s_[0][x]=s[0][x];
	REP(x,0,N){
		REP(y,1,N){
			s_[y][x]=s_[y-1][x]+s[y][x];
		}
	}
	REP(sy,0,N){
		REP(sx,0,N){
			REP(ey,sy,N){
				REP(ex,sx,N){
					lli tmp=0;
					tmp+=s_[ey][ex];
					if(sy!=0) tmp-=s_[sy-1][ex];
					if(sx!=0) tmp-=s_[ey][sx-1];
					if(sy!=0&&sx!=0) tmp+=s_[sy-1][sx-1];
					ans=max(ans,tmp);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1340
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef pair<int,int> P;
typedef long long int lnt;
lnt n,a,x[51],ans;
lnt dp[51][2500];
int main()
{
	cin>>n>>a;
	for(int i=0;i<n;i++){
		cin>>x[i+1];
	}
	dp[0][0]=1;
	for(lnt i=1;i<=n;i++){
		for(lnt j=n;j>=1;j--){
			for(lnt k=x[i];k<=2500;k++){
				if(dp[j-1][k-x[i]]) {
					dp[j][k]+=dp[j-1][k-x[i]];
					if(k%j==0&&k/j==a){
						ans+=dp[j-1][k-x[i]];
					}
				}
			}
		}
	}	
	cout<<ans<<endl;
}

Measured memory_bytes: 640
using System;
using System.Linq;

namespace procon
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var inputs = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var count = 0;

            for (int i = inputs[0]; i <= inputs[1]; i++)
            {
                if (inputs[2] % i == 0) count++;
            }

            Console.WriteLine(count);
        }
    }
}

Measured memory_bytes: 9568
#include <bits/stdc++.h>
using namespace std ;
#define ll long long
inline int D(){
    int t ;
    scanf( "%d" , &t ) ;
    return t ;
}
inline ll LLD(){
    ll t ;
    scanf( "%lld" , &t ) ;
    return t ;
}


//#########################################




int main() {

   int n=D();
   int a[n];
   for(int i=0;i<n;i++){
       scanf("%d",&a[i]);


   }
   sort(a,a+n);
   int x=0,y=0;
   for(int i=n-1;i>=0;i-=2){

       x+=a[i];

   }
    for(int i=n-2;i>=0;i-=2){

        y+=a[i];

    }
    cout<<x-y;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;


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

	string S, T;
	cin >> T;
	S = "keyence";
	int N = S.size();
	int M = T.size();
	bool ok = true;
	string Q1{}, Q2{};
	rep(i,min(N,M)){
		if(S[i] == T[i]){
			Q1 += S[i];
		}
		else break;
	}
	if(Q1 == S){
		cout << "YES" << endl;
		return 0;
	}
	int W = N - Q1.size();
	for(int i = 1;i<W+1;i++){
		if(S[N-i] == T[M-i]){
			Q2 = S[N-i] + Q2;
		}
		else break;
	}
	if(Q1 + Q2 == S) cout << "YES" << endl;
	else cout << "NO" << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	int H, W;
	int[] dx = {1, 0, -1, 0};
	int[] dy = {0, 1, 0, -1};
	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			W = sc.nextInt();
			H = sc.nextInt();
			if((H | W) == 0){
				break;
			}
			sc.nextLine();
			char[][] field = new char[H][W];
			for(int i = 0; i < H; ++i){
				field[i] = sc.nextLine().toCharArray(); 
			}
			for(int i = 0; i < H; ++i){
				for(int j = 0; j < W; ++j){
					if(field[i][j] == '@'){
						System.out.println(dfs(field, i, j));
					}
				}
			}
		}
	}
	int dfs(char[][] field, int y, int x){
		if(y < 0 || H <= y || x < 0 || W <= x){
			return 0;
		}
		if(field[y][x] == '#'){
			return 0;
		}
		field[y][x] = '#';
		int ret = 0;
		for(int i = 0; i < 4; ++i){
			ret += dfs(field, y+dy[i], x+dx[i]);
		}
		return ret+1;
	}
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 38456
#include <stdio.h>
int main()
{
  long long int i, j;
  long long int a,b,k;
  scanf("%lld %lld %lld",&a,&b,&k);
  if (a-k>=0) {
    a-=k;
    k=0;
  }
  if (a-k<0) {
    a-=k;
    k=a*-1;
    a=0;
  }
  b-=k;
  if (b<0) {
    b=0;
  }
    printf("%lld %lld\n",a,b);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Welcome to my source code!

int main() {
    string s;
    cin >> s;
    int n = s.size(), zero = 0, one = 0, ans = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == '1') {
            if (zero) zero--, ans += 2;
            else one++;
        } else {
            if (one) one--, ans += 2;
            else zero++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <algorithm>
#include <cstring>

long long modInv(long long a, long long m)
{
    long long b = m, u = 1, v = 0;

    while (b) {
        long long t = a / b;
        a -= t * b; std::swap(a, b);
        u -= t * v; std::swap(u, v);
    }

    u %= m;
    if (u < 0) {u += m;}

    return u;
}

int pattern(int count, int div, long long m)
{
    long long ans = 1;
    if (div == 1) {return 1;}
    for (int i = 1; i < div; i++) {
        ans *= count - i;
        ans %= m;
    }
    for (int i = 1; i < div; i++) {
        ans *= modInv(i, m);
        ans %= m;
    }

    return ans;
}

int solve(int red, int blue, int i)
{
    // 高橋君は青を取りたい
    long long ans = 0;
    long long m = 1000000007;

    long long redpattern = pattern(red, i , m);
    long long bluepattern = pattern(blue, i, m);

    // 赤 ... 赤 : 青をi個，赤をi+1個に分ける
    ans += pattern(red, i+1, m) * bluepattern;
    ans %= m;
    // 青 ... 赤 : 青をi個，赤をi個に分ける
    ans += redpattern * bluepattern;
    ans %= m;
    // 赤 ... 青 : 青をi個，赤をi個に分ける
    ans += redpattern * bluepattern;
    ans %= m;
    // 青 ... 青 : 青をi個，赤をi-1個に分ける
    if (i != 1) {
        ans += pattern(red, i-1, m) * bluepattern;
        ans %= m;
    }

    return ans;
}

int main(int argc, char *argv[])
{
    int n, k;

    std::cin >> n >> k;

    const auto blue = k;
    const auto red = n - k;

    for (int i = 1; i <= k; i++) {
        const auto ans = solve(red, blue, i);
        std::cout << ans << std::endl;
    }

    return 0;
}

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

int main(){
  int x,y,z,tmp;

  scanf("%d%d",&x,&y);
  if(x<1 || y>1e9) exit(1);
  
  if(x<y){
    tmp = x;
    x = y;
    y = tmp;
  }

  z = x % y;
  while(z!=0){
    x = y;
    y = z;
    z = x % y;
  }

  printf("%d\n",y);

  return 0;
}



Measured memory_bytes: 2104
import sys
s=list(input())
n=len(s)
if s[0]!="A":
    print("WA")
    sys.exit()
    
C_count=0
word=list("abcdefghijklmnopqrstuvwxyz")
for i in range(2,n-1):
    if s[i]=="C":
        C_count+=1
    elif s[i] in word:
        continue
    else:
        print("WA")
        sys.exit()
if C_count==1:
    if s[1] in word and s[n-1] in word:
        print("AC")
    else:
        print("WA")
else:
    print("WA")
    

Measured memory_bytes: 38256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  int n, m, k; cin >> n >> m >> k;
  vector<ll> a(n), b(m);
  REP(i, n) cin >> a[i];
  FOR(i, 1, n) a[i] += a[i - 1];
  REP(i, m) cin >> b[i];
  FOR(i, 1, m) b[i] += b[i - 1];
  int ans = upper_bound(ALL(b), k) - b.begin();
  REP(i, n) {
    if (a[i] > k) break;
    chmax(ans, i + 1 + upper_bound(ALL(b), k - a[i]) - b.begin());
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 6320
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String [] arr = s.split(",");
        for(int i=0; i<3; i++){
            System.out.print(arr[i]);
            if(i!=2)System.out.print(" ");
        }
        System.out.println();
    }
}

Measured memory_bytes: 9552
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)

struct INIT{
    INIT(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(0);
        cout << fixed << setprecision(13);
    }
}INIT;

int h, w, k;
string s[303];
int ans[303][303];

int main(){
    cin >> h >> w >> k;
    REP(i, h){
        cin >> s[i];
    }
    int num = 0;
    int cnt = 0;
    while(cnt == 0){
        REP(j, w){
            if(s[num][j] == '#'){
                cnt++;
            }
        }
        if(cnt == 0)num++;
    }
    int idx = 0;
    for(int i = num;i < h;i++){
        int fin = -1;
        REP(j, w){
            if(s[i][j] == '#')fin = j;
        }
        if(fin == -1){
            REP(j, w)ans[i][j] = ans[i - 1][j];
            continue;
        }
        idx++;
        for(int j = 0;j <= fin;j++){
            ans[i][j] = idx;
            if(s[i][j] == '#' && j != fin && idx != k)idx++;
        }
        for(int j = fin + 1;j < w;j++){
            ans[i][j] = idx;
        }
    }

    REP(i, num){
        REP(j, w)ans[i][j] = ans[num][j];
    }
    REP(i, h){
        REP(j, w){
            if(j)cout << " ";
            cout << ans[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 1280
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;
ll c[3][3];

int main() {
  vector<ll> a(3), b(3);
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> c[i][j];
    }
  }
  a[0] = 0;
  b[0] = c[0][0];
  b[1] = c[0][1];
  b[2] = c[0][2];
  a[1] = c[1][0] - b[0];
  a[2] = c[2][0] - b[0];
  bool fail = false;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (c[i][j] != a[i] + b[j]) {
        fail = true;
        break;
      }
    }
  }
  if (fail)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
using ll = long long;
int main(){
    int x ,n, ans, z;
    cin >> x >> n;
    vector<int> p(0);
    vector<int> q(0);
    z=1;
    rep(i,n){
        int y;
        cin >>y;
        y -= x;
        if(y<0){
            p.push_back(-y);
        }
        if(y>0){
            q.push_back(y);
        }
        if(y ==0){
            z =0;
        }
    }
    sort(p.begin(),p.end());
    sort(q.begin(),q.end());
    rep(i,51){
        bool pe =1;
        bool qe =1;
        rep(j,p.size()){
            
            if(i+1==p.at(j)){
                pe =0; 
            }
        }
        rep(j,q.size()){
            if(i+1==q.at(j)){
                qe =0; 
            }
        }
        if(pe){
            ans = x-i-1;
            break;
        }
        if(qe){
            ans = x+i+1;
            break;
        }
    }
    if(z){
        ans =x;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i,m,n) for(int i = m - 1; i >= n; i--)
#define ALL(v) v.begin(), v.end()
#define itn int
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define YES() cout << "YES" << endl
#define NO() cout << "NO" << endl
#define println(x) cout << x << endl
#define print(x) cout << x << " "
template<typename T, typename U>
inline bool CMAX(T &m, U x) { if (m < x) { m = x; return true; } return false; }
template<typename T, typename U>
inline bool CMIN(T &m, U x) { if (m > x) { m = x; return true; } return false; }

typedef long long lint;
typedef long double ldouble;
const int INF = 1e9;
const lint LINF = 1e18;
const int MOD = 1e9+7;
int main(){
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    bool flag = false;
    int ta = a;
    int tb = b;
    int tc = c;
    vector<int> digit(k,0);
    vector<int> val(k,2);
    while(1){
        REP(i,k){
            if(digit[i] == 0)
                ta *= 2;
            else if(digit[i] == 1)
                tb *= 2;
            else
                tc *= 2;
            if(tb > ta && tc > tb){
                flag = true;
                break;
            }
            
        }
        ta = a;
        tb = b;
        tc = c;
        if(flag)
            break;
        if(digit == val)
            break;
        digit[0]++;
        REP(i,k){
            if(digit[i] == 3){
                digit[i + 1]++;
                digit[i] = 0;
            }
            
        }
    }
    if(flag)
        Yes();
    else No();
    return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define P 1000000007LL
const ll P2 = P*P;
#define MAXN 200010
 
ll mod(ll &a){
	return ((a >= P) ? (a % P) : (a));
}
 
struct state {
	ll c0, c1, c2;
	state(){
		c0 = 1, c1 = 1, c2 = 0;
	}
 
	struct state& operator += (const state &a){
		c2 = (a.c1 + a.c2) *(c1 + c2) + a.c0*c2 + c0*a.c2;
		c1 = a.c1*c0 + a.c0*c1;
		c0 = a.c0*c0;
 
		c0 = mod(c0);
		c1 = mod(c1);
		c2 = mod(c2);
	}
};
 
vector<state> ans[MAXN];
int id[MAXN];
 
int level[MAXN];
int cnt[MAXN];
 
int p[MAXN];
vector<int> gr[MAXN];
 
void dfs(int u){
	if(gr[u].size() == 0){
		id[u] = u;
		ans[u].push_back(state());
		return;
	}
 
	int ma = -1, me = 0;
	int i_ma = 0;
	for(auto &v : gr[u]){
		level[v] = level[u]+1;
		cnt[level[v]]++;
		dfs(v);
		if((int)ans[id[v]].size() > ma){
			ma = ans[id[v]].size();
			i_ma = v;
		}
	}
 
	int aux = id[u] = id[i_ma];
	int t = ans[id[u]].size();
	for(auto &v : gr[u]){
		if(v == i_ma) continue;
		int t1 = ans[id[v]].size();
		me = max(me, t1);
		for(int i = 0; i < t1; i++){
			ans[id[u]][t-1- i ] += ans[id[v]][t1-1 - i];
		}
	}
	for(int i = 0; i < me; i++){
		ans[id[u]][t - 1 - i].c0 += ans[id[u]][t - 1 - i].c2;
		if(ans[id[u]][t - 1 - i].c0 >= P) ans[id[u]][t - 1 - i].c0 -= P;
		ans[id[u]][t - 1 - i].c2 = 0;
	}
 
	//cout << u << "\n";
 
	ans[id[u]].push_back(state());
	//for(auto &x : ans[id[u]]) cout << "(" << x.c0 << ", " << x.c1 << ", " << x.c2 << ") ";
	//cout << "\n";
}
 
ll pot2[MAXN];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	pot2[0] = 1;
	for(int i = 1; i < MAXN; i++){
		pot2[i] = pot2[i-1] << 1;
		if(pot2[i] >= P ) pot2[i] -= P;
	}
	int N;
	cin >> N;
 
	p[0] = -1;
	cnt[0] = 1;
	
	for(int i = 1; i <= N; i++) {
		cin >> p[i];
		gr[p[i]].push_back(i);
	}
 
	dfs(0);
	ll sol = 0;
	int t = ans[id[0]].size();
	for(int l = 0; l < t; l++){
		sol += ans[id[0]][t-1-l].c1 * pot2[N + 1 - cnt[l]];
		if(sol >= P2) sol -= P2;
		
	}
	sol %= P;
	cout << sol << "\n";
 
 
	return 0;
}

Measured memory_bytes: 56048
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7


int main() {

	int N;
	char S[1000];
	scanf("%d", &N);
	for (int i = 0; i < N*2; i++) {
		scanf("%c", &S[i]);
	}
	bool four = false;

	for (int i = 0; i < N*2; i++) {
		if (S[i] == 'Y') {
			four = true;
			break;
		}

	}

	if (four) {
		printf("Four");
	}
	else {
		printf("Three");
	}

}

Measured memory_bytes: 128
import sys
X = int(input())


def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1


number = X
while True:
    if is_prime(number) == True:
        print(number)
        sys.exit()
    else:
        number = number  + 1

Measured memory_bytes: 3060
/**
*Keep
**Moving
***Forward
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
#define pb push_back
#define all(c) (c).begin(),(c).end()



int main() {

    string x;
    cin >> x;
    long long ans = 1;
    int F[26] = {0};
    for(int i=0;i<x.size();i++){
        if(i>F[x[i]-'a'])ans+=i-F[x[i]-'a'];
        F[x[i]-'a']++;
    }
    cout << ans;

    return 0;
}


Measured memory_bytes: 640
nums = input().split()
W = int(nums[0])
H = int(nums[1])
X = int(nums[2])
Y = int(nums[3])
R = int(nums[4])
if (X - R) >= 0 and (X + R) <= W:
    if (Y - R) >= 0 and (Y+ R) <= H:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Measured memory_bytes: 7720
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
int K;
int A[MAX_N]; ll B[MAX_N];

void solve() {
	cin >> N >> K;
	rep(i, 0, N) cin >> A[i] >> B[i];
	ll res = 0;
	rep(i, 0, 30) {
		if(!(K & (1 << i))) continue;
		int bit = 0;
		rer(j, 30, i) bit |= (1 << j);

		ll tmp = 0;
		rep(j, 0, N) {
			int a = (K ^ (1 << i)) & bit;
			int b = A[j] & bit;
			if((a & b) == b) tmp += B[j];
		}
		MAX(res, tmp);
	}
	ll tmp = 0;
	rep(j, 0, N) {
		if((K & A[j]) == A[j]) tmp += B[j];
	}
	MAX(res, tmp);
	cout << res << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



Measured memory_bytes: 3328
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }

int a[11][11];

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

	int n, a, b;
  	cin >> n >> a >> b;
  	cout << min(n * a, b);
}

Measured memory_bytes: 256
def fib(n):
    global f
    if f[n]==False:
        val=fib(n-1)+fib(n-2)
        f[n]=val
        return val
    else:
        return f[n]


n=int(input())
N=44+1
f=[1,1]
f.extend([0]*N)
fib(N)
print(f[n])

Measured memory_bytes: 7752
#include<bits/stdc++.h>
using namespace std;
int main() {
  int64_t n,k,c,i,m;
  cin>>n;
  m=n-1;
  c=1;
  for(k=2;k*k<=m;k++){
    if(m%k==0){
      m/=k;
      i=1;
      while(m%k==0){
        m/=k;
        i++;
      }
      c*=(i+1);
    }
  }
  if(m>1) c*=2;
  c--;
  
  for(k=2;k*k<=n;k++){
    if(n%k==0){
      m=n/k;
      while(m%k==0) m/=k;
      if (m%k==1) c++;
    }
  }
  c++;
  cout<<c<<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

ll dfs(ll H) {
    if(H == 1)
        return 1;
    return dfs(H / 2) * 2 + 1;
}

int main() {
    ll H;
    cin >> H;
    cout << dfs(H) << endl;
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var count int
	var str string
	fmt.Scan(&str)

	if str[0] == '1' { count++ }
	if str[1] == '1' { count++ }
	if str[2] == '1' { count++ }

	fmt.Println(count)
}

Measured memory_bytes: 512
/*
  シャッフル( １つのアルファベットが描かれた n 枚のカードの山をシャッフルします。
  1回のシャッフルでは、下から h 枚のカードをまとめて取り出し、
  それを残ったカードの山の上に積み上げます。
  )
  2018/03/04
*/

#include<stdio.h>

int main(void)
{
  char str[201];
  char word;/*str[0]を一時的に保持*/
  int m;/*シャッフル回数*/
  int h;
  int i,j,k;
  
  
  while(1){
    scanf("%s",str);
    if(str[0] == '-')
      break;
    scanf("%d",&m);
    for(i=0;i<m;i++){
      scanf("%d",&h);
      for(j=0;j<h;j++){
	word = str[0];
	k=0;
	while(str[k+1] !='\0'){
	  str[k] = str[k+1];
	  k++;
	}
	str[k] = word;
      }
    }
    printf("%s\n",str);
  }
  return 0;
}


Measured memory_bytes: 2044
#if defined(LOCAL)
const double _max_double_error = 1e-9;
#include "testutils.h"
#define L(x...) (debug(x, #x))
#define I(x, ...) (x)
#define C(x...) CHECK(x)
#else
#define L(x, ...) (x)
#define I(x, ...) (x)
#define C(x, ...) ;
#endif
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <memory>
#include <numeric>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ii = pair<int, int>;
using lu = unsigned long long;
using l = long long;
using vs = vector<string>;
using vii = vector<ii>;
using vl = vector<l>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using ll = pair<l, l>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using mll = unordered_map<l, l>;
using sl = unordered_set<l>;
const l INF = numeric_limits<l>::max();
const double EPS = 1e-10;
const double PI = M_PI;
const l e0 = 1, e3 = 1000, e5 = 100000, e6 = 10 * e5, e7 = 10 * e6,
        e8 = 10 * e7, e9 = 10 * e8;
const char lf = '\n';
#define all(x) begin(x), end(x)
#define F(a, b, c) for (l a = l(b); a < l(c); a++)
#define B(a, b, c) for (l a = l(c) - 1; a >= l(b); a--)
#define VVL(x, a, b, i) vvl x(a, vl(b, l(i)));
#define VVVL(x, a, b, c, i) vvvl x(a, vvl(b, vl(c, l(i))));

void solve(istream &in, ostream &out);
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
#if defined(LOCAL)
  tst::test_init(argc, argv);
  // _generate_random_test = generate_random;
  // _solve_brute = solve_brute;
  // _player_b = player_b;
  // _custom_solution_checker = solution_checker;
  tst::maybe_run_tests(cin, cout);
#else
  solve(cin, cout);
#endif
}
const l MOD = e9 + 7; // end of template

void solve(istream &in, ostream &out) {
  l n;
  in >> n;
  mll a, b;
  F(i, 0, n / 2) {
    l x, y;
    in >> x >> y;
    a[x]++;
    b[y]++;
  }
  auto f = [&](mll &m) {
    l x, y, v;
    x = y = v = 0;
    for (auto kv : m) {
      if (kv.second > x) {
        swap(x, y);
        x = kv.second;
        v = kv.first;
        continue;
      }
      if (kv.second > y) {
        y = kv.second;
      }
    }
    return make_tuple(x, y, v);
  };
  l a1, a2, b1, b2, x, y;
  tie(a1, a2, x) = f(a);
  tie(b1, b2, y) = f(b);
  if (x == y) {
    if (a1 + b2 > a2 + b1)
      swap(b1, b2);
    else
      swap(a1, a2);
  }
  out << n - a1 - b1 << lf;
}


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

int main(){
  int a, b;
  char op;
  int ans;
  
  cin >> a >> op >> b;
  
  switch(op){
    case '+': ans=a+b; break;
    case '-': ans=a-b; break;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <iomanip>

#include <map>
#include <set>
#include <queue>
#include <stack>

#define ALL(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define rrep(i,n) RFOR(i,n,0)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdbl vector<double>
#define vstr vector<string>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

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

	int N;
	cin >> N;

	int p[N];
	rep(i,N){
		cin >> p[i];
		p[i]--; 
	}

	int a[N];
	rep(i,N) a[i] = N * (i+1);

	int b[N];
	rep(i,N) b[i] = N * (N-i-1);
	rep(i,N) b[p[i]] += (i+1);

	cout << a[0];
	rep(i,N-1) cout << " " << a[i+1];
	cout << endl;

	cout << b[0];
	rep(i,N-1) cout << " " << b[i+1];
	cout << endl;
}

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

int main() {
  int r,g,b;
  cin >> r >> g >> b;
  int x;
  x=100*r+10*g+b;
  if(x%4==0){
  cout << "YES" << endl;
  }
    else{
      cout << "NO" << endl;
    }
  }

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int k, s;
	cin >> k >> s;

	int ans = 0;
	for (int x = 0; x <= k; ++x) {
		for (int y = 0; y <= k; ++y) {
			int z = s - x - y;
			if (0 <= z && z <= k) {
				++ans;
			}
		}
	} 

	cout << ans << "\n";

	return 0;

}

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

int main(void) {
    int N;
    cin >> N;
    vector< int > a(N - 1), b(N - 1), c(N);
    for (int i = 0; i < N - 1; ++i) {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < N; ++i) {
        cin >> c[i];
    }
    sort(c.begin(), c.end());
    reverse(c.begin(), c.end());
    int score = accumulate(c.begin(), c.end(), 0) - c[0];
    cout << score << "\n";
    vector< int > ans(N + 1);
    for (int i = 1; i < N + 1; ++i) {
        ans[i] = 0;
    }
    ans[a[0]] = c[0];
    ans[b[0]] = c[1];
    for (int i = 1; i < N - 1; ++i) {
        for (int j = 1; j < N - 1; ++j) {
            if (ans[a[j]] == 0 && ans[b[j]] > 0) {
                ans[a[j]] = c[i + 1];
                break;
            } else if (ans[a[j]] > 0 && ans[b[j]] == 0) {
                ans[b[j]] = c[i + 1];
                break;
            }
        }
    }
    for (int i = 1; i < N; ++i) {
        cout << ans[i] << " ";
    }
    cout << ans[N] << "\n";
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
using namespace std;
int v[105];
int main() {
    // insert code here...
    int n,x;
    cin>>n>>x;
    for(int i=1;i<=n;i++)
        cin>>v[i];
    sort(v+1, v+1+n);
    int s=0;
    for(int i=1;i<=n;i++){
        if(x-v[i]>=0){
            s++;
            x-=v[i];
        }
        else{
            cout<<s<<endl;
            return 0;
        }
    }
    if(x>0)
        s--;
    cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int t;
    //tを定義
    int n;
    //nを定義
    for(int i = 0; i < 4; i++){
        cin >> t >> n;
        if(t == 1){
            cout << n * 6000 << endl;
        } else if(t == 2){
            cout << n * 4000<< endl;
        } else if(t == 3){
            cout << n * 3000 << endl;
        } else {
            cout << n * 2000<< endl;
        }
    }

}


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

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

#define LOG(variable) cerr << #variable":\t" << (variable) << "\n"
#define LOGCON(i, container) for(int (i) = 0; (i) < (container).size(); ++(i)) cerr << (i) << ":\t" << (container)[(i)] << "\n"
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, n, r) for(int i = (n); i >= (r); --i) // from n to r
#define REPOBJ(itr, obj) for(auto itr = (obj).begin(); itr != (obj).end() ; ++itr)
#define REPROBJ(itr, obj) for(auto itr = (obj).rbegin(), e = (obj).rend(); itr != e; ++itr)
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))
template<typename T = int>
T in() {T a; cin >> a; return a;}
/***** MAIN *****/
signed main() {
  string s, t; cin >> s >> t;
  int ans = 0;
  for(int i = 0; i < s.size(); ++i) {
    if(s[i] != t[i]) ++ans;
  }
  cout << ans;
  cout << "\n";
  return 0;
}
/***** MAIN *****/

Measured memory_bytes: 3924
import sys
input = sys.stdin.readline

inputs = list(map(int, input().split()))

if inputs[0] == inputs[1] and inputs[1] == inputs[2]:
    print(1)
elif inputs[0] == inputs[1] or inputs[1] == inputs[2] or inputs[0] == inputs[2]:
    print(2)
else:
    print(3)



Measured memory_bytes: 2940
#include "bits/stdc++.h"
using namespace std;

// 定義
typedef long long         ll;
typedef pair<ll, ll>      P;
#define ALL(x)            (x).begin(),(x).end()
#define REP(i, n)         for(ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)     for(ll i = m ; i < (ll)n ; ++i)
#define VL                vector<ll>
#define VVL               vector<vector<ll>>
#define VVVL              vector<vector<vector<ll>>>
#define VC                vector<char>
#define VVC               vector<vector<char>>
#define INF               (ll)2e9
#define INF_LL            1LL<<60
//#define MOD             998244353
#define MOD               1000000007

ll Ceil(ll val, ll div)   { return (val + div - 1) / div; }
ll CeilN(ll val, ll div)  { return Ceil(val, div) * div; }
ll FloorN(ll x, ll n)     { return (x - x % n); }
bool IsOdd(ll x)          { return ((x & 1) == 1); }
bool IsEven(ll x)         { return ((x & 1) == 0); }
template<class T> bool chmax(T& a, T b) { if (a <= b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, T b) { if (a >= b) { a = b; return 1; } return 0; }

void Solve()
{
	ll a, b, c, d;
	cin >> a >> b >> c >> d;

	VL ans;
	ans.emplace_back(a * c);
	ans.emplace_back(a * d);
	ans.emplace_back(b * c);
	ans.emplace_back(b * d);
	sort(ALL(ans));
	cout << ans.back() << endl;
}

// メイン
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Solve();
	return 0;
}


Measured memory_bytes: 3656
#include <stdio.h>

const int MAX_V = 10000;


int main() {
	int i, k, v;
	int sousi[2];
	int prime[MAX_V + 1];
	for (i = 2; i <= MAX_V; i++) {
		prime[i] = 1;
	}
	for (i = 2; i * i <= MAX_V; i++) {
		if (prime[i]) {
			for (k = 2 * i; k <= MAX_V; k += i) {
				prime[k] = 0;
			}
		}
	}
	while (1) {
		int isprime = prime[v];
		sousi[0] = 0;
		sousi[1] = 0;
		scanf("%d", &v);
		if (v == 0) {
			break;
		}
		for (i = v; i > 2; i--) {
			if (prime[i] == 1 && prime[i - 2] == 1) {
				sousi[0] = i - 2;
				sousi[1] = i;
				break;
			}
		}
		printf("%d %d\n", sousi[0], sousi[1]);
	}	
	return 0;
}

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

using namespace std;

long long divide(long long n, long long m){
    if(n==-1){
        return 0;
    }
    else{
        return n/m + 1;
    }
}

long long euclidean_gcd(long long a, long long b) {
  if(a < b) return euclidean_gcd(b, a);
  long long r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

long long least_common(long long n, long long m){
    return n*m/euclidean_gcd(n, m);
}


int main(){
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long ans=b-a+1;
    ans -= divide(b, c) - divide(a-1, c);
    ans -= divide(b, d) - divide(a-1, d);
    ans += divide(b, least_common(c,d)) - divide(a-1, least_common(c,d));
    cout << ans << endl;
}


Measured memory_bytes: 256
a,b=map(int,input().split())
s=input()
inter = s[b-1]
inter_new = inter.lower()
res = ""
if b ==1:
  res = inter_new+s[1:len(s)]
elif b == a:
  res = s[0:len(s)-1]+inter_new
else:
  res = s[0:b-1]+inter_new+s[b:len(s)]
print(res)

Measured memory_bytes: 9140
#include <bits/stdc++.h>
using  namespace std;
typedef long long ll;
int main(){
    ll n, ans, waitTime;
    cin >> n;
    ll C[n], S[n], F[n];
    for(ll i=0;i<n-1;i++){
        cin >> C[i] >> S[i] >> F[i];
    }
    C[n-1] = 0;
    S[n-1] = 0;
    F[n-1] = 0;
    for(ll i=0;i<n;i++){
        ans = S[i];
        ans += C[i];
        for(ll j=i+1;j<n-1;j++){
            if(ans <= S[j]){
                ans = S[j];
                ans += C[j];
            }else{
                waitTime = S[j];
                while(waitTime<ans){
                    waitTime += F[j];
                }
                ans = waitTime;
                ans += C[j];
            }
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define mt make_tuple
#define INF 2000000000
#define INFL 1000000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef pair<int, pair<int, int> > Edge;
typedef vector<Edge> vE;
typedef priority_queue<Edge, vector<Edge>, greater<Edge> > pqlE;

int main() {
	int N, M;
	cin >> N >> M;
	vi a(N);
	vi num(N, 0);
	vi f(N, 0);
	rep(i, N) {
		cin >> a[i];
		a[i]--;
		num[a[i]]++;
	}
	rep(i, N) {
		f[i]++;
		if (i - num[i] >= 0)f[i - num[i]]--;
	}
	int ans = 0;
	if (f[N - 1] == 0)ans++;
	reprev(i, N - 1) {
		f[i] += f[i + 1];
		if (f[i] == 0)ans++;
	}
	rep(i, M) {
		int x, y;
		cin >> x >> y;
		x--;
		y--;
		
		if (a[x] - num[a[x]] + 1 >= 0) {
			f[a[x] - num[a[x]] + 1]--;
			if (f[a[x] - num[a[x]] + 1] == 0)ans++;
		}
		num[a[x]]--;

		if (y - num[y] >= 0) {
			if (f[y - num[y]] == 0)ans--;
			f[y - num[y]]++;
		}
		num[y]++;

		a[x] = y;

		cout << ans << endl;
	}

	return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const long long MOD=(int)1e9+7;

// Problem Specific Parameter:

int main() {
  map<int, int> ma;
  int N, A[210000];
  cin >> N;
  for(int i = 0; i < N; ++i) cin >> A[i], ma[A[i]]++;

  bool ok = true;
  if(N % 2 == 1)
    if(ma[0] != 1) ok = false;
  int start;
  start = (N % 2 == 0) ? 1 : 2;
  for(; start < N; start += 2)
    if(ma[start] != 2) ok = false;

  if(!ok) cout << 0 << endl;
  else {
    long long res = 1;
    for(int i = 0; i < N/2; ++i) {
      res *= 2;
      res %= MOD;
    }
    cout << res << endl;
  }

  return 0;
}


Measured memory_bytes: 4480