akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T>
bool maxi(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool mini(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
#define INF2 1000000000000000037
#define INF 1000000007
#define MOD 1000000007
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
//--GLOBAL---------------------------------

//--MAIN-----------------------------------
void Main() {
    ll N; cin>>N;
    rep(i,50000){
        ll x=i;
       if(N==(x*108/100)){
           cout<< x <<"\n"; return;
       } 
    }

    cout<< ":("<<"\n";
}   
//--START----------------------------------
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
}
//-----------------------------------------


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=105;
const ll INF=1LL<<62;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N,T;cin>>N>>T;
    vector<int> A(N);
    for(int i=0;i<N;i++) cin>>A[i];
    
    sort(all(A));
    
    ll ans=1;
    
    for(int i=0;i<N;i++){
        int d=upper_bound(all(A),A[i]+T)-A.begin()-i;
        ans*=d;
        ans%=mod;
    }
    
    cout<<ans<<endl;
}




Measured memory_bytes: 3372
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
	  long a =scn.nextLong();
	   long b =scn.nextLong();
	   long c =scn.nextLong();
	   long k =scn.nextLong();
	   
	   if(a>=k){
		   System.out.println(k);
		   return ;
	   }
	   long ans=0;
	   ans+=a;
	   k-=a;
	   if(b>=k){
		   System.out.println(ans);
		   return;
	   }
	   k-=b;
	   ans-=(k);
	   System.out.println(ans);
	   
	   

	}

}

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;

int main() {
    string s;
    cin >> s;
    int t = 0;
    REP(i, s.size()) {
        if (s[i] == '1') {
            t++;
        }
    }
    cout << t << endl;
}


Measured memory_bytes: 764
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define ll long long

using namespace std;

int main(){

    string s;
    cin >> s;
    bool ans = true;

    for(int i = 0; i < 3; i++){
        if(s[i] == s[i + 1]) ans = false;
    }

    if(ans){
        cout << "Good" << endl;
    }else cout << "Bad" << endl;
    

    return 0;
}       

Measured memory_bytes: 256
def main():
    N, K = map(int, input().split())
    ans = 0
    for i in range(1, N + 1):
        if i >= K:
            ans += 1 / N
        else:
            tmp = i
            cnt = 0
            while True:
                tmp *= 2
                cnt += 1
                if tmp >= K:
                    break
            ans += 1 / N * (1 / 2)**cnt
    print(ans)


if __name__ == "__main__":
    main()


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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
	//入力
	int N, A, B;
	cin >> N;
	if (N == 1) {
		cout << "Hello World";
		return 0;
	}

	cin >> A >> B;
	cout << A + B;

	return 0;
}

Measured memory_bytes: 256
# coding:utf-8

import sys
from collections import Counter


# input = sys.stdin.readline
INF = float('inf')
MOD = 10 ** 9 + 7


def inpl(): return list(map(int, input().split()))


N = int(input())
A = inpl()

ans = 1
prev = A[0]
state = 0
for i in range(1, N):
    if state == 0:
        if A[i] > prev:
            state = 1
        elif A[i] < prev:
            state = -1

    elif state == 1:
        if A[i] < prev:
            ans += 1
            state = 0

    else:
        if A[i] > prev:
            ans += 1
            state = 0

    prev = A[i]

print(ans)


Measured memory_bytes: 14636
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const K = parseInt(arg[0].split(" ")[1]);
    
    const S = arg[1].split("");
    
    for(let i in S) {
        if(~~i + 1 === K) {
            S[i] = S[i].toLowerCase();
        }
    }
    
    console.log(S.join(""));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

void solve() {
  vector<array<int, 2>> trie;
  trie.push_back({-1, -1});
  i64 n, l;
  cin >> n >> l;
  int u = 1;
  rep(i, n) {
    string s;
    cin >> s;
    int m = s.size();
    int v = 0;
    rep(j, m) {
      int y = s[j] - '0';
      if (trie[v][y] == -1) {
        trie[v][y] = u++;
        trie.push_back({-1, -1});
      }
      v = trie[v][y];
    }
  }
  i64 G = 0;
  function<void(int, int)> dfs = [&](int v, int h) {
    if (v == -1) {
      i64 height = l - h + 1;
      i64 d = 1;
      while ((height % (d << 1ll)) == 0) d <<= 1ll;
      G ^= d;
      return;
    }
    if (trie[v][0] == -1 && trie[v][1] == -1) return;
    dfs(trie[v][0], h + 1);
    dfs(trie[v][1], h + 1);
  };
  dfs(0, 0);
  if (G) cout << "Alice" << '\n'; else cout << "Bob" << '\n';
}


Measured memory_bytes: 5856
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        _n: usize,
        s: String,
    }

    let s = s.as_bytes().to_vec();
    let ans = s.windows(3).filter(|x| x == b"ABC").count();

    println!("{}", ans);
}


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

using namespace std;

#define mp make_pair
#define pb push_back
#define F first
#define S second
#define eb emplace_back
#define endl '\n'
#define INF INT_MAX
#define nl cout << endl;
#define sz(a) (a).size()
#define len(a) (a).length()
#define all(v)  v.begin(),v.end()
#define set(v)  memset(v, 0, sizeof(v));
#define some(v, x) v.begin(), v.begin()+x
#define RANGET(i,a) for(ll i=0; i<a; ++i)
#define RANGE(i,a,b) for(ll i=a; i<b; ++i)
#define RANGEI(i,a,b,inc) for(ll i=a; i<b; i+=inc)
#define RANGER(i,a,b) for(ll i=a; i>=b; --i)
#define TEST_CASES(a) int t;if(a==1){t=1;}else{cin>>t;}while(t--)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define level 18
#define MAXN 1000001
#define MOD 1000000007

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<ll, ll>> vpl;
typedef vector<vpl> vvpl;

namespace io {
inline int rdi() { int v; cin >> v; return v; }
inline long long rdll() { long long v; cin >> v; return v;}
inline string rds() { string s; cin >> s; return s; }
inline char rdc() { char c; cin >> c; return c; }
template<class T>
void rdv(T beg_iter, T end_iter) {
    for (; beg_iter != end_iter; ++beg_iter)cin >> *beg_iter;
}
inline void wri(const int v) { cout << v; }
inline void wrll(const long long &v) { cout << v; }
inline void wrs(const string& s) { cout << s; }
inline void wrc(const char c) { cout << c; }
template<class T>
void wrv(T beg_iter, T end_iter, string separator = " ", string end_of_line = "\n") {
    for (; beg_iter != end_iter; ++beg_iter) {
        cout << *beg_iter;
        cout << separator;
    }
    cout << end_of_line;
}
}
using namespace io;

bool sortbysec(const pair<ll, ll> &a, const pair<ll, ll> &b) {return (a.second < b.second);}

ll binpow(ll a, ll b, ll m) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
string path = "DLRU";
vi di = {1, 0, 0, -1};
vi dj = {0, -1, 1, 0};

void solve();

int main()
{
    fast_io;

    TEST_CASES(1) solve();

    return 0;
}

void solve()
{
    //Adjust t
    int n, k;
    cin >> n >> k;

    vi A(n);
    rdv(all(A));

    vl dp(n, INT_MAX);
    dp[0] = 0;
    dp[1] = abs(A[1] - A[0]);

    RANGE(i, 2, n)
    RANGER(j, i - 1, (ll)max(i - k, 0ll))
    dp[i] = min(dp[i], dp[j] + abs(A[i] - A[j]));

    cout << dp[n - 1] << endl;
}

Measured memory_bytes: 4368
#ifdef _WIN32
#include "stdc++.h"
#else
#include <bits/stdc++.h>
#endif

// 継承可能な型
template <class Type>
struct IN : Type
{
	IN()
	{
		std::cin >> *this;
	}
};

// 継承不可能な型
template <class Type>
struct IN_
{
	Type val;

	IN_()
	{
		std::cin >> val;
	}

	operator Type&()
	{
		return val;
	}

	IN_<Type>& operator=(const Type& _value)
	{
		val = _value;
		return *this;
	}
};

template <class Char, class Type>
std::basic_ostream<Char>& operator <<(std::basic_ostream<Char>& os, const IN_<Type>& value)
{
	return os << value.val;
}

template <class Char, class Type>
std::basic_istream<Char>& operator >>(std::basic_istream<Char>& is, IN_<Type>& value)
{
	return is >> value.val;
}

template <class Type>
void OUT(const Type& value)
{
	std::cout << value << std::endl;
}

template <class Type, class ... Args>
void OUT(const Type& value, const Args& ... args)
{
	std::cout << value << ' ';
	OUT(args...);
}

void Yes()
{
	OUT("Yes");
}
void No()
{
	OUT("No");
}

using ll = long long;
using inll = IN_<ll>;
using vll = std::vector<ll>;
using setll = std::set<ll>;
using msetll = std::multiset<ll>;
using instr = IN<std::string>;

// 階乗を計算 O(N) (N=10^7 で O(10^7))
int Factorial(ll n)
{
	for (ll i = n - 1; i > 1; i--)
		n *= i;
	return n;
}

// nCrを計算 O(N) (N=10^7 で O(10^7))
ll Combination(const ll n, const ll r)
{
	return Factorial(n) / (Factorial(r) * Factorial(n - r));
}

// 素数判定 O(sqrt(N)) (N=10^7 で O(10^3))
bool IsPrime(const ll num)
{
    if (num < 2) return false;
    if (num == 2) return true;
    if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}

// 各桁の和を計算 O(logN) (N=10^7 で O(7))
ll DigitSum(ll n)
{
	ll sum = 0;
	while(n != 0){
		sum += n % 10;
		n /= 10;
	}
	return sum;
}

#define FOR(i, m, n) for (ll (i) = (m); (i) < (n); ++(i))
#define REP(i, n) for (ll (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (ll (i) = (n); (i) >= 0; --(i))
#define ITRREP(it, v) for (auto (it) = (v).begin(); (it) != (v).end(); ++(it))
#define ITRREPR(it, v) for (auto (it) = (v).rbegin(); (it) != (v).rend(); ++(it))
#define DIVUP(a, b) (((a) + (b) - 1) / (b))

void Main();

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

	Main();

#ifdef _DEBUG
	system("pause");
#endif

	return 0;
}

using namespace std;

//////////////////////////////

void Main()
{
	instr s;

	ll a = 0;
	REP(i, 4)
	{
		a += s[i] == '+' ? 1 : -1;
	}

	return OUT(a);
}


Measured memory_bytes: 256
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
N = int(input())
A = [int(x) for x in input().split()]
a = 1
MOD = 10**9+7
for i in A:
  a = lcm(a,i)
ans = 0
for i in A:
  ans += (a//i)
print(ans%MOD)


Measured memory_bytes: 6108
import re
s, t = input().replace('?', '.'), input()
l, m = len(s), len(t)

if l < m:
    print("UNRESTORABLE")
    exit()

can = []  # candidates
for i in range(l - m + 1):
    if re.match(s[i:i + m], t):
        can.append((s[:i] + t + s[i + m:]).replace('.', 'a'))
print(min(can) if can else "UNRESTORABLE")

Measured memory_bytes: 3316
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll  long long
#define PI  acos(-1)
#define pb  push_back
#define ins insert
#define INF 5000000000000000007 //1e18+7
#define mk  make_pair
#define lb(v,x) lower_bound(all(v),x)
#define ub(v,x)  upper_bound(all(v),x)
#define ff  first
#define ss  second
#define rev reverse
#define endl "\n"
#define max3(x,y,z)  max(x,max(y,z))
#define min3(x,y,z)  min(x,min(y,z))
#define sz(a) (ll)a.size()
#define double long double
#define coud(a,b) cout<<fixed << setprecision((b)) << (a)
#define mset(x,y)  memset(x,y,sizeof(x))
#define all(x)   (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define bp(n)  __builtin_popcountll(n)
#define mxt(a)  *(max_element(a.begin(),a.end()))
#define mnt(a)  *(min_element(a.begin(),a.end()))
#define unique_sort(c) (sort(all(c)), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define trav(a, x)    for(auto &a : x)
#define re(i,n)       for(ll i=0;i<n;++i) 
#define int2Bin(x,y)  bitset <y> z=x; cout<<z.to_string()<<endl;
const double eps=1e-7;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
// int dx[8]={+1, +1, +1, 0, 0, -1, -1, -1};
// int dy[8]={+1, 0, -1, +1, -1, +1, 0, -1};
int dx[4]={ 1, 0, 0, -1 };
int dy[4]={ 0, -1, 1, 0 };
ll power(ll x,ll y){ll ans=1;x=x;while(y>0){if(y&1)ans=(ans*x);y=y>>1;x=(x*x);}return ans;}
ll sqr(ll x) { return x * x;}
template <typename T> T gcd(T a,T b){ if(a==0) return b; return gcd(b%a,a); }
template <class T> inline void chmax(T &x,T y){ x = max((x), (y));}
template <class T> inline void chmin(T &x,T y){ x = min((x), (y));}
template <class T> T abs(T x) { return x>0 ? x : -x;}
template <typename T> T powm(T a,T b, ll m){T cnt=1; while(b>0){ if(b%2==1) cnt=(cnt*a)%m; b/=2; a=(a*a)%m; }return cnt%m;}
typedef pair<int,int>  pii;
typedef pair<ll,ll>  pll;
typedef vector<pll>  vpll;
typedef vector<pii>  vpii;
typedef vector<ll>   vll;
typedef vector<int>  vii;
#define minpq priority_queue<T,vector<T>,greater<T> >;
//#define T pll
//#define ordered_set tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>
//*X.find_by_order(k) returns the kth largest element (0-based).
//X.order_of_key(val) returns the no. of values less than val.
ll ncr(ll n,ll r){ll ans=1;if(r>n)return 0;if(r>n-r)r=n-r;for(ll i=0;i<r;i++){ans*=(n-i);ans/=(i+1);}return ans;}
const int MOD=1000000007;   
const int N=400005;
struct compare{
    bool operator() (const int &a,const int &b) const{
        return a>b;
    }
};
void prec(){

}
void run(){
    int a,b,c,k;cin>>a>>b>>c>>k;
    int cnt=0;
    while(b<=a and k) b*=2,k--;
    while(c<=b and k) c*=2,k--;
    if(k>=0 and b>a and c>b) cout<<"Yes\n";
    else cout<<"No\n";
}   
int32_t main(){
    cin.sync_with_stdio(0);cin.tie(0);
    cin.exceptions(cin.failbit);
    int tc=1;
    //cin>>tc;
    prec();
    re(i,tc)
        run();
    return 0; 
}
/* 
    stuff you should look for
    * int overflow,array bounds.
    * special cases (n=1?).
    * N,MOD value.
*/


Measured memory_bytes: 3652
#include<iostream>
#include<cstdio>
using namespace std;
#define NN 70000+117
#define mod 998244353
#define LL long long
#include<cstring>
char a[NN]={};
char b[NN]={};
int n,len;
struct seq{
	LL x[NN]={};
}s;
LL fact[NN]={};
int all,acnt,bcnt;
int fan[NN]={};
int rev[NN]={};
LL kkk(LL a,LL b){
	LL ret=1;
	while(b){
		if(b&1){
			(ret*=a)%=mod;
		}
		b>>=1;
		(a*=a)%=mod;
	}
	return ret;
}
LL reverse(LL a){
	return kkk(a,mod-2);
}
seq tp;
void NTT(seq &a,int sym){
	for(int i=1;i<len;++i){
		if(i<rev[i])swap(a.x[i],a.x[rev[i]]);
	}
	LL ORT=3;
	if(sym==-1)ORT=reverse(ORT);
	for(int d=1;d<len;d<<=1){
		LL rt=kkk(ORT,(mod-1)/(d*2));
		for(int st=0,gap=d<<1;st<len;st+=gap){
			LL r=1;
			for(int i=0;i<d;++i,(r*=rt)%=mod){
				LL y=a.x[st+i],z=r*a.x[st+d+i]%mod;
				a.x[st+i]=(y+z)%mod;
				a.x[st+d+i]=(mod+y-z)%mod;
			}
		}
	}
	if(sym==-1){
		LL di=reverse(len);
		for(int i=0;i<len;++i){
			(a.x[i]*=di)%=mod;
		}
	}
}
void multi(seq &a,seq &b){
	NTT(a,1);
	NTT(b,1);
	for(int i=0;i<len;++i){
		(a.x[i]*=b.x[i])%=mod;
	}
	NTT(a,-1);
}
LL ksm(seq &a,LL b){
	seq ret;
	memset(ret.x,0,sizeof(ret.x));
	ret.x[0]=1;
	for(int i=0;i<len;++i){
		rev[i]=(rev[i>>1]>>1)|(i&1?len>>1:0);
	}
	while(b){
		if(b&1){
			for(int i=0;i<=all;++i){
				tp.x[i]=a.x[i];
			}
			for(int i=all+1;i<len;++i){
				tp.x[i]=0;
			}
			multi(ret,tp);
			for(int i=all+1;i<len;++i){
				ret.x[i]=0;
			}
		}
		b>>=1;
		for(int i=0;i<=all;++i){
			tp.x[i]=a.x[i];
		}
		for(int i=all+1;i<len;++i){
			tp.x[i]=0;
		}
		multi(a,tp);
		for(int i=all+1;i<len;++i){
			a.x[i]=0;
		}
	}
	LL ans=0;
	for(int i=0;i<=all;++i){
		(ans+=ret.x[i])%=mod;
	}
	return ans;
}
int main(){
	//freopen("test.in","r",stdin);
	scanf("%s",a+1);
	scanf("%s",b+1);
	acnt=0;
	bcnt=0;
	all=0;
	n=strlen(a+1);
	for(int i=1;i<=n;++i){
		a[i]-='0';
		b[i]-='0';
	}
	for(int i=1;i<=n;++i){
		if(!a[i]&&b[i]){
			++bcnt;
		}
		else if(a[i]&&!b[i]){
			++acnt;
		}
		else if(a[i]&&b[i]){
			++all;
		}
	}
	len=1;
	while(len<=2*all)len<<=1;
	//len=128;
	if(bcnt!=acnt){
		printf("0\n");
		return 0;
	}
	fact[0]=1;
	for(int i=1;i<=acnt+all+1;++i){
		fact[i]=fact[i-1]*i%mod;
	}
	s.x[all]=reverse(fact[all+1]);
	for(int i=all;i>=1;--i){
		s.x[i-1]=s.x[i]*(i+1)%mod;
	}
	LL res=ksm(s,acnt);
	printf("%lld\n",res*fact[acnt]%mod*fact[all]%mod*fact[acnt+all]%mod);
}

Measured memory_bytes: 1536
#include <iostream>

using namespace std;
int main()
{
	int N, X;
	cin >> N >> X;
	int l, i = 0, a[100];
	while (cin >> l) {
		a[i] = l;
		i++;
		if (N == i) { break; }
	}
	int count, add;
	count = 1;
	add = 0;

	for (i = 0; i < N; i++) {
		add = add + a[i];

		if (X >= add) {
			count++;
		}
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 256
import math

n=int(input())
t=int(input())
mint=t
t1=int(input())
if t1<t: mint=t1
maxtt=t1-t

for i in range(2,n):
    t=int(input())

    if t-mint>maxtt: maxtt=t-mint
    if t<mint: mint=t

print(int(maxtt))


Measured memory_bytes: 5668
import numpy as np
N, M = map(int, input().split())

lights = []

for _ in range(M):
    light = np.zeros(N + 1, dtype='int32')
    line = list(map(int, input().split()))
    k = line[0]
    switches = line[1:]
    for s in switches:
        light[s] = 1
    lights.append(light)

p_list = list(map(int, input().split()))
for i in range(M):
    lights[i][0] = p_list[i]

result = 0
for S in range(2**N):
    switch_state = np.array([1] + list(map(int, list(('0000000000' + bin(S)[2:])[-N:]))))
    success = True
    
    for l in lights:
        if sum(l*switch_state) % 2 != 0:
            success = False
            break

    if success:
        result += 1

print(result)

Measured memory_bytes: 20788
#include <iostream>
#include <string>
#include <map>
#include <math.h>
using namespace std;

#define ll long long

int main(){
    int N,K;
    cin >> N >> K;
    string S;
    cin >> S;
    if(S[K-1] == 'A')S[K-1] = 'a';
    else if(S[K-1] == 'B')S[K-1] = 'b';
    else if(S[K-1] == 'C')S[K-1] = 'c';
    cout << S;
    return 0;
}

Measured memory_bytes: 256
import sys

oddEasySteps = ['R', 'U', 'D']
evenEasySteps = ['L', 'U', 'D']

steps = input()
oddSteps = steps[::2]
evenSteps = steps[1::2]

for step in oddSteps:
  if step not in oddEasySteps:
    print('No')
    sys.exit()

for step in evenSteps:
  if step not in evenEasySteps:
    print('No')
    sys.exit()

print('Yes')

Measured memory_bytes: 38384
#include <iostream>
using namespace std;
int sum_digit(int n) {
	int digit = 0;
    while (n > 0) {
	    digit += n % 10;
	    n /= 10;
	}
    return digit;
}

int main() {
	int N, A, B;
    int sum_d;
	int total_sum = 0;
	cin >> N >> A >> B;
    for (int i = 0; i < N; ++i) {
		sum_d = sum_digit(i+1);
        if (sum_d >= A & sum_d <= B) total_sum += i + 1;
	}
	cout << total_sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define INF 1200000000

using namespace std;

typedef pair<int, int> P;
typedef long long int LL;

int main() {
    int n, m;
    cin >> n >> m;
    double sum = 100 * (n - m) + 1900 * m;
    double p = pow(0.5, m);

    double ans = 0;
    for (int i = 1; i < 1000; i++) {
        ans += i * pow(1 - p, i - 1) * p;
    }

    cout << ceil(sum * ans) << endl;

    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <queue>
#include <vector>

using namespace std;

int main() {
    priority_queue<int> que;
    string S;
    while (true) {
        cin >> S;
        if (S == "end") break;
        if (S == "insert") {
            int K;
            cin >> K;
            que.push(K);
        } else {
            cout << que.top() << endl;
            que.pop();
        }
    }
    return 0;
}



Measured memory_bytes: 7064
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
typedef long long ll;
using namespace std;
int r, g, b;
void BackandForth() {

	int sx, sy, tx, ty;
	cin >> sx >> sy >> tx >> ty;
	int dx = tx - sx;
	int dy = ty - sy;

	cout << string(dy,'U') << string(dx,'R');
	cout << string(dy, 'D') << string(dx,'L');
	cout << 'L' << string(dy + 1, 'U') << string(dx + 1, 'R') << 'D';
	cout << 'R' << string(dy + 1, 'D') << string(dx + 1, 'L') << 'U';
}

int main() {
	BackandForth();
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int a,b,c,x,count=0;
int main() {
    cin >> a >> b >> c >> x;
    for (int i=0;i<a+1;i++){
      for (int j=0;j<b+1;j++){
        for (int k=0;k<c+1;k++){
          if (500*i+ 100*j+ 50*k == x) count++;
        }
      }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int r = sc.nextInt();
		int D = sc.nextInt();
		int x = sc.nextInt();
      
      	for (int i = 0; i < 10; i++) {
          x = r * x - D;
          
          System.out.println(x);
        }
	}
}

Measured memory_bytes: 20948
# include <bits/stdc++.h>
 
# define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
 
namespace utils{
  template <typename T> void print(vector<vector<T>> mat) {
    rep (i, mat.size()) {
      rep (j, mat[0].size()) cout << mat[i][j] << ' ';
      cout << endl;
    }
  }
 
  template <typename T> void print(vector<T> v) {
    rep (i, v.size()) cout << v[i] << ' ';
    cout << endl;
  }
 
  template <typename T> pair<T, T> shape(vector<vector<T>> mat) {
    int d1, d2;
 
    d1 = mat.size();
    if (d1 > 0) d2 = mat[0].size();
    else int d2 = 0;
    cout << "(" << d1 << ", " << d2 << ")" << endl;
    return make_pair(0, 0);
  }
 
  template <typename T> vector<vector<T>> empty(int n, int m) {
    vector<vector<T>> mat(n, vector<T>(m));
    return mat;
  }
}
 
 
const int OFFSET = 300;
 
int main() {
  int t, n;
  int cx, cy;
  int sx, sy;
 
  vector<int> dx = {1, 1, 0, -1, -1, 0};
  vector<int> dy = {1, 0, -1, -1, 0, 1};
 
  queue<pair<pair<int, int>, int>> s;
 
  while (cin >> t >> n && (t || n)) {
    vector<vector<bool>> visited = utils::empty<bool>(1000, 1000);
    rep (i, 1000) fill(visited[i].begin(), visited[i].end(), false);
 
    rep (i, n) {
      cin >> cx >> cy;
      cx += OFFSET; cy += OFFSET;
      visited[cx][cy] = true;
    }

    cin >> sx >> sy;
    sx += OFFSET;
    sy += OFFSET;

    //initialize
    s.push(make_pair(make_pair(sx, sy), 0));
    int ans = 0;
 
    while (!s.empty()) {
      pair<pair<int, int>, int> q = s.front(); s.pop();
      int cx = q.first.first;
      int cy = q.first.second;
      int turn = q.second;


      // if (cx < 0 || cy < 0 || cx >= 60 || cy >= 60 || visited[cx][cy]) continue;
      if (visited[cx][cy]) continue;
      ans++;
      visited[cx][cy] = true;
 
      rep (i, 6) {
        int nx = cx + dx[i];
        int ny = cy + dy[i];
 
        if (turn < t) {
          s.push(make_pair(make_pair(nx, ny), turn+1));
        }
      }
    }
    cout << ans << endl;
  }
}

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

public class DivideTheProblems {
    public static void Main(string[] argc){
        int length = int.Parse(Console.ReadLine());
        string[] input = Console.ReadLine().Split(' ');
        int[] arr = input.Select(x => int.Parse(x) ).ToArray();
        int a = CountDivide(arr, length);
        Console.WriteLine(a);
    }


    public static int CountDivide(int[] numArr, int length){
        int[] sortedArr = numArr.OrderBy(x=>x).ToArray();

        int centerIndex = length / 2;
        if(sortedArr[centerIndex] == sortedArr[centerIndex-1]){
            return 0;
        }
        return sortedArr[centerIndex] - sortedArr[centerIndex-1];
    }
}

Measured memory_bytes: 22752
#include<cstdio>

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

using namespace std;

bool is_arithmetic_progression(int n,const int *h){
	int d=h[1]-h[0];
	rep(i,n-1) if(h[i]+d!=h[i+1]) return false;
	return true;
}

int main(){
	for(int n;scanf("%d",&n),n;){
		int h[101];
		rep(i,n+1) scanf("%d",h+i);

		rep(i,n+1){
			int m=0,h2[100];
			rep(j,n+1) if(j!=i) h2[m++]=h[j];
			if(is_arithmetic_progression(m,h2)){ printf("%d\n",h[i]); break; }
		}
	}

	return 0;
}

Measured memory_bytes: 1028
n=int(input())
import math
p=list(map(int,input().split()))
q=list(map(int,input().split()))
pn=0
qn=0
for i in range(n):
  pn+=math.factorial(n-i-1)*(p[i]-1)
  qn+=math.factorial(n-i-1)*(q[i]-1)
  po=p[i]
  qo=q[i]
  p = [j-1 if j>po else j for j in p]
  q = [k-1 if k>qo else k for k in q]
print(abs(pn-qn)) 


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 1000000000
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repX(i, n ,x) for (int i = x; i < (int)(n); i++)
#define repM(i, n) for (int i = n; i > 0; i--)

int main() {
    int N;
    cin >> N;
    vector<string> S(N);
    rep(i,N)cin >> S[i];
    vector<string> original(N);
    sort(S.begin(), S.end());
    original = S;
    unique(original.begin(), original.end());
    vector<int> count(original.size());
    int stringNum = 0;
    rep(i, N)
    {
        if(S[i]==original[stringNum]){
            count[stringNum]++;
        }else{
            stringNum++;
            if (S[i] == original[stringNum])
            {
                count[stringNum]++;
            }
            else
            {
                stringNum++;
                if (S[i] == original[stringNum])
                {
                    count[stringNum]++;
                }
                else
                {
                    stringNum++;
                }
            }
        }
    }
    int maxS = 0;
    rep(i,original.size()){
        maxS = max(maxS,count[i]);
    }
    vector<string> ans(0);
    rep(i,original.size()){
        if(maxS==count[i]){
            ans.push_back(original[i]);
        }
    }
    sort(ans.begin(),ans.end());
    rep(i,ans.size()){
        cout << ans[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 18932
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define RFOR(i, begin, end) for(int i=(end)-1, i##_begin_=(begin);i>=i##_begin_;i--)
#define rep(i, N) FOR(i, 0, N)
#define rrep(i, N) RFOR(i, 0, N)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
using namespace std;
using ll = long long int;
using V = vector<ll>;
using P = pair<ll, ll>;
using VP = vector<P>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
constexpr int inf = 1e9;
constexpr ll  lnf = 1LL << 60;
constexpr int mod = 1e9+7;
template<class T> inline bool chmax(T& a, const T& b) { if(a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, const T& b) { if(a>b) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b? gcd(b, a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a, b)*b;}


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

    vector<V> abc(n, V(3));
    rep(i, n) {
        rep(j, 3) cin >> abc[i][j];
    }

    vector<V> dp(n+1, V(3));
    rep(i, n) {
        rep(j, 3) {
            rep(k, 3) {
                if(j == k) continue;
                chmax(dp[i+1][j], dp[i][k] + abc[i][j]);
            }
        }
    }
    cout << *max_element(all(dp[n])) << endl;

    return 0;
}


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

int main(){
  ll N;
	cin >> N;
  cout << N*(N-1)/2;
 }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
#define ll long long
#define mod 1000000007
#define rep(i, n) for (int i = 0; i < n; ++i)
using Graph = vector<vector<int>>;
#define grepq priority_queue<double, std::vector<double>, std::greater<double>>
#define all(v) v.begin(), v.end()
#define PI acos(-1)

const ll INF = 10010001010;
const int inf = 2000000000;
ll lcm(ll a, ll b)
{
    return a * b / __gcd(a, b);
}

typedef tuple<string, int, int> TUP;

bool tuplesort(const TUP &right, const TUP &left)
{
    if (get<0>(right) != get<0>(left))
    {
        return get<0>(left) < get<0>(right);
    }
    if (get<1>(left) != get<1>(right))
    {
        return get<1>(left) > get<1>(right);
    }
    return get<2>(left) < get<2>(right);
}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll nCr(int n, int r)
{
    ll ans = 1;
    for (int i = n; i > n - r; --i)
    {
        ans = ans * i;
    }
    for (int i = 1; i < r + 1; ++i)
    {
        ans = ans / i;
    }
    return ans;
}

int main()
{
    int H, W;
    cin >> H >> W;
    int h, w;
    cin >> h >> w;
    int ans = H * W - h * W - H * w + h*w;
    cout << ans << endl;
}


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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;
template <class T> using vec = vector<T>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> T(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &T[i]);
  }
  sort(all(T));
  T.erase(unique(all(T)), end(T));

  __int128_t ans = 1;
  rep(i, 0, sz(T)) { ans = lcm<__int128_t>(ans, T[i]); }
  put(ll(ans));
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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;
}

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) { return (a * b) / gcd(a, b); }

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mem(ar,num) memset(ar,num,sizeof(ar))
#define me(ar) memset(ar,0,sizeof(ar))
#define lowbit(x) (x&(-x))
#define Pb push_back
#define  FI first
#define  SE second
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define IOS ios::sync_with_stdio(false)
#define DEBUG cout<<endl<<"DEBUG"<<endl; 
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
const int    prime = 999983;
const int    INF = 0x7FFFFFFF;
const LL     INFF =0x7FFFFFFFFFFFFFFF;
const double pi = acos(-1.0);
const double inf = 1e18;
const double eps = 1e-6;
const LL     mod = 1e9 + 7;
LL qpow(LL a,LL b){LL s=1;while(b>0){if(b&1)s=s*a%mod;a=a*a%mod;b>>=1;}return s;}
LL gcd(LL a,LL b) {return b?gcd(b,a%b):a;}
int dr[2][4] = {1,-1,0,0,0,0,-1,1};
typedef pair<int,int> P;
LL MOD = 1e10;
int main(void)
{
	LL ans =0;
	string s;
	map<string,int> ma;
	int n;cin>>n;
	while(n--){
		string s;cin>>s;
		sort(s.begin(),s.end());
		// // gen =
		// for(auto c:s){

		// }
		ans += ma[s];
		ma[s]++;
	}
	cout<<ans<<endl;

   return 0;
}

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

int main()
{

        int N , K;
        cin >> N >> K;

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

        sort(h, h+N);
        int min = 0;
        for (int i = 0; i < N-K+1; ++i) {

                if (i == 0) {
                        min = h[i + K -1] - h[i];
                }
                else {
                        if (h[i+K-1]-h[i] < min) {
                                min = h[i+K-1]-h[i];
                        }
                }
        }
        cout << min << endl;

}


Measured memory_bytes: 640
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<array>
#include<string>
#include<stack>
#include<queue>
#include<algorithm>
#include<cassert>
#include<functional>
#include<random>
#include<complex>
#include<bitset>
#include<chrono>
//#include<boost/multiprecision/cpp_int.hpp>
#define int int64_t
#define uint uint64_t
#define REP(i, a, b) for (int64_t i = (int64_t)(a); i < (int64_t)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define SZ(X) ((int64_t)((X).size()))
#define ITR(x, a) for (auto x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define Min(x) *min_element(ALL(x))
#define Max(x) *max_element(ALL(x))
#define Unique(L) (L.erase(unique(ALL(L)), L.end()))
#define intmax (std::numeric_limits<int64_t>::max() / 4)
#define doublemax (std::numeric_limits<double>::max() / 4)
using namespace std;
//typedef boost::multiprecision::cpp_int bigint;
const double EPS = 1e-9;
const double PI = acos(-1.0);



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

	int A, B, C;
	cin >> A >> B >> C;
	if ((A == B) && (B == C) && ((A%2)==0)) {
		cout << -1 << endl;
		return 0;
	}
	int ans = 0;
	while (1) {
		if (((A % 2) == 1) || ((B % 2) == 1) || ((C % 2) == 1)) {
			cout << ans << endl;
			return 0;
		}
		int a = (B + C) / 2;
		int b = (A + C) / 2;
		int c = (A + B) / 2;
		A = a; B = b; C = c;
		ans++;
	}

	return 0;
}


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

int main () {
	int a1,a2,a3,a4,b1,b2,b3,b4;
	int Atotal,Btotal;
	cin>>a1>>a2>>a3>>a4>>b1>>b2>>b3>>b4;	
	Atotal=a1+a2+a3+a4;
	Btotal=b1+b2+b3+b4;
	if(Atotal>Btotal){
		cout<< Atotal <<'\n';
	}else{if(Atotal<Btotal){
		cout<< Btotal <<'\n';
	}else{
		cout<< Atotal <<'\n';
	}
}
	return 0;
}

Measured memory_bytes: 1160
#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int digit(int x) {
	int cnt = 0;
	while (x > 0) {
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}
int read() {
	int tmp;
	cin >> tmp;
	return tmp;
}
int xor128() {
	static int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	int t = (x xor (x << 11));
	x = y; y = z; z = w;
	return (w = (w xor (w >> 19)) xor (t xor (t >> 8)));
}

signed main() {
	int n, m;
	cin >> n >> m;
	if (n == m) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
using System.Collections.Generic;
using System;

public class hello
{
    public static void Main()
    {
        var h = new HashSet<string>();
        var n = int.Parse(Console.ReadLine().Trim());
        var ans = 0;
        for (int i = 0; i < n; i++)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            var a = Array.ConvertAll(line, int.Parse);
            Array.Sort(a);
            var hk = "";
            foreach (var x in a) hk += x.ToString();
            if (!h.Add(hk)) ans++;
        }
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 9980
/* ex3_3
   masaaki52	*/
#include <stdio.h>
int main(void){
  int num1,num2,num3,answer;
  scanf("%d %d",&num1,&num2);//num1,num2に値を入力
  num3 = num2;//num2をnum3に代入
  answer = 1;//1をanswerに代入
  while(num1 >= num3){//num1がnum3以上の間は
    num3 = num3 * num2;//num3*num2をnum3に代入
    answer += 1;//answerに1を加える
  }
  printf("%d\n",answer);//answerを出力
  return 0;
}

Measured memory_bytes: 128
package main

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

func main() {
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Scan()
	var line = stdin.Text()
	var aAndB = strings.Split(line, " ")
	var a, _ = strconv.Atoi(aAndB[0])
	var b, _ = strconv.Atoi(aAndB[1])
    var area = a * b
    var length = a * 2 + b * 2
    fmt.Println(area, length)
}



Measured memory_bytes: 1084
#include <iostream>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <string.h>
#include <algorithm>
#include <vector>

using namespace std;

int max(int a, int b);
int min(int a, int b);
int is_prime(int n);

int main(int argc, char const* argv[])
{
    int n;
    while (cin >> n ,n) 
    {
        //if ( n==-1 && p==-1 ) { break; }
        vector<int> arr(5);
        vector<int> sum(n);
        int min_num = 0;
        int max_num = 0;
        for (int t = 0; t < n; t++) 
        {
            for (int i = 0; i < 5; i++) 
            {
                cin >> arr[i];
                sum[t] += arr[i];
            }
        }
        sort( sum.begin(), sum.end() );
        min_num = sum[0];
        max_num = sum[n-1];
        cout << max_num << " " << min_num << endl;
    }
    return 0;
}

int is_prime(int n)
{
    if (n ==1 || n== 0) 
    {
        return 0;
    }
    for (int i = 2; i*i <= n; i++) 
    {
        if (n % i == 0) 
        {
            return 0;
        }
    }
    return 1;

}


int max(int a, int b)
{
    if (a > b) 
    {
        return a;
    }
    else{
        return b;
    }
}
int min(int a, int b)
{
    if (a > b) 
    {
        return b;
    }
    else{
        return a;
    }
}

Measured memory_bytes: 1212
#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
  int i, n;
  double ans = 0;
  cin >> n;
  double ara[n];
  for(i = 0; i < n; i++) {
    cin >> ara[i];
  }
  sort(ara,ara+n);
  ans = (ara[0]+ara[1])/2;
  if(n > 2) {
  for(i = 2; i < n; i++) {
    	ans = (ans+ara[i])/2;
  	}
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;
typedef long long ll;

const int N=100005;

struct node{
	int v,a[3];
	node(){v=a[0]=a[1]=a[2]=0;}
	int&operator[](int x){return a[x];}
	void give(int i,int j){v=a[j]-a[i];}
	bool friend operator < (const node&x,const node&y){
		if(x.v!=y.v)return x.v>y.v;
		for(int i=0;i<3;i++)if(x.a[i]!=y.a[i])return x.a[i]<y.a[i];
		return false;
	}
};

multiset <node> D[3][3];
int s[3];
ll ans;

void move(int u,int v,node t){
	int k=3-u-v;
	t.give(u,v),D[u][v].erase(D[u][v].find(t));
	t.give(u,k),D[u][k].erase(D[u][k].find(t));
	t.give(v,u),D[v][u].insert(t);
	t.give(v,k),D[v][k].insert(t);
}

int main(){
	for(int i=0;i<3;i++)scanf("%d",&s[i]);
	for(int i=0;i<3;i++){
		while(s[i]--){
			node v;
			scanf("%d%d%d",&v[0],&v[1],&v[2]);
			for(int j=0;j<3;j++)if(i!=j)v.give(i,j),D[i][j].insert(v);
			ans+=v[i];
		}
	}
	bool ok=true;
	while(ok){
		ok=false;
		for(int u=0;u<3;u++)for(int v=u+1;v<3;v++){
			auto i=D[u][v].begin(),j=D[v][u].begin();
			if(i->v+j->v>0)ans+=i->v+j->v,move(u,v,*i),move(v,u,*j),ok=true;
		}
		for(int x=0;x<1;x++)for(int y=1;y<3;y++){
			int z=3-x-y;
			auto i=D[x][y].begin(),j=D[y][z].begin(),k=D[z][x].begin();
			if(i->v+j->v+k->v>0)ans+=i->v+j->v+k->v,move(x,y,*i),move(y,z,*j),move(z,x,*k),ok=true;
		}
	}
	printf("%lld\n",ans);
	return 0;
}


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

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

    int Q;
    cin >> Q;
    vector<int> l(Q), r(Q);
    int MAX = 0;
    for (int i = 0; i < Q; ++i) {
        cin >> l.at(i) >> r.at(i);
        MAX = max(MAX, r.at(i));
    }
    vector<bool> is_Prime(MAX + 1, true);
    vector<int> prime;
    vector<int> LNum(MAX + 1, 0);
    if (MAX > 0) is_Prime.at(0) = false;
    if (MAX > 1) is_Prime.at(1) = false;
    for (int i = 2; i <= MAX; ++i) {
        if (is_Prime.at(i)) {
            prime.push_back(i);
            for (int j = 2 * i; j <= MAX; j += i) {
                is_Prime.at(j) = false;
            }
        }
        if (i % 2 == 1 && is_Prime.at(i) && is_Prime.at((i + 1) / 2)) {
            LNum.at(i) = LNum.at(i - 1) + 1;
        } else {
            LNum.at(i) = LNum.at(i - 1);
        }
    }

    for (int i = 0; i < Q; ++i) {
        cout << LNum.at(r.at(i)) - LNum.at(l.at(i) - 1) << endl;
    }

    return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
int main(void){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(15);

    int n;
    string s,t;
    cin>>n>>s>>t;
    for(int i=0; i<n; i++){
        cout<<s[i]<<t[i];
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 3576
//#pragma Gbb optimize("Ofast") 
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<cstdio>
#include<string>
#include<vector>
#include<fstream>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<time.h>
#include<algorithm>
#define inf 0x3f3f3f3f
using namespace std;

long long a[100860], b[100860], c[100860];
int a1, b1, c1, n, m;

bool cmp(long long x, long long y)
{
	return x > y;
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> m >> a1 >> b1 >> c1;
	for (int i = 1; i <= a1; i++) cin >> a[i];
	for (int i = 1; i <= b1; i++) cin >> b[i];
	for (int i = 1; i <= c1; i++) cin >> c[i];
	sort(a + 1, a + a1 + 1, cmp);
	sort(b + 1, b + b1 + 1, cmp);
	sort(c + 1, c + c1 + 1, cmp);
	int l = n, r = m;
	for (int i = 1; i <= c1; i++)
		if ((l) && (r))
		{
			if ((c[i] > a[l]) && (c[i] > b[r]))
			{
				if (a[l] > b[r])
				{
					b[r] = c[i];
					r--;
				}
				else
				{
					a[l] = c[i];
					l--;
				}
			}
			else if (c[i] > a[l])
			{
				a[l] = c[i];
				l--;
			}
			else if (c[i] > b[r])
			{
				b[r] = c[i];
				r--;
			}
		}
		else if (l)
		{
			if (c[i] > a[l])
			{
				a[l] = c[i];
				l--;
			}
		}
		else if (r)
		{
			if (c[i] > b[r])
			{
				b[r] = c[i];
				r--;
			}
		}
	long long ans = 0;
	for (int i = 1; i <= n; i++) ans += a[i];
	for (int i = 1; i <= m; i++) ans += b[i];
	cout << ans;
	return 0;
}


Measured memory_bytes: 2688
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,a,b) for(Int i=a;i<b;++i)
#define rrep(i,a,b) for(Int i=a;i>=b;--i)
using namespace std;

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

  	string s1, s2, s3; cin >> s1 >> s2 >> s3;
    cout << s1[0] << s2[1] << s3[2] << endl;
}


Measured memory_bytes: 256