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

#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define reps(i,n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i,n) for (int i = (int)(n - 1); i >= 0; --i)
#define repds(i,n) for (int i = (int)(n); i > 0; --i)
#define loop(i,x,n) for (int i = (int)(x); i < (n); ++i)
#define loops(i,x,n) for (int i = (int)(x); i <= (n); ++i)
#define loopd(i,x,n) for (int i = (int)(x); i > (n); --i)
#define loopds(i,x,n) for (int i = (int)(x); i >= (n); --i)
#define itrep(i,a) for (auto i = begin(a); i != end(a); ++i)
#define itrepd(i,a) for (auto i = rbegin(a); i != rend(a); ++i)
#define all(f,x,...) [&](decltype(x)& whole) { return (f)(begin(whole), end(whole), ##__VA_ARGS__); }(x)
using namespace std;
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e18);
constexpr int iinf = static_cast<int>(1e9);
constexpr double dinf = 1e10;
constexpr ld ldinf = 1e18;
ll mod = static_cast<ll>(1e9 + 7);
template<class T> constexpr int sz(const T& a) { return (int)a.size(); }
template<class T> constexpr T pow2(const T a) { return a * a; }
template<class T, class ... Args> constexpr void mins(T& a, Args... args) { a = min<T>({ a, args... }); }
template<class T, class... Args> constexpr void maxs(T& a, Args... args) { a = max<T>({ a,args... }); }
template<class A, int N, class T>
void fillArray(A(&array)[N], const T& val) { std::fill((T*)array, (T*)(array + N), val); }

int h, w, k;
int a[15][1005];
void solve() {
    cin >> h >> w >> k;
    rep(i, h) rep(j, w) {
        char c;
        cin >> c;
        a[i][j] = c - '0';
    }

    int ans = iinf;
    rep(s, 1 << (h - 1)) {
        int res = 0;
        int tmp = s;
        while (tmp != 0) {
            if ((tmp & 1) == 1) ++res;
            tmp >>= 1;
        }

        int sum = 0;
        bool ok = true;
        vector<int> v(h, 0);
        vector<int> up(h, 0);
        rep(j, w) {
            rep(i, h) {
                sum += a[i][j];
                if (((s >> i) & 1) == 1 || i == h - 1) {
                    up[i] = sum;
                    v[i] += sum;
                    sum = 0;
                }
            }

            bool update = false;
            rep(i, h) if (v[i] > k) { update = true; break; }
            if (update) {
                rep(i, h) v[i] = up[i];
                ++res;
            }

            ok = true;
            rep(i, h) if (up[i] > k) { ok = false; break; }
            if (!ok) break;
        }
        if (ok) mins(ans, res);
    }
    cout << ans << endl;
}

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


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

int func(int x)
{
    if(x%2==0)
    {
        return x/2;
    }
    else
    {
        return 3*x+1;
    }
}
int main()
{
    int n;
    cin>>n;
    vector <ll> a(n);
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }

    bool flag = true;
    int count = 0;
    while(flag)
    {
        for(int i=0;i<n;i++)
        {
            if(a[i]%2==0)
            {
                a[i]=a[i]/2;
            }
            else
            {
                flag = false;
                break;
            }
        }
        if(flag)
        {
            count++;
        }
       
    }

    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
	static final int MAX = 2_147_483_646; // intMax 
	static final int INF = 1_000_000_000; // 10^9  
	public static void main(String[] args) throws Exception{
		hayami saori = new hayami();
		long n = saori.saorihayami();
		int[] primeNumber = new int[1000001];
		int i = 2;
		while(i <= 1000000){
			while(n % i == 0){
				n /= i;
				primeNumber[i]++;
			}
			i++;
		}

		int ans = 0;
		for(int j = 0;j < 1000001;j++){
			int count = 1;
			int roop = 0;
			while(primeNumber[j] >= count){
				ans++;
				roop++;
				count = count + roop + 1;
			}
		}
		if(n != 1){
			System.out.println(ans + 1);
		} else {
			System.out.println(ans);
		}
		saori.close();
	}
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}


Measured memory_bytes: 36540
#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int64_t> a(n+1);
  a[0]=2;a[1]=1;
  if(n>=2)
    for(int i=2;i<n+1;++i){
      a[i]=a[i-1]+a[i-2];
    }
  cout<<a[n]<<endl;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define mod 1000000007
#define f(i,a,b) for(ll i=a;i<b;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ii pair<ll,ll>
#define vii vector<ii>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define MAX 1e9
 
ll modpow(ll base, ll exp, ll modulus) {base %= modulus;ll result = 1;while (exp > 0) {if (exp & 1) result = (result * base) % modulus;base = (base * base) % modulus;exp >>= 1;}return result;}
const ld pi=acos(-1);


int main(){
    IOS;
    ll n,m;cin>>n>>m;
    ld a[n];
    ld sum=0;
    f(i,0,n){cin>>a[i];sum+=a[i];}
    sort(a,a+n,greater<ll>());
    // f(i,0,n)cout<<a[i]<<" ";
    // cout<<endl;
    ld x=sum/(4*m);
    // cout<<"x>"<<x<<endl;
    ll cnt=0;
    f(i,0,n){
        if(a[i]>=x)cnt++;
    }
    if(cnt>=m)cout<<"Yes";
    else cout<<"No";
    return 0;  
} 





Measured memory_bytes: 256
while True:
    h, w = map(int,input().split())

    if h == 0 and w == 0:
        break

    for i in range(h):
        if i%2 == 0:
            for j in range(w):
                if j%2 == 0:
                    print("#", end ="")
                else:
                    print(".", end ="")

        else:
            for j in range(w):
                if j%2 == 0:
                    print(".", end ="")
                else:
                    print("#", end ="")

        print()
    print()


Measured memory_bytes: 7004
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

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

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    //Fast Reader
    private static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public void resetST() {
            st = null;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public float nextFloat() {
            return Float.parseFloat(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            st = null;
            return str;
        }

        public int[] nextIntArray(int size) {
            int[] arr = new int[size];
            for (int i = 0; i < size; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int size) {
            long[] arr = new long[size];
            for (int i = 0; i < size; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public double[] nextDoubleArray(int size) {
            double[] arr = new double[size];
            for (int i = 0; i < size; i++) {
                arr[i] = nextDouble();
            }
            return arr;
        }
    }

    public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter pr = new PrintWriter(System.out);

        int n = sc.nextInt();
        int d = sc.nextInt();
        int count = 0;
        for (int i = 0; i < n; i++) {
            double x = sc.nextDouble();
            double y = sc.nextDouble();
            double dis = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
            if (dis <= d)
                count++;
        }
        pr.println(count);

        pr.close();
        // write your code here
    }
}


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

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, n) for(int i=0; i<n; i++)
#define FOR1(i, n) for(int i=1; i<=n; i++)
#define FORI(i, n) for(int i=n-1; i>=0; i--)
template<class T, class U> void umin(T& x, const U& y){ x = min(x, (T)y);}
template<class T, class U> void umax(T& x, const U& y){ x = max(x, (T)y);}
template<class T, class U> void init(vector<T> &v, U x, size_t n) { v=vector<T>(n, (T)x); }
template<class T, class U, typename... W> void init(vector<T> &v, U x, size_t n, W... m) { v=vector<T>(n);  for(auto& a : v) init(a, x, m...); }

int main(int argc, char** argv) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << setprecision(15);
    if (argc == 2 && atoi(argv[1]) == 123456789) freopen("d:\\code\\cpp\\contests\\stdin", "r", stdin);

    int d, t, s;
    cin >> d >> t >> s;
    if (t*s >= d)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    if (argc == 2 && atoi(argv[1]) == 123456789) cout << clock()*1.0/CLOCKS_PER_SEC << " sec\n";
    return 0;
}



Measured memory_bytes: 3648
//#include <climits>
#include <vector>
#include <iostream>
#include <sstream>
// #include <string>
using namespace std;

const int STACK_SIZE = 100;

vector<string> split(string &str, char delim) {
    vector<string> splited;
    stringstream ss(str);
    string buffer;

    while(getline(ss, buffer, delim)) {
        splited.push_back(buffer);
    }

    return splited;

}

class MyStack {
    private:
        int m_top = 0; //スタックポインタ
        string m_buffer[STACK_SIZE];

    public:
        void init();
        void push(string s);
        string pop();
        bool isEmpty();
        bool isFull();
        void show();
};

void MyStack::init() {
    m_top = 0; //スタックポインタの初期化
}

void MyStack::push(string s) {
    if(isFull()) {
        cout << "stack is full." << endl;
        return;
    }

    //topの位置に要素を入れて、ポインタを1つ進める
    m_buffer[m_top++] = s;
    // printf("top : %d\n", m_top);
}

string MyStack::pop() {
    if(isEmpty()) {
        cout << "stack is empty." << endl;
        return "";
    }

    //topの位置の要素を返して、ポインタを1つ手前に戻す
    // printf("top : %d\n", m_top);
    return m_buffer[--m_top];
}

void MyStack::show() {
    if(!isEmpty()) {
        cout << "stack[" << m_top << "] : " << m_buffer[m_top-1] << endl;
    }
}

bool MyStack::isEmpty() {
    if(m_top == 0) {
        return true;
    }

    return false;
}

bool MyStack::isFull() {
    if(m_top == STACK_SIZE) {
        return true;
    }

    return false;
}


int main() {
    string str;
    getline(cin, str); //1行全てを受け取る

    //半角スペースで分割
    vector<string> s = split(str, ' ');
    // for (int i = 0; i < s.size(); ++i)
    // {
    //     cout << s[i] << endl;
    // }

    MyStack stack;
    stack.init();

    // for (int i = 0; i < s.size(); ++i)
    // {
    //     stack.push(s[i]);

    // }
    // cout << stack.pop() << endl;
    // cout << stack.pop() << endl;
    // cout << stack.pop() << endl;
    // return 0;


    for (int i = 0; i < s.size(); ++i)
    {
        string tmp = s[i];
        if(tmp == "+") {
            int a = stoi(stack.pop());
            int b = stoi(stack.pop());
            stack.push(to_string(a + b));
        } else if(tmp == "-") {
            int a = stoi(stack.pop());
            int b = stoi(stack.pop());
            stack.push(to_string(b - a));
        } else if(tmp == "*") {
            int a = stoi(stack.pop());
            int b = stoi(stack.pop());
            stack.push(to_string(a * b));
        } else {
            stack.push(tmp);
        }
        //stack.show();
    }

    cout << stack.pop() << endl;


    return 0;
}


Measured memory_bytes: 3252
#include <iostream>
#include <vector>
#include <climits>
using namespace std;
using uint = unsigned int;

int main() {
	uint H, N;
	cin >> H >> N;
	
	vector<uint> A(N);
	vector<uint> B(N);
	
	for(uint i=0; i<N; i++) {
		cin >> A[i] >> B[i];
	}

	vector<uint> dp(H+1, UINT_MAX);
	dp[0] = 0;
	
	for(uint k=1; k<=H; k++) {
		for(uint i=0; i<N; i++) {
			uint p = A[i];
			uint c = (k >= p) ? B[i] + dp[k - p] : B[i]; 
			
			dp[k] = min(dp[k], c);
		}
	}

	cout << dp[H];
	return 0;
}

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

using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "
#define cout(n) cout<<fixed<<setprecision(n)
int main(){
  int N;
  cin>>N;

  if(N<1200){
    cout<<"ABC"<<endl;
  }
  else if(N<2800){
    cout<<"ARC"<<endl;
  }
  else{
    cout<<"AGC"<<endl;
  }

}


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

long long freq[1000005];
vector<long long> sums;

int main()
{
	long long N;
	scanf("%lld", &N);
	
	if(N == 1)
	{
		printf("0");
		return 0;
	}
	
	long long tempN = N, i = 2;
	while(i * i <= tempN)
	{
		if(N % i == 0)
		{
			N /= i;
			freq[i]++;
		}
		
		else
			i++;
	}
	
	long long ans = 0;
	if(N == tempN)
	{
		printf("1");
		return 0;
	}
	
	else if(N > 1)
	{
		//freq[N]++;
		ans++;
	}
	
	i = 0;
	while(true)
	{
		sums.push_back(i * (i + 1) / 2);
		if(sums.back() >= (long long)(1E6) * (long long)(1E6))
			break;
			
		i++;
	}

	for(long long int i = 0; i < 1000005; i++)
	{
		if(freq[i] == 0)
			continue;
			
		long long pos = upper_bound(sums.begin(), sums.end(), freq[i]) - sums.begin();
		ans += pos - 1;
	}
	
	printf("%lld", ans);
}


Measured memory_bytes: 19820
#include <iostream>
#include <string>
#include <vector>
 
using namespace std;
 
 
int main() {
	int M, N;
	
	cin >> N >> M;
	
	if (N == M){
		cout << "Yes" << endl;
	}else{
		
		cout << "No" << endl;
	}
	
	
	
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
//#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
const int64 INF = 1LL << 58;
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 (a>b) { a=b; return 1; } return 0; }

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

    int N; cin >> N;
    ve_vei ans(N+1, vei(N+1,1));

    int sub = 0;
    if(N % 2 == 1) {
        for(int i = 1; i <= (N-1)/2; i++) {
            ans[i][N-i] = ans[N-i][i] = 0;
        }
        sub = (N-1)/2;
    }
    else {
        for(int i = 1; i <= N/2; i++) {
            ans[i][N-i+1] = ans[N-i+1][i] = 0;
        }
        sub = N/2;
    }
    int M = N * (N - 1) / 2 - sub;
    cout << M << endl;
    rep1(i,N+1) repk(j,i+1,N+1) {
        if(i == j) continue;
        if(ans[i][j] == 1) cout << i << " " << j << endl;
    }
    return 0;
}



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

using namespace std;

#define ll long long




void solve() {

	
	int k, x;	
	cin >> k >> x;
	for(int i = max(-1000000, x - k + 1); i <= min(1000000, x + k - 1); i++) {
		cout << i << " ";
	}	
	




	
}

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	solve();

	return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
const int INF = 1e9;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
#define PI 3.14159265358979323846264338327950L
#define MOD 1000000007
//setprecision(15)
int main() {
	ll N; cin >> N;
	ll ans;
	if (N == 1) {
		ans = 0;
	} else {
		ans = (N-1) * N / 2;
	}
	cout << ans << endl;
}

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

using namespace std;

typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define ci cin
#define co cout
#define en endl
#define ln cout<< '\n'
#define rep(i, n) for(int i = 0; i < n; i++)
#define outl(x) cout<< (x) << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007

template<typename Tn> Tn gcd(Tn a, Tn b)
{
	return (b ? gcd(b, a % b) : a);
}

template<typename Tn> Tn lcm(Tn a, Tn b)
{
	return a / gcd(a, b) * b;
}

string IntToString(int number)
{
	stringstream ss;
	ss << number;
	return ss.str();
}

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

int main()
{
    int a, b, c;
    ci >> a >> b >> c;

    if(a == b && b == c)
	co << "Yes" << en;
    else 
	co << "No" << en;
  
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 998244353
ll ans[500010]={};
int main() {
	ll n,a,k;
	cin>>n>>a>>k;
	map<ll,ll>q;
	ll now=a;
	q[a]++;
	ll cnt=1;
	ll ans=a;
	if(n==1){
		cout <<ans;
		return 0;
	}
	bool ro=false;
	ll rocnt=0;
	ll rozan=0;
	while(true){
		cnt++;
		now*=now;
		now%=k;
		q[now]++;
		ans+=now;
		if(q[now]==3){
			ll zan=n-cnt;
			ans+=zan/rozan*rocnt;
			zan%=rozan;
			cnt=n-zan;
			//cout <<cnt<<endl;
		}		
		if(cnt==n){
			cout <<ans<<endl;
			return 0;
		}		
		if(q[now]==2){
			ro=true;
		}
		if(ro){
			rocnt+=now;
			rozan++;
		}
		//cout <<now<<endl;
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 6724
using System;
using System.Linq;
using System.Collections.Generic;
    
class Program
{
    static void Main(string[] args)
    {
        string input = Console.ReadLine();

        int sum = 0;
        for(int i=0; i<input.Length; i++)
        {
            sum += int.Parse(input[i].ToString());
        }

        if(sum % 9 == 0)
        {
            Console.WriteLine("Yes");
        }
        else
        {
            Console.WriteLine("No");
        }
    }
}

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

using namespace std;

int main(){
  int n; cin>>n;
  vector<pair<int, int> > arr;
  for(int i = 0; i < n; i++){
     int x; cin>>x;
     arr.push_back({x, i+1});
  }
  sort(arr.begin(), arr.end());
  for(int i = 0; i < n; i++) cout<<arr[i].second<<" ";
  cout<<"\n";
  return 0;
}

Measured memory_bytes: 1780
#include<bits/stdc++.h>
 using namespace std;
int main(){
  int N;
  cin >> N;
  int H[30];
  for (int i = 0; i < N; i++) {
    cin >> H[i];
  }
  int res = 1;
  int max = H[0];
  for (int i = 1; i < N; i++) {
    if (H[i] >= max) {
      res++;
      max = H[i];
    }
  }

  cout << res << "\n";
}


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

int main(){
  int a,b;
  cin >> a >> b;

  cout << a * b << endl;

  return 0;
}


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

int main()
{
	std::string s[100];
	int n, l;
	scanf("%d%d", &n, &l);
	for (int i = 0; i < n; i++)
		std::cin >> s[i];
	std::sort(s, s + n);
	for (int i = 0; i < n; i++)
		std::cout << s[i];
	std::cout << std::endl;

	return 0;
}

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

int main() 
{
    long N;
    cin>>N;
    vector<long>A(N);
 
    for (int i = 0; i < N; i++)
    {
       cin>>A[i];
    }   
 
    long money=1000;
    for (int i = 1; i < N; i++)
    {
        long stock=0;
        if(A[i]>A[i-1])
        {
            stock=money/A[i-1];
        }
        money +=(A[i]-A[i-1])*stock; 
    }
    
    cout<<money<<endl;
    
    return 0;
}

Measured memory_bytes: 3640
n,m,k=map(int, input().split())
a=list(map(int, input().split()))
b=list(map(int, input().split()))

from itertools import accumulate
a_acc=list(accumulate(a))
b_acc=list(accumulate(b))
a_acc.insert(0,0)
b_acc.insert(0,0)

cnt=0

import bisect
for i in range(n+1):
    nokori=k-a_acc[i]
    if nokori<0:
        break
    b_i=bisect.bisect_right(b_acc,nokori)-1
    cnt=max(cnt,i+b_i)
    # print(nokori,i,b_i)

print(cnt)

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

using namespace std;
typedef long long ll ;
#define rep(i,a,n) for(int i=a ; i<n ; i++)
#define pb push_back

ll p=1e9+7 ;

int main()
{
	int T=1;
	// cin >> T ;

	while(T--)
	{
		int n ;
		cin>>n ;
		double p[n] ,a,b,ans=0;
		rep(i,0,n) cin>>p[i] ;
		double dp[n+1][n+1] ;
		memset(dp,0,sizeof(dp)) ;

		dp[0][0]=1 ;
		rep(i,1,n+1)
			dp[i][0] = dp[i-1][0]*(1-p[i-1]) ;

		rep(i,1,n+1)
			rep(j,1,i+1)
				dp[i][j] = (1-p[i-1])*dp[i-1][j] + p[i-1]*dp[i-1][j-1] ;
		
		// rep(i,0,n+1)
		// {
		// 	rep(j,0,n+1)
		// 	{
		// 		cout<<dp[i][j]<<" " ;
		// 	}
		// 	cout<<endl ;
		// }
		rep(i,n/2+1,n+1)
		{
			ans += dp[n][i] ;
		}
		printf("%.9lf\n",ans) ;
	}	
	return 0;
}

Measured memory_bytes: 74048
#include<iostream>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	if(a<b){
		cout<<"a < b"<<endl;
	}
	if(a>b){
		cout<<"a > b"<<endl;
	}
	if(a==b){
		cout<<"a == b"<<endl;
	}
	return 0;
}

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

using ll = long long;

constexpr ll MOD = 1e9+7;
constexpr ll INF = 1ll<<60;

#define FOR(i,a,b) for (ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

vector<vector<pair<ll, ll>>> G;
vector<ll> dist;

void bfs(ll v, ll pv, ll d)
{
	if (dist[v] != -1) return;
	dist[v] = d; 
	
	for (auto &nvP : G[v])
	{
		ll nv = nvP.first;
		ll nc = nvP.second;
		if (nv == pv) continue;
		bfs(nv, v, dist[v] + nc);
	}
}

int main(int argc, char **argv)
{
	ll N; cin >> N;
	G.resize(N);
	dist.assign(N, -1);;
	REP(i, N-1)
	{
		ll a, b, c; cin >> a >> b >> c;
		--a, --b;
		G[a].push_back(pair<ll, ll>(b, c));
		G[b].push_back(pair<ll, ll>(a, c));
	}

	ll Q, K; cin >> Q >> K;
	--K;
	bfs(K, -1, 0);

	REP(_, Q)
	{
		ll a, b; cin >> a >> b;
		--a, --b;
		std::cout << dist[a] + dist[b] << std::endl;
	}
}


Measured memory_bytes: 14336
n,m = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(m)]
l = [[0]*n for _ in range(n)]
for a_ in a:
    l[a_[0]-1][a_[1]-1] = 1
    l[a_[1]-1][a_[0]-1] = 1
visited = [False]*n
def dfs(v):
    visited[v] = True
    for i in range(n):
        if l[v][i]==1 and not visited[i]:
            dfs(i)
    return visited
ans = 0
for a_ in a:
    l[a_[0]-1][a_[1]-1] = 0
    l[a_[1]-1][a_[0]-1] = 0
    bridge = False
    k = dfs(0)
    for i in k:
        if not i:
            bridge=True
    if bridge:
        ans += 1
    visited = [False]*n
    l[a_[0]-1][a_[1]-1] = 1
    l[a_[1]-1][a_[0]-1] = 1
print(ans)

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

int main()
{
  int n, x, c;
  while (1)
  {
    c = 0;
    cin >> n >> x;
    if (n == 0 && x == 0)
    {
      break;
    }
    for (int i = 1; i < n - 1; i++)
    {
      for (int j = i + 1; j < n; j++)
      {
        for (int k = j + 1; k < n + 1; k++)
        {
          if (i + j + k == x)
          {
            c += 1;
          }
        }
      }
    }
    cout << c << endl;
  }
  return 0;
}



Measured memory_bytes: 3092
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort()
B.sort()
C.sort()
C.reverse()

ans = 0
ai = 0
ci = N-1
for b in B:
    while ai < N and A[ai] < b:
        ai += 1
    while ci >= 0 and C[ci] <= b:
        ci -= 1
    ans += ai * (ci+1)

print(ans)

Measured memory_bytes: 23328
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <numeric>
#include <bitset>

using namespace std;
using ll = long long;
using ld = long double;
const ll mod =  1000000007;

#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP_FROM(i, j, n) for (ll i = (j); i < (n); ++i)
#define all(x) (x).begin(),(x).end()

ll power(ll base, ll exponent, ll module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ ll root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
ll inverse(ll x){ return power(x, mod - 2, mod);}
ll gcd(ll a, ll b) {if(a < b) gcd(b, a);ll r;while(r=a%b) {a=b;b=r;}return b;}
struct combination{ vector<ll> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } ll C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };

int bsearch(const vector<ll>& a, ll x){
  int lft = 0;
  int rgt = a.size();
  while (rgt - lft > 1) {
    int mid = (lft + rgt) / 2;
    if(a[mid] < x) {
      lft = mid;
    }
    else {
      rgt = mid;
    }
  }
  return lft;
}


signed main() {
  ios::sync_with_stdio(false);
  ll n, m;
  cin >> n >> m;
  vector<ll> dp(3*n+100000, -1);
  vector<vector<ll>> g(n);
  REP(i, m) {
    ll x, y;
    cin >> x >> y;
    x--;y--;
    g[x].push_back(y);
  }
  ll s,t;
  cin >> s >> t;
  s--;t--;
  queue<pair<ll, ll>> q;
  q.emplace(s, 0);
  dp[s] = 0;
  while(q.size()) {
    int node, cnt;
    tie(node, cnt) = q.front();
    q.pop();
    vector<ll> nexts = g[node];
    ll ni = (cnt+1)%3;
    REP(i, nexts.size()) {
      if(~dp[nexts[i]+ni*n]) continue;
      dp[nexts[i]+ni*n] = dp[node+cnt*n] + 1;
      q.emplace(nexts[i], ni);
    }
  }
  // REP(i, n) cout << dp[i] << " ";
  // cout << endl;
  // REP(i, n) cout << dp[i+n] << " ";
  // cout << endl;
  // REP(i, n) cout << dp[i+2*n] << " ";
  // cout << endl;
  if(~dp[t]) dp[t] /= 3;
  cout << dp[t]<< endl;
  return 0;
}


Measured memory_bytes: 8832
#include<iostream>
#include<cmath>
#include<numeric>
#include<string>
#include<algorithm>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define int64 long long 
using namespace std;

int main(){
  string pattern;
  cin>>pattern;
  int64 countwhite=0,whiteposition=0;
  rep(i,pattern.length()){
    if(pattern[i]=='W'){
      countwhite++;
      whiteposition+=i;
    }
  }
  int64 finalst=countwhite*(countwhite-1)/2;
  int64 ans=whiteposition-finalst;
  cout<<ans<<endl;
}


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

#define for(i, a, b) for(ll (i)=a;(i)<(b);++(i))
#define rep(i, n)    for(i, 0, n)

const ll inf = 1e15;
const ll mod = 1e9+7;

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

int main() {
    int H, W;
    cin >> H >> W;
    
    vector<string> field(H);
    rep(i, H) cin >> field[i];
    
    rep(i, W+2) cout << '#'; cout << endl;
    rep(i, H) cout << '#' + field[i] + '#' << endl;
    rep(i, W+2) cout << '#'; cout << endl;
    
    return 0;
}

Measured memory_bytes: 256
import itertools
N, M, r = map(int, input().split())
R = [int(a)-1 for a in input().split()]

X = [[0 if i == j else 1<<100 for j in range(N)] for i in range(N)]
for _ in range(M):
    a, b, c = map(int, input().split())
    X[a-1][b-1] = c
    X[b-1][a-1] = c

for k in range(N):
    for i in range(N):
        for j in range(N):
            X[i][j] = min(X[i][j], X[i][k] + X[k][j])
mi = 1<<100
for A in itertools.permutations(R, r):
    mi = min(mi, sum([X[A[i-1]][A[i]] for i in range(1, r)]))

print(mi)

Measured memory_bytes: 66136
use std::cmp::*;
use std::io::*;

fn main() {
    let mut s: String = String::new();
    stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let l: usize = itr.next().unwrap().parse().unwrap();
    let a: Vec<usize> = (0..n)
        .map(|_| itr.next().unwrap().parse().unwrap())
        .collect();
    let mut saigo = n;
    for i in 0..n - 1 {
        if a[i] + a[i + 1] >= l {
            saigo = i;
        }
    }
    if saigo == n {
        println!("Impossible");
        return;
    }

    let mut out = Vec::new();
    writeln!(out, "Possible").ok();
    for i in 0..saigo {
        writeln!(out, "{}", i + 1).ok();
    }
    for i in (saigo..n - 1).rev() {
        writeln!(out, "{}", i + 1).ok();
    }
    stdout().write_all(&out).unwrap();
}


Measured memory_bytes: 8956
/*Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.

My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.

He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
const int maxn= 100010;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a=0,b=0;
    cin>>a>>b;
    if(a>=13)
        cout<<b;
    else if(a>=6&&a<=12)
        cout<<(b/2);
    else
        cout<<"0";
    cout<<endl;
}

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

int main(){
  int a,b,c,x,y;
  cin>>a>>b>>c>>x>>y;
  int sum=a*x+b*y;
  int z=min(x,y),k=max(x,y);
  if(2*c>=a+b){
    
    cout<<sum<<endl;
  }
  else{int sum1;
       sum1=2*c*k;
    for(int i=1;i<=z;i++){
      sum+=2*c-a-b;  
    }
    cout<<min(sum,sum1)<<endl;
  }
  
  

}



Measured memory_bytes: 256
N,M=map(int,input().split())
H=[int(h) for h in input().split()]
MAX=[-1 for _ in range(N)]
for _ in range(M):
    A,B=map(int,input().split())
    MAX[A-1]=max(H[B-1],MAX[A-1])
    MAX[B-1]=max(H[A-1],MAX[B-1])

ans=sum(int(h>M) for h,M in zip(H,MAX))
print(ans)

Measured memory_bytes: 20080
#include<cstdio>
#include<cmath>
int digit(int);
int main(){
	int n,a,b;
	scanf("%d",&n);
	scanf("%d",&a);
	scanf("%d",&b);
	int sum = 0;
	for(int x = 1;x <= n;x++){
		int digitsum = digit(x);
		if (digitsum <= b&&digitsum >= a) sum += x;
	}
	printf("%d",sum);
} 

int digit(int x){
	int ans = 0;
	for(int a = log10(x);a >= 0;a--){
		ans += x/(int)(pow(10,a));
		x = x%(int)(pow(10,a));
	}
	return ans;
}

Measured memory_bytes: 128
using System;
using System.IO;

class Program
{
    static void Main(string[] args) {
        var writer = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(writer);
        Console.WriteLine(Solve());
        Console.Out.Flush();
    }
    static int Solve() {
        var N = Console.ReadLine();
        var len = N.Length;
        var isNines = true;
        for (int i = 1; i < len; i++) {
            if (N[i] == '9') continue;
            isNines = false;
            break;
        }
        if (isNines) return 9 * (len - 1) + N[0] - '0';
        if (N[0] == '1') return 9 * (len - 1);
        return len - N.Replace("9", "").Length == len ? 9 * len : 9 * (len - 1) + N[0] - '1';
    }
}

Measured memory_bytes: 25848
#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

int main(){
  Int n;cin >> n;
  Int ans=0;
  vector<Int> a(n+1),b(n);
  for(auto &i:a) cin >> i;
  for(auto &i:b) cin >> i;
  for(Int i=0;i<n;i++){
    if(a[i]>=b[i]){ans+=b[i];}
    else{
      ans+=a[i];
      b[i]-=a[i];
      if(a[i+1]>=b[i]){a[i+1]-=b[i];ans+=b[i];}
      else{ans+=a[i+1];a[i+1]=0;}
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define PI 3.14159265358979323846

#define int64 long long
#define uint64 unsigned long long
using namespace std;

int main()
{
	int64 nn, kk, ss;
	cin >> nn >> kk >> ss;
	for(int64 ii = 0;ii < kk;ii++)
	{
		cout << ss << ' ';
	}
	for(int64 ii = kk;ii < nn;ii++)
	{
		cout << (ss == 1000000000 ? 1 : ss + 1) << ' ';
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 3604
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Main main = new Main();
        main.solve();
    }
    public void solve() throws Exception {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        long K = scan.nextLong();
        long[] A = new long[N];
        for (int i = 0; i < N; i++) {
            A[i] = scan.nextLong();
        }
        long[] sumA = new long[N];
        long[] sumB = new long[N];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                if (A[i] > A[j]) {
                    if (i < j) {
                        sumA[i] += 1;
                    }
                    sumB[i] += 1;
                }
            }
        }
        long MOD = 1000000007;
        long answer = 0;
        for (int i = 0; i < N; i++) {
            answer += K * sumA[i];
            answer %= MOD;
            if (1 < K) {
                long x = (K - 1) * K / 2;
                x %= MOD;
                answer += sumB[i] * x;
                answer %= MOD;
            }
        }
        System.out.println(answer);
    }
}


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

using ll=long long;
const ll MOD=1000000007;

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if(2*b==a+c){
    cout << "YES" << endl;
  }
  else
    cout << "NO" << endl;
}

Measured memory_bytes: 256
N, M , C = map(int,input().split())
L = list(map(int,input().split()))
cnt = 0
for _ in range(N):
    tmp = 0
    for x ,y in zip(map(int,input().split()),L):
        tmp += x * y
    if tmp + C > 0:
        cnt += 1
print(cnt)
    


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;
// vector<vector<int>> data(3, vector<int>(4));

void solve(long long H, long long A){
	cout << (H-1)/A+1 << endl;
}

int main(){	
	long long H;
	long long A;
	scanf("%lld",&H);
	scanf("%lld",&A);
	solve(H, A);
	return 0;
}



Measured memory_bytes: 256
MOD = 998244353
N = int(input())
D = list(map(int, input().split()))
D_2 = [0]*(max(D)+1)
for i in D:
    D_2[i] += 1
ans = 1 if D_2[0] == 1 and D[0] == 0 else 0
for i in range(1,max(D)+1):
    ans *= D_2[i-1]**D_2[i]
    ans %= MOD
print(ans)


Measured memory_bytes: 84616
#include <bits/stdc++.h>
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define showvp(p) rep(i,p.size()) printf("%d %d\n", p[i].first, p[i].second);
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define incl(v,x) find(rng(v),x)!=v.end()
#define incls(s,c) s.find(c)!=string::npos
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define bit(n,k) ((n>>k)&1) // nのk bit目
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
using vt = vector<T>;
const int mod = 1000000007;
const double EPS = 1e-9;
//const long double EPS = 1e-14;
const int INF = (1<<30)-1;
const ll LINF = (1LL<<62)-1;
#define dame { puts("No"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
inline int in() { int x; scanf("%d",&x); return x;}
//template<class T = int> inline T in() { T x; cin >> x; return (x);}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
char itoa(int n) { return n + '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 () {
  string s;
  getline(cin, s);
  rep(i,s.size()) {
    if ('a'<=s[i] && s[i]<='z') s[i] += 'A'-'a';
    else if ('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A'; 
  }
  cout << s << endl;
  return 0;
}


Measured memory_bytes: 3160
#include <iostream>
#include <vector>
using namespace std;
int main(){
  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  vector<int> c(n);
  for(int i = 0; i < n; i++){
    cin >> p[i];
    --p[i];
  }
  for(int i = 0; i < n; i++){
    cin >> c[i];
  }
  long long ans = -1e18;
  for(int si = 0; si < n; si++){
    int x = si;
    vector<int> s;
    long long tot = 0;
    while(1){
      x = p[x];
      s.push_back(c[x]);
      tot += c[x];
      if(x == si) break;
    }
    int l = s.size();
    long long t = 0;
    for(int i = 0; i < l; i++){
      t += s[i];
      long long now = t;
      if(i+1 > k) break;
      if(tot > 0){
        long long e = (k-(i+1))/l;
        now += tot*e;
      }
      ans = max(ans, now);
    }
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 3728
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for(ll i = a; i < (ll)(b); i++)

#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

using namespace std;
using ll = long long;
using vel = vector<ll>;
using ves = vector<string>;
using veb = vector<bool>;
using qul = queue<ll>;

void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

int binary_search(ll x, vel a){
    auto ite = lower_bound(ALL(a), x);
    if(ite != a.end() && *ite == x) {
        return ite - a.begin() ;
    } else {
        return -1;
    }

}

ll modpow(ll a, ll n, ll mod) {
    if(n == 0)
        return 1;
    if(n == 1)
        return a % mod;
    if(n % 2 == 1)
        return (a * modpow(a, n - 1, mod)) % mod;
    ll t = modpow(a, n / 2, mod);
    return (t * t) % mod;
}



int main() {
    ll X,K,D,min,amari,shou;
    cin >> X >> K >> D;
    amari = X%D;
    shou = abs(X/D);
    min = abs(amari);
    if(shou < K && (K - shou)%2 == 1){
        if(amari >= 0){
            min = abs(amari - D);
        } else {
            min = amari + D;
        }
    } else if(shou < K && (K - shou)%2 == 0) {

    } else if(shou == K) {

    } else {
        min = abs(X) - (K * D);
    }

    cout << min << endl;
    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define endl '\n'
typedef pair<int, int> P;
typedef long long ll;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll a;
    long double b;
    cin >> a >> b;
    cout << (ll)(a * b) << endl;
}

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;

#define ZP(a, len) setfill('0') << setw(len) << right << a
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
const ll LINF = 1e11;

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


void solve() {
    int n, a, b;
    cin >> n >> a >> b;

    string ans = ((b - a) % 2 == 0) ? "Alice" : "Borys";

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


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

    solve();
    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_DEPRECATE
#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <memory.h>
#include <set>
#include <ctime>
#include <map>
#include <cstring>
#include <iterator>
#include <queue>
#include <assert.h>
#include <bitset>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <functional>

//#pragma comment(linker, "/STACK:512000000")

using namespace std;

#define pb emplace_back
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < (n); ++i)
#define forab(i, a, b) for (int i = (a); i < (b); ++i)

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int infi = 1e9 + 7;
const ll infl = (ll)1e18 + (ll)7;


int32_t main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    //srand(time(NULL));
   // freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    //freopen("customs.in", "r", stdin); freopen("customs.out", "w", stdout);
    int n;
    string a, b, c;
    cin >> n >> a >> b >> c;
    int ans = 0;
    forn(i, n) {
        if (a[i] == b[i] && b[i] == c[i])
            continue;
        if (a[i] == b[i] || b[i] == c[i] || a[i] == c[i])
            ans++;
        else
            ans += 2;
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
int main() {
  int N;
  int view = 0;
  int max = 0;
  scanf("%d", &N);
  int H[N];
  for(int i = 0; i < N; i++){
    scanf("%d", &H[i]);
    if(H[i] > max){
      max = H[i];
    }
    if(H[i] >= max){
      view += 1;
    }
  }
  
  printf("%d\n", view);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ll long long
#define sz(a) int((a).size())
#define fr(i,n) for(int i=0;i<n;i++) 
#define rf(i,n) for(int i=1;i<=n;i++) 
#define pb push_back 
#define all(c) (c).begin(),(c).end() 
#define tr(c,i) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++) 
#define present(c,x) ((c).find(x) != (c).end()) 
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define MAX INT_MAX 
#define f first
#define s second
using namespace std;
#define M 1000000007
ll dp[100001];
int main()
{
    int n,w;
    cin>>n>>w;
    std::vector<pair<int,int> > v(n);
    fr(i,n)
        cin>>v[i].f>>v[i].s;

    fr(i,w)
        dp[i]=0;
    dp[0]=0;
    for(int i=0;i<n;i++)
    {
        for(int j=w; j>=v[i].f;j--)
            dp[j] = max((ll)v[i].s + dp[j-v[i].f], dp[j]);
    } 
    ll ans = dp[w];
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 4380
#include<stdio.h>
int N,i,dp[35]={1};
int main()
{
	for(i=0;i<31;i++)
	{
		dp[i+1]+=dp[i];
		dp[i+2]+=dp[i];
		dp[i+3]+=dp[i];
	}
	for(;scanf("%d",&N),N;printf("%d\n",dp[N]/3650+(dp[N]%3650?1:0)));
	return 0;
}

Measured memory_bytes: 600
n = int(input())
A = list(map(int, input().split()))

mod = 10**9 + 7
total = 0
for i in range(60):
  cnt = sum([1 for a in A if (a>>i & 1)])
  total += cnt * (n-cnt) * (1 << i)
  total %= mod
print(total)

Measured memory_bytes: 42156