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

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef unsigned long long ul;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<int, int> Pair;
typedef pair<ll, ll> PL;
typedef priority_queue<int> PQ;
typedef priority_queue<int, V, greater<int>> PQG;

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

ll N, M;
vector<PL> dem;

int main() {
    cin >> N >> M;
    REP(i, M) {
        CINT(a, b);
        dem.emplace_back(b, a);
    }
    sort(All(dem));
    ll tmp = 0, ans = 0;
    FOREACH(d, dem) {
        if(d.second > tmp) {
            ans++;
            tmp = d.first - 1;
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
int gcd(int a,int b){return b?gcd(b,a%b):a;}    //最大公約数
int lcm(int a, int b) {return a * b / gcd(a, b);}   //最小公倍数

int main()
{
	int M;
	int D;
	cin >> M >> D;
	int count = 0;
	int a[2];
	REP2(j, 4, M + 1)
	{
		REP2(i,22,D+1){
			a[0] = i % 10;
			a[1] = i /10;
			if(a[0]>=2&&a[1]>=2&&a[0]*a[1]==j)
				count++;
		}
	}
	cout << count << endl;
}

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

int main()
{
    string A, B, C;
    char a, b, c;
    cin >> A >> B >> C;
    a = A.at(0);
    b = B.at(0);
    c = C.at(0);

    a=toupper(a);
    b = toupper(b);
    c = toupper(c);
    cout << a <<b<<c<< endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int input = 0;
  string str;
  cin >> input >> str;
  int judge = input / 2;
  string top;
  string tale;
  
  if (input % 1){
   cout << "No" << endl;
  }

  for (int i = 0; i < judge; i++) {
    top += str[i];
  }
  
   for (int i = judge; i < str.length(); i++) {
    tale += str[i];
  }
  
  if (top == tale){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

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

    ll n;
  	cin >> n;
  	ll sum = (n*(n+1))/2;
  	
  	for(ll i=3; i<=n; i+=3){
      sum -= i;
    }
  	for(ll i=5; i<=n; i+=5){
      if(i%3 != 0) sum -= i;
    }
  	cout << sum << endl;

    return 0;
}


Measured memory_bytes: 3652
#include <algorithm>
#include <array>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>

using namespace std;

typedef long long ll;

ll cnt = 0;

void recursive(ll *lens, int n, bool *choices, int ind, int choice_cnt) {
  if (ind >= n && choice_cnt < 3) {
    return;
  }

  if (choice_cnt >= 3) {
    ll vals[3];
    int crt_ind = 0;

    for (int i = 0; i < n; i++) {
      if (choices[i]) {
        vals[crt_ind++] = lens[i];
      }
    }

    if (vals[0] == vals[1] || vals[1] == vals[2] || vals[0] == vals[2]) {
      return;
    }

    ll max_len = vals[0];
    ll max_ind = 0;
    for (int i = 1; i < 3; i++) {
      if (max_len < vals[i]) {
        max_len = vals[i];
        max_ind = i;
      }
    }

    ll sum_len_without_max = 0;
    for (int i = 0; i < 3; i++) {
      if (i != max_ind) {
        sum_len_without_max += vals[i];
      }
    }

    if (max_len < sum_len_without_max) {
      cnt++;
    }

    return;
  }

  bool *new_choices = new bool[n];
  for (int i = 0; i < ind; i++) {
    new_choices[i] = choices[i];
  }
  for (int i = ind; i < n; i++) {
    new_choices[i] = false;
  }

  new_choices[ind] = true;
  recursive(lens, n, new_choices, ind + 1, choice_cnt + 1);
  new_choices[ind] = false;
  recursive(lens, n, new_choices, ind + 1, choice_cnt);
}

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

  ll *lens = new ll[n];
  for (int i = 0; i < n; i++) {
    cin >> lens[i];
  }

  bool *choices = new bool[n];
  for (int i = 0; i < n; i++) {
    choices[i] = false;
  }
  recursive(lens, n, choices, 0, 0);

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 21468
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>

using namespace std;
int main() {
	int N, cnt = 0;
	int h[100];
	int l, r, tmp;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> h[i];
	}

	for (int i = 0; i < 10000; i++) {
		for (l = 0; l < N; l++) {
			if (h[l] - 1 >= 0)break;
		}
		for (r = l; r < N; r++) {
			if (h[r] - 1 < 0)break;
		}
		tmp = l;
		if (tmp + r >= N * 2)break;

		for (; l <= r; l++) {
			h[l]--;
		}
		
		cnt++;
	}

	cout << cnt << endl;

	return(0);
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main ()
{
	int n;
	scanf("%i",&n);
	string s[n+10];
	int a[n+1],r=0;
	for(int i=1;i<=n;i++)
	{
		cin >> s[i] >> a[i];
		if(i==n)	cin >> s[n+1];
	}
	for(int i=1;i<=n;i++)
	{
		if(i!=n && s[i]==s[n+1])
		{
			for(int j=i+1;j<=n;j++)
			{
				r+=a[j];
			}
		}
	}
	printf("%i",r);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define for1(i,n) for(int i=1;i<=(int)(n);i++)
const int MOD = 1e9 + 7 ;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=4000012;

int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      string s;
      cin>>s;
      for(int i=1;i<s.length();i++)
      {
            if(s[i]==s[i-1])
            {
                  cout<<"Bad\n";
                  return 0;
            }
      }
      cout<<"Good";
}     
// I never lose. I either win or I learn

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;

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

    int cls;
    if(x < 600) cls = 8;
    else if(x < 800) cls = 7;
    else if(x < 1000) cls = 6;
    else if(x < 1200) cls = 5;
    else if(x < 1400) cls = 4;
    else if(x < 1600) cls = 3;
    else if(x < 1800) cls = 2;
    else cls = 1;

    cout << cls;

    return 0;
}

Measured memory_bytes: 3620
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;

namespace hello_world
{ class Program
	{
		static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			int[] a = new int[n];
			long  sum = 0;
			for(int i = 0; i < n; i++)
			{
				if (((i + 1) % 3) != 0 && ((i + 1) % 5) != 0)
				{
					a[i] = i + 1;
					sum += a[i];
				}
				
			}
			Console.WriteLine(sum);
				
			
		}
	}

}

Measured memory_bytes: 31032
#include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,n) (int i=a;i<n;i++)
#define per(i,a,n,s) (int i=n-1;i>=a;i--)
#define range(...) _overload3(__VA_ARGS__,per,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define vecin(x) for(auto&youso_: (x) ) cin >>  youso_
#define vecout(x) for(auto&youso_: (x) ) cout << youso_ << " " ; cout << endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int inf = 1e9+10;
const int mod = 1e9+7;
const long long llinf = 1e18;
#define _GLIBCXX_DEBUG
// head

int main(){
    int n,k,h,count=0;
    cin >> n >> k;
    for  range(i,n){
        cin>>h;
        if (h>=k){
            count ++;
        }
    }
    cout << count << endl;
}

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

void selectionSort(int a[],int n){
    int min,c=0;
    for(int i=0;i<n;i++){
        min=i;
        for(int j=i;j<n;j++){
            if(a[min]>a[j]) min=j;
        }
        swap(a[i],a[min]);
        if(i!=min) c++;
    }
    for(int i=0;i<n;i++) cout<<a[i]<<((i==n-1)?'\n':' ');
    cout<<c<<endl;
}
 
int main(){
    int n,a[100];
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    selectionSort(a, n);
}


Measured memory_bytes: 3116
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>

using namespace std;

#define sz(a) static_cast<int>((a).size())
#define f first
#define s second
#define els(v) for (auto &el : (v))


#ifdef KIRYA
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif

template<typename T>
void _dbg(const char* _s, T _h) {
    cerr << _s << " = " << _h << "\n";
}

template<typename T, typename... Ts>
void _dbg(const char*_s, T _h, Ts... _t) {
    int _b = 0;

    while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',')
        cerr << *_s++;

    cerr << " = " << _h << ",";
    _dbg(_s + 1, _t...);
}

const int64_t INF = static_cast<int64_t>(1e9) + 7;
const int64_t LINF = INF * INF;
const int MAXN = static_cast<int>(1e6) + 17;

void solve() {
    int n, m;
    cin >> n >> m;
    vector<int> state(m + 1, 0), cost(m + 1);
    for (int i = 1; i <= m; ++i) {
        int sz;
        cin >> cost[i] >> sz;
        for (int j = 0; j < sz; ++j) {
            int val;
            cin >> val;
            --val;
            state[i] |= (1 << val);
        }
    }
    int n_subsets = (1 << n);
    vector<vector<int>> dp(n_subsets, vector<int>(m + 1, INF));
    dp[0][0] = 0;
    for (int j = 1; j <= m; ++j) {
        for (int i = 0; i < n_subsets; ++i) {
            dp[i][j] = min(dp[i][j], dp[i][j - 1]);
            dp[i | state[j]][j] = min(dp[i | state[j]][j], dp[i][j - 1] + cost[j]);
        }
    }
    int ans = INF;
    for (int j = 1; j <= m; ++j) {
        ans = min(ans, dp[n_subsets - 1][j]);
    }
    if (ans == INF) {
        cout << "-1\n";
    } else {
        cout << ans << '\n';
    }
}

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

    int q = 1;

    for (int i = 0; i < q; ++i) {
        solve();
    }
}


Measured memory_bytes: 16384
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
 
using namespace std;
using namespace __gnu_pbds;

#define debug(s) cout << #s << " = " << s << endl
#define all(v) (v).begin(), (v).end()
#define mem(a,val) memset(a, val, sizeof a)
 
#define ff first
#define ss second
typedef long long ll;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

double dp[3011];

int main() {
  int n;
  scanf("%d", &n);
  dp[0] = 1;
  for (int coin = 0; coin < n; ++coin) {
    double p_heads;
    scanf("%lf", &p_heads);
    for (int i = coin + 1; i >= 0; --i) {
      dp[i] = dp[i - 1] * p_heads + dp[i] * (1. - p_heads);
    }
  }  
  double answer = 0.;
  for (int heads = 0; heads <= n; ++heads) {
    if (heads > n - heads) {
      answer += dp[heads];
    }
  }
  printf("%.10lf\n", answer);
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>
// *テンプレート*
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>
#define sz(x) x.size()
// aよりbの方が小さかったら、aの値をbの値に置き換える。(swapではない！)
template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
// aよりbの方が大きかったら、aの値をbの値に置き換える。
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;
//最大公約数
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
//最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
// 素数かどうか判定
bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1LL << 60;
// *テンプレートここまで*

// pair -> vector<pair<int,int>> 
//		   AandB.push_back(make_pair(a[i],b[i]))



signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	vector<int>x(n), y(n), h(n);
	rep(i, n)cin >> x[i] >> y[i] >> h[i];
	rep(i, 101) {
		rep(j, 101) {
			int cnt = 0;
			rep(k, n) {
				if (h[k]) {
					cnt = h[k] + abs(i - x[k]) + abs(j - y[k]);
					break;
				}
			}
			bool ok = true;
			rep(k, n) {
				if (h[k] != max((ll)0, cnt - abs(i - x[k]) - abs(j - y[k]))) {
					ok = false; break;
				}
			}
			if (ok)cout << i << " " << j << " " << cnt << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
n = int(input())
va = input().split()
co = input().split()

val = [int(v) for v in va]
cos = [int(c) for c in co]

dif = [val[i]-cos[i] for i in range(n)]
ma = 0
for d in dif:
    ma += d if d >= 0 else 0
print(ma)

Measured memory_bytes: 3064
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int res = 0;
            for (int i = 0; i < n; ++i) {
                int x = in.nextInt();
                int y = in.nextInt();
                res += y - x + 1;
            }
            out.println(res);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}



Measured memory_bytes: 21716
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]
s = [0]*(n+1)
for i in range(n): s[i+1] = s[i] + a[i]
cnt = Counter(s)
ans = 0
for v in cnt.values(): ans += v*(v-1)//2
print(ans)

Measured memory_bytes: 41536
#include<iostream>
#include<algorithm>
using namespace std;
string s[60];
int n;
int alphabet[30];
int temp[30];
int main()
{
	cin>>n;
	for(int i=1;i<=n;++i) cin>>s[i];
	for(int i=0;i<27;++i) alphabet[i]=1000000;
	for(int i=1;i<=n;++i){
		for(int j=0;j<27;++j) temp[j]=0;
		for(int j=0;j<s[i].length();++j){
			temp[s[i][j]-'a']++;
		}
		for(int j=0;j<27;++j) alphabet[j]=min(alphabet[j],temp[j]);
	}
	for(int i=0;i<27;++i){
//		cout<<alphabet[i]<<endl;
		for(int j=1;j<=alphabet[i];++j) cout<<(char)(i+'a');
	}
	return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <utility>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#define each(e,c) for(auto&e:c)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<(DUMP(),__VA_ARGS__).str()<<" ["<<__LINE__<<"]"<<endl)
struct DUMP:ostringstream{template<class T>DUMP &operator,(const T&t){if(this->tellp())*this<<", ";*this<<t;return *this;}};
#else
#define dump(...)
#endif
template<class T> ostream& operator<<(ostream& os, vector<T> const& v){
    rep(i,v.size()) os << v[i] << (i+1==v.size()?"":" ");
    return os;
}

int main(){
    int n; cin >> n;
    while(n--){
        int cnt[32] = {0};
        int sum = 0;
        rep(i,8){
            int x;
            scanf("%x",&x);
            rep(j,32) if(x>>j & 1) cnt[j]++;
            sum += x;
        }
        int s; scanf("%x", &s);
        int K = 0;
        rep(i,32){
            if((sum>>i&1) != (s>>i&1)){
                K |= 1<<i;
                sum = sum - (1<<i)*cnt[i] + (1<<i)*(8-cnt[i]);
                cnt[i] = 8-cnt[i];
            }
        }
        printf("%x\n",K);
    }
}

Measured memory_bytes: 1220
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>
 
using namespace std;
 
int main(){
 
    int d,sum;
    while(scanf("%d",&d)!=EOF){
        sum = 0;
        for(int i=d;i<=600;i+=d){
            sum += d*(i-d)*(i-d);
        }
        printf("%d\n",sum);
    }
 
    return 0;
}


Measured memory_bytes: 3132
#include<cstdio>

int main(){
	int rank[] = {0,0,0};
	int t;
	for(int i = 0; i < 10 ; i++){
		scanf("%d", &t);
		if(t > rank[0]){
			rank[2] = rank[1];
			rank[1] = rank[0];
			rank[0] = t;
		}else if(t > rank[1]){
			rank[2] = rank[1];
			rank[1] = t;
		}else if(t > rank[2]){
			rank[2] = t;
		}
	}
	printf("%d\n%d\n%d\n", rank[0], rank[1], rank[2]);
	return 0;
}

Measured memory_bytes: 1028
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll          long long
#define pb          push_back
#define eb 			emplace_back
#define mp 			make_pair
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define fi          first
#define si          second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define checkbit(n, b) ((n >> b) & 1)
#define mod        1000000007
#define inf        1000000000000000000
#define puts(n)		cout<<n;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define setbits(x) __builtin_popcount(x)
#define mset(m,v) memset(m,v,sizeof(m))
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll x1,x2,x3,x4,x5;
	cin>>x1>>x2>>x3>>x4>>x5;
	if(x1==0) cout<<1;
	else if(x2==0) cout<<2;
	else if(x3==0) cout<<3;
	else if  (x4==0) cout<<4;
	else cout<<5;
	
	return 0;
}

Measured memory_bytes: 3580
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int even = 0;
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			if(a[i]%2==0) {
				even++;
			}
		}
		int ans = (int) (Math.pow(3, n)-Math.pow(2, even));
		System.out.println(ans);
	}
}

Measured memory_bytes: 35480
def mips():
    return map(int,input().split())
def ii():
    return int(input())
N = ii()
L = []
for i in range(N-1):
    C,S,F = mips()
    L.append([C,S,F])
for i in range(N-1):
    x = L[i][0] + L[i][1]
    j = i + 1
    while j != N-1:
        if x >= L[j][1] and x % L[j][2] == 0: #no waiting time :)
            x += L[j][0]
            j += 1
        else:
            if x < L[j][1]: #1st train will arrive shortly ;)
                x += (L[j][1]-x + L[j][0])
                j += 1
            else: #if x % L[j][2] != 0, 1st train gone, wait for next :-(
                while x % L[j][2] != 0:
                    x += 1
                x += L[j][0] #a train arrived, go to next station.
                j += 1
    print(x)
print(0)

Measured memory_bytes: 3188
from collections import defaultdict
import sys
input = sys.stdin.readline
import math

def combnations(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = int(input())
a = list(map(int, input().split()))
rui = [0] * (N + 1)
for i in range(N):
    rui[i + 1] = rui[i] + a[i]

d = defaultdict(int)
for key in rui:
    d[key] += 1

sortd = sorted(d.items(), key=lambda x: x[1], reverse=True)

cnt = 0
for i, j in sortd:
    if j >= 2:
        cnt += combnations(j, 2)
    else:
        break
print(cnt)

Measured memory_bytes: 48668
#include <iostream>
#include <cstring>
#include <string>    
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll n, a[200008], b[200008];
string str;

int main(){
	cin >> n;
	for(ll i = 1; i <= n; i++){cin >> a[i];}
	
	ll ans1 = 0;
	vector<ll> ans2;
	for(ll i = n; i >= 1; i--){
        ll mod = a[i];
        //cout << mod << endl;
		for(ll j = 2; i*j <= n; j++){mod += b[i*j];}
		mod %= 2;
		b[i] = mod;
		if(mod == 1){ans1++; ans2.push_back(i);}
	}
	
	cout << ans1 << endl;
	for(ll k = 0; k < ans1; k++){
		if(k == ans1-1){cout << ans2[k] << endl;}
		else{cout << ans2[k] << " " << endl;}
	}
	return 0;
}

Measured memory_bytes: 5108
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define INF 1<<30
#define LINF 1LL<<60


/*
<url:https://beta.atcoder.jp/contests/arc085/tasks/arc085_b>
問題文============================================================

N  枚のカードからなる山札があります。カードにはそれぞれ数が書かれており， 
上からi 枚目にはai が書かれています。
この山札を使い，X さんと Y さんが2 人でゲームをします。 X, Y さんは最初，
Z,W が書かれたカードを持っています。 そして X さんから交互に以下を行います。
山札から何枚かカードを引く。そして今持っているカードを捨て，最後に引いたカードを代わりに持つ。
ただし，必ず1 枚は引かなくてはならない。
山札がなくなるとゲームは終了で，2 人の持っているカードに書かれた数の差の絶対値がこのゲームのスコアになります。
X さんはスコアを最大化するように，Y さんはスコアを最小化するようにゲームをプレイした時， スコアはいくつになるでしょうか？

=================================================================
解説=============================================================

min-max + αβ法の実装で間に合う

p.s 想定解法はO(1)

================================================================
*/

ll N, Z, W;
ll dp[2001][2001];
vector<ll> a;
ll rec(ll i,ll j, ll k,ll alpha, ll beta) {
	ll& res = dp[i][j];
	if (res != -LINF)return res;
	if (i == N || j == N) {
		ll X = (i == 0) ? Z : a[i];
		ll Y = (j == 0) ? W : a[j];
		res = abs(X - Y);
		return res;
	}
	if (k == 1) {
		res = LINF;
		for (int y = N; y > i;y--) {
			res = min(res, rec(i, y, 0, alpha, res));
			if (alpha >= res) {
				return alpha;
			}
		}
	}
	else {
		for (int x = N; x > j;x--) {
			res = max(res, rec(x, j, 1, res, beta));
			if (res >= beta) {
				return beta;
			}
		}
	}
	return res;
}

int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
	cin >> N >> Z >> W;
	a.resize(N + 1);
	for (int i = 1; i <= N;i++) cin >> a[i];
	for (int i = 0; i <= N;i++) {
		for (int j = 0; j <= N;j++) {
			dp[i][j] = -LINF;
		}
	}
	a.erase(unique(a.begin(), a.end()), a.end());
	N = a.size() - 1;

	cout << rec(0, 0, 0, -LINF, LINF) << endl;
	return 0;
}

Measured memory_bytes: 31616
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define BE(c) c.begin(),c.end()
#define PB push_back
#define F first
#define S second
#define BEB(s) s
using namespace std;
int main(){
	int a,b,c,d;
	while(1){
		cin>>a>>b>>c;
		if(a==-1&&b==-1&&c==-1)break;
		d=(120*60)-(a*60*60+b*60+c);
		printf("%02d:%02d:%02d\n",d/3600,d%3600/60,d%60);
		d*=3;
		printf("%02d:%02d:%02d\n",d/3600,d%3600/60,d%60);
	}
	return 0;
}

Measured memory_bytes: 1164
import sys
input = sys.stdin.readline
enum = enumerate
INF = 1001001001

import collections
import random

def linput(ty=int, cvt=list):
	return cvt(map(ty,input().split()))

def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a

def lcm(a: int, b: int):
	return a * b // gcd(a, b)

def dist(x1,y1,x2,y2):
	return abs(x1-x2)+abs(y1-y2)

def ran():
	vRan = [random.randint(1,5) for i in range(8)]
	return vRan

def main():
	if 1:
		N,M,K = linput()
		vA = linput()
		vB = linput()
	else:
		#vA=[5, 3, 3, 5, 3, 4, 1, 4]
		#vB=[5, 1, 4, 1, 1, 2, 1, 2]
		#4
		N,M,K = 0,0,8
		vA = ran()
		vB = ran()
		print(vA,vB,sep="\n")###
	
	res = 0
	
	cnt = 0
	t = 0
	for a in vA:
		if t+a<=K:
			t += a
			cnt += 1
		else: break
	
	res = max(res,cnt)
	vJ = vA[0:cnt]
	for b in vB:
		while t+b>K:
			if not vJ: break
			j = vJ.pop()
			t -= j
			cnt -= 1
		if t+b<=K:
			t += b
			cnt += 1
			res = max(res,cnt)
		else:
			break
		#print(res,cnt)
	
	print(res)
	#sT = "No Yes".split()
	#print(sT[res])
	

if __name__ == "__main__":
	main()


Measured memory_bytes: 42060
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn=205;
int T,n;char s[maxn];
long long a[maxn],b[70];
inline void add(long long x){
	for (int i=60;~i;i--) if((x>>i)&1)
	if(!b[i]){b[i]=x;break;}else x^=b[i];
}
inline bool query(long long x){
	for (int i=60;~i;i--) if((x>>i)&1) x^=b[i];
	return !x;
}
inline bool solve(){
	for (int i=n;i;i--)
	if(s[i]=='0') add(a[i]);
	else if(!query(a[i])) return 0;
	return 1;
}
int main(){
	for (scanf("%d",&T);T--;){
		memset(b,0,sizeof b);
		scanf("%d",&n);
		for (int i=1;i<=n;i++) scanf("%lld",&a[i]);
		scanf("%s",s+1);
		puts(solve()?"0":"1");
	}
	return 0;
}

Measured memory_bytes: 1612
#include <bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define FINF(a) memset(a,0x3f,sizeof(a))
#define POW(n) (1LL<<(n))
#define IN(i,a,b) (a <= i && i <= b)
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a>b) { a=b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a<b) { a=b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(ALL(a)); }
template <typename T> inline void REV(T& a) { reverse(ALL(a)); }
template <typename T> inline void UNI(T& a) { sort(ALL(a)); a.erase(unique(ALL(a)),a.end()); }
const int MOD = 1000000007;
const int INF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-10;
/* ---------------------------------------------------------------------------------------------------- */

vector<int> calc(int x) {
  vector<int> res;
  for (int i = 1; i*i <= x; i++) {
    if (x%i == 0) {
      res.push_back(i);
      if (i*i != x) res.push_back(x/i);
    }
  }
  return res;
}

int N;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  cin >> N;
  vector<int> div = calc(N);
  int ans = 0;
  for (auto v : div) {
    if (v == 1) continue;
    if (N%(v-1) == N/(v-1)) ans += v-1;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 384
#include<stdio.h>

int depth(int);
int degree(int);
int sibling(int);
int height(int);

int n,counti=0;
int countj=0;
int count=0;

typedef struct{
  int id;
  int parent;
  int right;
  int left;
} node;

node A[100000];

int main()
{
  int i,rightchild,leftchild,id;

  scanf("%d",&n);

  for(i=0;i<n;i++)
    {
      A[i].parent=-1;
    }
  
  for(i=0;i<n;i++)
    {
      scanf("%d",&id);
      A[id].id=id;
      scanf("%d",&leftchild);
      A[id].left=leftchild;
      A[leftchild].parent=id;
      scanf("%d",&rightchild);
      A[id].right=rightchild;
      A[rightchild].parent=id;
    }

  for(i=0;i<n;i++)
    {
      count=0;
      countj=0;
      counti=0;
      printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,A[i].parent,sibling(i),degree(i),depth(i),height(i));
      if(A[i].parent==-1) printf("root\n");
      else if((A[i].left==-1)&&(A[i].right==-1)) printf("leaf\n");
      else printf("internal node\n");
    }

  return 0;
}

int depth(int m)
{
  int l;
  l=A[m].parent;
  if(l==-1) return count;
  count++;
  depth(l);
}

int height(int m)
{
  int j=0,i=0;
  if(A[m].left!=-1)
    {
      i=height(A[m].left)+1;
    }
  if(A[m].right!=-1)
    {
      j=height(A[m].right)+1;
    }
  if(i>j) return i;
  else return j;
}

int sibling(int m)
{
  int i;
  for(i=0;i<n;i++)
    {
      if((A[i].id!=m)&&(A[m].parent==A[i].parent)) return A[i].id;
    }
  return -1;
}

int degree(int m)
{
  int i=0;
  if(A[m].left!=-1) i++;
  if(A[m].right!=-1) i++;
  return i;
}

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

void rect(int n,int m){
    for(int i = 0 ; i < n ; i++){
        for(int j = 0 ; j < m ; j++){
            if(!i||!j||i==n-1||j==m-1)cout << '#';
            else cout << '.';
        }
        puts("");
    }
}

int main(){
    int n,m;
    
    while(true){
        cin >> n >> m;
        if(!n&&!m) break;
        rect(n,m);
        puts("");
    }
    
    
    return 0;
}

Measured memory_bytes: 1120
#include<bits/stdc++.h>
#include<boost/algorithm/string/replace.hpp>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::algorithm;
using namespace boost::multiprecision;
 
#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;
 
const ll INF = 1LL<<60;
const int mINF = 1e9;
const int MOD = 1e9+7;

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

template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

template<typename T>//文字列の置換/Boost:replace_all()
T replace_str(T str, string target, string str_to) {
    string::size_type pos = 0;
    while (pos = str.find(target, pos), pos != string::npos) {
        str.replace(pos, target.length(), str_to);
        pos += str_to.length();
    }
    return str;
}

int main(){
    int a,b,c,x,y;
    cin >>a>>b>>c>>x>>y;
    int z = abs(x-y);
    int buy = ((x+y) - z) / 2;
    int ans = 0;
    if(a+b < c*2){
        ans += a * buy + b * buy;
    }else{
        ans += c * buy * 2;
    }

    if(x>y){
        if(a > c*2){
            ans += c * z * 2;
        }else{
            ans += a * z;
        }
    }else{
        if(b > c*2){
            ans += c * z * 2;
        }else{
            ans += b * z;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<set>
#include<algorithm>
using namespace std;
int n,b;
int a[100010];
int x(int x){
if(x>=0)
return x;
return -x;}
int main(){
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
for(int i=0;i<=n+1;i++)
b+=x(a[i]-a[i-1]);
for(int i=1;i<=n;i++){
if(a[i]>a[i-1] && a[i]>a[i+1])
cout<<b-(a[i]-max(a[i-1],a[i+1]))*2<<endl;
else
if(a[i]<a[i-1] && a[i]<a[i+1])
cout<<b-(min(a[i-1],a[i+1])-a[i])*2<<endl;
else
cout<<b<<endl;}
system("pause");
return 0;
}

Measured memory_bytes: 1792
#include<iostream>

#include<stdio.h>

#define pi 3.1415926535

using namespace std;

int a[1000], b[1000];
char op[1000];

int main(){

	
	for (int n = 0; n < 1000; n++){
		cin >> a[n] >> op[n] >> b[n];
		if (op[n] == '?')   break;
		else if (op[n] == '*')	cout << a[n] * b[n]<<endl;

		else if (op[n] == '-')	cout << a[n] - b[n] << endl;

		else if (op[n] == '+')	cout << a[n] + b[n] << endl;

		else if (op[n] == '/')	cout << a[n] / b[n] << endl;
	}






	return 0;
}


Measured memory_bytes: 3088
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
//typedef __int64 LL;
//typedef long long int LL;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef pair<int,int> P;

const int MOD=1000000007;

int main(){
	int n;cin>>n;
	P v[100010];
	for(int i=0;i<n;i++)
	{
		int x;cin>>x;
		v[i].first=x,v[i].second=i+1;	
	}	
	sort(v,v+n);
	for(int i=0;i<n;i++)
	{
		cout<<v[i].second<<" ";
	}
	cout<<"\n";
	return 0;
}

Measured memory_bytes: 1536
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main{

	Scanner sc=new Scanner(System.in);

	int INF=1<<28;
	double EPS=1e-9;

	int n, m;
	HashMap<String, String> parent;
	HashMap<String, LinkedList<String>> children;

	void run(){
		for(;;){
			n=sc.nextInt();
			m=sc.nextInt();
			if((n|m)==0){
				break;
			}
			parent=new HashMap<String, String>();
			children=new HashMap<String, LinkedList<String>>();
			sc.nextLine();
			String p="", r=""; // ツ親ツ，1ツづつ前
			children.put(p, new LinkedList<String>());
			int x=-1;
			for(int j=0; j<n; j++){
				String s=sc.nextLine();
				int y=s.length()-s.replaceAll(" ", "").length();
				s=s.replaceAll(" ", "");
				debug(s, r, p);
				if(y>x){
					// 1ツづつ可慊づ個階ツ層
					debug("->");
					p=r;
					// parent.put(s, p);
					// children.get(p).add(s);
					// children.put(s, new LinkedList<String>());
				}else if(y<x){
					debug("<-");
					for(int i=y; i<x; i++){
						p=parent.get(p);
					}
					// parent.put(s, p);
					// children.get(p).add(s);
					// children.put(s, new LinkedList<String>());
				}else{
					debug("-");
					// parent.put(s, p);
					// children.get(p).add(s);
					// children.put(s, new LinkedList<String>());
				}
				parent.put(s, p);
				children.get(p).add(s);
				children.put(s, new LinkedList<String>());
				x=y;
				r=s;
			}
			debug();
			dfs("", "");
			for(int i=0; i<m; i++){
				String s=sc.next();
				sc.next();
				sc.next();
				char c=sc.next().charAt(0);
				sc.next();
				String t=sc.next();
				t=t.substring(0, t.length()-1);
				boolean f=false;
				debug(s, t);
				switch(c){
				case 'c':
					f=parent.containsKey(s)&&parent.get(s).equals(t);
					break;
				case 'p':
					f=parent.containsKey(t)&&parent.get(t).equals(s);
					break;
				case 's':
					f=parent.containsKey(s)&&parent.containsKey(t)
							&&parent.get(s).equals(parent.get(t));
					break;
				case 'd':
					for(s=parent.get(s); s!=null; s=parent.get(s)){
						f|=s.equals(t);
					}
					break;
				case 'a':
					for(t=parent.get(t); t!=null; t=parent.get(t)){
						f|=t.equals(s);
					}
					break;
				}
				println(f?"True":"False");
			}
			println("");
			// child:ツ子
			// parent:ツ親
			// sibling:ツ兄ツ津ュ
			// descendant:ツ子ツ堕キ
			// ancestor:ツ静ヲツ祖
		}
	}

	void dfs(String s, String tab){
		for(String t : children.get(s)){
			debug(tab, t, parent.get(t));
			dfs(t, tab+"\t");
		}
	}

	void debug(Object... os){
		// System.err.println(Arrays.deepToString(os));
	}

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

	public static void main(String[] args){
		// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		new Main().run();
	}
}

Measured memory_bytes: 13000
#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>

using namespace std;

bool is_prime(int p) {
    for (int i=2; i*i<=p; i++) {
        if (p % i == 0) return false;
    }
    return true;
}

int main() {
    int N;
    while (cin >> N) {
        int p1, p2;
        for (p1=N-1; ; p1--) {
            if (is_prime(p1)) break;
        }
        for (p2=N+1; ; p2++) {
            if (is_prime(p2)) break;
        }
        cout << p1 << " " << p2 << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
/*
    @uthor: Amit Kumar
    user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define all(vec) vec.begin(),vec.end()
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"Case #"<<x<<":"
#define pi 3.14159265358979323846264338327950L

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


void virus(){
          string s;
          cin>>s;
          ll sum = 0;
          for(auto i:s) sum += (i-'0');
          if(sum%9 == 0) cout<<"Yes\n";
          else cout<<"No\n";
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t = 1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
           cerr << "\n Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

Measured memory_bytes: 3744
#include <stdio.h>

#define MAXSIZE 100000
int num;
int data[MAXSIZE];
int tmp[MAXSIZE];

int min(int a,int b){
    if(a>b){
        return b;
    }else{
        return a;
    }
}
int abs(int a){
    if(a < 0){
        return -a;
    }else{
        return a;
    }
}

int cost(){
    if(num==2){
        return abs(data[num-1]-data[num-2]);
    }else{
        for(int j=1;j<num;j++){
            if(j==1){
                tmp[j] = tmp[j-1]+abs(data[j]-data[j-1]);
            }else{
                tmp[j] = min(
                tmp[j-1]+abs(data[j]-data[j-1]),
                tmp[j-2]+abs(data[j]-data[j-2])
                );
            }
        }
        
        return tmp[num-1];
    }
    
    
}

int main(){
    scanf("%d",&num);
    for(int i=0;i<num;i++){
        scanf("%d",data+i);
    }
    printf("%d\n",cost());
}

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

int main(void){
    int l,r,d;
    cin >> l >> r >> d;
    int ans = 0;
    for(int i=l;i<=r ;i++){
        if(i%d==0) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

int main()
{
    char c1,c2;
    cin>>c1>>c2;
    if(c1==c2)
        cout<<"="<<endl;
    else if(c1<c2)
        cout<<"<"<<endl;
    else
        cout<<">"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;

//xまでの素数を列挙O(n^1.5)
vector<int> primeNumbers(int x) {
	vector<int> v;
	int sn = sqrt(x);

	for (int number = 2; number <= x; number++) {
		int i = 0;
		bool pn = false;
		while (true) {
			if (i >= v.size() || v[i] > sn) { //平方根までの全素数で割れればOK
				v.push_back(number);
				break;
			}
			if (number % v[i] == 0) break;
			i++;
		}
	}
	return v;
}

//素因数分解
map<int, int> primeFactorMap(int x, vector<int> vpn) {
	map<int, int> mpn;

	int k = 0;
	while (true) {
		bool can_div = false;
		for (int i = k; i < vpn.size(); i++) {
			int n = vpn[i];
			if (x % n == 0) {
				if (mpn.count(n) == 0) mpn.insert(pair<int, int>(n, 1));
				else mpn[n]++;
				x /= vpn[i];
				k = i;
				can_div = true;
				break;
			}
		}
		if (!can_div) break;
	}
	return mpn;
}


//Valueを＋演算子でマージ
template<typename Tkey,typename Tval>
void mergeMap(map<Tkey, Tval>& mapBase, map<Tkey, Tval> mapAdded) {

	for (pair<Tkey,Tval> p : mapAdded) {
		if (mapBase.count(p.first) > 0) {
			mapBase[p.first] += p.second;
		}
		else {
			mapBase[p.first] = p.second;
		}
	}
}

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

	map<int, int> mp;
	vector<int> primes= primeNumbers(N);
	
	for (int i = 2; i <= N; i++) {
		auto m = primeFactorMap(i, primes);
		mergeMap(mp, m);
	}

	long long counter = 1;
	for (auto p : mp) {
		counter *= (p.second + 1);
		counter %= MOD;
	}
	cout << counter << endl;

	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << endl;
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (int i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    int N;
    cin >> N;

    if (N >= 30) print("Yes");
    else print("No");
    
}


Measured memory_bytes: 3656
#include "bits/stdc++.h"

using namespace std;

const int INF = 1e9 + 7;

void solve()
{
  int a, b;
  cin >> a >> b;
  if (a + b >= 10) cout << "error\n";
  else cout << a + b << "\n";
}

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

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> s = new ArrayList<String>();
		int H = sc.nextInt();
		int W = sc.nextInt();
		for(int i = 0;i < H;i++) {
			String a = sc.next();
			for(int m = 0;m < 2;m++) {
				s.add(a);
			}
		}
		for(String k : s) {
			System.out.println(k);
		}
	}
}

Measured memory_bytes: 23940
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int N;
    R(N);
    int an=0;
    REP(i,N){
        int x;
        R(x);
        an+=x-1;
    }
    W(an);
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define REP1(i, n) for(int i=1; i<=(n); i++)
#define RREP1(i, n) for(int i=(n); i>=1; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define out(...) printf(__VA_ARGS__)
#if DEBUG
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...) /* ... */
#endif
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

void solve();
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 100
#else
#define SIZE 223450
#endif

int N,Q,K;
string S,T;

void solve() {
    cin>>S>>T;
    int ans = 0;
    REP(i,S.size()) {
        if (S[i]!=T[i])ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3780