akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

const ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll a,b; cin>>a>>b;
  if(b==1){
    cout<<0<<endl;
    return 0;
  }
  b-=a;
  if(b<=0){
    cout<<1<<endl;
  }else{
    ll ans=1+(b+a-2)/(a-1);
    cout<<ans<<endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define faster() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const long long int infLL = 9000000000000000000;
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(a) (a).begin(),(a).end()
#define mx_int_prime 999999937
const int inf = 2000000000;
const double PI = acos(-1);
const double eps = 1e-9;
typedef long double ld;
#define MOD 1000000007
typedef long long ll;
const int mx=2e5+125;
ll p[mx],a[mx],b[mx];
#define PB push_back
#define endl '\n'
#define S second
#define F first
int main()
{
    faster();
    string s,ans;
    cin>>s>>ans;
    int len=ans.size()-1;
    ans.erase(ans.begin()+len);
    if(s==ans)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;



    return 0;
}


Measured memory_bytes: 3592
S = input()
L = len(S)
for i in range(1,L,2):
    if S[i] == 'L' or S[i]=='U' or S[i]=='D':
        pass
    else:
        print('No')
        exit()

for j in range(0,L,2):
    if S[j]=='R' or S[j]=='U' or S[j]=='D':
        pass
    else:
        print('No')
        exit()
print('Yes')

Measured memory_bytes: 3064
package main

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

func main() {
	sc.Split(bufio.ScanWords)

	n := nextInt()

	cm := make(map[int]int)
	as := make([]int, n)
	for i := 0; i < n; i++ {
		as[i] = nextInt()
		cm[as[i]]++
	}
	sort.Ints(as)

	ans := 0
	for i := 0; i < n; i++ {
		a := as[n-i-1]
		if cm[a] == 0 {
			continue
		}

		a2 := 1
		for a2 <= a {
			a2 *= 2
		}
		b := a2 - a

		if (b != a && cm[b] >= 1) || (b == a && cm[b] >= 2) {
			cm[a]--
			cm[b]--
			ans++
		}
	}
	fmt.Println(ans)
}

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}


Measured memory_bytes: 14656
#include <bits/stdc++.h>
template< typename T >
T mod_pow(T x, T n, const T &p) {
  if(x < 0) return 0;
  T ret = 1;
  while(n > 0) {
    if(n & 1) (ret *= x) %= p;
    (x *= x) %= p;
    n >>= 1;
  }
  return ret;
}
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;
const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}
template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}
template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}
template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for(int i=0;i<((int)(v.size()));++i) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}
using ld = long double;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int n; cin >> n;
  map<pair<ll, ll>, ll> mp;
  ll zero = 0;
  ll lzero = 0, rzero = 0;
  for(int i=0;i<(n);++i) {
    ll a, b; cin >> a >> b;
    if(a == 0 || b == 0) {
      if(a == 0 && b == 0) zero++;
      else if(a == 0) lzero++;
      else if(b == 0) rzero++;
      continue;
    }
    if(a < 0) {
      a = -a;
      b = -b;
    }
    ll g = __gcd(abs(a), abs(b));
    a /= g;
    b /= g;
    mp[{a, b}]++;
  }
  ll ans = mod_pow<ll>(2, lzero, MOD);
  ans += mod_pow<ll>(2, rzero, MOD);
  ans %= MOD;
  ans += MOD - 1;
  ans %= MOD;
  map<pair<ll, ll>, bool> sel;
  for(auto &e: mp) {
    pair<ll, ll> b = {e.first.second, -e.first.first};
    if(b.first < 0) {
      b.first = -b.first;
      b.second = -b.second;
    }
    if(sel[e.first] || sel[b]) continue;
    sel[e.first] = true;
    sel[b] = true;
    ll now = 0;
    now += mod_pow<ll>(2, e.second, MOD);
    now %= MOD;
    now += mod_pow<ll>(2, mp[b], MOD);
    now %= MOD;
    now += MOD - 1;
    now %= MOD;
    ans *= now;
    ans %= MOD;
  }
  ans += zero;
  ans %= MOD;
  cout << (ans + MOD - 1) % MOD << endl;
}


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

using namespace std;
using ll=long long;
using vi=vector<int>;
using vl=vector<ll>;
using vs=vector<string>;

#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define rep(i, a, n) for (int i = (n); i < (a); ++i)
#define repr(i, a, n) for (int i = (n); i >= (a); --i)

template<typename T,typename U>
void Inparray(T &f,U n){
  for(int i=0;i<n;i++) cin>>f[i];
}

template<typename T,typename U>
void Printarray(T f,U n){
  for(int i=0;i<n;i++) i!=n ? cout<<f[i]<<" " : cout<<f[i];
}

void flagfunc(bool flag,string A,string B){
  flag ? cout<<A<<endl : cout<<B<<endl;
}

void flag2func(bool flag){
  flag ? cout<<"Yes"<<endl : cout<<"No"<<endl;
}

void flag3func(bool flag){
  flag ? cout<<"YES"<<endl : cout<<"NO"<<endl;
}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int a,b,c,d;cin>>a>>b>>c>>d;
  cout<<max(a*b,c*d)<<endl;
}


Measured memory_bytes: 256
import sys

#+++++
		
def main():
	n=int(input())
	for i in range(n+1):
		if int(i*1.08) == n:
			return i
	print(':(')
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 3060
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <time.h>
int main(){
    int i,ans=0;
    char s[3];
    scanf("%s",s);
    for(i=0; i<3; i++){
        if(s[i]=='R')ans++;
    }
    if(ans==2 && s[1]=='S')ans=1;
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 1728
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/






int N;
int v[3] = { 3,5,7 };
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    int ans = 0;

    rep(dgt, 3, 10) {
        int ma = 1;
        rep(i, 0, dgt) ma *= 3;

        rep(msk, 0, ma) {
            int x = 0;
            int m = msk;
            int cn[3] = { 0, 0, 0 };
            rep(i, 0, dgt) {
                int d = m % 3;
                x = x * 10 + v[d];
                cn[d]++;
                m /= 3;
            }
            if (x <= N and 0 < cn[0] and 0 < cn[1] and 0 < cn[2]) ans++;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int d[1005][1005];

void warshall_floyd(int n, int m) {
	rep(i,n) rep(j,n) d[i][j] = INF;
	rep(i,n) d[i][i] = 0;

	rep(i, m) {
		int s, t;
		cin >> s >> t;

		s--;
		t--;

		d[s][t] = 1;
		d[t][s] = 1;
	}

	rep(k, n) {
		rep(i, n) {
			rep(j, n) {
				if(d[i][k] == INF || d[k][j] == INF) continue;
				d[i][j] = min(d[i][j],d[i][k] + d[k][j]);
			}
		}
	}
}

int main() {
	int n, m;
	while(cin >> n >> m) {
		if(n == 0 && m == 0) break;

		warshall_floyd(n, m);

		int ans = 0;
		rep(i, n) {
			if(i == 0) continue;
			if(d[0][i] <= 2) {
				ans++;
			}
		}

		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 3120
import heapq
n,m = map(int, input().split())
a = list(map(int, input().split()))
a = list(map(lambda x: x*(-1), a))

heapq.heapify(a)#ヒープ化
for i in range(m):
    tmp_max = heapq.heappop(a)
    heapq.heappush(a,tmp_max - tmp_max//2) #プッシュ
print(-sum(a))

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

typedef long long ll;

ll n;
ll a[1<<18];
ll ans = 1;
map<ll,ll> mp;
ll use[1<<18];
ll mod = 1e9+7;
int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        if (a[i] == 0) {
            if (mp[0] == 0) {
                mp[0]++;
                ans *= 3;
            } else if (mp[0] == 1) {
                mp[0]++;
                ans *= 2;
            } else if (mp[0] == 2) {
                mp[0]++;
                ans *= 1;
            } else {
                cout << 0 << endl;
                return 0;
            }
            ans %= mod;
            continue;
        }
        if (a[i] != 0 && !mp.count(0)) {
            cout << 0 << endl;
            return 0;
        }
        if (mp[a[i]] == 3) {
            cout << 0 << endl;
            return 0;
        }
        mp[a[i]]++;
        ans *= mp[a[i] - 1] - use[a[i] - 1];
        use[a[i] - 1]++;
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 9344
n = int(input())
l = sorted(list(map(int, input().split())), reverse=True)

alice_sum = 0
bob_sum = 0
for i in range(n):
  if i% 2 == 0:
    alice_sum += l[i]
  else:
    bob_sum += l[i]

print(alice_sum - bob_sum)

Measured memory_bytes: 9116
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, string> P;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define sc(x) scanf("%d",&x);
int main(){
    string s,s2,c,tmp1,tmp2;
    vector<P> v;
    int q, t, F;
    int cnt = 0; /*trueが正の向き, falseが反対*/
    cin >> s;
    cin >> q;
    int order[q];
    for (int i = 0; i < q; i++){
        sc(t)
        if (t == 1){
            order[i] = 1;
            cnt += 1;
        }else if (t == 2){
            order[i] = 2;
            sc(F)
            cin >> c;
            v.push_back(P(F, c));
        }
    }
    bool check;
    int left = 0;
    if (cnt % 2 != 0){
        reverse(s.begin(), s.end());
        check = false;
    }else{
        check = true;
    }
    for (int i = 0; i < q; i++){
        if (order[i] == 1){
            if (check) check = false;
            else check = true;
        }else{
            if (v[left].first == 1){
                if (check) tmp1 = v[left].second + tmp1;
                else tmp2 = tmp2 + v[left].second;
            }else{
                if (check) tmp2 = tmp2 + v[left].second;
                else tmp1 = v[left].second + tmp1;
            }
            left += 1;
        }
    }
    cout << tmp1 + s + tmp2 << endl;
    return 0;
}

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

#define int long long
typedef pair<int, int> P;

int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

/*
#define cin ifs
#define cout ofs
ifstream ifs("in.txt");
ofstream ofs("out.txt");
//*/

signed main() {
    int A, B, K;
    set<int> s;
    cin >> A >> B >> K;
    for (int i = A; i < A + K && i <= B; i++) {
        s.insert(i);
    }
    for (int i = B; i > B - K && i >= A; i--) {
        s.insert(i);
    }
    for (auto itr = s.begin(); itr != s.end(); ++itr) {
        cout << *itr << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include <math.h>
using namespace std;

typedef long long ll;

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    ll ans=1;
    FOR(i,1,n+1){
        ans *= i;
        ans %= 1000000000 + 7;
        //cout << ans << endl; 
    }

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

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

int main(){
    int n,d;
    cin >> n >> d;
    vector<vector<int>> x(n,vector<int>(d));
    rep(i,n){
        rep(j,d){
            cin >> x[i][j];
        }
    }
    int res = 0;
    rep(i,n){
        rep(j,i){
            int sq = 0;
            rep(k,d){
                int s = x[i][k] - x[j][k];
                sq += s*s;
            }
            int s = sqrt(sq)+0.5;
            if (s*s == sq) res++;
        }
    }
    cout << res << endl;
}

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

const int INF = 1001001001;

int main(){
    int l,r,d;
    int i;
    int count=0;
    cin>>l>>r>>d;
    rep(i,r-l+1){
        if((i+l)%d==0)count++;
    }
    cout<<count;
    return 0;
}


Measured memory_bytes: 3616
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <bitset>
#include <iostream>
#include <deque>
#include <functional>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <string>
#include <vector>
#include <vector>

using namespace std;

#define int long long
struct Fast
{
  Fast()
  {
    std::cin.tie(0);
    std::cout.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;

#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

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

#define debug(x) cerr << #x << ": " << x << endl;

const int MOD = 1e9 + 7;

signed main(void)
{

  int x, a;
  cin >> x >> a;
  if (x < a)
    cout << 0 << endl;
  else
    cout << 10 << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    
    int a,b,c,d,answer;
    
    cin>>a>>b>>c;
    
    d=a+b;
    
    answer=d-c;
    
    if(answer>=0){
        
        cout<<"Yes"<<endl;
    }
    
    if(answer<0){
        cout<<"No"<<endl;
    }
  
    
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>

using namespace std;
#define vsort(v) sort(v.begin(), v.end());

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int A, B;
	cin >> A >> B;
	string tmp;
	int count = 0;
	for(int i = A;i <= B; i++){
		tmp = to_string(i);
		bool flag = true;
		for(int j = 0;j < 2;j++){
			int length = tmp.length();
			if(tmp[j] != tmp[length - j - 1]) flag = false;
		}
		if(flag) count += 1;
	}
	cout << count << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define max(a, b)	(((a) > (b)) ? (a) : (b))		/* ２個の値の最大値 */
#define min(a, b)	(((a) < (b)) ? (a) : (b))		/* ２個の値の最小値 */
#define ENTER		printf("\n")					/* 改行プリント */
int DBG = 1;										/* デバッグプリント 提出時は0 */
/* main *************************************************************/
int main()
{
	int		a,b,c,i,j,k,n,m,x,y,ans = 0;
	char	str[256];
	
	scanf("%d", &n);

	//100000

	if (n < 9) {
		ans = n;
	} else 	if (n < 99) {
		ans = 9;
	} else 	if (n < 999) {
		ans = 9 + n - 99;
	} else 	if (n < 9999) {
		ans = 909;
	} else 	if (n < 99999) {
		ans = 909 + n - 9999; 
	} else {
		ans = 90909;
	}

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


	return 0;
}


Measured memory_bytes: 128
import java.util.*;

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

		int n = sc.nextInt();

		for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		}
	}
}

Measured memory_bytes: 23764
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
 
using namespace std;
 
int main()
{
    double R1, R2;
    if (scanf("%lf%lf", &R1, &R2) < 2) return 0;
 
    printf("%.10lf\n", R1 * R2 / (R1 + R2));
    return 0;
}

Measured memory_bytes: 128
n,m=map(int,input().split())
h=list(map(int,input().split()))
a=[]
for i in range(m):
    a.append(list(map(int,input().split())))

res=[1]*n
for i in range(m):
    if(h[a[i][0]-1]==h[a[i][1]-1]):
        res[a[i][0]-1]=0
        res[a[i][1]-1]=0
        
    elif(h[a[i][0]-1]<h[a[i][1]-1]):
        res[a[i][0]-1]=0
    else:
        res[a[i][1]-1]=0
ans=0
for i in range(n):
    if(res[i]==1):
        ans+=1
print(ans)


Measured memory_bytes: 93380
#include <cstdio>

inline int abs(int target) { return target<0?target*-1:target; }

int main(void)
{
    int a,b;
    scanf("%d%d",&a,&b);
    for(int i=1; i<1e9; i++){
        if(abs(a-i)==abs(b-i)){
            printf("%d\n",i);
            return 0;
        }
    }
    puts("IMPOSSIBLE");
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    vector<int> p(3);
    rep(i,3) cin>>p[i];
    int k; cin>>k;
    sort(etob(p));
    rep(i,k) p[0]*=2;
    int ans=0;
    rep(i,3) ans+=p[i];
    cout<<ans<<endl;
    return 0;
}

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

int main(void) {
    int a, b, c;
    cin >> a >> b >> c;
    int i = a;
    while(i != b * a) {
        if((i * a) % b == c) {
            cout << "YES" << endl;
            return 0;
        }
        i++;
    }
    cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;

int main(){
    ll A;
    double b;
    cin >> A >> b;
    ll ib = b * 100 +.1; //暗黙の型変換をするが切り捨て
    cout << (A * ib)/100 << endl;
}


Measured memory_bytes: 3696
#include <iostream>
#include <queue>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;

  vector<vector<int>> G(N);
  vector<int> inE(N, 0);
  rep(i, N + M - 1) {
    int A, B;
    cin >> A >> B;
    A--, B--;
    G[A].emplace_back(B);
    inE[B]++;
  }

  queue<int> que;
  vector<int> dist(N, -1);
  vector<int> answer(N, -1);
  rep(i, N) {
    if (inE[i] == 0) {
      que.emplace(i);
      dist[i] = 0;
      answer[i] = 0;
    }
  }

  while (!que.empty()) {
    int u = que.front();
    que.pop();
    for (auto v : G[u]) {
      inE[v]--;
      if (dist[v] < dist[u] + 1) {
        dist[v] = dist[u] + 1;
        answer[v] = u + 1;
      }
      if (inE[v] == 0) que.emplace(v);
    }
  }

  rep(i, N) cout << answer[i] << endl;
  return 0;
}

Measured memory_bytes: 9856
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;

public class Program
{

	public void Proc()
	{
        int inpt = int.Parse(Reader.ReadLine());
        for (int i = 0; i < inpt; i++) {
            Haiten.Add(int.Parse(Reader.ReadLine()));
        }
        int ans = GetAns(0, 0);
        Console.WriteLine(ans);
    }

    private List<int> Haiten = new List<int>();

    private Dictionary<int, Dictionary<int, int>> dic = new Dictionary<int, Dictionary<int, int>>();

    private int GetAns(int idx, int subTotal) {
        if(idx >= Haiten.Count) {
            if(subTotal % 10 == 0) {
                return 0;
            } else {
                return subTotal;
            }
        }
        if(!dic.ContainsKey(idx)) {
            dic.Add(idx, new Dictionary<int, int>());
        }
        if(dic[idx].ContainsKey(subTotal)) {
            return dic[idx][subTotal];
        }
        int ans = GetAns(idx + 1, subTotal + this.Haiten[idx]);
        ans = Math.Max(ans, GetAns(idx + 1, subTotal));
        dic[idx][subTotal] = ans;
        return ans;
    }


	public class Reader
	{
		private static StringReader sr;
		public static bool IsDebug = false;
		public static string ReadLine()
		{
			if (IsDebug)
			{
				if (sr == null)
				{
					sr = new StringReader(InputText.Trim());
				}
				return sr.ReadLine();
			}
			else
			{
				return Console.ReadLine();
			}
		}
		private static string InputText = @"


3
10
20
30

";
	}

	public static void Main(string[] args)
	{
#if DEBUG
		Reader.IsDebug = true;
#endif
		Program prg = new Program();
		prg.Proc();
	}
}


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

int main(){
	int k,s;
	cin>>k>>s;
	int ret = 0;
	for(int i=0; i<=k; i++){
		for(int j=0; j<=k; j++){
			int z = s-i-j;
			if(0<=z && z<=k) ret++;
		}
	}
	cout<<ret;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[100010], mem[100010];
int main(){
    int n;
    while(cin>>n){
        for(int i=0; i<n; ++i){
            scanf("%d",a+i);
        }
        mem[n]=1e9;
        mem[n-1]=0;
        for(int i=n-2; i>=0; --i){
            mem[i]=min(abs(a[i+1]-a[i])+mem[i+1], abs(a[i+2]-a[i])+mem[i+2]);
        }
        cout<<mem[0]<<endl;
    }
  return 0;
}




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

const ll MOD = 1e9 + 7;
const int N = (1e2) + 5;
int memo[N][4][4][4];

int DP(int n, int c, int b, int a) {
  if (n == 3) return 1;
  int& ret = memo[n][c][b][a];
  if (ret != -1) return ret;
  ret = 0;
  for (int i = 0; i < 4; ++i) {
    if (i == 0 and b == 2 and a == 1) continue;
    if (i == 0 and c == 2 and a == 1) continue;
    if (i == 0 and c == 2 and b == 1) continue;
    if (i == 2 and c == 0 and b == 1) continue;
    if (i == 0 and c == 1 and b == 2) continue;
    ret += DP(n - 1, i, c, b);
    ret %= MOD;
  }
  return ret;
}

int main() { // claudio van
  int n; scanf("%d", &n);
  memset(memo, -1, sizeof memo);
  /*int ans = 0;
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      for (int k = 0; k < 4; ++k) {
        if (i == 0 and j == 2 and k == 1) continue;
        if (i == 0 and j == 1 and k == 2) continue;
        if (i == 2 and j == 0 and k == 1) continue;
        ans += DP(n, i, j, k);
        ans %= MOD;
      }
    }
  }
  */
  int ans = DP(n + 3, 3, 3, 3);
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 256
function Main(input){
    var weathers=["Sunny","Cloudy","Rainy"];
    if(input=="Sunny\n")console.log(weathers[1])
    else if(input=="Cloudy\n")console.log(weathers[2])
    else if(input=="Rainy\n")console.log(weathers[0])
    else console.log("bad")
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include<bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
typedef long long ll ;
typedef double ld;
typedef pair<int,int> p2;
typedef pair<ll,p2> p3;
typedef vector<int> vi;
const ll  Mod = 7 + 1e9;
const ll  INF32 = 5 + 2e9;
const ll  INF64 = 5 + 1e18;
const ll  MAX = 5+ 2e5;

int N,a[MAX],h[MAX];
ll T[5*MAX];

ll update(int TAR,ll VAL,int x = 1,int l = 0,int r = N+1)
{
    if( TAR < l || r < TAR )
        return T[x];
    if( l == r )
    {
        if( TAR == l )
            return T[x] = VAL;
        return T[x];
    }
    int mid = l+r>>1;
    int x1 = x<<1, x2 = x<<1 |1;
    ll c1 = update(TAR,VAL,x1,l,mid);
    ll c2 = update(TAR,VAL,x2,mid+1,r);
    return T[x] = max(c1,c2);
}

ll query(int TAR,int x = 1,int l = 0,int r = N+1)
{
    if( l >= TAR )
        return 0;
    if( r < TAR )
        return T[x];
    int mid = l+r>>1;
    int x1 = x<<1, x2 = x<<1 |1;
    ll c1 = query(TAR,x1,l,mid);
    ll c2 = query(TAR,x2,mid+1,r);
    return max(c1,c2);
}

int main()
{
    cin >> N;
    for(int i=1;i<=N;i++)
        cin >> h[i];
    for(int i=1;i<=N;i++)
        cin >> a[i];
    for(int i=1;i<=N;i++)
    {
        ll mx = query(h[i]);
        update(h[i],mx+a[i]);
    }
    cout << T[1] << endl;
    return 0;
}


Measured memory_bytes: 9600
import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7

def main():
    N, K = map(int, readline().rstrip().split())
    ans = 0
    m = (N * (N + 1)) // 2
    for k in range(K, N+2):
        mi = ((k-1) * k) // 2
        ma = m - ((N-k) * (N-k+1)) // 2
        ans += (ma - mi + 1) % MOD

    print(ans % MOD)


if __name__ == '__main__':
    main()

Measured memory_bytes: 9204
# coding: utf-8

def main():
    N = int(input())
    a = sorted(map(int, input().split()))

    # a[i] >= N な項は少なくともa[i]//N 回選ばれる
    tK = 0
    while max(a) >= N:
        K = 0
        for i in range(N):
            if a[i] >= N:
                k = a[i] // N
                a[i] -= (N + 1) * k
                K += k
        for i in range(N):
            a[i] += K
        tK += K
    return tK


print(main())


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

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

    int d;
    cin >> d;

    vector<int> c(26);
    rep(i, 26) cin >> c[i];
    vector<vector<int>> s(d, vector<int>(26));
    rep(i, d) rep(j, 26) cin >> s[i][j];

    vector<int> t(d);
    rep(i, d){
        cin >> t[i];
        --t[i];
    }

    vector<int> last(26, 0);
    int res = 0;
    rep(i, d){
        res += s[i][t[i]];
        
        int minus = 0;

        rep(j, 26) ++last[j];
        last[t[i]] = 0;
        rep(j, 26) minus += c[j] * last[j];

        res -= minus;
        cout << res << endl;
    }




    return 0;
}

Measured memory_bytes: 3708
#include <iostream>
#include "bits/stdc++.h"

using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i, a, b) for(ll i=a;i<b;i++)
#define REP(i, a) for(ll i=0;i<a;i++)
#define jkl ll debug = 0;
#define RREP(i, a) for(ll i=a;i>0;i--)
#define rrep(i, a, b) for(ll i=a-1;i>=b;i--)
#define printall(n, array) {for(ll i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
#define mp make_pair
typedef long long ll;
typedef pair<ll, ll> Pi;
typedef pair<ll, Pi> V;
typedef vector<ll> VE;
typedef vector<vector<ll>> VVE;
const ll mod = 1e9 + 7; //10^9+7

int main() {
    ll n;
    ll a[5];
    cin >> n;
    ll Min = 1e15 + 7;
    REP(i, 5) {
        cin >> a[i];
        Min = min(a[i], Min);
    }
    ll ans = (ceil)((double)n / (double)Min);
    print(ans + 4);
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
bool custom(pair<int, int> a, pair<int, int> b){
  if(a.second != b.second) return a.second < b.second;
  else return a.first > b.first;
}
int main(){
  int n;
  cin >> n;
  vector<pair<int, int>> work(n);
  for(int i = 0; i < n; ++i){
    cin >> work[i].first >> work[i].second;
  }
  sort(work.begin(), work.end(), custom);
  int current = 0;
  for(int i = 0; i < n; ++i){
    if(work[i].first + current > work[i].second){
      cout << "No" << endl;
      return 0;
    }
    current += work[i].first;
  }
 cout << "Yes" << endl; 
}

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

using namespace std;

#define ll long long
#define ld long double
#define pb push_back
#define fi first
#define se second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vp vector<pll>
#define pqll priority_queue<ll>
#define test int tcase; cin>>tcase; for(int tc = 1; tc <= tcase; tc++)
#define inp(a,n,f) ll a[n+f];for(int hh=f;hh<n+f;hh++)cin>>a[hh];
#define prdec(k) cout<<fixed<<setprecision(k);
#define ub upper_bound
#define lb lower_bound
#define mapp map<ll,ll>
#define mem(x,y) memset(x,y,sizeof(x))
#define all(v) v.begin(),v.end()
#define qll queue<ll>
#define sll set<ll>
#define inf LLONG_MAX


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

	int n,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int x;
		cin>>x;
		if(i%2==1&&x%2==1)
			ans++;
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 3600
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    // Your code here!
    int n;
    std::cin >> n;
    int d[100];
    for (int i = 0; i < n; i++) {
        std::cin >> d[i];
    }
    sort(d,d+n);
    int m=d[0],cnt=1;
    for (int i = 1; i < n; i++) {
        if(m<d[i]){
            m=d[i];
            cnt++;
        }
    }
    std::cout << cnt << std::endl;
}


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

using namespace std;

int main()
{
    int a;
    cin>>a;
    set<string> str;
    string inp,temp;
    set<string>::iterator *it;
    cin>>inp;
    temp = inp;
    str.insert(inp);
    for(int i = 1; i < a; i++)
    {
        cin>>inp;
        str.insert(inp);
        if(inp[0] != temp.back())
        {
            cout<<"No ";
            return 0;
        }
        
        if(str.size() != i+1)
        {
            cout<<"No";
            return 0;
        }
        
        str.insert(inp);
        temp = inp;
    }
    cout<<"Yes";
    
    return 0;
}


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

signed main(){
  int a, b, c;
  cin >> a >> b >> c;
  int count = 0;
  if(a != b)
    count++;
  if(b != c)
    count++;
  if(c != a)
    count++;
  if(a == b && b == c)
    count = 1;
  cout << count << endl;
}

Measured memory_bytes: 256
n,k = map(int,input().split())
a = [int(i) - 1 for i in input().split()]
r = []
nx = 0
sr = set([])
for i in range(n):
    r.append(nx)
    sr.add(nx)
    if k < i:
        print(r[k] + 1)
        break
    tnx = a[nx]
    if tnx in sr:
        m = r.index(a[nx])
        d = i - m + 1
        k = k - m
        k = k % d
        print(r[k + m] + 1)
        break  
    nx = tnx


Measured memory_bytes: 113920
#include<bits/stdc++.h>
using namespace std;
     
#define int long long
typedef pair<int, int> Pii;
     
template <typename T,typename E>
struct SegmentTree{
  using F = function<T(T,T)>;
  using G = function<T(T,E)>;
  using H = function<E(E,E)>;
  using P = function<E(E,size_t)>;
  int n;
  F f;
  G g;
  H h;
  T ti;
  E ei;
  P p;
  vector<T> dat;
  vector<E> laz;
  SegmentTree(int n_,F f,G g,H h,T ti,E ei,
    	      P p=[](E a,size_t b){b++;return a;}):
    f(f),g(g),h(h),ti(ti),ei(ei),p(p){
    init(n_);
  }
  void init(int n_){
    n=1;
    while(n<n_) n*=2;
    dat.assign(2*n-1,ti);
    laz.assign(2*n-1,ei);
  }
  void build(int n_, vector<T> v){
    for(int i=0;i<n_;i++) dat[i+n-1]=v[i];
    for(int i=n-2;i>=0;i--)
      dat[i]=f(dat[i*2+1],dat[i*2+2]);
  }
  inline void eval(int len,int k){
    if(laz[k]==ei) return;
    if(k*2+1<n*2-1){
      laz[k*2+1]=h(laz[k*2+1],laz[k]);
      laz[k*2+2]=h(laz[k*2+2],laz[k]);
    }
    dat[k]=g(dat[k],p(laz[k],len));
    laz[k]=ei;
  }
  T update(int a,int b,E x,int k,int l,int r){
    eval(r-l,k);
    if(r<=a||b<=l) return dat[k];
    if(a<=l&&r<=b){
      laz[k]=h(laz[k],x);
      return g(dat[k],p(laz[k],r-l));
    }
    return dat[k]=f(update(a,b,x,k*2+1,l,(l+r)/2),
    		    update(a,b,x,k*2+2,(l+r)/2,r));
  }
  T update(int a,int b,E x){
    return update(a,b,x,0,0,n);
  }
  T query(int a,int b,int k,int l,int r){
    eval(r-l,k);
    if(r<=a||b<=l) return ti;
    if(a<=l&&r<=b) return dat[k];
    T vl=query(a,b,k*2+1,l,(l+r)/2);
    T vr=query(a,b,k*2+2,(l+r)/2,r);
    return f(vl,vr);
  }
  T query(int a,int b){
    return query(a,b,0,0,n);
  }
  void update(int k,T x){
    query(k,k+1);//evaluate
    k+=n-1;
    dat[k]=x;
    while(k){
      k=(k-1)/2;
      dat[k]=f(dat[k*2+1],dat[k*2+2]);
    }
  }
};
      
signed main(){
  int N;
  cin >> N;

  vector<int> b(N);
  for ( int i = 0; i < N; i++ ) cin >> b[i];

  vector<int> cum(N, 0);
  cum[0] = b[0];
  for ( int i = 1; i < N; i++ ) cum[i] = cum[i-1]+b[i];     

  int Q;
  cin >> Q;

  vector<Pii> lr(Q);  
  for ( int i = 0; i < Q; i++ ) cin >> lr[i].first >> lr[i].second;

  sort(lr.begin(), lr.end());

  SegmentTree<int, int>::F f=[](int a,int b){return max(a,b);};
  SegmentTree<int, int>::G g=[](int a,int b){return a+b;};
  const int INF = 1e9;
  SegmentTree<int, int> seg(N+1,f,g,g,-INF,0);
  seg.update(0, 0);
  vector<int> dp(N+1, -INF);
  dp[0] = 0;

  int now = 0;
  for ( int i = 0; i < Q; i++ ) {

    int l = lr[i].first-1, r = lr[i].second;
    while ( now < l ) {
      dp[now+1] = max(dp[now+1], dp[now]+(!b[now]));
      now++;
    }
    
    dp[r] = max(dp[r], seg.query(l, r)+cum[r-1]);
    dp[r] = max(dp[r], dp[l]+cum[r-1]-cum[l-1]);    
    if ( seg.query(r, r+1) < dp[r]-cum[r-1] )
      seg.update(r, dp[r]-cum[r-1]);
  }
  while ( now < N ) {
    dp[now+1] = max(dp[now+1], dp[now]+(!b[now]));
    now++;
  }

  cout << N-dp[N] << endl;
     
  return 0;
}


Measured memory_bytes: 16256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>

#define M 100010

using namespace std;

int n;

int S[M * 2], tmp[M * 2];

bool vis[M];

bool cmp(int x, int y) {return S[x] < S[y];}

int Abs(int x) {return x < 0 ? -x : x;}

int main() {
    scanf("%d", &n);
    for(int i = 1; i <= n; i++) scanf("%d%d", &S[i * 2 - 1], &S[i * 2]), tmp[i * 2 - 1] = i * 2 - 1, tmp[i * 2] = i * 2;
    sort(tmp + 1, tmp + n * 2 + 1, cmp);
    int _1 = 0, _0 = 0;
    long long ans = 0;
    for(int i = 1; i <= n; i++) {
        ans += S[tmp[i]];
        if(tmp[i] % 2 == 0) _0++; else _1++;
        vis[(tmp[i] + 1) / 2] = 1;
    }
    int l = -1;
    for(int i = 1; i <= n; i++) if(!vis[i]) l = i;
    if(l == -1 && _0 && _1) {
        long long realans;
        long long A = 0, B = 0;
        for(int i = 1; i <= n; i++) A += S[i * 2 - 1], B += S[i * 2];
        if(A > B) realans = B; else realans = A;
        if(Abs(tmp[n + 1] - tmp[n]) != 1) realans = min(realans, ans + S[tmp[n + 1]] - S[tmp[n]]);
        else realans = min(realans, min(ans + S[tmp[n + 2]] - S[tmp[n]], ans + S[tmp[n + 1]] - S[tmp[n - 1]]));
        ans = realans;
    }
    printf("%lld\n", ans);
}


Measured memory_bytes: 1792
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <valarray>
#include <vector>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(__typeof((X).begin()) it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)x.size())

using namespace std;

struct timer{
	time_t start;
	timer(){start=clock();}
	~timer(){cerr<<1.*(clock()-start)/CLOCKS_PER_SEC<<" secs"<<endl;}
};

typedef istringstream iss;
typedef long long ll;
typedef pair<int,int> pi;
typedef stringstream sst;
typedef vector<int> vi;

int Na,Nt,Ng,Nc,m;
string s[55];
ll term[52][17];
bool over[52];
ll dp[52][52][52][52];
int conv[128];
map<string,int> M;

#define getmod(x) if((x)>LLONG_MAX>>1)x%=MOD

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	conv['A']=1;
	conv['T']=2;
	conv['G']=4;
	conv['C']=8;
	cin>>Na>>Nt>>Ng>>Nc>>m;
	getline(cin,s[0]);
	rep(i,m){
		getline(cin,s[i]);
		s[i]+=" ";
		int colon=s[i].find(":");
		M[s[i].substr(0,colon)]=i;
	}
	for(int i=m-1;i>=0;i--){
		int cur=s[i].find(":")+2;
		string t="";
		while(cur<sz(s[i])){
			if(s[i][cur]==' '){
				int sig=M[t];
				rep(j,16)term[i][j] += term[sig][j];
				over[i] |= over[sig];
				t="";
				cur++;
			}else if(s[i][cur]=='['){
				cur++;
				int mask=0;
				while(s[i][cur]!=']'){
					mask |= conv[s[i][cur++]];
				}
				term[i][mask]++;
				cur+=2;
			}else{
				t+=s[i][cur];
				cur++;
			}
		}
		ll sum=0;
		rep(j,16)sum+=term[i][j];
		if(sum > Na+Nt+Ng+Nc){
			over[i]=1;
		}
	}
	ll sum=0;
	rep(i,16)sum+=term[0][i];
	if(over[0] || sum!=Na+Nt+Ng+Nc){
		cout<<0<<endl;
		return 0;
	}
	vi v;
	rep(i,16){
		rep(j,term[0][i])v.pb(i);
	}
	//rep(i,sz(v))cout<<v[i]<<" ";cout<<endl;
	dp[0][0][0][0]=1;
	rep(sum,Na+Nt+Ng+Nc)rep(i,Na+1)rep(j,Nt+1)rep(k,Ng+1){
		int l=sum-i-j-k;
		if(l>Nc)continue;
		if(v[sum]&1){
			dp[i+1][j][k][l] += dp[i][j][k][l];
			getmod(dp[i+1][j][k][l]);
		}
		if(v[sum]&2){
			dp[i][j+1][k][l] += dp[i][j][k][l];
			getmod(dp[i][j+1][k][l]);
		}
		if(v[sum]&4){
			dp[i][j][k+1][l] += dp[i][j][k][l];
			getmod(dp[i][j][k+1][l]);
		}
		if(v[sum]&8){
			dp[i][j][k][l+1] += dp[i][j][k][l];
			getmod(dp[i][j][k][l+1]);
		}
	}
	cout<<dp[Na][Nt][Ng][Nc]%MOD<<endl;
}

Measured memory_bytes: 58304
#include <bits/stdc++.h>
using namespace std;
 
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
 
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ITER(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cout << #a << " = " << a << endl;

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	//freopen("In.txt", "w", stdout);
	
	int n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;
	--a; --b; --c; --d;
	string s;
	cin >> s;
	
	bool ok = 1;
	
	FOR(i, a, c)
		if (s[i] == '#' && s[i + 1] == '#')
			ok = 0;
	FOR(i, b, d)
		if (s[i] == '#' && s[i + 1] == '#')
			ok = 0;
	
	if (c > d)
	{
		bool ye = 0;
		
		FOR(i, b - 1, d)
			ye |= s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.';
		
		ok &= ye;		
	}
	
	if (ok)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	
	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
	return 0;
}


Measured memory_bytes: 896
#include <iostream>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if(a == b && a == c) cout << 1 << endl;
  else if((a == b || b == c || a==c) || (b == c && a != b)) cout << 2 << endl;
  else cout << 3 << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int calc_scoa(vector<int>, int*, int*, int*, int*,int size,int length,int m);



int main() {
	int n, m, q;
	vector<int> v;
	cin >> n >> m >> q;
	int* a = new int[q];
	int* b = new int[q];
	int* c = new int[q];
	int* d = new int[q];
	for (int i = 0;i < q;i++) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
	}
	cout << calc_scoa(v, a, b, c, d, q,n,m) << endl;
}

int calc_scoa(vector<int> v, int* a, int* b, int* c, int* d, int size,int length,int m) {
	if (v.size() == length) {
		int scoa = 0;
		for (int i = 0;i < size;i++) {
			if (v[b[i] - 1] - v[a[i] - 1] == c[i])scoa += d[i];
		}
		return scoa;
	}
	if (v.size() == 0) {
		int scoa = 0;
		for (int i = 1;i <=m;i++) {
			v.push_back(i);
			scoa = max(scoa, calc_scoa(v, a, b, c, d, size,length,m));
			v.erase(v.begin() + v.size() - 1);
		}
		return scoa;
	}
	else {
		int scoa = 0;
		for (int i = v[v.size() - 1];i <= m;i++) {
			v.push_back(i);
			scoa = max(scoa, calc_scoa(v, a, b, c, d, size,length,m));
			v.erase(v.begin() + v.size() - 1);
		}
		return scoa;
	}
}

Measured memory_bytes: 3200
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include<deque>
using namespace std;
const int maxn=2e5+10;
char a[maxn],b[maxn];
int main()
{
    cin>>a>>b;
    int num=0;
    int len1=strlen(a);
    for(int i=0;i<len1;i++)
    {
        if(a[i]!=b[i])
            num++;
    }
    cout<<num<<endl;
    return 0;
}


Measured memory_bytes: 3952
<?php
while ($line = fgets(STDIN)) {
    $line = rtrim($line);
    $data = explode(" ", $line);
    sort($data, SORT_NUMERIC );
    foreach($data as $value) {
        if ($value === end($data )) {
            echo $value . PHP_EOL;
        } else {
            echo $value . " ";
        }
    }
}

Measured memory_bytes: 15236
#include "stdio.h"
void gcd(int,int);

int main(){
    int a,b;
    
    scanf("%d %d",&a,&b);
    gcd(a,b);

    return 0;
    }

void gcd(a,b){
    int i;
    for(i=10;i != 0;){
        i = a % b;
        a = b;
        b = i;
    }
    printf("%d\n",a);
}



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

void testCase(){
	int n;
    cin>>n;
    int val = n%10;
    if(val == 2 || val == 4 || val == 5 || val == 7 || val == 9){
        cout<<"hon"<<endl;
    }
    else if(val == 0 || val == 1 || val == 6 || val == 8){
        cout<<"pon"<<endl;
    }
    else cout<<"bon"<<endl;
}

int main(){
    int t = 1;
    // cin>>t;
    while(t--){
        testCase();
    }
}


Measured memory_bytes: 3636
from collections import Counter
n = int(input())
v = list(map(int,input().split()))
o= v[0::2]
e =v[1::2]
o_mode = Counter(o).most_common(2)
e_mode = Counter(e).most_common(2)
if o_mode[0][0] == e_mode[0][0]:
  if len(o_mode) == 1:
    print(int(n/2)) 
  else:
    print(n-max(o_mode[1][1],e_mode[1][1])-o_mode[0][1])
else:
  print(n-o_mode[0][1]-e_mode[0][1])


Measured memory_bytes: 15972
#include<bits/stdc++.h>
#define _USE_MATH_DEFINES
using namespace std;
    
#define ll long long int
#define pb push_back
#define rep(i , j , n) for(ll i = j ; i < n ; i++)
#define pre(i , j , n) for(ll i = j ; i >= n ; i--)
#define all(x) x.begin(), x.end()
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vll;
typedef vector<char>	vc;
typedef vector<bool>	vb;
#define br "\n"

void solve(){
    ll a,b,c,k;
    cin >> a >> b >> c >> k;
    ll ans = 0;
    while(b <= a){
        ans++;
        b *= 2;
    }
    while(c <= b){
        ans++;
        c *= 2;
    }
    if(ans <= k) cout <<"Yes";
    else cout <<"No";

}
 
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif 

	ll t = 1;
	// cin >> t;
	rep(i,0,t){
		solve();
	}
 
}

Measured memory_bytes: 3636
#include <stdio.h>

int left(int);
int right(int);
void maxHeapify(int*, int, int);
void buildMaxHeap(int*, int);

int main()
{
    int i, n;
    scanf("%d", &n);
    int A[n + 1];
    for(i = 1; i <= n; i++) scanf("%d", &A[i]);
    
    buildMaxHeap(A, n);
    for (i = 1; i <= n ; i++) printf(" %d", A[i]);
    printf("\n");
    return 0;
}


void maxHeapify(int *A, int i, int H) {
    int l, r, s, largest;
l = left(i);
r = right(i);
if (l <= H && A[l] > A[i]) largest = l;
else largest = i;
if (r <= H && A[r] > A[largest]) largest = r;
if (largest != i){
    s = A[i];
    A[i] = A[largest];
    A[largest] = s;
    maxHeapify(A, largest, H);
}
}


void buildMaxHeap(int *A, int H){
    int i;
    for (i = H / 2; i >= 1; i--) maxHeapify(A, i, H);
}

int left(int i){
    return 2 * i;
}

int right(int i){
    return 2 * i + 1;
}



Measured memory_bytes: 3756
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int n;
  cin >> n;
  int c[2][n];
  for(int i=0;i<2;i++){
    for(int j=0;j<n;j++){
      cin >> c[i][j];
    }
  }
  int ans=-1;
  for(int i=0;i<n;i++){
    int sum=0;
    for(int j=0;j<=i;j++){
      sum+=c[0][j];
    }
    for(int k=i;k<n;k++){
      sum+=c[1][k];
    }
    ans=max(ans,sum);
  }
  cout << ans << endl;
}


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

using namespace std;

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

typedef long long ll;

int C[3][3];

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

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
void solve()
{
   

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

    int dp[n];
    memset(dp,0,sizeof(dp));
    dp[0]=0;
    for(int i=1;i<n;i++)
    {
        int temp=INT_MAX;
        int count=k;
        for(int j=i-1;j>=0&&count>0 ;j--,count--)
        {
            temp=min(temp,abs(a[i]-a[j])+dp[j]);
        }
        dp[i]=temp;
    }
    

    cout<<dp[n-1]<<"\n";
     

}
void tool() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
}
int32_t main() {
	tool();
	
		solve();
	return 0;
}

Measured memory_bytes: 4384
n,m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]

for i in ab:
    ans = []
    for j in cd:
        ans.append(abs(i[0] - j[0]) + abs(i[1] - j[1]))
    print(ans.index(min(ans))+1)

Measured memory_bytes: 3064
package main

import (
	"flag"
	"fmt"
)

func main() {
	flag.Parse()
	var a int
	var b int
	fmt.Scan(&a)
	fmt.Scan(&b)

	pow := a * b
	if pow%2 == 0 {
		fmt.Println("Even")
	} else {
		fmt.Println("Odd")
	}
}


Measured memory_bytes: 512