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




int main() {
  priority_queue<int> pq;
  int N, M, a;
  long long sum = 0;
  
  cin >> N >> M;
  while (N--) {
    cin >> a;
    pq.push(a);
  }
  while (M--) {
    pq.push(pq.top()/2);
    pq.pop();
  }
  while (!pq.empty()) {
    sum += pq.top();
    pq.pop();
  }
  cout << sum;
}

Measured memory_bytes: 892
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>

using namespace std;

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

	int n;
	cin >> n;
	vector<int> a(n);
	for (auto &t : a) {
		cin >> t;
	}
	vector<int> vl = {-1, 0};
	vector<int> dp = {1, 1};
	for (int i = 1; i < n; i++) {
		vector<int> ndp(2);
		for (int f = 0; f < 2; f++) {
			for (int s = 0; s < 2; s++) {
				if (a[i - 1] + vl[f] <= a[i] + vl[s] && dp[f]) {
					ndp[s] = 1;
				}
			}
		}
		dp = ndp;
	}
	if (dp[0] || dp[1]) cout << "Yes\n";
	else cout << "No\n";
}


Measured memory_bytes: 640
x = int(input())
def sosuu(n):
    jud = 0
    for k in range(2,int(n**(0.5))):
        if n % k == 0:
            jud = 1
    if jud == 0:
        return True
    else:
        return False

for i in range(x,100004):
    if sosuu(i):
        print(i)
        break

Measured memory_bytes: 9368
from collections import defaultdict
N = int(input())
a = list(map(int,input().split()))

r = defaultdict(int)

for i in a:
    r[i-1] += 1
    r[i] += 1
    r[i+1] += 1

print(max(r.items(), key=(lambda x : x[1]))[1])


Measured memory_bytes: 20004
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <math.h>
#include <iomanip>
using namespace std;
#define Would
#define you
const int INF = 999999999;
const int MOD = 1e9 + 7;
const double pi = 3.141592653589793238;

int main() {
	int a, b, mmon;
	char c;
	cin >> a >> b >> c;
	string mon = ".-|+";
	mon += c;
	for (int i = 0; i < b; ++i) {
		for (int j = 0; j < a; ++j) {
			mmon = 0;
			if (i == 0 || i == b - 1) { ++mmon; }
			if (j == 0 || j == a - 1) { mmon += 2; }
			if (i == b / 2 && j == a / 2) { mmon = 4; }
			cout << mon[mmon];
		}
		cout << endl;
	}
}


Measured memory_bytes: 3228
#include <cstdio>
#include <cctype>
#include <utility>
#include <complex>
#include <algorithm>
#include <unordered_set>
#include <vector>
using namespace std;

const auto gcu = getchar_unlocked;
const auto pcu = putchar_unlocked;
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
_T _DEF(T,in,int c){T n=0;int m=1;while(isspace(c)){c=gcu();}if(c=='-')m=-1,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
_DEF(int, in){return in<int>(gcu());}
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
_T _SCAN(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_DEF(bool, scan, char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_SCAN(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);}
_OUT(const char *s){while(*s)pcu(*s++);}
_OUT(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_OUT(string s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b,m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=n%10*m+'0',n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _OUT(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}

using P = complex<long>;

P dec(long n) {return {n >> 32, n & ((1L << 32) - 1)};}
long enc(P p) {return (p.real() << 32) + p.imag();}

int main() {
	for (int m; (m = in());) {
		vector<P> p(m - 1);
		P z = {in(), in()};
		for(P &x : p)
			x = P{in(), in()} - z;
		unordered_set<long> s;
		for (int n = in(); n--;)
			s.insert(enc({in(), in()}));
		for (long n: s)
			if([&]{
			   for (P i: p)
				   if (!s.count(enc(dec(n) + i)))
					   return false;
			   return true;}()) {
				P r = dec(n) - z;
				outl(r.real(), ' ', r.imag());
				break;
			}
	}
}


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


/**
 * src から dst までの最短距離を求める
 */
int solve(int src, int dst) {
  if (src == dst) return 0;
  int answer = 0;
  if (src % 2 != 0) { answer++; src++; }
  if (dst % 2 != 0) { answer++; dst--; }
  answer += solve(src / 2, dst / 2);
  return answer;
}

int main(){
  int N, s, d;
  cin >> N;
  for ( int i = 0; i < N; i++ ){
    cin >> s >> d;
    cout << solve(s, d) << endl;
  }
}




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

#define sysp system("pause")

typedef long long ll;

map<int,int> m;
int n,k,ans;

int main(){
	vector<int> v;
	cin>>n>>k;
	for(int i=0;i<n;i++){
		int dis;
		cin>>dis;
		if(m.count(dis)==0){
			m.insert(make_pair(dis,1));
		}else{
			m[dis]++;
		}
	}
	if(m.size()<=k){
		cout<<0<<endl;
		sysp;
		return 0;
	}
	for(auto ite=m.begin();ite!=m.end();ite++){
		int dis=ite->second;
		v.push_back(dis);
	}
	sort(v.begin(),v.end());
	for(int i=0;i<m.size()-k;i++){
		ans+=v[i];
	}
	cout<<ans<<endl;
	sysp;
}

Measured memory_bytes: 10748
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 998244353;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<ll> vec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-5;
const ld pi = acos(-1.0);

int mex(vector<int> &a) {
	sort(a.begin(), a.end());
	a.erase(unique(a.begin(), a.end()), a.end());
	rep(i, a.size()) {
		if (a[i] != i)return i;
	}
	return a.size();
}
int calc_grandy(ll n, ll m) {
	ll d = n / 2;
	if (d < m) {
		ll dif = (n-m); dif %= 2;
		if (dif)return 1;
		else return 0;
	}
	ll pren=n, prep=0, preq=1;
	ll p, q;
	while (true) {
		n = (pren / 2);
		if (n == 1&&m==1) {
			if (pren == 2) {
				if (prep)return 0;
				else return 1;
			}
			else {
				if (preq)return 0;
				else return 1;
			}
		}
		vector<int> vp;
		ll dif = (pren - (n+1));
		if (dif % 2 == 0) {
			vp.push_back(prep);
		}
		else {
			vp.push_back(preq);
		}
		dif = (pren - 2 * n);
		if (dif % 2 == 0)vp.push_back(prep);
		else vp.push_back(preq);
		p = mex(vp);
		vector<int> vq;
		vq.push_back(p);
		dif = (pren - 2 * (n - 1));
		if (dif % 2 == 0)vq.push_back(prep);
		else vq.push_back(preq);
		q = mex(vq);
		if (n / 2 < m) {
			ll dif = (n - m); dif %= 2;
			if (dif)return q;
			else return p;
		}
		pren = n, prep = p, preq = q;
	}
}


int grandy(int x, int y) {
	if (x < y)return 3;
	vector<int> v;
	v.push_back(grandy(x, y + 1));
	v.push_back(grandy(x, 2 * y));
	return mex(v);
}

void check() {
	rep1(i, 100) {
		rep1(j, 100) {
			if (i < j)continue;
			//cout << i << " " << j << endl;
			int l = grandy(i, j);
			int r = calc_grandy(i, j);
			if (l != r) {
				cout << i << " " << j << endl;
				cout << l << " " << r << endl;

			}
			//cout << grandy(i, j) << " " << calc_grandy(i, j) << endl;
		}
	}
}

void solve() {
	int k; cin >> k;
	int x = 0;
	rep(i, k) {
		ll n, m; cin >> n >> m;
		x ^= calc_grandy(m, n);
	}
	if (x) {
		cout << "mo3tthi" << endl;
	}
	else {
		cout<<"tubuann" << endl;
	}
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//check();
	solve();
	//stop
	return 0;
}



Measured memory_bytes: 3220
import java.io.*;
import java.io.IOException;
import java.util.*;

@SuppressWarnings({"rawtypes", "unchecked"})
class Main {
    final static int INF = 1 << 28;
    final static long LNF = 1L << 60;
    final static double EPS = 1e-9;
    final static double GOLDEN_RATIO = (1.0 + Math.sqrt(5)) / 2.0;

    static final long MOD = 1_000_000_007;

    public static void main(String[] args) throws Exception {
        final MyScanner sc = new MyScanner();
        long N;
        N = sc.nextLong();
        solve(N);
    }

    static void solve(long N){
        long ans = 0;
        long tmpans = -1;
        long div;
        if(N%2 == 0) {
            div = 2;
        } else {
            System.out.println(0);;
            return;
        }

        while(tmpans != 0) {
            div *= 5;
            tmpans = N / div;
            ans += tmpans;
        }

        System.out.println(ans);

    }



    static class MyScanner {
 
        BufferedReader br;
        StringTokenizer st;
 
        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }
 
        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        String next() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }
 
        char nextChar() {
            return nn().charAt(0);
        }
 
        int nextInt() {
            return Integer.parseInt(nn());
        }
 
        long nextLong() {
            return Long.parseLong(nn());
        }
 
        double nextDouble() {
            return Double.parseDouble(nn());
        }
 
        Integer[] niArr0(int n) {
            Integer[] ar = new Integer[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Integer[] niArr1(int n) {
            Integer[] ar = new Integer[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
 
        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
    }

}


Measured memory_bytes: 21460
import java.io.*;
import java.util.*;

class Main {
    static class Pair {
        int to;
        long w;
        Pair(int t, long wt) {
            to = t;
            w = wt;
        }
    }
    static long[] depth;
    static ArrayList<Pair>[] v;
    static boolean[] visited;
    public static void main(String[] args) {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        depth = new long[n];
        v = new ArrayList[n];
        visited = new boolean[n];
        for (int i = 0; i < n; i++) v[i] = new ArrayList<>();
        for (int i = 0; i < n - 1; i++) {
            int x = in.nextInt() - 1;
            int y = in.nextInt() - 1;
            long w = in.nextLong();
            v[x].add(new Pair(y, w));
            v[y].add(new Pair(x, w));
        }
        int q = in.nextInt();
        int k = in.nextInt() - 1;
        dfs(k, -1, 0);
        for (int i = 0; i < q; i++) {
            int x = in.nextInt() - 1;
            int y = in.nextInt() - 1;
            out.println(depth[x] + depth[y]);
        }
        out.close();
    }

    static void dfs(int source, int parent, long d) {
        visited[source] = true;
        depth[source] = d;
        for (Pair a : v[source]) {
            if (!visited[a.to]) {
                dfs(a.to, source, d + a.w);
            }
        }
    }

    static class InputReader {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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



Measured memory_bytes: 93376
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stack>
#include <queue>
#include <list>
#include <map>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;

#define MAX(x,y) ( (x) > (y) ? (x) : (y) )
#define MIN(x, y) ( (x) < (y) ? (x) : (y) )
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define IVFOR(p,a) for(vector<int>::iterator p = (a).begin(); p!=(a).end(); p++)
#define ILFOR(p,a) for(list<int>::iterator p = (a).begin(); p!=(a).end(); p++)
#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define CHECK(x)  cout << #x << " = " << (x) << endl
#define FINA(y) cout << (y) << endl

int main(){

  string str;
  stack<int> S;
  int n;
  S.push(100);

  cin >> str;
  
  REP(i,str.size()){
    if(str[i] == '0')
      S.push(0);
    else if(str[i] == '1')
      S.push(1);
    else if(S.top() == 100)
      continue;
    else
      S.pop();
  }	
  //    cout << S.top() << endl;
  
  int size;
  size = S.size() - 1;
  //  CHECK(size);
  int ans[size];
  //  CHECK(S.top());
  
  FOR(i,0,size){
    ans[i] = S.top();
    //  CHECK(ans[i]);
    S.pop();
  }
  for(int i = size -1; i >=0; i--){
    cout << ans[i];
  }
  cout << endl;
 
 return 0;
}


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

using i64 = long long int;

const i64 MAX_N = 1ll << 20;
const i64 INF = 1e12;

struct Node{
    i64 id, point;
    bool operator<(const Node &obj)const{
        if(point == obj.point)return id > obj.id;
        return point < obj.point;
    }
};

i64 n, times[MAX_N]={0};
Node dat[2*MAX_N-1];

void init(i64 n_){
    n = 1;
    while(n < n_)n *= 2;
    for(i64 i=0;i<2*n-1;i++)dat[i] = (Node){INF, -INF};
    for(i64 i=0;i<n_;++i)dat[i+n-1] = (Node){i, 0};
}

void update(i64 k, i64 a){
    k += n - 1;
    dat[k].point += a;
    while(k > 0){
        k = (k - 1) / 2;
        dat[k] = max(dat[k*2 + 1], dat[k*2 + 2]);
    }
}

Node query(i64 a, i64 b, i64 k, i64 l, i64 r){
    if(r <= a || b <= l)return (Node){INF, -INF};

    if(a <= l && r <= b)return dat[k];
    else{
        Node vl = query(a, b, k*2+1, l, (l+r)/2);
        Node vr = query(a, b, k*2+2, (l+r)/2, r);
        return max(vl, vr);
    }
}

int main(){
    i64 N, Q;
    cin >> N >> Q;
    init(N);
    for(int i=0;i<Q;++i){
        i64 a, v;
        cin >> a >> v;
        update(a-1, v);
        Node top = query(0, N, 0, 0, N);
        cout << top.id + 1 << " " << top.point << endl;
    }

    return 0;
}



Measured memory_bytes: 35840
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>

struct Swap {
	int a, b;
	int min() const { return std::min(a, b); }
	int max() const { return std::max(a, b); }
	int swap(int pos) const {
		if (a == pos) return b;
		if (b == pos) return a;
		return pos;
	}
};
class Replacer {
	std::vector<std::vector<std::vector<int>>> jump;
	std::vector<std::vector<int>> swap_history;
	std::vector<Swap> swap;
public:
	Replacer(const int n, const std::vector<Swap>& _swap) : jump(_swap.size(), std::vector<std::vector<int>>(2)), swap_history(n), swap(_swap) {
		for (auto t = 0; t < swap.size(); ++t) {
			swap_history[swap[t].a].push_back(t);
			swap_history[swap[t].b].push_back(t);
		}
		for (int t = swap.size() - 1; t >= 0; --t) {
			jump[t][0].push_back(swap[t].max());
			jump[t][1].push_back(swap[t].min());
			for (auto i = 1; (1 << i) + t <= swap.size(); ++i) {
				jump[t][0].push_back(move(swap[t].max(), t + 1, t + (1 << i) - 1));
				jump[t][1].push_back(move(swap[t].min(), t + 1, t + (1 << i) - 1));
			}
		}
	}
	int move(int pos, int s, int t) const {
		if (s == t) return swap[s].swap(pos);
		if (swap[s].swap(pos) == pos) {
			auto next = std::upper_bound(swap_history[pos].begin(), swap_history[pos].end(), s);
			if (next != swap_history[pos].end() && *next <= t) {
				return move(pos, *next, t);
			}
			else {
				return pos;
			}
		}
		else {
			auto idx = (swap[s].min() == pos) ? 0 : 1;
			auto next = 0;
			while ((1 << next) + s <= t && next < jump[s][idx].size()) ++next;
			--next;
			return move(jump[s][idx][next], s + (1 << next), t);
		}
	}
};


int main() {
	int n, k, q; std::cin >> n >> k >> q;
	std::vector<Swap> swap(k);
	for (auto& s : swap) {
		std::cin >> s.a>> s.b; --s.a; --s.b;
	}
	Replacer forward(n, swap);
	std::reverse(swap.begin(), swap.end());
	Replacer backward(n, swap);
	for (auto c = 0; c < q; ++c) {
		int type, s, t, x; std::cin >> type >> s >> t >> x; --s; --t; --x;
		switch (type) {
		case 1:
			std::cout << backward.move(x, k - t - 1, k - s - 1) + 1 << '\n';
			break;
		case 2:
			std::cout << forward.move(x, s, t) + 1 << '\n';
			break;
		default: throw 0;
		}
	}
}


Measured memory_bytes: 72580
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;

//#define int long long
//using ll = boost::multiprecision::cpp_int;
using ll = long long;
//constexpr int INF = 1e9;//INT_MAX=(1<<31)-1=2147483647
constexpr ll INF = (ll)1e18;//(1LL<<63)-1=9223372036854775807
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-9;
constexpr int dx[4]={1,0,-1,0};
constexpr int dy[4]={0,1,0,-1};
#ifdef LOCAL_ENV
	#define debug(var) std::cout<<#var" = "<<var<<std::endl
#else
	#define debug(var)
#endif
#define p(var) std::cout<<var<<std::endl
#define rep(i, n)   for(ll i=0, i##_length=(n); i< i##_length; ++i)
#define repeq(i, n) for(ll i=1, i##_length=(n); i<=i##_length; ++i)
#define all(a) (a).begin(), (a).end()
#define PI (acos(-1))
template<typename T> inline T power(T x, T n){ return n ? power(x*x%MOD,n/2)*(n%2?x:1)%MOD : 1; }
template<typename T> inline T gcd(T a, T b) { return b ? gcd(b,a%b) : a; }
template<typename T> inline T lcm(T a, T b) { return a / gcd(a,  b) * b; }
template<typename T1, typename T2>inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template<typename T1, typename T2>inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	for (int i = 0, len = v.size(); i < len; ++i){
		s << v[i]; if (i < len - 1) s << "\t";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
	for (int i = 0, len = vv.size(); i < len; ++i){
		s << vv[i] << endl;
	}
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const map<T1, T2>& m) {
	s << "{" << endl;
	for (typeof(m.begin()) itr = m.begin(); itr != m.end(); ++itr){
		s << "\t" << (*itr).first << " : " << (*itr).second << endl;
	}
	s << "}" << endl;
	return s;
}

/*-----8<-----8<-----*/

constexpr ll N_MAX = 200010;

ll N;
ll a[N_MAX];

void input() {
	scanf("%lld", &N);
	repeq(i, N) scanf("%lld", a + i);
}

void solve() {

	vector<int> b(N+1,0);
	for(int i=N;i>0;i--){
		int c=0;
		int j=i;
		while(j<=N){
			if(b[j])c+=b[j];
			j+=i;
		}
		c+=a[i];
		b[i]=c%2;
	}

	p(accumulate(all(b),0));
	bool first=true;
	repeq(i,N){
		if(b[i]){
			cout<<i<<' ';
		}
	}
	cout<<endl;
}

signed main() {
	input();
	solve();
	return 0;
}


Measured memory_bytes: 3200
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <iomanip>
using namespace std;

#define pi 3.141592653589
#define repeat(i,n) for(int i=0;i<n;i++)

int main(){
	int n, m;
	int **a, *b,*c;
	cin >> n >> m;

	//配列確保
	a = new int*[n];
	repeat(i,n)
	{
		a[i] = new int[m];
	}
	b = new int[m];
	c = new int[n];

	//配列Cの初期化
	repeat(i, n)
	{
		c[i] = 0;
	}
	
	//配列の各要素に値を代入
	repeat(i,n)
	{
		repeat(j,m)
		{
			cin >> a[i][j];
		}
	}

	repeat(i, m)
	{
		cin >> b[i];
	}

	//行列Cの各要素計算
	repeat(i, n)
	{
		repeat(j, m)
		{
			c[i] += (a[i][j] * b[j]);
		}
	}

	//行列Cの要素の表示
	repeat(i, n)
	{
		cout << c[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 1228
#include "bits/stdc++.h"
using namespace std;
 
int N,u,v,w,i;
vector<pair<int,int> >T[100010];
int cl[100010];
 
void dfs(int v,int pv,int c){
    cl[v] = c;
    for(auto nv : T[v]){
        if(nv.first == pv) continue;
        dfs(nv.first, v, c^nv.second);
    }
}
 
int main(){
    cin >> N;
    i=0;
    while(i<N-1){
        cin >> u >> v >> w;
        T[u].push_back(make_pair(v,w%2));
        T[v].push_back(make_pair(u,w%2));
        i++;
    }
    dfs(1,0,0);
    i=0;
    while(i<N) {
        cout << cl[i+1] << "\n";
      i++;
        }
    return 0;
}

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

bool graph[4][4];

int main() {
    int a, b;
    for (int i = 0; i < 3; i++) {
        cin >> a >> b;
        a--, b--;
        graph[a][b] = graph[b][a] = true;
    }
    for (int i = 0; i < 4; i++) {
        int now_cnt = 0;
        for (int j = 0; j < 4; j++) {
            if (i == j) continue;
            if (graph[i][j]) now_cnt++;
        }
        if (now_cnt > 2) {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,i;
    cin>>n>>k;
    int h,sum=0;
    for(i=0;i<n;i++)
    {
        cin>>h;
    if(h>=k)sum++;
    }
    cout<<sum;
    return 0;
    
}

Measured memory_bytes: 256
#include<stdio.h>



#define emt 1000 + 1


bool check[ emt ][ emt ][ emt ] ;


int ans ;



int min( int a ,int b )
{
	return a > b ? b : a ;
}


int max( int a ,int b )
{
	return a > b ? a : b ;
}



int main()
{
	int n ;
	scanf( "%d" ,&n ) ;


	int a ,b ,c ;

	int i ;
	for( i = 0 ; i < n ; ++i )
	{
		scanf( "%d %d %d" ,&a ,&b ,&c ) ;


		int aa = min(  a ,min( b ,c )  ) ;

		int bb = min(  max( a ,b ) ,min(  max( b ,c ) ,max( a ,c )  )  ) ;

		int cc = max(  a ,max( b ,c )  ) ;



		if( check[ aa ][ bb ][ cc ] == true )
		{
			ans += check[ aa ][ bb ][ cc ] ;
		}

		else
		{		
			check[ aa ][ bb ][ cc ] = true ;
		}
	}


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


	return 0 ;
}

Measured memory_bytes: 6560
#include <cstdio>
#include <complex>
using namespace std;

typedef complex<double> xy_t;

xy_t P[110];

int main(){
  int N=0;
  double x, y;
  while (~scanf("%lf,%lf", &x, &y)){
    P[N++] = xy_t(x,y);
  }
  double sum = 0.0;
  for (int i=2; i<N; ++i){
    xy_t a=P[0], b=P[i-1], c=P[i];
    sum += 0.5*((b.real()-a.real())*(c.imag()-a.imag())
		-(b.imag()-a.imag())*(c.real()-a.real()));
  }
  printf("%.6f\n", abs(sum));
  return 0;
}

Measured memory_bytes: 2576
dp = {}


def fib(n):
    if n in dp:
        return dp[n]
    else:
        if n <= 1:
            dp[n] = 1
        else:
            dp[n] = fib(n-1) + fib(n-2)
        return dp[n]


n = int(input())
print(fib(n))


Measured memory_bytes: 5600
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: i32,
    }
    let (i, j, k) = ((n / 100) % 10, (n / 10) % 10, n % 10);
    let i = match i {
        1 => 9,
        9 => 1,
        a => a,
    };
    let j = match j {
        1 => 9,
        9 => 1,
        a => a,
    };
    let k = match k {
        1 => 9,
        9 => 1,
        a => a,
    };
    println!("{}{}{}", i, j, k);
}


Measured memory_bytes: 4352
///بِسْمِ الّٰلهِ الرَّحْمٰنِ الرَحِيْمِ
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1.0)
int main()
{
     ios_base::sync_with_stdio(false);cin.tie(NULL);
     ll int i,n,t,j=0,p,x,a=0,b,l=0,r=0,y,k,c,sum=0,m,d;
     cin>>a>>b>>c>>d>>k;
      y=0;
        if(a<c){
           x=(c-a)*60;
           if(b>d){
             y=(60-b)+d-60;
           }
           else if(d>b){
             y=d-b;
           }
           cout<<x+y-k<<endl;
        }
        else if(a==c){
            if(b<d){
                cout<<d-b-k<<endl;
            }
            else if(b==d){
                cout<<0<<endl;
            }
            else{
                cout<<1440-(b-d)-k<<endl;
            }
        }
        else{
            x=24-a+c;
            x=x*60;
           if(b>d){
             y=(60-b)+d-60;
           }
           else if(d>b){
             y=d-b;
           }
           cout<<x+y-k<<endl;
        }

     return EXIT_SUCCESS;
}





Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long long i64;
typedef long double ld;
const int inf = int(1e9) + int(1e5);
const ll infl = ll(2e18) + ll(1e10);

int main() {
    #ifdef LOCAL
    assert(freopen("a.in", "r", stdin));
    #else
    #endif
    ll a, b, c;
    cin >> a >> b >> c;
    forn (iter, 1e7) {
        ll na = a + b;
        ll nb = a + c;
        ll nc = b + c;
        if (a % 2 || b % 2 || c % 2) {
            cout << iter << '\n';
            return 0;
        }
        a = na / 2, b = nb / 2, c = nc / 2;
        //cerr << a << ' ' << b << ' ' << c << '\n';
    }
    cout << -1 << '\n';
}


Measured memory_bytes: 764
#include <stdio.h>
using namespace std;

int N, L;
int S=0;

int main(){
  if(scanf("%d %d", &N, &L)==1);  
  int a[N];
  int b[N];
  int c[N]={0};
  for(int i=0; i<N; i++){
    a[i] = L + i;
    S += a[i];
    if(a[i]<0){
      b[i] = -a[i];
      c[i]++;
    } else {
      b[i] = a[i];
    }
  }
  int min;
  min = b[0];
  for(int i=0; i<N-1; i++){
    if(min>b[i+1])min = b[i+1];
  }
  for(int i=0; i<N; i++){
    if(min==b[i] && c[i]==1)min=a[i];
  }
  
  printf("%d", S-min);
  
  return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

int main(){

  int i,j,H,W;
  while (1){
    scanf("%d %d",&H,&W);if(W==0&&H==0){break;}
for(j=0;j<H;j++){
for(i=0;i<W;i++){    
if(i!=0&&i!=W-1&&j!=0&&j!=H-1){printf(".");
}else{printf("#");}
}
printf("\n");
 }printf("\n");}
 
 return 0;
}

Measured memory_bytes: 572
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip())
    ts = [int(x) for x in input().rstrip().split(" ")]
    original_time = sum(ts)
    m = int(input().rstrip())
    for i in range(m):
        p, x = [int(x) for x in input().rstrip().split(" ")]
        print(original_time - ts[p-1] + x)

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 62320
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  set<char> s;
  s.in('a'),s.in('i'),s.in('u'),s.in('e'),s.in('o');
  char c;
  R c;
  if(s.count(c)) pr("vowel");
  else pr("consonant");
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 256
N_str=input()
K=int(input())

#print(N_str)
digit_N=len(N_str)

#dp[i][j]: j:digit, k:K
dp_eq=[]
dp_ne=[]
for i in range(digit_N):
  dp_eq.append([0]*(K+1))
  dp_ne.append([0]*(K+1))

#init
dp_eq[0][1]=1
dp_ne[0][1]=int(N_str[0])-1
for i in range(digit_N):
  dp_ne[i][0]=1

for j in range(1,digit_N):
  digit=int(N_str[j])
  for k in range(1,K+1):
    if digit==0:
      dp_ne[j][k]=dp_ne[j-1][k]+9*dp_ne[j-1][k-1]
      dp_eq[j][k]=dp_eq[j-1][k]
    else:
      dp_ne[j][k]=dp_ne[j-1][k]+9*dp_ne[j-1][k-1]+dp_eq[j-1][k]+(digit-1)*dp_eq[j-1][k-1]
      dp_eq[j][k]=dp_eq[j-1][k-1]
    
print(dp_ne[-1][K]+dp_eq[-1][K])

Measured memory_bytes: 38384
def rren(): return list(map(int, input().split()))


N = int(input())
S = []
Ans = 0
for i in range(N):
    foo = int(input())
    S.append(foo)
    Ans += foo

S.sort()
Flag = True
if(Ans % 10 != 0):
    print(Ans)
    Flag = False
else:
    for i in S:
        if i % 10 == 0:
            continue
        else:
            print(Ans - i)
            Flag = False
            break

if(Flag):
    print(0)


Measured memory_bytes: 3064
#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 n;
    string s;
    cin >> n >> s;
    map<char, int> mp;
    mp['A'] = 2; mp['B'] = 1; mp['C'] = 0;
    int r = 2, ans = 0;
    while (r < n) {
        auto itr = mp.find(s[r]);
        if (itr != mp.end()) {
            if (itr->second == 0) {
                if (s[r-1]=='B' && s[r-2]=='A') ans++;
                r += 3;
            } else r += itr->second;
        } else r += 3;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;

vector<ll> num(45,0);

//繰り返し二乗法
ll EX(ll x,ll n){
    if(n == 0) return 1;
    else if(n%2 == 1) return EX(x,n-1)*x;
    else return EX(x*x,n/2);
};

vector<ll> to_k (ll n,ll k){
    vector<ll> memo(45);
    for(ll i = 44; i >= 0; i--){
        ll e = EX(k,i);
        if(e <= n){
            memo[i] = 1;
            n -= e;
        } else memo[i] = 0;
    }
    return memo;
}
vector<ll> x(45);
ll re_k (ll k){
    ll res = 0;
    for(ll i = 0; i < 45; i++){
        res += x[i]*EX(k,i);
    }
    return res;
}

int main(){
    ll n,k;
    cin >> n >> k;
    vector<ll> a(n);
    for(ll i = 0; i < n; i++){
        cin >> a[i];
        vector<ll> vlu = to_k(a[i],2);
        for(ll j = 0; j < 45; j++){
            if(vlu[j]%2 == 1) num[j]++;
        }
    }
    for(ll i = 0; i < 45; i++){
        if(num[i] <= n/2) x[i] = 1;
        else x[i] = 0;
    }
    vector<ll> kd = to_k(k,2);
    bool flag = true;
    for(ll i = 44; i >= 0; i--){
        if(flag && kd[i] == 1) flag = false;
        if(kd[i] == 1 && x[i] == 0) break;
        else if(kd[i] == 0 || flag) x[i] = 0;
        
    }
    ll hoge = re_k(2);
    ll ans = 0;
    for(ll i = 0; i < n; i++){
        ans += hoge^a[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3964
#include<stdio.h>
#include<string.h>
int N,W,w[1000],v[1000],i,j,dp[1005],R,U,c;
int main()
{
	for(c=1;~scanf("%d%d",&W,&N),W;c++)
	{
		memset(dp,-1,sizeof(dp));
		dp[0]=0;
		for(i=0;i<N;i++)scanf("%d,%d",&v[i],&w[i]);
		for(i=0;i<N;i++)
			for(j=W-w[i];j>=0;j--)
				if(dp[j]>=0)
					dp[j+w[i]]=dp[j]+v[i]>dp[j+w[i]]?dp[j]+v[i]:dp[j+w[i]];
		for(i=R=U=0;i<=W;i++)
			if(R<dp[i])
			{
				R=dp[i];
				U=i;
			}
		printf("Case %d:\n%d\n%d\n",c,R,U);
	}
	return 0;
}

Measured memory_bytes: 612
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1000000000
using namespace std;
using ll = long long;
int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n){
        cin >> a[i];
    }
    int ans = INF;
    rep(i,n){
        int tmp = 0;
        while(a[i]%2==0){
            tmp++;
            a[i] /= 2;
        }
        ans = min(ans, tmp);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>

using namespace std;

int main(){
	int x,y,temp,r;
	scanf("%d %d",&x,&y);
	if(x<y){
		temp=x;
		x=y;
		y=temp;
	}
	while(y>0){
		r=x%y;
		x=y;
		y=r;
	}
	printf("%d\n",x);
}

Measured memory_bytes: 3208
x, k, d = map(int,input().split())
x = x if x < 0 else -x

def solve():
    if (0 - x) >= k * d:
        return abs(x + k * d)
    s = (0 - x) // (d)
    if (k - s) % 2 == 0:
        return abs(x + d * s)
    return abs(x + d * (s + 1))

print(solve())

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

const int N = 200005;

int n, k;
int a[N];
long long b[N];
map<long long, int> ma;
int sz;
long long fen[N];

long long fget(int i) {
  long long ret = 0;
  while (i > 0) {
    ret += fen[i];
    i -= i & -i;
  }
  return ret;
}

void fset(int i, int val) {
  while (i < N) {
    fen[i] += val;
    i += i & -i;
  }
}

int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    b[i + 1] = sum - (long long) (i + 1) * k;
    ma[b[i + 1]];
  }
  ma[0];
  for (auto &it : ma) it.second = ++sz;
  long long ans = 0;
  for (int i = 0; i <= n; i++) {
    int index = ma[b[i]];
    ans += fget(index);
    fset(index, 1);
  }
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 16640
#include <bits/stdc++.h>
using namespace std;
int ans1[26],ans2[26];
int main()
{
    string s1,s2;
    cin>>s1>>s2;
    int i,j;
    s2+=s2;
    for(i=0;i<s1.size();i++)
    {
        int c=0;
        int flag=0;
        for(j=i;j<s2.size();j++)
        {
            if(s1[c]==s2[j])
            {
                c++;
                continue;

            }
            else
            {
                flag=1;
                break;
            }
        }
        if(c==s1.size())
        {
            cout<<"Yes\n";
            return 0;
        }
    }

    cout<<"No\n";
}


Measured memory_bytes: 256
n,m,q=map(int,input().split())

mylist=[[0]*(n+1) for _ in range(n+1)]

for i in range(m):
    l,r=map(int,input().split())
    mylist[l][r]+=1

for i in range(1,n+1):
    for j in range(1,n+1):
        mylist[i][j]+=mylist[i][j-1]

memo=[[-1]*(n+1) for _ in range(n+1)]

for i in range(q):
    P,Q=map(int,input().split())
    if(memo[P][Q]!=-1):
        print(memo[P][Q])
        continue
    tmp=0
    for j in range(Q,P-1,-1):
        tmp+=mylist[j][Q]
        memo[j][Q]=tmp
    print(tmp)

Measured memory_bytes: 13064
#include <bits/stdc++.h>
using namespace std;
int main() {
    
    string s, t;
    
    cin>>s;
    
    cin>>t;
    
    long long int count = 0;
  
    for(int i = 0; i < s.length(); ++i) {
        
          if(s[i] != t[i]) {
              
               count++; 
          }
    }
    
    cout<<count;
    return 0; 
}

Measured memory_bytes: 3904
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
using namespace std;
int n,m,K;
int main()
{
	scanf("%d%d",&n,&m);
	if(n<m)
	{
		for(int i=1;i<=m;i++)
			printf("%d",n);
	}
	else
		for(int i=1;i<=n;i++)
			printf("%d",m);
	puts("");
	return 0;
}

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

int main(){
    char S[256];
    char A[256]="AAA";
    char B[256]="BBB";
    scanf("%s",S);
    if(strcmp(S,A)==0||strcmp(S,B)==0){
        printf("No");
    }else{
        printf("Yes");
    }
    return 0;
}

Measured memory_bytes: 128
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let N: usize = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    };
    let L: Vec<i64> = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|x| x.parse().unwrap())
            .collect()
    };

    let S = {
        let mut S = L.clone();
        S.sort();
        S
    };
    fn bis<P>(ok: i64, ng: i64, p: P) -> i64
        where P: Fn(i64) -> bool {
        let mid = (ok + ng) / 2;
        if (ok - ng).abs() == 1 {
            ok
        } else if p(mid) {
            bis(mid, ng, p)
        } else {
            bis(ok, mid, p)
        }
    }
    // println!("{:?}", S);
    let ans = (2..N).map(|i|
        (0..(i - 1)).map(|j| {
            let k = bis(i as i64, j as i64, |k| S[i] < S[j] + S[k as usize]) as usize;
            // println!("{} {} {}", i, j, k);
            if k > j { i - k } else { 0 }
        }).sum::<usize>()
    ).sum::<usize>();

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

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

string s;
bool visit1[200000],visit2[200000];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n,A,B,C,D;
	cin>>n>>A>>B>>C>>D;
	A--;B--;C--;D--;
	cin>>s;
	visit1[A]=true;
	for(int i=A+1;i<n;i++)
		if(s[i]=='.'&&((i-1>=0&&visit1[i-1])||(i-2>=0&&visit1[i-2])))
			visit1[i]=true;
	visit2[B]=true;
	for(int i=B+1;i<n;i++)
		if(s[i]=='.'&&((i-1>=0&&visit2[i-1])||(i-2>=0&&visit2[i-2])))
			visit2[i]=true;
	bool blank=false;
	for(int i=B;i<=D;i++)
		if(s[i+1]=='.'&&s[i]=='.'&&s[i-1]=='.')
			blank=true;
	if(C<D){
		if(visit1[C]&&visit2[D])
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
	else{
		if(blank&&visit1[C]&&visit2[D])
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
}


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

int main()
{
 int n,m;
    cin>>n;
     int t[n];
     int s[n];
        for(int w=0;w<n;w++)
        {
            cin>>t[w];

            s[w]=t[w];
        }
        cin>>m;
        int p[m]={0};
        int x[m]={0};
        int sum[m]={0};
        for(int a=0;a<m;a++)
        {
           cin>>p[a]>>x[a];
        }
        for (int z=0;z<m;z++)
        {
            for(int i=0;i<n;i++)
            {
                if(p[z]==(i+1))
                {
                    t[i]=x[z];
                }
                    sum[z]+=t[i];
                    t[i]=s[i];
            }
        }
        for(int z=0;z<m;z++)
        {
            printf("%d \n",sum[z]);
        }
}

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

int t,n;

int main(){
	scanf("%d", &n);
	for(int i=1; i<=n; ++i){
		if(i%3==0){
			printf(" %d",i);
		}else{
			t = i;
			do{
				if(t%10==3){
					printf(" %d",i);
					break;
				}
				t = t/10;	
			}
			while(t);
		}
	}
	printf("\n");
}


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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

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

  string s;
  cin>>s;
  int N=s.size();
  vector<int>ans(N,0);
  int a=0;
  int b=0;
  int memo=0;
  for(int i=0;i<N;i++){
    if(i==N-1&&s[i]=='R'){
      ans[i]+=a+b+1;
    }
    else if(s[i]=='R'){
      if((i-memo)%2)a++;
      else b++;
    }
    else if(s[i]=='L'){
      ans[i]+=a;
      ans[i-1]+=b;
      a=0;
      b=0;
      memo=i+1;
    }
  }
  a=0;
  b=0;
  memo=N-1;
  for(int i=N-1;i>=0;i--){
    if(i==0&&s[i]=='L'){
      ans[i]+=a+b+1;
    }
    else if(s[i]=='L'){
      if((memo-i)%2)a++;
      else b++;
    }
    else if(s[i]=='R'){
      ans[i]+=a;
      ans[i+1]+=b;
      a=0;
      b=0;
      memo=i-1;
    }
  }
  for(auto it:ans)cout<<it<<" ";
  return 0;
}


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

using namespace std;

const int max_n = 303, mod = 998244353;
const int max_sum = max_n * max_n;

int n, a[max_n];
int dp[2][max_sum];
int cnt[2][max_sum];

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n;
    int q1 = 0, q2 = 1, ans = 1, sum = 0;
    dp[q1][0] = 1;
    cnt[q1][0] = 1;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        sum += a[i];
        memset(dp[q2], 0, sizeof(dp[q2]));
        memset(cnt[q2], 0, sizeof(cnt[q2]));
        for (int x = 0; x < max_sum; ++x) {
            if (dp[q1][x]) {
                dp[q2][x + a[i]] += dp[q1][x];
                dp[q2][x + a[i]] %= mod;
                dp[q2][x] += (2LL * dp[q1][x]) % mod;
                dp[q2][x] %= mod;
            }
            if (cnt[q1][x]) {
                cnt[q2][x + a[i]] += cnt[q1][x];
                cnt[q2][x + a[i]] %= mod;
                cnt[q2][x] += cnt[q1][x];
                cnt[q2][x] %= mod;
            }
        }
        swap(q1, q2);
        ans = (3LL * ans) % mod;
    }
    int add = 0;
    for (int x = (sum + 1) / 2; x < max_sum; ++x) {
        add += dp[q1][x];
        add %= mod;
    }
    add = (3LL * add) % mod;
    ans += mod - add;
    ans %= mod;
    if (sum % 2 == 0) {
        ans += (3LL * cnt[q1][sum / 2]) % mod;
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
 string a,b;
  cin >> a >> b;
  sort(a.begin(),a.end());
  sort(b.begin(),b.end(),greater<int>());

  if(a<b)cout << "Yes" << endl;
  else{
  cout << "No" << endl;
  }


}


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

namespace abc071_a
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Console.WriteLine(Math.Abs(x[0] - x[1]) < Math.Abs(x[0] - x[2]) ? "A" : "B");
        }
    }
}

Measured memory_bytes: 11348
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, sum int
	fmt.Scan(&n)
	a := make([]int, n)
	sum = 0

	for i := 0; i < n; i++ {
		var tmp int
		fmt.Scan(&tmp)
		a[i] = tmp
		sum += tmp
	}

	sort.SliceStable(a, func(i, j int) bool {
		return a[i] > a[j]
	})

	suma := 0
	for i := 0; i < n; i = i + 2 {
		suma += a[i]
	}

	ans := suma - (sum - suma)

	fmt.Println(ans)
}


Measured memory_bytes: 1840
#include<iostream>
#include<vector>
#include<string>
#include<array>
#include<algorithm>
#include<list>
#include<cmath>
#include<iomanip>
#include<queue>
#include<functional>
#include<climits>
#include<iterator>
#include<unordered_set>
#include<unordered_map>
using namespace std;

const double pi=4*atan(1.0);

int main() {
	string str;
	cin>>str;
	int N_num=0,S_num=0,W_num=0,E_num=0;
	for(const auto& val:str){
		if(val=='N'){
			++N_num;
		}
		else if(val=='S'){
			--S_num;
		}
		else if(val=='W'){
			++W_num;
		}
		else{
			--E_num;
		}
	}

	bool ans=true;
	if(N_num!=0 && S_num==0)ans=false;
	else if(N_num==0 && S_num!=0)ans=false;
	
	if(W_num!=0 && E_num==0)ans=false;
	else if(W_num==0 && E_num!=0)ans=false;

	if(ans)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

//	system("pause");
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while (s.hasNextInt()) {
			int h = s.nextInt();
			int w = s.nextInt();
			if (h == 0 && w == 0) return;
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print(((i + j) % 2 == 0)? '#' : '.');
				}
				System.out.println();
			}
			System.out.println();
		}
	}
}

Measured memory_bytes: 29040
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
 
ll fact[200010];
ll invfact[200010];
void makefact(int n,ll m){
	n=min(n,m-1);
	fact[0]=1;
	rep(i,0,n)fact[i+1]=fact[i]*(i+1)%m;
	invfact[n]=invp(fact[n],m);
	for(int i=n;i>0;i--)invfact[i-1]=invfact[i]*i%m;
}
ll choose(int n,int r,int m){return n<0||r<0||n-r<0?0:fact[n]*invfact[r]%m*invfact[n-r]%m;}

int n,k;
int main(){
    scanf("%d%d",&n,&k);
    makefact(200005,MOD);
    ll ans=0;
    rep(i,0,min(n,k)+1)ans+=choose(n,i,MOD)*choose(n-1,i,MOD)%MOD;
    printf("%lld",ans%MOD);
}

Measured memory_bytes: 3328
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e8;

using namespace std;


//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用


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

	int a, b, c;
	cin >> a >> b >> c;
	int d;
	cin >> d;

	if (abs(a - c) <= d || abs(a - b) <= d && abs(b - c) <= d)
	{
		cout << "Yes";
	}
	else
	{
		cout << "No";
	}
	cout << endl;

}

Measured memory_bytes: 256