akhauriyash/Code-Regression huggingface dataset:
import java.io.*;
import java.util.*;

class Main{
	public static void main(String[] args){
		solve();
	}
	public static void solve(){
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		for(int i=0;i<3;i++){
			a[i] = sc.nextInt();
		}		
		Arrays.sort(a);
		System.out.println(a[0]+" "+a[1]+" "+a[2]);
	}
}



Measured memory_bytes: 26252
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int bill = sc.nextInt();
        int otoshidama = sc.nextInt();
        int x = -1;
        int y = -1;
        int z = - 1;
        check :for(int k = 0; k <= bill; k++) {
            for(int i = 0; i <= bill - k; i++) {
                int j =  bill - (k +i);
                int sum = 10000 * k + 5000 * i + 1000 * j;
                if(sum ==otoshidama && (k + i + j) == bill) {
                    x = k; y = i; z = j;
                    break check;
                }
            }
        }
        System.out.println(x +" "+y+" "+z);
    }
}


Measured memory_bytes: 22608
/******************************************
* AUTHOR : Lokesh goel*
* NICK : InsaneNerd *
* INSTITUTION : NIT Kurukshetra *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 1000000000
#define N 100005
#define pii pair<int,int>
#define vp vector<pair<int,int > >
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define gsz(x) ((int)(x).size())
#define F first
#define S second
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ms(x,v) memset(x,v,sizeof(x))
int main() {
	fastio;
	ll n,a,b;
	cin>>n>>a>>b;
	if(abs(a-b)%2==0)
		cout<<(abs(a-b)+1)/2;
	else
	{
		// they need to go for 1 or N
		// for 1
		// ll ans1= max(a-1,b-1);
		// //for N
		// ll ans2= max(n-a,n-b);
		// cout<<min(ans1,ans2)<<endl;
		ll ans= min(a-1,n-b)+1+(b-a-1)/2;
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
using ll = long long;
int main() {
	int k;
	string s;
	cin >> k >> s;
	int n = s.size();
	if (n <= k)
		cout << s << endl;
	else {
		rep(i, k) { cout << s[i]; }
		cout << "..." << endl;
	}
	return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
int n,m;
cin>>n>>m;
cout<<(n-1)*(m-1)<<endl;
return 0;}

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

typedef struct {
    int b;
    int c;
} option;

int comp_int(const void* a, const void* b)
{
    int arg1 = *(const int*)a;
    int arg2 = *(const int*)b;
 
    if (arg1 < arg2) return -1;
    if (arg1 > arg2) return 1;
    return 0;
}

int comp_op(const void *a, const void *b)
{
    option op1 = *(const option*)a;
    option op2 = *(const option*)b;
    if (op1.c > op2.c) return -1;
    if (op1.c < op2.c) return 1;
    return 0;
}

int count_less(int a[], int c, int n)
{
    int lb = -1;
    int ub = n;
    int m;
    while (ub - lb > 1) {
	m = (lb + ub) / 2;
	if (a[m] < c) {
	    lb = m;
	} else {
	    ub = m;
	}
    }
    return ub;
}

long long solve(int a[], option ops[], int n, int m)
{
    int i;
    long long sum = 0;
    int from = 0;
    int cnt;
    for (i = 0; i < m; i++) {
	cnt = count_less(a + from, ops[i].c, n-from);
	if (cnt < ops[i].b) {
	    sum += (long long)ops[i].c * cnt;
	    from += cnt;
	    break;
	} else {
	    sum += (long long)ops[i].c * ops[i].b;
	    from += ops[i].b;
	}
    }
    for (i = from; i < n; i++) {
	sum += a[i];
    }
    return sum;
}

int main()
{
    int n, m, i;
    int a[1<<17];
    option ops[1<<17];
    scanf("%d %d", &n, &m);
    for (i = 0; i < n; i++) {
	scanf("%d", a + i);
    }
    for (i = 0; i < m; i++) {
	scanf("%d %d", &ops[i].b, &ops[i].c);
    }
    qsort(a, n, sizeof(int), comp_int);
    qsort(ops, m, sizeof(option), comp_op);
    long long ans = solve(a, ops, n, m);
    printf("%lld\n", ans);
    return 0;
}



Measured memory_bytes: 2164
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    int N, M, X, Y;
    cin >> N >> M >> X >> Y;
    vector<int>xs(N);
    vector<int>ys(M);

    for (int i=0; i<N; i++){
        cin >> xs.at(i);
    }
    
    for(int j=0; j<M; j++){
        cin >> ys.at(j);
    }

    int Zmi, Zma;
    Zmi = X+1;
    Zma = Y;

    for (int i=Zmi; i<=Zma; i++){
        if (X < i && i <= Y && *max_element(xs.begin(), xs.end()) < i && *min_element(ys.begin(), ys.end()) >= i){
            cout << "No War" << endl;
            return 0;
        }
    }
    cout << "War" << endl;
    
}

Measured memory_bytes: 256
import java.util.Scanner;

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

    static void insertionSort(int[] arr) {
        for (int i = 1; i < arr.length; i++) {
            int v = arr[i];
            int j = i - 1;
            while (j >= 0 && arr[j] > v) {
                arr[j + 1] = arr[j];
                j--;
            }
            arr[j + 1] = v;
            printArray(arr);
        }
    }


    static void printArray(int[] arr) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < arr.length - 1; i++) {
            sb.append(arr[i]);
            sb.append(" ");
        }
        sb.append(arr[arr.length - 1]);
        System.out.println(sb.toString());
    }
}



Measured memory_bytes: 28684
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

ll dp[MAX_N];

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

    // ダイクストラ法。計算量はO((V+E)*log(V))
    const ll sv = 0;  // 始点となる頂点。デフォルトでは0
    vl dist(MAX_N, INF);  // dist[v] : 頂点svから頂点vへの最短距離
    priority_queue<P, vector<P>, greater<P>> prQ;
    dist[sv] = 0;
    prQ.push(make_pair(sv, 0));  // (頂点番号, 頂点svからの最短距離)
    while(!prQ.empty()) {
        auto p1 = prQ.top();
        prQ.pop();
        ll v = p1.first;
        if(dist[v] < p1.second) {
            continue;
        }
        for(ll pow6 = 1; v + pow6 <= n; pow6 *= 6) {
            ll nv = v + pow6;
            if(dist[nv] > dist[v] + 1) {
                dist[nv] = dist[v] + 1;
                prQ.push(make_pair(nv, dist[nv]));
            }
        }
        for(ll pow9 = 1; v + pow9 <= n; pow9 *= 9) {
            ll nv = v + pow9;
            if(dist[nv] > dist[v] + 1) {
                dist[nv] = dist[v] + 1;
                prQ.push(make_pair(nv, dist[nv]));
            }
        }
    }

    out(dist[n]);
    re0;
}

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

#define int long long

using namespace std;



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

    long double A, B;
    cin >> A >> B;

    int temp = A*B;

    cout << temp << '\n';

    return 0;
}

Measured memory_bytes: 3748
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
ll llmax = LLONG_MAX;
string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alp = "abcdefghijklmnopqrstuvwxyz";
vi d1 = {1, 0, -1, 0}, d2 = {0, 1, 0, -1};
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
void neg() {cout << -1 << endl;}

int main() {
  ll n;
  cin >> n;
  vll a(1, 1);
  ll six = 6, nine = 9;
  while (six <= n) {
    a.push_back(six);
    six *= 6;
  }
  while (nine <= n) {
    a.push_back(nine);
    nine *= 9;
  }
  ll m = a.size();
  vll dp(100001, llmax);
  dp[0] = 0;
  for (ll i = 1; i <= n; i++) {
    for (ll j = 0; j < m; j++) {
      if (i < a[j]) continue;
      dp[i] = min(dp[i], dp[i - a[j]] + 1);
    }
  }
  cout << dp[n] << endl;
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
namespace Atcoder_0404
{
    class Program
    {
        static void Main(string[] args)
        {
            var K = GetInput_int()[0];
            var AB = GetInput_int();
            var min = AB[0];
            var max = AB[1];
            int i = 0;
            while (true)
            {
                if (K * i >= min) break;
                i++;
            }
            if (K * i <= max)
            {
                Console.WriteLine("OK");
            }
            else
            {
                Console.WriteLine("NG");
            }
        }
        #region input
        

        static string[] GetInput_string()
        {
            var input = Console.ReadLine().Split(' ');
            return input;
        }

        static int[] GetInput_int()
        {
            var input = GetInput_string();
            var result = new int[input.Length];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = int.Parse(input[i]);
            }
            return result;
        }
        static long[] GetInput_long()
        {
            var input = GetInput_string();
            var result = new long[input.Length];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = long.Parse(input[i]);
            }
            return result;
        }
        #endregion
        #region sonota
        static void Swap_array<T>(T[] target, int a, int b)
        {
            T temp = target[a];
            target[a] = target[b];
            target[b] = temp;
        }
        static void Swap_list<T>(List<T> target, int a, int b)
        {
            T temp = target[a];
            target[a] = target[b];
            target[b] = temp;
        }
        /// <summary>
        /// 最大公約数
        /// </summary>
        public static int GCD(int a, int b)
        {

            /* 自然数 a > b を確認・入替 */
            if (a < b)
            {
                int tmp = a;
                a = b;
                b = tmp;
            }

            /* ユークリッドの互除法 */
            int r = a % b;
            while (r != 0)
            {
                a = b;
                b = r;
                r = a % b;
            }
            return b;
        }

        /// <summary>
        /// 最小公倍数
        /// </summary>
        public static int LCM(int a, int b)
        {
            int x = a * b;
            b = GCD(a, b);
            return x / b;

        }
        #endregion

        static long mod = 1000000000 + 7;
    }
}

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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  ll a,b,k;cin>>a>>b>>k;
  if(a>k){
    a-=k;
    k=0;
  }else{
    k-=a;
    a=0;
  }

  if(b>k)b-=k;
  else b=0;

  cout<<a<<' '<<b;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

int n, m, a[112345], b[112345];
V g[112345];
bool used[112345];

int f, e;
V v;

void dfs(int s)
{
    used[s] = true;

    for (int i : g[s])
    {
        if (i == v[1])
        {
            e++;
            continue;
        }

        if (!used[i])
            dfs(i);
    }
}

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

    cin >> n >> m;
    REP(i, m)
    {
        cin >> a[i] >> b[i];
        g[a[i]].push_back(b[i]);
        g[b[i]].push_back(a[i]);
    }

    int ma = 0;

    for (int i = 1; i <= n; i++)
    {
        if (g[i].size() % 2)
        {
            cout << "No" << endl;
            return 0;
        }

        if (ma < g[i].size())
        {
            ma = g[i].size();
            v.clear();
        }
        if (ma == g[i].size())
            v.push_back(i);
    }

    if (ma > 4)
    {
        cout << "Yes" << endl;
        return 0;
    }

    if (ma < 4)
    {
        cout << "No" << endl;
        return 0;
    }

    if (v.size() < 2)
    {
        cout << "No" << endl;
        return 0;
    }

    if (v.size() > 2)
    {
        cout << "Yes" << endl;
        return 0;
    }

    for (int i = 1; i <= n; i++)
        used[i] = false;

    f = 0;
    e = 0;

    dfs(v[0]);

    if (e == 2)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 7932
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
using namespace std;

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>>res;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        res.emplace_back(i,0);
        while (n%i == 0)
        {
        n /= i;
        res.back().second++;
        }
        
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

void trace(int A[],int N){
    REP(i,N){
        if(i>0)printf(" ");
        printf("%d",A[i]);
    }
    printf("\n");
}


int main(){
    int A,B,C;
    cin >> A >> B >> C;
    int ans;
    if(A==B)ans = C;
    else if(A==C)ans = B;
    else ans = A;
    cout << ans << endl;
}


Measured memory_bytes: 256
/***********************************************************
 *This code By @1353055672(Ligen)                          *
 *[Warning]You're not excepted to understand this code!    *
 *CSP-S 2019 RP++                                          *
 ***********************************************************/
// #pragma GCC optimize(3)
#define ADD_STACK int size = 512 << 20;\
	char *pp = (char*)malloc(size) + size;  \
	__asm__("movl %0, %%esp\n" :: "r"(pp))
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<fstream>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<bitset>
#include<ctime>
#include<vector>
#define ll long long
#define ull unsigned long long
#define mn 200020
#define Max(x,y) (((x)>(y))?(x):(y))
#define Min(x,y) (((x)<(y))?(x):(y))
#define Abs(x) (((x)<(0))?(-(x)):(x))
#define infll (ll)(1e18)
#define infint (1<<30)
#define mod (int)(1e9+7)
#define FOR(a,b,c) for (register int a=b;a<=c;++a)
#define FORD(a,b,c) for (register int a=b;a>=c;--a)
using namespace std;
// char buf[1<<20],*p1=buf,*p2=buf;
// #define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline ll read(){
	ll x=0,f=1;char c;
	for(c=getchar();c<'0'||c>'9';f=((c=='-')?-1:f),c=getchar());
	for(;c>='0'&&c<='9';x=x*10+c-'0',c=getchar());
	return x*f;
}
template<typename T>
inline void write(T a){
	if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
	while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
}
inline void write_(){return;}
template<typename T,typename... Args>
inline void write_(T a,Args... b){write(a);putchar(' ');write_(b...);}
inline void writeln(){putchar('\n');return;}
template<typename T,typename... Args>
inline void writeln(T a,Args... b){write(a);putchar(' ');writeln(b...);}
//need c++11

//inline void write(ll a){
//    if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
//    while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
//}
//inline void write_(ll a){write(a);putchar(' ');}
//inline void writeln(ll a){write(a);putchar('\n');}
inline ll gcd(ll a,ll b){return a==0?b:gcd(b%a,a);}
inline ll lcm(ll a,ll b){return 1ll*a/gcd(a,b)*b;}
inline ll Pow(ll n,ll a){ll b=1;while(a){if(a&1)b=1ll*b*n%mod;n=1ll*n*n%mod;a>>=1;}return b;}
//---------------------Head Files--------------------------//

signed main(){
#ifdef LOCAL_LIGEN
	freopen("0.in","r",stdin);
	// freopen("0.out","w",stdout);
	double be=clock();
#endif
	ll n=read(),sq=sqrt(n),ans=infll;
	FOR(i,1,sq)if(n%i==0)ans=Min(ans,i+(n/i)-2);
	writeln(ans);
#ifdef LOCAL_LIGEN
	double en=clock();
	printf("Time: %.0lfms\n",en-be);
	fclose(stdin);fclose(stdout);
#endif
	return 0;
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

struct f2mat64{
    using row=uint_fast64_t;
    vector<row> m;
    f2mat64(int n):m(n){}
    f2mat64(vector<row>&v):m(v.size()){copy(v.begin(),v.end(),m.begin());}
    f2mat64& operator+=(const f2mat64& x){
        if(m.size()!=x.m.size()) return m.clear(),*this;
        for(size_t i=0;i<m.size();++i) m[i]^=x.m[i];
        return *this;
    }
    int rnf(){
        int n=m.size(),rnk=0;
        for(size_t j=63;j!=numeric_limits<size_t>::max();--j){
            for(size_t i=rnk;i<n;++i) if((m[i]>>j)&1u){
                swap(m[i],m[rnk]);
                break;
            }
            if(~(m[rnk]>>j)&1u) continue;
            for(size_t i=0;i<n;++i) if(((m[i]>>j)&1u)&&i!=rnk) m[i]^=m[rnk];
            ++rnk;
        }
        return rnk;
    }
};

class FXorSum3 {
public:
    void solve(istream& in, ostream& out) {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        int n,d,e;
        in>>n;
        vector<unsigned> c(60);
        vector<uint_fast64_t> a(n);
        for(auto&i:a) in>>i;
        fr(i,n) fr(j,60) if((a[i]>>j)&1u) ++c[j];
        uint_fast64_t ans{},D{},x{};
        fr(j,60){
            if(c[j]&1u) ans^=(1ul<<unsigned(j));
            else D^=(1ul<<unsigned(j));
        }
        fr(i,n) a[i]&=D;
        f2mat64 ma(a);
        ma.rnf();
        fr(i,n) x^=ma.m[i];
        out<<ans+x*2<<endl;
    }
};

int main() {
    FXorSum3 solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 1792
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        s: chars
    }
    let mut s = s;
    s.sort();
    if s[0] == s[1] && s[2] == s[3] && s[1] != s[2] {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL //デバッグ出力系
#define dout cout
#define debug() if(true)
#else
#define dout if(false) cout
#define debug() if(false)
#endif//
#define next asdnext
#define prev asdprev
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define vrep(i, v) for(auto &i : v)
#define all(x) (x).begin(),(x).end()
#define vout(v) for(auto &i:v){cout<<i<<" ";}cout<<"\n"; //配列出力
#define vin(v) for(auto &i:v)cin>>i; //配列入力
#define vec(v,n) vector<int> v(n,0);
typedef long long ll;
typedef unsigned long long ull;

void Main() {
	int N;
	cin >> N;
	vec(a, N);
	vin(a);

	int ans=0;
	for (int i = 1; i < a.size() - 1; i++) {
		if (a[i - 1] < a[i]) {
			if(a[i] < a[i + 1]) ans++;
		}
		else {
			if(a[i] > a[i + 1]) ans++;
		}
	}

	cout << ans <<"\n";
}

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


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

int main(int argc, char const *argv[])
{
    string S;
    cin >> S;
    int i1 = atoi(S.substr(0,2).c_str());
    int i2 = atoi(S.substr(2,2).c_str());
    if(1<=i1&&i1<=12&&1<=i2&&i2<=12)
        cout << "AMBIGUOUS" << endl;
    else if(0<=i1&&i1<=99&&1<=i2&&i2<=12)
        cout << "YYMM" << endl;
    else if(0<=i2&&i2<=99&&1<=i1&&i1<=12)
        cout << "MMYY" << endl;
    else
        cout << "NA" << endl;


    return 0;
}

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

using static Input;
using static Util;
class Program
{
    static int N;
    static int[] a;
    static void INPUT()
    {
        N = NextInt();
        a = LineInt();
    }

    static void OUT()
    {
        var c = 0;
        for (int i = 0; i < N; i++)
        {
            if (i % 2 == 0 && a[i] % 2 == 1)
                c++;
        }
        Console.WriteLine(c);
    }

    static void Main(string[] args)
    {
#if DEBUG  
        //TESTINPUT();
        INPUT();

#else
        INPUT();
#endif
        OUT();
    }

    static void TESTINPUT()
    {
    }

}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

class Util
{
}


Measured memory_bytes: 19108
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
signed main()
{
    SPEED;
    string s;
    cin>>s;
    int q,cnt=0;
    cin>>q;
    int t[q]={0},f[q]={0},ss[q+1]={0},r=0;
    deque<char> frnt,end;
    char c[q];
    for(int i=0;i<q;i++)
    {
        cin>>t[i];
        if(t[i]==2)
        {
            cin>>f[i]>>c[i];
        }
    }
    for(int i=q-1;i>=0;i--)
    {
        if(t[i]==1)
        {
            ss[i]=ss[i+1]+1;
        }
        else
        {
            ss[i]=ss[i+1];
        }
    }
    for(int i=0;i<q;i++)
    {
        if(t[i]==2)
        {
            if(f[i]==1)
            {
                if(ss[i]%2==0)
                {
                    frnt.push_front(c[i]);
                }
                else
                {
                    end.push_back(c[i]);
                }
            }
            else
            {
                if(ss[i]%2==0)
                {
                    end.push_back(c[i]);
                }
                else
                {
                    frnt.push_front(c[i]);
                }
            }
        }
        else
        cnt++;
    }
    if(cnt%2==1)
    {
        reverse(s.begin(),s.end());
    }
    for(auto it=frnt.begin();it!=frnt.end();++it)
    {
        cout<<*it;
    }
    cout<<s;
    for(auto it=end.begin();it!=end.end();++it)
    {
        cout<<*it;
    }
}

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

typedef long long ll;
#define pii pair<int , int>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 1005

int n , s;
int a[MAXX];

int main()
{
    _FastIO;
    cin >> n;
    for(int i = 0; i < n - 1; i++){
        cin >> a[i];
    }
    s = (a[0] + a[n - 2]);
    for(int i = 1; i < n - 1; i++){
        s += min(a[i - 1] , a[i]);
    }
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
int a, b;
scanf("%d %d",&a ,&b);
	if(a < b){
		printf("a < b\n");
	}else if(a > b){
		printf("a > b\n");
	}else if(a == b){
		printf("a == b\n");
	}
return 0;
}


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

using namespace std;

int main()
{

    int n;
    cin>>n;
    vector<int> v(n);
    for(int i = 0;i<n;i++)
    {
        cin>>v[i];
    }

    int minsofar = INT_MAX;
    int count = 0;
    for(int i = 0;i<n;i++)
    {
        minsofar = min(minsofar,v[i]);
        if(v[i] <= minsofar)
        {
            count++;
        }
    }
    
    cout<<count;
    
    return 0;
}

Measured memory_bytes: 4032
#include <iostream>
using namespace std;
int main()
{
	int sum=0,n,tmp;
	cin>>n;
	tmp=n;
	do
	{
		sum+=tmp%10;
		tmp=tmp/10;
	}while(tmp!=0);
	if(n%sum==0)
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    int n;
    cin >> n;
    string s;
    cin >> s;
    s += "0";
    char temp = s[0];
    string ans = "";
    
    for(int i = 1;i < s.size();i++){
        if(temp != s[i]){
            ans += temp;
            temp = s[i];
        }
    }
    
    cout << ans.size() << endl;
    
}


Measured memory_bytes: 640
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  ll A, B, C, X, Y;
  while (cin >> A >> B >> C >> X >> Y) {
    ll res = A * X + B * Y;
    for (int i = 0; i < 100100; i++) {
      // ABを2 * i
      res = min(res, C * i * 2 + max(0ll, X - i) * A + max(0ll, Y - i) * B);
    }
    cout << res << endl;
  }
  return 0;
}


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

int main(){
    using namespace std;
    constexpr unsigned long MOD = 1000000007;
    unsigned long N, M;
    cin >> N >> M;
    vector<unsigned long> A(N), B(M);
    for(auto&& i : A)cin >> i;
    for(auto&& i : B)cin >> i;
    A.push_back(0);
    B.push_back(0);
    sort(begin(A), end(A));
    sort(begin(B), end(B));
    unsigned long ans{1}, rem{0};
    for(unsigned long i{N * M}; i; --i)if(A.back() == i){
        A.pop_back();
        if(B.back() == i){
            B.pop_back();
            rem += N + M - size(A) - size(B);
        }else{
            (ans *= M - size(B) + 1) %= MOD;
            rem += M - size(B);
        }
    }else if(B.back() == i){
        B.pop_back();
        (ans *= N - size(A) + 1) %= MOD;
        rem += N - size(A);
    }else(ans *= rem--) %= MOD;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3648
package main

import (
	"fmt"
)

func main() {
	var b, ans string
	fmt.Scan(&b)

	if b == "A" {
		ans = "T"
	} else if b == "T" {
		ans = "A"
	} else if b == "C" {
		ans = "G"
	} else {
		ans = "C"
	}

	fmt.Println(ans)
}


Measured memory_bytes: 512
def judge(isHonest, judge_list):
    for j in judge_list:
        x, y = j 
        if isHonest[x-1] != y:
            return False
    return True  

def main():
    N = int(input())

    testimony = []
    for _ in range(N):
        A = int(input())
        testimony.append([list(map(int, input().split())) for _ in range(A)])
    
    ans = 0
    for i in range(2**N):
        judge_list = []
        isHonest = []
        for j in range(N):
            if i & (1 << j):
                judge_list += testimony[j]
                isHonest.append(1)
            else:
                isHonest.append(0)
        if judge(isHonest, judge_list):
            ans = max(ans, sum(isHonest))
    
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> w(n);
    for (int i = 0; i < n; i++) {
        cin >> w[i];
    }
    int s1=0, s2=0;
    long long min = 100000000000;
    int ans;
    for (int t = 0; t < n-1; t++) {
       for (int i = 0; i < n; i++) {
            if (i <= t) {
                s1+= w[i];
            } else {
                s2+= w[i];
            }
       } 
       if (abs(s1-s2) <= min) {
           min = abs(s1-s2);
       }
       s1=0;
       s2=0;
    }

    ans = min;
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rw freopen("input.txt","r",stdin),freopen("output.txt","w",stdout);
#define pb push_back
#define F first
#define S second
#define pf push_front
#define lp(i,a,b) for (int i=a;i<=b;++i)
#define lp2(i,a,b) for (int i=a;i>=b;--i)
#define f(x) return cout<<x<<"\n",0
#define pii pair<int,int>
#define mod 1000000007
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
#define p(x) cout<<#x<<" = { "<<x<<" } \n"
#define FAST ios::sync_with_stdio(0),ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N=1e5+4;
ll dp[1005][1005]= {};
char grid[1005][1005]= {};
int h,w;
inline bool valid(int r,int c)
{
    return r<=h&&c<=w&&grid[r][c]=='.';
}
ll solve(int r,int c)
{
    if (!valid(r,c))
        return 0;
    if (r==h&&c==w)
        return 1;
    ll &ret=dp[r][c];
    if (~ret)
        return (ret%mod);
    ret=0;
    ret=solve(r+1,c);
    if (ret>=mod)
        ret%=mod;
    ret+=solve(r,c+1);
    if (ret>=mod)
        ret%=mod;
    return ret;
}
int main()
{
#ifdef ONLINE_JUDGE
    FAST;
#endif
    cin>>h>>w;
    lp(i,1,h)
    {
        lp(j,1,w)
        cin>>grid[i][j];
    }
    memset(dp,-1,sizeof(dp));
    cout<<solve(1,1)<<"\n";
    return 0;
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  long long y;
  cin>>n>>y;
  for(int i=0;i<=n;i++){
    for(int j=0;j<=n;j++){
      long long m=y-(10000*i+5000*j);
      long long k=m/1000;
      if(m%1000==0 && i+j+k==n && m>=0){
        cout<<i<<" "<<j<<" "<<k<<endl;
        return 0;
      }
    }
  }
  cout<<-1<<" "<<-1<<" "<<-1<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;


int main(void){
  int n,i,p[200005];
  
  cin >> n;
  for (i=0;i<n;i++) cin >> p[i];
  
  int pmin=1e9,ans=0;
  for (i=0;i<n;i++){
    if (pmin>p[i]){
      ans++;
      pmin=p[i];
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 1024
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        for(int i = 0; i < N; i++) {
            set.add(sc.nextInt());
        }
        System.out.println(set.size());
    }
}


Measured memory_bytes: 22612
#include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
	#define DBG(X) cout << #X << "=" << (X) << '\n';
	#define SAY(X) cout << (X) << '\n';
#else
	#define DBG(X)
	#define SAY(X)
#endif
 
using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld  = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF  = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for(auto el: v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for(auto& elem: ret) cin >> elem; return ret; }

const int MOD  = (int)1e9 + 7;

int add(int x, int y) {
	return (x + y >= MOD ? x + y - MOD : x + y);
}

int mult(int x, int y) {
	return (x * 1LL * y) % MOD;
}

int binpow(int x, int y) {
	if(y == 0 || x == 1) return 1;
	if(x == 0) return 0;
	ll rez = binpow(x, y/2);
	rez = mult(rez, rez);
	if(y&1) rez = mult(rez, x);
	return rez;
}

int divide(int x, int y) {
	return mult(x, binpow(y, MOD - 2));
}

const int MAXN = (int)1e6 + 77;
int a[MAXN], n;
int lp[MAXN];
int cnt[MAXN];

void solve() {
	cin >> n; for(int i = 0; i < n; ++i) cin >> a[i];
	for(int i = 2; i < MAXN; ++i) {
		for(int j = i; j < MAXN; j += i) {
			if(lp[j] == 0) lp[j] = i;
		}
	}

	for(int i = 0; i < n; ++i) {
		int v = a[i];
		while(v > 1) {
			int p = lp[v];
			int cur = 0;
			while(v%p == 0) {
				++cur;
				v /= p;
			}
			cnt[p] = max(cnt[p], cur);
		}
	}

	int LCM = 1;
	for(int p = 1; p < MAXN; ++p) {
		LCM = mult(LCM, binpow(p, cnt[p]));
	}
	int answ = 0;
	for(int i = 0; i < n; ++i) {
		answ = add(answ, divide(LCM, a[i]));
	}
	cout << answ << '\n';
}

int main() {
	fast_io();
	solve();

	return 0;
}


Measured memory_bytes: 8192
#include<stdio.h>
int main(void) {
	int a[1000], b[1000],x,c,d,e,f;
	int i = 0;
	int r = 1;
	while (r) {
		scanf("%d %d",&a[i],&b[i]);
		if(a[i] == 0 && b[i] == 0) {
			r = 0;
		}
		i++;
	}
	for (x = 0; x < i; x++) {
		c = a[x];
		d = b[x];
		for (e = 0; e < a[x]; e++) {
			for (f = 0; f < b[x]; f++) {
				printf("#");
			}
			printf("\n");
		}
		if (x != i - 1) {
			printf("\n");
		}
	}
	return 0;
}


Measured memory_bytes: 2104
#include<stdio.h>
int main(){
  int h,w,i,j,t=0;
  char c;
  scanf("%d%d",&h,&w);
  for(i=0;i<h;i++){
    for(j=0;j<=w;j++){
      scanf("%c",&c);
      if(c=='#') t++;
    }
  }
  puts(t==h+w-1?"Possible":"Impossible");
}

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

const int MAX = 100000;
int main() {
	static int n, v[2][MAX];
	cin >> n;
	for (int i = 0;i < n;++ i) cin >> v[i & 1][i >> 1];
	for (int i = 0;i < 2;++ i) {
		sort(v[i], v[i]+ (n >> 1));
	}
	
	static pair<int, int> freq[2][MAX]; // 数と出現数
	int index[2] = {1, 1};
	for (int i = 0;i < 2;++ i) {
		freq[i][0] = make_pair(0, 0); // 番兵
		freq[i][1] = make_pair(1, v[i][0]);
	}
	for (int i = 1;i < n >> 1;++ i) {
		for (int j = 0;j < 2;++ j) {
			if (v[j][i] == v[j][i - 1]) ++ freq[j][index[j]].first; // 前回と同値ならそっちに加算
			else {
				++ index[j];
				freq[j][index[j]] = make_pair(1, v[j][i]); // そうでないなら新しく作る
			}
		}
	}
	for (int i = 0;i < 2;++ i) sort(freq[i], freq[i]+index[i]+1);
	
	if (freq[0][index[0]].second != freq[1][index[1]].second) cout << n - freq[0][index[0]].first - freq[1][index[1]].first;
	else cout << n - max(freq[0][index[0] - 1].first + freq[1][index[1]].first, freq[0][index[0]].first + freq[1][index[1] - 1].first);
	
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

a_奇数とa_偶数にもっとも頻出する数字を選び、それ以外を変えれば良い

と思ったら同値ダメなのか、面倒な
*/

Measured memory_bytes: 1408
#include <stdio.h>
#include <algorithm>
typedef long long ll;
using namespace std;

int main(void) {
  ll i, j, k, a, b, q, x;
  scanf("%lld%lld%lld", &a, &b, &q);
  ll s[a], t[b];
  for(i = 0; i < a; ++i) scanf("%lld", &s[i]);
  for(i = 0; i < b; ++i) scanf("%lld", &t[i]);
  for(i = 0; i < q; ++i) {
    scanf("%lld", &x);
    ll ans = 1e18, bs = -1e18, as = 1e18, bt = -1e18, at = 1e18;
    if(upper_bound(s, s + a, x) != s) bs = s[upper_bound(s, s + a, x) - s - 1];
    if(upper_bound(t, t + b, x) != t) bt = t[upper_bound(t, t + b, x) - t - 1];
    if(lower_bound(s, s + a, x) != s + a) as = *(lower_bound(s, s + a, x));
    if(lower_bound(t, t + b, x) != t + b) at = *(lower_bound(t, t + b, x));
    ans = x + at - 2 * bs;
    if(ans > x + as - 2 * bt) ans = x + as - 2 * bt;
    if(ans > 2 * at - x - bs) ans = 2 * at - x - bs;
    if(ans > 2 * as - x - bt) ans = 2 * as - x - bt;
    if(ans > max(as, at) - x) ans = max(as, at) - x;
    if(ans > -min(bs, bt) + x) ans = -min(bs, bt) + x;
    printf("%lld\n", ans);
  }
  return 0;
}

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a, b, c, d;
    a.resize(n);
    b.resize(n);
    c.resize(m);
    d.resize(m);

    rep(i, n) { cin >> a[i] >> b[i]; }
    rep(i, m) { cin >> c[i] >> d[i]; }
    int minp, mind;

    rep(i, n) {
        minp = 0;
        mind = 1e9 + 7;
        rep(j, m) {
            int dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
            if(dis < mind) {
                minp = j;
                mind = dis;
            }
        }
        cout << minp + 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
int r;
  int g;
  int b;
  cin >>r>>g>>b;
  int x=100*r+10*g+b;
  if((x%4)==0) {
cout << "YES" << endl;
  }
else {
cout << "NO" << endl;
}
}

Measured memory_bytes: 256
N = gets.to_i
G = Array.new(N + 1){[]}
(N - 1).times do
  a, b, c = gets.split.map(&:to_i)
  G[a] << [b, c]; G[b] << [a, c]
end
Q, K = gets.split.map(&:to_i)

d = Array.new(N + 1)
d[K] = 0
s = [[K, -1]]
until s.empty?
  v, p = s.pop
  G[v].each do |i, c|
    unless i == p
      d[i] = d[v] + c
      s << [i, v]
    end
  end
end
Q.times{puts gets.split.inject(0){|s, x| s + d[x.to_i]}}

Measured memory_bytes: 29588
/*
         ██╗ ██████╗ ██╗███╗   ██╗    ██╗   ██╗███████╗
         ██║██╔═══██╗██║████╗  ██║    ██║   ██║██╔════╝
         ██║██║   ██║██║██╔██╗ ██║    ██║   ██║███████╗
    ██   ██║██║   ██║██║██║╚██╗██║    ██║   ██║╚════██║
    ╚█████╔╝╚██████╔╝██║██║ ╚████║    ╚██████╔╝███████║
     ╚════╝  ╚═════╝ ╚═╝╚═╝  ╚═══╝     ╚═════╝ ╚══════╝
*/
//password:+BdCHpO8dQvpo5fnV3/u
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn = 5e5 + 5;
const int inf = 0x3f3f3f3f;
int 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;
    return 0;
}

 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std ;
template < class R > inline void Readin( R &K ) {
	K = 0 ; bool F = false ; char C = getchar() ; while( C < '0' or C > '9' ) { if( C == '-' ) F = true ; C = getchar() ; }
	while( C <= '9' and C >= '0' ) K = ( K << 1 ) + ( K << 3 ) + C - '0' , C = getchar() ; if( F ) K = -K ;
}
template < class R > inline void Checkmax( R &A , R B ) {
	if( A < B ) A = B ;
}
template < class R > inline void Checkmin( R &A , R B ) {
	if( A > B ) A = B ;
}
const int MaxN = 100 + 10 ;
int Odds ;
int N , M , A[MaxN] , Fir , Las ;
int main() {
	Readin( N ) ;
	Readin( M ) ;
	for(register int i = 0 ; ++i <= M ; ) {
		Readin( A[i] ) ;
		Odds += ( A[i] & 1 ) ;
	}
	if( M == 1 ) {
		if( A[1] == 1 ) return not printf( "1\n1\n1\n" ) ;
			else return not printf( "%d\n2\n1 %d\n", A[1] , A[1] - 1 ) ;
	}
	if( Odds > 2 ) return not printf( "Impossible\n" ) ;
	if( Odds ) {
		for(register int i = 1 ; ; ++i )
			if( A[i] & 1 ) {
				Fir = i ;
				printf( "%d " , A[i] ) ;
				break ;
			}
	} else Fir = 1 ;
	for(register int i = 0 ; ++i <= M ; )
		if( ( A[i] & 1 ) == 0 )
			printf( "%d " , A[i] ) ;
	if( Odds > 1 ) {
		for(register int i = M ; ; --i )
			if( A[i] & 1 ) {
				Las = i ;
				printf( "%d " , A[i] ) ;
				break ;
			}
	} else Las = M - ( Fir == M ) ;
	printf( "\n%d\n" , M - ( A[Fir] == 1 ) ) ;
	if( A[Fir] != 1 ) printf( "%d " , A[Fir] - 1 ) ;
	for(register int i = 0 ; ++i <= M ; )
		if( i != Fir and i != Las )
			printf( "%d " , A[i] ) ;
	return not printf( "%d\n" , A[Las] + 1 ) ;
}

Measured memory_bytes: 256
function Main(input) {
  var temp;
  var temp2;
  input = input.split("\n");
  temp = input[0].split(' ');
  temp2 = input[1].split(' ');

  var N = +temp[0];
  var K = +temp[1];
  var A1 = +temp2[0];
  var A2 = +temp2[1];
  var A3 = +temp2[2];
  var A4 = +temp2[3];
  var result = Math.floor((N - 1) / (K - 1));

  if((N - 1) % (K - 1) === 0) {
    console.log(result);
  } else {
    console.log(result + 1);
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 16716
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=100000+10;
int n,k,h[maxn],dp[maxn];
int main()
{
	cin>>n>>k;
	for(int i=1;i<=n;i++)cin>>h[i];
	memset(dp,0x3f3f3f3f,sizeof(dp));
	dp[1]=0;
	for(int i=2;i<=n;i++)
	{
		for(int j=1;j<=k;j++)
		{
			if(i-j>=1)
			dp[i]=min(dp[i],dp[i-j]+abs(h[i]-h[i-j]));	
		}
	}
	cout<<dp[n]<<endl;
	return 0;
}
//Phoenix-ZH

Measured memory_bytes: 4396
use std::collections::BinaryHeap;
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n = read::<usize>();
    let m = read::<usize>();
    let mut items = vec![(0, 0); n];
    for i in 0..n {
        let a = read::<usize>();
        let b = read::<usize>();
        items[i] = (a, b);
    }
    items.sort();
    let mut index = 0;
    let mut ans = 0;
    let mut heap = BinaryHeap::<usize>::new();
    for i in 0..m {
        while index < n && items[index].0 <= i + 1 {
            heap.push(items[index].1);
            index += 1;
        }
        if let Some(v) = heap.pop() {
            ans += v;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 8444
N = int(input())
S = list(input())

L = [chr(i) for i in range(97, 123)]

X = []
for i in L:
    X.append(S.count(i))

s = 1
for i in X:
    s = (i + 1) * s
    s = s % 1000000007

print(s - 1)

Measured memory_bytes: 3956
//pragma
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

#define YOU using
#define DONT namespace
#define SAY std

YOU DONT SAY;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define REPP(i,a,b,d) for(int i=a;i<=b;i+=d)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,d) for(int i=a;i>=b;i-=d)
#define REV(i,a,b) REVV(i,a,b,1)

#define FOR(i,a) for(int i=0; i<a; i++)
#define FORD(i,a) for(int i=(int)a-1; i>=0; i--)

#define mp make_pair

#define pb push_back
#define F first
#define S second

const int OO = 1e9;
const ll INF = 1e18;

const int irand(int lo,int hi){
    return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}

const ll lrand(ll lo,ll hi){
    return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}

#define getc getchar
template<typename T>
T getnum(){
    int sign = 1;
    T ret = 0;
    char c;

    do{
        c = getc();
    }while(c == ' ' || c == '\n');
    if(c == '-')sign = -1;
    else ret = c-'0';
    while(1){
        c = getc();
        if(c < '0' || c > '9')break;
        ret = 10*ret + c-'0';
    }
    return sign * ret;
}

inline void ini(int& x){
    x = getnum<int>();
}

inline void scani(int& x){
    scanf("%d",&x);
}

//end of macro

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #define endl '\n'
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(10);

    string str;
    cin>>str;
    str[3] = '8';
    cout << str << endl;

    return 0;
}


Measured memory_bytes: 256
program main

    integer H1,H2,M1,M2,K,ANS
    ANS = 0
    read *,H1,M1,H2,M2,K
    ANS = ( H2 * 60 + M2 ) - ( H1 * 60 + M1 ) - K
    print *,ANS
    end program main

Measured memory_bytes: 2856