akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pl;
#define all(a) (a).begin(),(a).end()
#define overload4(_1, _2, _3, _4, name, ...) name
#define rep1(n) for(ll i = 0;i < (n);i++)
#define rep2(i,n) for(ll i = 0;i < (n);i++)
#define rep3(i,a,b) for(ll i = (a);i < (b);i++)
#define rep4(i,a,b,c) for(ll i = (a);i < (b);i += (c))
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep1(n) for(ll i = (n)-1;i >= 0;i--)
#define rrep2(i,n) for(ll i = (n)-1;i >= 0;i--)
#define rrep3(i,a,b) for(ll i = (a)-1;i >= (b);i--)
#define rrep4(i,a,b,c) for(ll i = (a)-1;i >= (b);i -= (c))
#define rrep(...) overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define SHOW(x) cout << #x << ": " << x << endl;
template<class T> ll sumArr(const T& a){ return accumulate(all(a), 0LL);}
template<class T> auto minArr(const T& a){ return *min_element(all(a));}
template<class T> auto maxArr(const T& a){ return *max_element(all(a));}
template<class T> void DEBUG_PRINT(T tmp){cout<<tmp<<endl;}
template<class T1,class... T2> void DEBUG_PRINT(T1 tmp,T2... tmp2){cout<<tmp<<" ";DEBUG_PRINT(tmp2...);}
ll gcd(ll a, ll b){ while(b){ ll c = b; b = a % b; a = c; } return a; }
const ll INF=1e18,MOD = 1e9+7;
const int iINF = 1e9;

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

    int s,w;
    cin>>s>>w;
    if(s > w)cout<<"safe"<<endl;
    else cout<<"unsafe"<<endl;

    return 0;
}

Measured memory_bytes: 3652
/*
Author: Xjrjyy
LANG: C++
PROG: abc177_a.cpp
Mail: admin@xjrjyy.com
Blog: https://blog.xjrjyy.cn/
*/

#include <cstdio>
#include <cctype>
#include <vector>
#include <iostream>

#define MAXN ()

int d, t, s;

int main()
{
    scanf("%d%d%d", &d, &t, &s);
    puts(d <= t * s ? "Yes" : "No");
    return 0;
}


Measured memory_bytes: 3724
#include<stdio.h>
int main(void)
{
  int i,j,h,w;
  scanf("%d %d",&h,&w);
  while(h!=0 || w!=0){
    for(i=0;i<h;i++){
      for(j=0;j<w;j++)  printf("#");
      printf("\n");
    }
    printf("\n");
    scanf("%d %d",&h,&w);
  }

  return 0;
}

Measured memory_bytes: 572
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  char c[N];
  for (int i = 0; i<N; i++){
    cin >> c[i];
  }
  int count = N;
  for (int i = 1; i < N; i++){
    if (c[i-1]==c[i]) count--;
  }
  cout << count;
}

Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <random>
#include <vector>
#include <array>
#include <bitset>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>

using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
int bsr(int x) { return 31 - __builtin_clz(x); }

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20);
    int n, l;
    cin >> n >> l;
    int a[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    for (int i = 0; i < n-1; i++) {
        if (a[i]+a[i+1] >= l) {
            cout << "Possible" << endl;
            for (int j = 0; j < i; j++) {
                cout << j+1 << endl;
            }
            for (int j = n-1; j >= i+1; j--) {
                cout << j << endl;
            }
            return 0;
        }
    }
    cout << "Impossible" << endl;
    return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x, a, b;
  cin >> x >> a >> b;
  if (b - a <= 0) { cout << "delicious" << endl; }
  else if (b - a <= x) { cout << "safe" << endl; }
  else { cout << "dangerous" << endl; }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(int i=(n);i<(m);i++)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) for(int i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<int,int>;
using PP=pair<int,P>;
using Pl=pair<ll,ll>;
using PPl=pair<ll,Pl>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
int main(){
    int n;
    cin>>n;
    int x=0;
    FOR(i,1,n+1){
        int t=0;
        FOR(j,1,i+1){
            if(!(i%j)){
                t++;
            }
        }
        if(i%2&&t==8){
            x++;
        }
    }
    cout<<x<<endl;
    return 0;
}

Measured memory_bytes: 256
N=input()
n=N[-1:]
n=int(n)

if(n==3):
  print("bon")
elif(n==0):
  print("pon")
elif(n==1):
  print("pon")
elif(n==6):
  print("pon")
elif(n==8):
  print("pon")
else:
  print("hon")

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

int main(){
    int x,y;
    cin>>x>>y;
    if(y%2==1){
        cout<<"No"<<endl;
        return 0;
    }
    if(2*x<=y&&y<=4*x){
        cout<<"Yes"<<endl;
    }
    else cout<<"No"<<endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define DESCEND greater<int>()  // sort 降順 大きい順
#define UNIQUE(vec) (vec).erase(unique(ALL((vec))), (vec).end());  // 必ずsortを行なってから
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007


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

    // input
    string A, B, C;
    cin >> A >> B >> C;
    
    // calculation
    if (A.back() == B.front() && B.back() == C.front()) {
        cout << "YES" << "\n";
    } else{
        cout << "NO" << "\n";
    }
    
    return 0;
}


Measured memory_bytes: 256
// JavaProgram.cpp
// Author : Priydarshi Singh (@dryairship)
// One cat just leads to another. One bug leads to two others.

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

// I like my types defined.
typedef long long           ll;
typedef pair<int, int>      pii;
typedef pair<ll, ll>        pll;
typedef vector<int>         vi;
typedef vector<ll>          vl;
typedef vector<pii>         vii;
typedef vector<pll>         vll;
typedef set<int>            si;
typedef map<string, int>    msi;
typedef map<int, int>       mii;

// Traditional science is all about finding "hashtag define"s.
#define fr(i, n)            for(int i=0; i<(n); ++i)
#define frC(i, n, c)        for(int i=0; (i<(n)) && (c); ++i)
#define frA(i, a, n)        for(int i=a; i<=(n); ++i)
#define frD(i, a, n)        for(int i=a; i>=(n); --i)
#define fill(a)             memset(a, 0, sizeof(a))
#define fill1(a)            memset(a, -1, sizeof(a))
#define revsort(a, b)       sort(a, b, greater<int>())
#define ff                  first
#define ss                  second
#define pb                  push_back 
#define dout                if(DEBUGGING) cout
#define dbg                 if(DEBUGGING) 
#define endl                "\n"

// When you realize MOD > INF...
int DEBUGGING    =          0;
const int INF    =          1000000000;
const int MOD    =          1000000007;
const ll LINF    =          1e18;
const double PI  =          3.1415926535897932;
const double EPS =          1e-7;

// I'D SPAM. Hehe.
ll gcdEx                    (ll a, ll b, ll *x, ll *y){if(!a){*x=0;*y=1;return b;} 
ll x1,y1,gcd=gcdEx          (b%a,a,&x1,&y1); *x=y1-(b/a)*x1;*y=x1; return gcd;}
ll modI(ll b, ll m)         {ll x,y;gcdEx(b,m,&x,&y);return (x%m+m)%m;}
ll modD(ll a, ll b)         {return (modI(b,MOD)*(a%MOD))%MOD;}
ll modS(ll a, ll b)         {return ((a%MOD)-(b%MOD)+MOD)%MOD;}
ll modP(ll x, ll y)         {ll r=1; x%=MOD; while(y>0){if(y&1){r=(r*x)%MOD;} y=y>>1; x=(x*x)%MOD;} return r;}
ll modA(ll a, ll b)         {return ((a%MOD)+(b%MOD))%MOD;}
ll modM(ll a, ll b)         {return ((a%MOD)*(b%MOD))%MOD;}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int a[100005];
int dp[100005];

void solve(int TEST_CASE){
    int n;
    cin >> n;
    fr(i,n) cin >> a[i];
    fr(i,n) dp[i]=INF;
    dp[0]=0;
    fr(i,n){
        dp[i+1] = min(dp[i+1], dp[i]+abs(a[i+1]-a[i]));
        dp[i+2] = min(dp[i+2], dp[i]+abs(a[i+2]-a[i]));
    }
    cout << dp[n-1];
}

int main(int argc, char* argv[]){
    if(argc==2 && argv[1][1]=='v') DEBUGGING = 1;
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin.exceptions(cin.failbit);
    int nTestCases=1;
    //cin >> nTestCases;
    frA(i,1,nTestCases) solve(i);
    return 0;
}

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

///Author:Refat(BSMRSTU)///

#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define pii pair<int,int>
#define pil pair<int,ll>
const int N = 1e5 + 5;
const int M = 1e9 + 7;
double pi=2*acos(0.0);
int Set(int N,int pos) {
    return N=N | (1<<pos);
}
int reset(int N,int pos) {
    return N= N & ~(1<<pos);
}
bool check(int N,int pos) {
    return (bool)(N & (1<<pos));
}
ll ar[2005];
ll binarysearch(int v1,int v2,ll l,ll r) {
    int ans=0;
    while(l<=r) {
        int mid=(l+r)>>1;
        if(v1+v2<=ar[mid]) {
            r=mid-1;
            ans=mid;
        } else {
            l=mid+1;
        }
    }
    return ans;
}
int main() {
    /// freopen("input.txt","r",stdin);
    /// freopen("output.txt","w",stdout);

    ll total=0,n;
    scanf("%lld",&n);
    for(int i=1; i<=n; i++) {
        scanf("%lld",&ar[i]);
    }
    total=(n*(n-1ll)*(n-2ll))/6ll;
    sort(ar+1,ar+n+1);
    /*for(int i=1; i<=n; i++) {
       cout<<ar[i]<<" ";
    }cout<<endl;*/
    for(int i=1; i<n; i++) {
        for(int j=i+1; j<n; j++) {
            ll pos=binarysearch(ar[i],ar[j],j+1,n);
            //cout<<pos<<" "<<i<<" "<<j<<endl;
            if(pos!=0)
                total-=(n-(pos)+1);
        }
    }
    printf("%lld\n",total);
    return 0;
}



Measured memory_bytes: 384
#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll a, b, c, d;
	cin>>a>>b>>c>>d;
	ll ans = LLONG_MIN;
	ans = max(ans, a * c);
	ans = max(ans, a * d);
	ans = max(ans, b * c);
	ans = max(ans, b * d);
	cout<<ans<<'\n';
	return 0;
}
/*
clock_t start, end; 
start = clock();
end = clock();
double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
cout<<time_taken<<endl;
* */


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

int main(){
  int n;
  cin>>n;
  vector<int>h(n);
  for(int i=0;i<n;i++){
    cin>>h[i];
  }
  h[0]--;
  for(int i=1;i<n;i++){
    if(h[i]<h[i-1]){
      cout<<"No"<<endl;
      return 0;
    }
    else if(h[i]>h[i-1]){
      h[i]--;
    }
  }
  cout<<"Yes"<<endl;
}
      
      


Measured memory_bytes: 640
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:usize,
    b:usize,
    c:usize,
    }
    println!("{}",max(a,max(b,c))-min(a,min(b,c)))
}

Measured memory_bytes: 2164
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 10;

int main() {
	ios::sync_with_stdio(false);
	ll n, num;
	while(cin >> n) {
		cin >> num;
		ll gcd = num;
		for(int i = 0; i < n - 1; i++) {
			cin >> num;
			gcd = __gcd(gcd, num);
		}
		cout << gcd << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <utility>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
int dp[1001][1001] = {};

int getLCS(string X, string Y)
{
    int m = 0;
    for (int i = 1; i <= X.size(); i++)
    {
        for (int j = 1; j <= Y.size(); j++)
        {
            dp[i][j] = X[i - 1] == Y[j - 1] ? dp[i - 1][j - 1] + 1 : max(dp[i - 1][j], dp[i][j - 1]);
            m = max(m, dp[i][j]);
        }
    }
    return m;
}

int main()
{
    int q;
    string X, Y;
    cin >> q;
    for (int i = 0; i < q; i++)
    {
        cin >> X >> Y;
        cout << getLCS(X, Y) << "\n";
    }
    return 0;
}


Measured memory_bytes: 7040
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int H, W, N, diff = 0;
	static pair<int, int> point[200000];
	cin >> H >> W >> N;
	for (int i = 0;i < N;++ i) cin >> point[i].first >> point[i].second;
	sort(point, point+N); // X昇順、同値ならY昇順
	for (int i = 0;i < N;++ i) {
		if (point[i].first - point[i].second - diff > 0) H = min(H, point[i].first - 1); // この障害物を使って邪魔する
		else if (point[i].first - point[i].second - diff == 0) ++ diff; // 青木君が移動できないので、上を抜けるしかない
	}
	cout << H;
	return 0;
}

Measured memory_bytes: 1792
import sys
from collections import Counter
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

S = input()
T = input()

s = Counter(S)
t = Counter(T)

if sorted(s.values()) == sorted(t.values()):
    print("Yes")
else:
    print("No")



Measured memory_bytes: 4136
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false);cin.tie(0);cout.precision(10);cout << fixed
#define endl '\n'

const ll MOD = 1e9 + 7;
struct mint {
    ll x;
    mint() : x(0) {}
    mint(ll x) : x((x % MOD + MOD) % MOD) {}
    mint& operator+=(const mint& r) { if ((x += r.x) >= MOD) { x -= MOD; } return *this; }
    mint& operator-=(const mint& r) { if ((x -= r.x) < 0) { x += MOD; } return *this; }
    mint& operator*=(const mint& r) { if ((x *= r.x) > MOD) { x %= MOD; } return *this; }
    mint& operator++() { if ((++x) >= MOD) { x -= MOD; } return *this; }
    mint operator++(int) { mint ret = x; if ((++x) >= MOD) { x-= MOD; } return ret; }
    mint& operator--() { if ((--x) < 0) { x += MOD; } return *this; }
    mint operator--(int) { mint ret = x; if ((--x) < 0) { x += MOD; } return ret; }
    mint operator+(const mint& r) { mint ret; return ret = x + r.x; }
    mint operator-(const mint& r) { mint ret; return ret = x - r.x; }
    mint operator*(const mint& r) { mint ret; return ret = x * r.x; }
    mint operator-() { return mint() - *this; }
    bool operator<(const mint& a) { return x < a.x; }
    bool operator>(const mint& a) { return x > a.x; }
    bool operator<=(const mint& a) { return x <= a.x; }
    bool operator>=(const mint& a) { return x >= a.x; }
    bool operator==(const mint& a) { return x == a.x; }
    bool operator!=(const mint& a) { return x != a.x; }
};
ostream& operator<<(ostream& os, const mint& r) { os << r.x; return os; }
ostream& operator>>(ostream& os, const mint& r) { os >> r.x; return os; }

void solve(istream& cin, ostream& cout) {
  int n;
  string input;
  cin >> n;
  map<string, int> s;
  REP(i, n) {
    cin >> input;
    s[input]++;
  }
  map<int, set<string>> ans;
  EACH(a, s) {
    ans[a.second].insert(a.first);
  }
  EACH(r, ans.rbegin()->second) {
    cout << r << endl;
  }
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
}
#endif


Measured memory_bytes: 33280
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[][] list = new int[N][100];
		for(int i = 0; i < N; i++) {
			int a = sc.nextInt();
			for(int j = 1; j <= 100; j++) {
				list[i][j-1] = (j-a)*(j-a);
			}
		}
		int ans = listCheck(list);
		System.out.println(ans);
	}
	
	public static int listCheck(int[][] list) {
		int ans = Integer.MAX_VALUE;
		for(int i = 0; i < 100; i++) {
			int check = 0;
			for(int j = 0; j < list.length; j++) {
				check += list[j][i];
			}
			if(ans > check) {
				ans = check;
			}
		}
		return ans;
	}
}

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

using namespace std;

#define JAM(x) cout << #x << " = " << x << "\n"
#define II() ({ int a ; read(a) ; a; })
#define LL() ({ ll a ; read(a) ; a; })
#define DD() ({double a; scanf("%lf", &a); a; })

//Fast Reader
template <class T>
inline bool read(T &x)
{
    int c = getchar();
    int sgn = 1;
    while (~c && c < '0' || c > '9')
    {
        if (c == '-')
            sgn = -1;
        c = getchar();
    }
    for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
    x *= sgn;
    return ~c;
}

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPI;

const int INF = 2e9;
const int MX = 100005;
const int MOD = 1000000007;
const double PI = acos(-1.0);



long long int power(long long int a, long long int b)
{
    a %= MOD;
    long long int res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}
bool isprime(int n)
{
    if (n == 1)
        return false;
    for (int i = 2; i * i <= n; i++)
    {
        if (n % i == 0)
            return false;
    }
    return true;
}



/*_______________________________________________*/



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int x;
    cin>>x;
    cout<<(!x);
}

Measured memory_bytes: 3608
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

const ll MOD = 1000000007;
const ll MAX = 2000001;

ll mod(ll a){
  return a % MOD;
}

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

ll fac[MAX], finv[MAX], inv[MAX];

void nCrprep() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll nCr(ll n, ll r){
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

ll nCrcheep(ll n,ll r){
  if(r == 0) return 1;
  else if(r == 1) return n;
  else return nCrcheep(n-1,r-1)*n/r;
}

vector<pair<ll,ll>> prime_factorize(ll n){
  vector<pair<ll,ll>> res;
  
  for(ll i=2; i*i <= n; i++){
    if(n % i != 0) continue;
    
    ll ex = 0;
    while(n % i == 0){
      ex++;
      n /= i;
    }
    
    res.push_back({i,ex});
  }
  
  if(n != 1) res.push_back({n,1});
  
  return res;
  
}




int main(){
  ll h,w,k; cin >> h >> w >> k; ll ans = 0;
  vector<vector<char>> table(h,vector<char>(w));
  
  rep(i,h){
    rep(j,w){
      cin >> table[i][j];
    }
  }
  
  for (int bit = 0; bit < (1<<h); ++bit) {
    vector<int> S; 
    for (int i = 0; i < h; ++i) {
      if (bit & (1<<i)) { // 列挙に i が含まれるか
        S.push_back(i);
      }
    }
    for(int bit2 = 0; bit2 < (1<<w); ++bit2){ 
      vector<int> S2;
      for(int a = 0; a < w; ++a){
        if(bit2 & (1<<a)){
          S2.push_back(a);
        }
      }
    
     
    auto tablecopy = table;
    for(ll x : S){
      rep(b,w){
        tablecopy[x][b] = 'r';
      }
    }
    for(ll x : S2){
      rep(c,h){
        tablecopy[c][x] = 'r';
      }
    }
    
    ll cnt = 0;
    
    
    rep(d,h){
      rep(e,w){
        if(tablecopy[d][e] == '#') cnt++;
      }
    }

    
    if(cnt == k) ans++;
  } 
      
      
      
      
    }
    

  
  cout << ans << endl;
  
  
  
}

Measured memory_bytes: 3620
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

s = list(input())
n = len(s)
for i in range(n):
    if s[i] == ',':
        s[i] = ' '
print(''.join(s))



Measured memory_bytes: 5488
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
#include<cmath>
#include<set>
#include<random>
#include<map>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
const long long mod = 1000000007;
const long long inf = 1145141919810;
typedef pair<int, int> P;
typedef pair<P, P> PP;
struct edge {int to, cost;};
signed main() {
	int a, b, c, k; cin >> a >> b >> c >> k;
	if (k & 1)cout << b-a << endl;
	else cout << a-b << endl;
}

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

const int mxN = 2e5 + 5;
int N, h[mxN], a[mxN];
ll tree[4 * mxN];

ll query(int l, int r, int ql, int qr, int node) {
	if (ql > r || qr < l) {
		return 0;
	}
	if (ql <= l && qr >= r) {
		return tree[node];
	}
	int mid = l + (r - l) / 2;
	return max(query(l, mid, ql, qr, 2 * node), query(mid + 1, r, ql, qr, 2 * node + 1));
}

void update(int l, int r, int idx, ll val, int node) {
	if (l == r) {
		tree[node] = val;
	} else {
		int mid = l + (r - l) / 2;
		if (idx >= l && idx <= mid) {
			update(l, mid, idx, val, 2 * node);
		} else if (idx > mid && idx <= r) {
			update(mid + 1, r, idx, val, 2 * node + 1);
		}
		tree[node] = max(tree[2 * node], tree[2 * node + 1]);
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> h[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	ll ans = 0;
	for (int i = 0; i < N; i++) {
		ll val = a[i] + query(1, N, 1, h[i] - 1, 1);
		update(1, N, h[i], val, 1);
		ans = max(ans, val);
	}
	cout << ans;
	
	return 0;
}


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


def main():
    S = input().rstrip()
    K = int(input())

    N = len(S)
    if S == S[0] * N:
        ans = (N * K) // 2
    elif S[0] == S[-1]:
        a = 1
        for i in range(N):
            if S[i] == S[i+1]:
                a += 1
            else:
                break
        b = 1
        for i in reversed(range(N)):
            if S[i-1] == S[i]:
                b += 1
            else:
                break
        seq = 1
        ans = 0
        for i in range(a, N-b):
            if S[i] == S[i+1]:
                seq += 1
            elif seq > 1:
                ans += seq//2
                seq = 1
        if seq > 1:
            ans += seq//2
        ans *= K
        ans += a//2
        ans += (a+b)//2 * (K-1)
        ans += b//2
    else:
        seq = 1
        ans = 0
        for i in range(N-1):
            if S[i] == S[i+1]:
                seq += 1
            elif seq > 1:
                ans += seq//2
                seq = 1
        if seq > 1:
            ans += seq//2
        ans *= K

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;
#define PI 3.14159265359
#define tMOD 998244353
#define mkpr(x,y) make_pair(x,y)




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


    if(N%2==0){
        cout<<N/2<<endl;
    }
    else{
        cout<<(N+1)/2<<endl;
    }



}


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

int main(void){
    int a, b;
    cin >> a >> b;
    string s = to_string(a)+to_string(b);
    int z = stoi(s);

    float f = sqrt(z);
    if(floor(f) == f)
        cout << "Yes";
    else 
        cout << "No";
    return 0;
}


Measured memory_bytes: 3616
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int ck(int cd[]){
	rep(i,9){
		while(cd[i]>=3)cd[i]-=3;
		while(cd[i]){
			cd[i]--,cd[i+1]--,cd[i+2]--;
			if(cd[i+1]<0||cd[i+2]<0)return 0;
		}
	}
	return 1;
}
int main(){
	int n; cin>>n;
	while(n--){
		int r[11]={0},g[11]={0},b[11]={0};
		
		int nm[9]; char cl[9];
		rep(i,9)cin>>nm[i],nm[i]--; rep(i,9)cin>>cl[i];
		rep(i,9){
			int t=nm[i];
			if(cl[i]=='R')r[t]++;
			else if(cl[i]=='G')g[t]++;
			else b[t]++;
		}
		
		cout<<(ck(r)&&ck(g)&&ck(b))<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
// https://atcoder.jp/contests/abc178/tasks/abc178_c
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define CEIL(a, b) ((a - 1) / b + 1)

const int MOD = 1e9 + 7;

// 参考
// https://atcoder.jp/contests/s8pc-1/submissions/15772604
template <int mod> struct ModInt {
    int x;

    ModInt() : x(0) {}

    ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) {
        if ((x += p.x) >= mod)
            x -= mod;
        return *this;
    }

    ModInt &operator-=(const ModInt &p) {
        if ((x += mod - p.x) >= mod)
            x -= mod;
        return *this;
    }

    ModInt &operator*=(const ModInt &p) {
        x = (int)(1LL * x * p.x % mod);
        return *this;
    }

    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }

    ModInt operator-() const { return ModInt(-x); }

    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }

    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const {
        int a = x, b = mod, u = 1, v = 0, t;
        while (b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }

    ModInt pow(int64_t n) const {
        ModInt ret(1), mul(x);
        while (n > 0) {
            if (n & 1)
                ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }

    friend ostream &operator<<(ostream &os, const ModInt &p) {
        return os << p.x;
    }

    friend istream &operator>>(istream &is, ModInt &a) {
        int64_t t;
        is >> t;
        a = ModInt<mod>(t);
        return (is);
    }

    static int get_mod() { return mod; }
};

using mint = ModInt<MOD>;

void solve() {
    int N;
    cin >> N;
    if (N == 1) {
        cout << 0 << endl;
    } else {
        cout << static_cast<mint>(10).pow(N) - static_cast<mint>(9).pow(N) * 2 +
                    static_cast<mint>(8).pow(N)
             << endl;
    }
}

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <limits.h>
using namespace std;


int main(){
  int ans = 0, N ;
  string S ;
  cin >> N >> S ;
  for(int i=0;i<(N-2);i++){
    if((S[i]=='A') && (S[i+1]=='B') && (S[i+2]=='C')) ans++ ;
  }  
  cout << ans << endl ;
  return 0 ;
}

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

using namespace std;


int main() {
    int q;
    cin >> q;

    vector<string> X(q), Y(q);
    int X_size, Y_size;

    vector<int> tmp(3, 0);

    for(int i = 0; i < q; i++) {
        cin >> X[i];
        cin >> Y[i];
    }

    for(int k = 0; k < q; k++) {
        X_size = X[k].size();
        Y_size = Y[k].size();

        // Xのi文字目までとTのj文字目までのLCSの長さdp[i][j]
        vector<vector<int> > dp(X_size+1, vector<int>(Y_size+1, 0));

        // 初期条件
        dp[1][0] = 0, dp[0][1] = 0;

        // dp開始
        for(int i = 1; i <= X_size; i++) {
            for(int j = 1; j <= Y_size; j++) {
                if(X[k][i-1] == Y[k][j-1]) {
                    tmp = {};
                    tmp.push_back(dp[i-1][j-1] + 1);
                    tmp.push_back(dp[i-1][j]);
                    tmp.push_back(dp[i][j-1]);
                    sort(tmp.begin(), tmp.end());
                    dp[i][j] = tmp.back();
                    // dp[i][j] = max({dp[i-1][j-1] + 1, dp[i-1][j], dp[i][j-1]});
                } else {
                    dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
                }
            }
        }

        cout << dp[X_size][Y_size] << endl;
    }

	return 0;
}


Measured memory_bytes: 6828
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char x;
  cin >> x;
 
  if (x >= 'A' && x <= 'Z') {
    cout << "A" << endl;
  }
  else if (x >= 'a' && x <= 'z'){
    cout << "a" << endl;
  }
}

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


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

    int N, M; cin >> N >> M;
    vi A(N), B(N);
    REP(i, N) cin >> A[i] >> B[i];

    priority_queue_lo<pii> pql;
    REP(i, N) pql.push(pii(A[i], B[i]));

    priority_queue<int> pq;

    ll ans = 0;
    for (int d = M - 1; d >= 0; d--) {
        int rest = M - d;

        while(!pql.empty()){
            pii ab = pql.top();
            if (ab.first > rest) break;
            pql.pop();
            pq.push(ab.second);           
        }

        if (!pq.empty()) {
            ans += pq.top(); pq.pop();
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 2676
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int i=sc.nextInt();
		int[] arr=new int[i];
		for(int x=0;x<arr.length;x++) {
			arr[x]=sc.nextInt();
		}
		boolean f=true;
		Arrays.sort(arr);
		for(int x=0;x<arr.length-1;x++) {
			if (arr[x]==arr[x+1])
				f =false;
		}
		if (f==true)
			System.out.println("YES");
		else 
			System.out.println("NO");
		
	}

}


Measured memory_bytes: 80908
#include <bits/stdc++.h>
#define deb(x) cout<<#x<<" "<<x<<endl;
#define ll long long int
#define ld long double
#define fo(i, n) for(ll i = 0; i<n; i++)
#define Fo(i, a, n) for(ll i = a; i<n; i++)
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define pi pair<int, int>
#define pl pair<ll, ll>
#define u_m unordered_map
#define u_s unordered_set
#define p_q priority_queue
using namespace std;
const int N = 1e5+2;
vi g[N];
bool visited[N];
bool in[N];
int size[N];
void dfs(int u)
{
    visited[u] = 1;
    for(int v:g[u])
    {
        if(!visited[v])
            dfs(v);
        //deb(u);
        //deb(v);
        //cout<<size[v]+1<<endl;
        size[u] = max(size[u], size[v]+1);
    }
}
void solve()
{
    int n, m;
    cin>>n>>m;
    fo(i, m)
    {
        int u, v;
        cin>>u>>v;
        g[u].pb(v);
        in[v] = 1;
    }
    Fo(i, 1, n+1)
    {
        if(!in[i])
            dfs(i);
    }
    int ans = 0;
    Fo(i, 1, n+1)
    {
        ans = max(ans, size[i]);
        //deb(i);
        //cout<<size[i]<<endl;
    }
    cout<<ans<<endl;
}
int main()
{
    ios::sync_with_stdio(NULL);
    cin.tie(NULL); cout.tie(NULL);
    int t;
    //cin>>t;
    //while(t--)
		solve();	
    return 0;
}


Measured memory_bytes: 11008
import java.util.Scanner;
 
class Main {
    public static void main(String[] args) {
        Scanner kb = new Scanner( System.in);   
         
        while( true ) {
            int H = kb.nextInt();
            int W = kb.nextInt();
             
            if( 0==W && 0==H )break;
             
            for( int i=0; i<H; i++ ) {
                for( int j=0; j<W; j++ ) {
                    if((j+i)%2==0) {
                        System.out.print("#");
                    } else {
                        System.out.print(".");
                    }
                }
                System.out.print( "\n" );
            }
            System.out.print( "\n" );
        }
    }
}

Measured memory_bytes: 31800
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
typedef long long int lint;
using namespace std;

//ただの辺
struct edge {
    using lint = long long int;
    int to;
    lint cost;
    //引数一つの時は距離1
    edge(int t, lint c = 1) : to(t), cost(c) {
    }
    edge() {
    }
};

void dfs(int start, vector<vector<edge>> &g, vector<int> &path,
         vector<bool> &calced) {
    if (calced[start]) {
        return;
    }
    if (g[start].size() == 0) {
        path[start] = 0;
        calced[start] = true;
    } else {
        int temp = 0;
        for (int i = 0; i < g[start].size(); i++) {
            dfs(g[start][i].to, g, path, calced);
            temp = max(temp, path[g[start][i].to]);
        }
        path[start] = temp + 1;
        calced[start] = true;
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<edge>> g(n);
    // spring[i]:iが湧き出しかどうか
    vector<bool> isSpring(n, true);
    for (int i = 0; i < m; i++) {
        int x, y;
        cin >> x >> y;
        x--, y--;
        g[x].push_back(y);
        isSpring[y] = false;
    }
    //湧き出しだけの集合を作る
    vector<int> spring;
    for (int i = 0; i < n; i++) {
        if (isSpring[i]) {
            spring.push_back(i);
        }
    }
    // iスタートのパスで最長なものの長さ
    vector<int> path(n, 0);
    vector<bool> calced(n, false);
    int ans = 0;
    for (int i = 0; i < spring.size(); i++) {
        dfs(spring[i], g, path, calced);
        ans = max(ans, path[spring[i]]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 17024
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;

const LL inf = 11234567890;

// RMQ
class SegmentTree
{
private:
	LL n;
	std::vector<LL>node;

public:
	void init(LL size)
	{
		n = 1;
		while (n < size) n *= 2;
		node.resize(2 * n - 1, -inf);
	}

	// node[i] = x 
	void update(LL i, LL x)
	{
		i += n - 1;
		node[i] = x;
		while (i > 0)
		{
			i = (i - 1) / 2;
			node[i] = std::max(node[2 * i + 1], node[2 * i + 2]);
		}
	}

	// min([a, b))
	// ex.) [0, N - 1] == [0, N)
	LL get_max(LL a, LL b, LL k = 0, LL l = 0, LL r = -1)
	{
		if (r < 0) r = n;
		if (r <= a || b <= l) return -inf;
		if (a <= l && r <= b) return node[k];
		LL vl = get_max(a, b, 2 * k + 1, l, (l + r) / 2);
		LL vr = get_max(a, b, 2 * k + 2, (l + r) / 2, r);
		return std::max(vl, vr);
	}
};

int main()
{
	LL N;
	in >> N;
	std::vector<LL>A(N);
	rep(i, N) in >> A[i];

	std::map<LL, std::vector<LL>>rev;
	rep(i, N) rev[A[i]].push_back(i);

	SegmentTree tree;
	tree.init(N);
	rep(i, N) tree.update(i, A[i]);

	LL max, ans = 0;
	while ((max = tree.get_max(0, N)) >= 0)
	{
		LL startNum = max;
		tree.update(rev[startNum][0], -1);
		LL end = rev[startNum][0];
		rev[startNum].erase(rev[startNum].begin());
		while (true)
		{
			tree.update(end, -1);
			if (tree.get_max(0, end) > max) break;
			max = tree.get_max(0, end);
			if (max < 0) break;
			end = rev[max][0];
			rev[max].erase(rev[max].begin());
		}
		++ans;
	}

	out << ans << std::endl;
}


Measured memory_bytes: 13824
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for(int i = 0; i < (int)(n);i++)
typedef long long ll;
using namespace std;
int main() {
	ll n;
	cin >> n;
	if (n % 2 == 0) {
		cout << n << endl;
	}
	else {
		cout << 2 * n << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <numeric>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void){
    string s;
    cin >> s;
    int K;
    cin >> K;
    int n = s.size();

    // vector<string> l;
    // REP(i, n){
    //     Rep(j, 1, (n-i+1 < 6 ? : 6)){
    //         string ss = s.substr(i,j);
    //         if(!FIND(l, ss))
    //             l.pb(ss);
    //         else continue;    
    //         if(l.size() > 5){
    //             SORT(l);
    //             if(l.back() == ss){
    //                 l.pop_back();
    //                 break;
    //             }
    //         }
    //     }
    // }
    // SORT(l);
    // pr(l[K-1]);

    set<string> l;
    REP(i, n){
        Rep(j, 1, min(n-i+1,6)){
            l.insert(s.substr(i,j));
        }
    }
    int it = 0;
    for(auto&& ss : l){
        if(++it == K) pr(ss);
    }
}

Measured memory_bytes: 1664
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
int main(){
	vector<tuple<int, int, int>> go;
	REP(i, 2) {
		int a, b, c;
		cin >> a >> b >> c;
		go.push_back(make_tuple(a, b, c));
	}
	sort(go.begin(), go.end());
	int ans = get<0>(go[1]) - get<0>(go[0]);
	if (get<1>(go[1]) > get<1>(go[0])) {
		ans++;
	}
	else if (get<1>(go[1]) == get<1>(go[0])) {
		if (get<2>(go[1]) > get<2>(go[0])) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3108
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define int long long
#define ld long double
#define fi first
#define se second
#define all(uiet) uiet.begin(),uiet.end()
#define read(UIET) for(int i = 0; i < n; ++i) cin >> UIET[i]
#define out(UIET) for(int i = 0; i < n; ++i) cout << UIET[i]
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vpp vector<pair< int, int > >
#define pll pair<int , int >
#define ppll pair < pll , pll >
#define debug(n1) cout << n1 << endl
#define len(a) ((int) (a).size())
#define endl "\n"
#define mod 1000000007
const int INF=(1LL<<60)-1;
const int maxN = 1000001;

int32_t main(){
    SPEED;
    int n;
    cin >> n;
    int cnt = 0, chk = 0;
    for(int i = 0; i < n; ++i){
        int x, y;
        cin >> x >> y;
        if(x == y) cnt++;
        else cnt = 0;
        if(cnt == 3) chk = 1;
    }
    if(chk) cout << "Yes"  ;
    else cout << "No" ;
}

Measured memory_bytes: 3648
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>


using namespace std;

int A, B;
char op;
int N, M;

int main(){
	cin >> N;
	vector <int> T(N);

	for (int i = 0; i < N; i++) {
		cin >> T[i];
	}
	cin >> M;
	vector <int> P(M),X(M);
	//int P, X;

	for (int i = 0; i < M; i++) {
		cin >> P[i] >> X[i];

	}
	int res = 0;
	
	for (int i = 0; i < M; i++) {
		for (int j = 0; j < N;j++) {
			if (j+1 == P[i]) {
				res += X[i];
			}
			else res += T[j];
				}

	cout << res << endl;
	res = 0;

	}
	
}

Measured memory_bytes: 256
from collections import deque

if __name__ == '__main__':
    n, q = list(map(int, input().split()))
    queue = deque()
    t = 0

    for _ in range(n):
        name, time = input().split()
        queue.append((name, int(time)))

    while len(queue):
        name, time = queue.popleft()

        if time <= q:
            t += time
            print(name, t)
        else:
            t += q
            time -= q
            queue.append((name, time))



Measured memory_bytes: 12528
fn main(){
	let mut v = read_vec::<i32>();
    v.sort();
    println!("{} {} {}", v[0], v[1], v[2] );
}
  
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}


Measured memory_bytes: 5024
#include <bits/stdc++.h>
#include <iomanip> 
using namespace std; 
#define rep(i,a,b)		for(long int i=a;i<=b;i++)
#define MOD 1e9+7

int arr[3],sum=0,k;
int main() 
{ 
	ios::sync_with_stdio(false);
    cin.tie(NULL);  
    
	cin>>arr[0]>>arr[1]>>arr[2]>>k;
	sort(arr,arr+3); 
	while(k--)
	{
		arr[2]*=2;
	}	
	for(int i=0;i<3;i++)
		sum+=arr[i];
	cout<<sum;
}
	

Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cmath>

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) for(int i = 0; i < (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i <= 0; --i)

using ll = long long;
using namespace std;

constexpr int INF = 2147483647; // 2 * 1e9
constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	vector<int> v;
	int n;
	cin >> n;
	string s, s2;
	cin >> s >> s2;
	REP(i, n){
		if(i == n - 1){
			v.push_back(0);
			break;
		}
		if(s[i] == s[i + 1]) {
			v.push_back(1);
			++i;
		}else{
			v.push_back(0);
		}
	}
	ll ans = 1;
	REP(i, v.size()){
		if(i == 0){
			if(v[i] == 0)ans *= 3;
			else ans *= 6;
		}
		else{
			if(v[i - 1] == 0) ans *= 2;
			else{
				if(v[i] == 1) ans *= 3;
			}
		}
		ans %= 1000000007;
		
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>
#include <stack>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define sz(x) (ll)(x).size()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;
typedef vector<ll> vl;
typedef vector<P> vp;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) {
    cin >> a[i];
  }

  vector<ll> cnts(1e6+5);
  rep(i,n) {
    ++cnts[a[i]];
  }

  ll ans = 0;
  rep(i,n) {
    --cnts[a[i]];

    bool found = false;
    for (ll j = 1; j*j <= a[i]; ++j) {
      if (a[i]%j == 0) {
        if (cnts[j] > 0) {
          found = true;
          break;
        }
        if (cnts[a[i]/j] > 0) {
          found = true;
          break;
        }
      }
    }

    if (!found) {
      ++ans;
    }

    ++cnts[a[i]];
  }
  cout << ans << endl;
}


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

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

int a[3];

int main(){
	cin.tie(0);
	
	rep(i, 3)cin>>a[i];
	
	sort(a, a+3);
	
	cout<<a[0]<<' '<<a[1]<<' '<<a[2]<<endl;
	
	return 0;
}



Measured memory_bytes: 3092
#include<bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define FORR(i,a,b) for (int i = b - 1; i >= a; --i)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,0,n)

int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	REP(i, N) cin >> A[i];

	sort(A.begin(), A.end());
	int maxval = A[N - 1];

	int cnt = 0;
	vector<int> arr(maxval + 1);
	REP(i, N) {
		if (arr[A[i]] == 0) {
			if (i == N - 1) ++cnt;
			else if (A[i] != A[i + 1]) ++cnt;
		}
		for (int a = A[i]; a <= maxval; a += A[i]) arr[a] += 1;
	}

	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 7992
#include<stdio.h>
int main(void)
{
    int room[4][3][10];
    int n,b,f,r,v,i,j,k,in;
    for(i=0;i<4;i++)
    {
        for(j=0;j<3;j++)
        {
            for(k=0;k<10;k++)
            {
                room[i][j][k]=0;
            }
        }
    }
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d%d",&b,&f,&r,&v);
        in = room[b-1][f-1][r-1];
        if(in+v<0)
        {
            in = 0;
        }
        else if(in+v>9)
        {
            in = 9;
        }
        else
        {
            room[b-1][f-1][r-1]=in+v;
        }
    }
    for(i=0;i<4;i++)
    {
        for(j=0;j<3;j++)
        {
            for(k=0;k<10;k++)
            {
                in = room[i][j][k];
                printf(" %d",in);
            }
            printf("\n");
        }
        if(i<3) printf("####################\n");
    }

    return 0;
}

Measured memory_bytes: 612
#include<iostream>
#include<algorithm>
using lint=int64_t;
using namespace std;

int main()
{
	int K,X;
	cin >> K >> X;

	for(int i=X-K+1;i<X+K;i++)
	{
		cout << i;
		if(i==X+K-1)cout << endl;
		else cout << " ";
	}
	return 0;
}



Measured memory_bytes: 256