akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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; }

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n;
    cin >> n;
    VS s(n);
    VI t(n);
    REP(i,0,n) cin >> s[i] >> t[i];
    string x;
    cin >> x;
    int ans = 0;
    bool b = false;
    REP(i,0,n) {
        if (b) ans += t[i];
        if (s[i] == x) b = true;
    }
    cout << ans << endl;
}

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

Measured memory_bytes: 256
N = int(input())

points = [list(map(int, input().split())) for _ in range(N)]

p = points[0][0]
q = points[0][1]
r = points[0][2]

points.sort(key=lambda x: x[2], reverse = True)

for i in range(0,101):
  for j in range(0,101):
    H= points[0][2] + abs(points[0][0] - i) + abs(points[0][1] - j)
    for x,y,z in points:
      if z != max(H - abs(x - i) - abs(y - j),0):
        break
    else:
      print(i,j,H)

Measured memory_bytes: 3064
#include<iostream>

using namespace std;
int main(){
	char str[1205];
	scanf("%[^\n]", &str);
	int len = 0;
	for(int i = 0;str[i] != '\0';i++)len++;
	
	for(int i = 0;i<len;i++){
			 if(str[i] >= 'A' && str[i] <= 'Z'){
			 	  str[i] =  str[i]+('a'-'A');
			 	}else if(str[i] >= 'a' && str[i] <= 'z'){
			 		   str[i] =  str[i]-('a'-'A');
			 		}
			 			
		}
	cout << str<<'\n';
	
	return 0;
}  

// fAIR, LATER, OCCASIONALLY CLOUDY.


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

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> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }

template<typename T> void fill_all(T& arr, const T& v) { arr = v; }
template<typename T, typename U> void fill_all(T& arr, const U& v) { for (auto& i : arr) fill_all(i, v); }

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}
#define DUMP(x) cout<<#x<<" = "<<(x)<<endl

struct edge { int to, cost; };

const LL LINF = 1LL<<60;
const int IINF = 1<<30;
const LL MOD = 1e9+7;

int main()
{
   int n, K; cin >> n >> K;
   vector<LL> A(n), B(n);
   for (int i = 0; i < n; ++i) {
      cin >> A[i] >> B[i];
   }


   vector<LL> C(32);

   for (int i = 0; i < n; ++i) {
      if (A[i] > K) continue;
      for (int j = 30; j >= 0; --j) {
         if ((K >> j & 1) == 0 &&
             (A[i] >> j & 1) == 1) {
            break;
         }
         if ((K >> j & 1) == 1 &&
             (A[i] >> j & 1) == 0) {
            C[j+1] += B[i];
         }
      }
      if ((A[i] & ~K) == 0) {
         C[0] += B[i];
      }
   }

   cout << *max_element(C.begin(), C.end()) << endl;

   return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,f=0;cin>>n;
  while(n!=0)
  {
    if((n%10)==7){f=1;break;}
   n/=10;
  }
  if(f==1)cout<<"Yes";
  else cout<<"No";
}


Measured memory_bytes: 3620
import math

h = int(input())

#第一項……全モンスターの体力を1にするために必要な攻撃数
#第二項……体力が1のモンスターの数
#math.floor(math.log(h,2))は体力を1にするために必要なステップ数
print((1-2**math.floor(math.log(h,2)))//(1-2)+2**math.floor(math.log(h,2)))

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

using namespace std;

int N, M, n, m, i, j, sum = 0, a[505][505];

int main()
{
 //   freopen("input", "r", stdin);
    cin.sync_with_stdio(false);

    cin >> N >> M >> n >> m;

    if(N % n == 0 && M % m == 0)
    {
        cout << "No\n";
        return 0;
    }

    cout << "Yes\n";
    if(N % n)
    {
        for(i=0; i<N; ++i)
        {
            for(j=0; j<M; ++j)
                if(i % n == 0) cout << 1000 * (n-1) - 1 << ' ';
                    else cout << -1000 << ' ';
            cout << '\n';
        }
    }
    else for(i=0; i<N; ++i)
            {
                for(j=0; j<M; ++j)
                    if(j % m == 0) cout << 1000 * (m-1) -1 << ' ';
                        else cout << -1000 << ' ';
                cout << '\n';
            }
    return 0;
}


Measured memory_bytes: 1792
from sys import stdin
n,t = map(int,stdin.readline().split())
ans = 'TLE' 
a = []
for i in xrange(n):
 x,y = map(int,stdin.readline().split())
 if y <=t:
  a.append(x)
a.sort()
if len(a):
 ans = a[0]
print ans

Measured memory_bytes: 2568
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL 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; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

string s;

int main(){
    INIT;
    cin >> s;
    int n = (int)s.size();
    s = " " + s;
    if(s[1] == '0'|| s[n] == '1'){
        cout << -1 << endl;
        return 0;
    }
    for(int i = 2;i <= n - 1;i++){
        if(s[i] != s[n - i]){
            cout << -1 << endl;
            return 0;
        }
    }
    int pre = 1;
    for(int i = 2;i <= n;i++){
        cout << pre << " " << i << endl;
        if(s[i - 1] == '1'){
            pre = i;
        }
    }
}

Measured memory_bytes: 1664
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(){
    string S;
    string T;
    cin >> S >> T;
    int atari = 0;
    if(S[0]==T[0]) ++atari;
    if(S[1]==T[1]) ++atari;
    if(S[2]==T[2]) ++atari;


    cout << atari << endl;
}


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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
template<typename T1, typename T2>
ostream& operator<<(ostream& o, const pair<T1, T2>& p){
    return o << "(" << p.first << ", " << p.second << ")";
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    int n,k; cin >> n >> k;
    vl A(n);
    rep(i,n) cin >> A[i];
    sort(rall(A));

    int l = 0, r = n-1;
    ll ans = 1;
    if(k & 1) ans *= A[0], l = 1;
    rep(i,k/2){
        if(A[l] * A[l+1] >= A[r-1] * A[r]) (ans *= A[l] * A[l+1] % mod) %= mod, l += 2;
        else (ans *= A[r] * A[r-1] % mod) %= mod, r -= 2;
    }
    if(ans < 0){
        ans = 1;
        rep(i,k) (ans *= mod + A[i]) %= mod;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4788
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
const int N = 20;
int n, a[N], b[N];
struct node
{
    int x, p;
    node(int x = 0, int p = 0): x(x), p(p) {}
} c[N];
int d[N];
int solve(int x)
{
    for (int i = 0; i < n; i++)
        if (x >> i & 1)
            c[i + 1] = node(b[i + 1], 1), d[i + 1] = b[i + 1];
        else
            c[i + 1] = node(a[i + 1], 0), d[i + 1] = a[i + 1];
    sort(d + 1, d + 1 + n);
    int ans = 0;
    for (int i = n; i >= 1; i--)
    {
        bool flag = false;
        for (int j = i; j >= 1; j--)
            if (c[j].x == d[i] && c[j].p == (i - j & 1))
            {
                flag = true;
                ans += i - j;
                for (int k = j; k < i; k++)
                {
                    c[k + 1].p ^= 1;
                    swap(c[k], c[k + 1]);
                }
                break;
            }
        if (!flag) return inf;
    }
    return ans;
}
int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
    int ans = inf;
    for (int i = 0; i < 1 << n; i++)
        ans = min(ans, solve(i));
    if (ans == inf) ans = -1;
    printf("%d\n", ans);
}



Measured memory_bytes: 384
#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<vector>
#include<map>
#include<queue> 
#include<algorithm>
using namespace std;
#define maxn 100005
#define ll long long
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m;
int lst,ans;
int main(){
	n=read();
	lst=n+1;
	for(int i=1;i<=n;i++){
		if(i==read()){
			 if(lst==i-1)
			 	lst=n+1;
			else{
			 	ans++;lst=i;
			}
		}
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

const int kN = 1000000;

void primeNumber(bool prime[kN], vector<long long> &p){
    rep(i,kN) prime[i] = 1;
    prime[0] = prime[1] = 0;
    rep(i,kN){
        if(prime[i]){
            if(p.size() >= 1) p.push_back(p[p.size() - 1] + i);
            else p.push_back(i);
            for(int j = i + i; j < kN; j+=i){
                prime[j] = 0;
            }
        }
    }
}

int main(){
    bool prime[kN];
    vector<long long> p;
    primeNumber(prime, p);

    int n;
    while(cin >> n, n){
        cout << p[n - 1] << endl;
    }
}

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

using namespace std;

void solve()
{
	int N;
	cin >> N;
	int A, B;
	cin >> A >> B;
	int ACount = 0;
	int BCount = 0;
	int CCount = 0;
	vector<int> P(N);
	for (int i = 0; i < N; ++i)
	{
		cin >> P[i];
		if (P[i] <= A)
		{
			++ACount;
		}
		else if (A < P[i] && P[i] <= B)
		{
			++BCount;
		}
		else
		{
			++CCount;
		}
	}
	cout << min(min(ACount, BCount), CCount) << endl;
}

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

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

#define ls   ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define quit return 0

using namespace std;
int main()
{
    ls;
    
    int a,b;
    cin >> a >> b ;
    cout << a*b ;
    quit;
}

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

using namespace std;
typedef long long ll;
int N;
ll A,B;
ll h[100001];
ll MAX;
ll mid;
bool solve(ll t) {
  ll tmp = 0;
  for(int i = 0; i < N; i++) {
    if(h[i] - B * t > 0){
      if((h[i] - B * t) % (A - B) != 0) tmp++;
      tmp += (h[i] - B * t) / (A - B);
    }
  }
  // cout <<"t = "<<t<<"  tmp = "<<tmp<<endl;
  if(tmp <= t) return true;
  else return false;
}

int main() {

  cin >> N >> A >> B;

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

  ll l = 0, r = MAX / B + 1;

  while(r - l > 1) {
     mid = (r + l) / 2;
    if(solve(mid)) r = mid;
    else l = mid;
  }

  cout << r <<endl;
}
  



  


Measured memory_bytes: 1152
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int kMaxN = 405, kMaxC = 405, kMod = 1e9 + 7;
int n, c, a[kMaxN], b[kMaxN];
ll g[kMaxN][kMaxN], dp[kMaxN][kMaxN];

inline ll QuickPow(ll x, ll y) {
  ll ret = 1;
  for (; y; y >>= 1, x = x * x % kMod)
    if (y & 1) ret = ret * x % kMod;
  return ret;
}

int main() {
  scanf("%d%d", &n, &c);
  for (int i = 1; i <= n; ++i)
    scanf("%d", a + i);
  for (int i = 1; i <= n; ++i)
    scanf("%d", b + i);
  for (int i = 0; i <= 400; ++i) {
    for (int j = 0; j <= 400; ++j) {
      g[i][j] = (g[i][j - 1] + QuickPow(j, i)) % kMod; 
    }
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= c; ++j) {
      for (int m = 0; m <= j; ++m) {
        dp[i][j] = (dp[i][j] + dp[i - 1][j - m] * (g[m][b[i]] - g[m][a[i] - 1]) % kMod) % kMod;
      }
    }
  }
  printf("%lld\n", (dp[n][c] % kMod + kMod) % kMod);
  return 0;
}

Measured memory_bytes: 2688
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repeat(i,s,n) for(int (i)=s; (i)<(n); (i)++)
#define revrep(i,n) for(int (i)=(n)-1;i>=0; i--)

bool check(int x, vector<int> ds) {
  sort(ds.begin(),ds.end());
  reverse(ds.begin(),ds.end());
  int a=0;
  for(auto& d : ds) {
    if(abs(a+d-x)<abs(a-d-x)) {
      a+=d;
    } else {
      a-=d;
    }
  }
  if(a==x)
    return true;
  return false;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<setprecision(std::numeric_limits<float>::max_digits10);
  string s;
  int x,y;
  cin>>s>>x>>y;
  vector<int> d;
  int a=0;
  for(auto& ch : s) {
    if(ch=='T') {
      d.push_back(a);
      a=0;
    } else {
      a++;
    }
  }
  d.push_back(a);
  vector<int> d1;
  vector<int> d2;
  rep(i,d.size()) {
    if(i==0) x-=d[i];
    else if(i%2==0) d1.push_back(d[i]);
    else d2.push_back(d[i]);
  }
  if(check(x,d1)&&check(y,d2)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 384
# ' 'dで区切ってprintする方法
# print(*a, sep=' ')

import math

n = int(input())
a = []

for i in range(n):
    a_i = int(input())
    a.append(a_i)

max_a = max(a)

if a.count(max_a) == 1:
    b = a.copy()
    b.remove(max_a)
    second_max = max(b)
    for aa in a:

        if aa == max_a:
            print(second_max)
        else:
            print(max_a)
else:
    for i in range(n):
        print(max_a)

Measured memory_bytes: 14068
N, X = map(int,input().split())
d_list = []
l_list = input().split()
d_list.append(0)
now_d = 0
for l in l_list:
  now_d += int(l)
  d_list.append(now_d)
ans = [i for i in d_list if X>=i ]
print(len(ans))

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

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	TEST(freopen("input.txt","r",stdin));
	TEST(freopen("output.txt","w",stdout));
	TEST(freopen("debug.txt","w",stderr));
	int A, B, C;
	cin>>A>>B>>C; swap(A,B); swap(A,C);
	cout<<A<<' '<<B<<' '<<C<<'\n';
	return 0;
}

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

typedef long long ll;
#define FOR(i, a, n) for (ll i=(ll)a;i<(ll)n;i++)
#define REP(i, n) FOR(i, 0, n)

int main(){
    vector<int> x; x.resize(5);
    int left = 10;
    REP(i, 5){
        cin >> x[i];
        if (x[i]%10 && x[i]%10 < left){
            left = x[i]%10;
        }
    }

    int ans = 0;
    REP(i, 5){
        if (x[i]%10){
            ans +=  10*(x[i]/10+1);
        }
        else{
            ans += x[i];
        }
    }

    ans -= 10-left;

    cout << ans << endl;
}

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

int main(){

  string b;
  cin >> b;


  if(b == "A") cout << "T" << endl;
  if(b == "T") cout << "A" << endl;
  if(b == "C") cout << "G" << endl;
  if(b == "G") cout << "C" << endl;

  return 0;

}

Measured memory_bytes: 256
#include <inttypes.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
    char S[7];

    gets(S);

    if ((S[2] == S[3]) && (S[4] == S[5])) {
        puts("Yes");
    } else {
        puts("No");
    }

    return 0;
}


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

using namespace std;


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

    int ans = 0, cur = 0;
    int a;
    scanf("%d", &a);
    for (int i = 1; i < n; ++i)
    {
        static int b;
        scanf("%d", &b);
        if (a >= b)
            ++cur;
        else
        {
            ans = max(ans, cur);
            cur = 0;
        }
        a = b;
    }
    ans = max(ans, cur);

    printf("%d", ans);
}


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

int main(){
	int a, b, c, d;
	scanf("%d%d%d%d", &a, &b, &c, &d);
	int y = c-a, x = d-b;
	printf("%d %d %d %d\n", c-x, d+y, a-x, b+y);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define f first
#define s second
using namespace std;

int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #ifdef debug
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    string s, t = ""; cin >> s;
    for(int i = 0; i < s.length(); i++){
        if(s[i] == '1'){
            t += "9";
        }
        else if(s[i] == '9') t+= "1";
        else t += s[i];
    }
    cout << t << endl;
    return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define IP pair<int,int>
#define enld endl

int main() {
	lint A, B, C, K;
	cin >> A >> B >> C >> K;
	if (K % 2 == 0) {
		cout << A - B << endl;
	}
	else {
		cout << B - A << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, m, n) for(ll i = m; i > n; i--)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define lmax(x, y) max<ll>(x, y)
#define lmin(x, y) min<ll>(x, y)
#define tmax(x, y, z) lmax((x), lmax((y), (z)))
#define tmin(x, y, z) lmin((x), lmin((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
// struct edge{ ll from, to, cost; };
// struct edge{ ll to, cost; };
// using Graph = vector<vector<ll>>;  // 重み無し
// using Graph = vector<edge>;  // 辺
// using Graph = vector<vector<edge>>;  // 重み付き
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};


int main(){
    ll a, b, c , d; cin >> a >> b >> c >> d;
    cout << lmax(a*c, tmax(a*d, b*c, b*d)) << endl;
}


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

/*  using namespace  */
using namespace std;

/*  local var  */
//None

/*  define  */
#define loop(i,j) for(int i = 0; i < j; i++)
#define scan1(d) scanf("%lld",&d);
#define scan2(a,b) scanf("%lld %lld",&a,&b);
#define print(a) printf("%lld\n",a);

/*  typedef  */
typedef long long ll;

/*  function  */
//None

/*  main program  */
int main()
{
	ll cnt=0;
	ll N;
	ll H=0;
	ll BH=0;
	ll m=0;
	scan1(N);
	loop(i,N){
		scan1(H);
		if(BH>=H) cnt++;
		else{m=max(m,cnt);cnt=0;}
		BH=H;
	}
	print(max(m,cnt));
	
}
	

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

int main(){
    int K;
    cin >> K;
    string S;
    cin >> S;
    if((int)S.size()<=K){
        cout << S << '\n';
    }else{
        cout << S.substr(0,K)+"..." << '\n';
    }
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  int n,k;
  cin>>n>>k;
  vi x(n);
  REP(i,n)cin>>x[i];
  int ans = 0;
  REP(i,n)ans += 2*min(x[i],k-x[i]);
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
a = [[int(i) for i in input().split()] for _ in range(n)]
dp = [[0,0,0] for i in range(n+1)]
for i in range(1,n+1):
    for j in range(3):
        for k in range(3):
            if j != k: dp[i][k] = max(dp[i][k],dp[i-1][j] + a[i-1][k])
print(max(dp[n]))

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

int main() {
  int A, B, C;
  cin >> A >> B >> C;

  if ((C > A && C < B) || (C > B && C < A)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
sx, sy, tx, ty = map(int,input().split()) #n:頂点数　m:辺の数
ans = []
#(sx, sy) to (tx, ty)
for i in range(tx - sx):
  ans.append("R")
for i in range(ty - sy):
  ans.append("U")
#reverse
for i in range(tx - sx):
  ans.append("L")
for i in range(ty - sy):
  ans.append("D")
#(sx, sy) to (sx, sy - 1) to (tx + 1, sy - 1) 
#to (tx + 1, ty) to (tx, ty)
ans.append("D")
for i in range(tx - sx + 1):
  ans.append("R")
for i in range(ty - sy + 1):
  ans.append("U")
ans.append("L")
#reverse
ans.append("U")
for i in range(tx - sx + 1):
  ans.append("L")
for i in range(ty - sy + 1):
  ans.append("D")
ans.append("R")

for i in range(len(ans)):
  print(ans[i], end="")
  


Measured memory_bytes: 9368
#include <algorithm>
#include <iostream>
#include <set>
#include <vector>

using namespace std;

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

    vector<pair<int, int>> V;
    for (int i = 1; i < N + 1; i++) {
        int p;
        cin >> p;
        V.emplace_back(p, i);
    }

    sort(begin(V), end(V));
    reverse(begin(V), end(V));

    multiset<int> S{0, 0, N + 1, N + 1};

    int64_t ans = 0;
    for (auto &v : V) {
        int value = v.first;
        int index = v.second;

        auto it = S.lower_bound(index);

        int r1 = *it++;
        int r2 = *it--;

        it--;

        int l1 = *it--;
        int l2 = *it;

        ans += 1l * value * (
            (r2 - r1) * (index - l1) +
            (l1 - l2) * (r1 - index)
        );

        S.insert(index);
    }

    cout << ans << '\n';
}


Measured memory_bytes: 5748
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n;
  cin >> n;
  vl h(n);
  rep(i, n) cin >> h[i];
  ll ans = 0;
  rep(_, 100) {
    bool b = false;
    rep(i, n) {
      if(h[i] > 0) {
        h[i]--;
        if(!b) {
          ans++;
          b = true;
        }
      } else if(h[i] == 0)
        b = false;
    }
  }
  cout << ans << endl;
}

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

using namespace std;

int ans;
string s;

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

    for (int i = 0; i < s.size(); ++i) {
        char c;
        if(i % 2) c = 'p';
        else c = 'g';
        if(c < s[i]) ans --;
        else if(c > s[i]) ans ++;
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define scan int n;cin>>n;for(int i=0;i<n;i++)
#define ll long long
#define vl vector<long long>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    vector<pair<int,int> > v;
    scan{
        int a,b;
        cin >> a >> b;
       // cout << a << b << endl;
        v.push_back({a,b});
    }
    float answer = 0.0000001;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
float curr=sqrt( pow((v[i].first-v[j].first),2)+pow((v[i].second-v[j].second),2));
        //cout << i << " " << j << " " <<  curr << endl;
        //cout << ((v[i].first - v[j].first)^2) << endl;
        answer += curr;
        }
    }
    int fact = 1;
    for(int i=2;i<=n;i++){
        fact *= i;
    }
    cout <<fixed << setprecision(7) << answer*((n-2)*2+2)/(n * (n-1));
}



Measured memory_bytes: 256
code = """

# distutils: language=c++
# distutils: include_dirs=[/home/USERNAME/.local/lib/python3.8/site-packages/numpy/core/include, /opt/atcoder-stl]
# cython: boundscheck=False
# cython: wraparound=False


cimport numpy as np
cdef extern from "<atcoder/fenwicktree>" namespace "atcoder" nogil:
    cdef cppclass fenwick_tree[T]:
        fenwick_tree(int n)
        void add(int p, T x)
        T sum(int l, int r)

cdef class FenwickTree:
    cdef fenwick_tree[long] *_thisptr
    def __cinit__(self, np.ndarray[long, ndim=1] array):
        cdef int N = array.size
        self._thisptr = new fenwick_tree[long](N)
        for i in range(N):
            self.add(i, array[i])
    cpdef void add(self, int p, long x):
        self._thisptr.add(p, x)
    cpdef long sum(self, int l, int r):
        return self._thisptr.sum(l, r)
"""


import os, sys, getpass

if sys.argv[-1] == 'ONLINE_JUDGE':
    code = code.replace("USERNAME", getpass.getuser())
    open('atcoder.pyx','w').write(code)
    os.system('cythonize -i -3 -b atcoder.pyx')
    sys.exit(0)


from atcoder import FenwickTree
import numpy as np

N,Q = list(map(int,input().split()))
bit = FenwickTree(np.array(list(map(int,input().split())), dtype=np.int))

for i in range(Q):
    a,b,c = list(map(int,input().split()))
    if a==0:
        bit.add(b,c)
    else:
        print(bit.sum(b,c))

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

int n, m, ans[500000], num[10000], lim;
long long all;

long long Calc(int x) {
	return (pow(n, x + 1) - 1) / (n - 1);
}

void Dfs(int x) {
	if(x == -1) return;
	if(!all) return;
//	printf("%d\n", x);
	int i = 1;
	while((i - 1) * Calc(x) < all) i++;
	i--;
	printf("%d ", i);
	all -= (i - 1) * Calc(x) + 1;
	Dfs(x - 1);
}

void Solve(int x, int res) {
	if(x > lim) {
		printf("%d ", (n + 1) / 2);
		Solve(x - 1, res + 1);
		return;
	}
	all = Calc(x);
	all = (res + all + 1) / 2 - res;
//	printf("\n%d\n", x);
	printf("%d ", (n + 1) / 2);
	all--;
	Dfs(x - 1);
}

int main() {
	scanf("%d%d", &n, &m);
	if(n == 1) {
		for(int i = 1; i <= (m + 1) / 2; i++) 
			printf("%d ", 1);
		return 0;
	}
	if(n & 1) {
		long long now = 1;
		for(; now <= m; now *= n) {
			lim++;
		}
		Solve(m - 1, 0);
	} else {
		printf("%d ", n / 2);
		for(int i = 1; i < m; i++)
			printf("%d ", n);
		return 0;
	}
	return 0;
}

Measured memory_bytes: 2304
#!/usr/bin/python3

n = int(input())

def solve():
    o = 0
    s = 0
    b = [False, False, False]
    while o < 3:
        inst = input()
        if inst == 'OUT':
            o += 1
        elif inst == 'HIT':
            if b[2]:
                s += 1
            b2 = [True]
            b2.extend(b[0:2])
            b = b2
        elif inst == 'HOMERUN':
            s += 1
            for k in range(3):
                if b[k]:
                    b[k] = False
                    s += 1
    return s

for _ in range(n):
    print(solve())

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

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

signed main()
{
    int n; cin >> n;
    string s; cin >> s;

    int numR = 0, numG = 0, numB = 0;
    rep(i,n){
        if (s[i] == 'R') ++numR;
        else if (s[i] == 'G') ++numG;
        else ++numB;
    }

    ll ans = (ll)numR * (ll)numG * (ll)numB;
    rep(i,n-2){
        for (int diff = 0; diff <= n+2/3; ++diff){
            if (i + diff * 2 >= n) continue;
            char c1 = s[i], c2 = s[i + diff], c3 = s[i + diff * 2];
            if ((c1 != c2) && (c2 != c3) && (c3 != c1)){
                --ans;
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3592
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
const int N=1,INF=~0u>>2;
char s[13];
int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return f*x;
}
int main(){
//	freopen("ex.in","r",stdin);
	scanf("%s",s);
	for(int i=0;i<=3;++i) printf("%c",s[i]);
	putchar(' ');
	for(int i=4;i<12;++i) printf("%c",s[i]);
	putchar('\n');
	return 0;
}

Measured memory_bytes: 256
<?php
while (true) {
    fscanf(STDIN, "%d %d", $inputNumX, $inputNumY);
    if ($inputNumX === 0 && $inputNumY === 0) {
        break;
    }
    echo orderByAskForTwoNums($inputNumX, $inputNumY), PHP_EOL;
}
 
function orderByAskForTwoNums($inputNumX, $inputNumY)
{
    return min($inputNumX, $inputNumY).' '.max($inputNumX, $inputNumY);
}

Measured memory_bytes: 15124
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

const double INF = 1e9;

struct D {
    vector<double> l, r;
    D(): l(3, INF), r(3, -INF) {}
    void add(double pos, int dir) {
        dir++;
        l[dir] = min(l[dir], pos);
        r[dir] = max(r[dir], pos);        
    }
    double get(double time) {
        double nl = INF, nr = -INF;
        rep(i, 3) {
            nl = min(nl, l[i] + i*time);
            nr = max(nr, r[i] + i*time);
        }
        return nr - nl;
    }
    // 可能性のあるものを返す
    vector<double> events() {
        vector<double> res;
        rep(i, 3) rep(j, i) {
            double nt = (l[j] - l[i]) / (i - j);
            if (nt > 0) res.push_back(nt);
        }
        rep(i, 3) rep(j, i) {
            double nt = (r[j] - r[i]) / (i - j);
            if (nt > 0) res.push_back(nt);
        }
        return res;
    }
};

int main() {
    int N;
    cin >> N;
    D xd, yd;
    rep(i, N) {
        double x, y;
        char d;
        cin >> x >> y >> d;
        if (d == 'L') xd.add(x, -1), yd.add(y, 0);
        if (d == 'R') xd.add(x, 1), yd.add(y, 0);
        if (d == 'U') xd.add(x, 0), yd.add(y, 1);
        if (d == 'D') xd.add(x, 0), yd.add(y, -1);
    }
    vector<double> cand;
    cand.push_back(0);
    cand.push_back(INF);
    vector<double> ex = xd.events();
    vector<double> ey = yd.events();
    cand.insert(cand.end(), ex.begin(), ex.end());
    cand.insert(cand.end(), ey.begin(), ey.end());
    sort(cand.begin(), cand.end());
    cand.erase(unique(cand.begin(), cand.end()), cand.end());
    double ans = 1e18;
    for (double t : cand) {
        double temp = xd.get(t) * yd.get(t);
        ans = min(ans, temp);        
    };
    printf("%.11f\n", ans);
    return 0;
}

Measured memory_bytes: 3800
#include <bits/stdc++.h>
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define perm(c) sort(ALL(c));for(bool c##p=1;c##p;c##p=next_permutation(ALL(c)))
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MAX max<ll>
#define MIN min<ll>
#define pb push_back
#define to_s to_string
#define len(v) (ll)v.size()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define print(x) cout << (x) << '\n'
#define drop(x) cout << (x) << '\n', exit(0)
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
typedef vector<ll> vec;
typedef vector<vector<ll>> vec2;
typedef vector<vector<vector<ll>>> vec3;
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; }
ll devc(ll x, ll y) { return (x + y - 1) / y; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);

    ll K;
    cin >> K;
    ll ans = 0;
    rep1(a, K) rep1(b, K) rep1(c, K){
        ans += gcd(a, gcd(b, c));
    }
    print(ans);

    return 0;
}

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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll A, B;
    cin >> A >> B;

    if (A == B) {
        cout << B << endl;
        return 0;
    }

    ll tmp = (B-A)/2;        
    if (A%2==0 && B%2==0) {
        if (tmp%2) {
            cout << (B^1) << endl;
        } else {
            cout << B << endl;
        }
    } else if (A%2==0 && B%2 == 1) {
        if (tmp%2) {
            cout << 0 << endl;
        } else {
            cout << 1 << endl;
        }
    } else if (A%2==1 && B%2 == 0) {
        if (tmp%2) {
            cout << (A^B^1) << endl;
        } else {
            cout << (A^B) << endl;
        }
    } else if (A%2==1 && B%2 == 1) {
        if (tmp%2) {
            cout << (A^1) << endl;
        } else {
            cout << A << endl;
        }
    }
    return 0;
}

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

int main()
{
    string S, T;
    cin >> S >> T;
    int ans = 0;
    for (int i = 0; i < S.size(); i++) {
        if (S[i] == T[i]) ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int i,j,z,N,A[100],count=0;

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
 }
  for(i=0;i<N-1;i++){
    for(j=N-1;j>i;j--){
      if(A[j]<A[j-1]){
	z=A[j];
	A[j]=A[j-1];
	A[j-1]=z;
	count++;
      }
	
    }
  }
  for(i=0;i<N-1;i++)printf("%d ",A[i]);
  printf("%d",A[N-1]);
  printf("\n%d\n",count);
  
  return 0;
}



Measured memory_bytes: 2144
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007


vector<vi> v;
vector<vi> d(110,vi(110,-1));


int calc(int y,int x){
	if(d[y][x]!=-1)return d[y][x];
	int ret=0;
	if(y==v.size()-1)ret=v[y][0];
	else if(y<v.size()/2){
		if(x+1<v[y+1].size())ret=v[y][x]+max(calc(y+1,x),calc(y+1,x+1));
		else ret=v[y][x]+calc(y+1,x);
	}
	else{
		if(x==0)ret=v[y][x]+calc(y+1,x);
		else if(x<v[y+1].size())ret=v[y][x]+max(calc(y+1,x),calc(y+1,x-1));
		else ret=v[y][x]+calc(y+1,x-1);
	}
	return d[y][x]=ret;
}



int main(){
	int n,e;
	char c;
	vi u;
	while(1){
		e=scanf("%d%c",&n,&c);
		if(e==EOF)break;
		u.pb(n);
		if(c=='\n'){
			v.pb(u);
			u.clear();
		}
	}
	// rep(i,v.size()){
	// 	rep(j,v[i].size()){
	// 		if(j!=0)cout<<",";
	// 		cout<<v[i][j];
	// 	}
	// 	cout<<endl;
	// }
	cout<<calc(0,0)<<endl;
}

Measured memory_bytes: 1308
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] array = input.split("[ .,]");
		
		boolean first = true;
		for(int i = 0; i < array.length ; i++){
			if(array[i].length() >= 3 && array[i].length() <= 6){
				if(!first){
					System.out.print(" ");
				}
				System.out.print(array[i]);
				first = false;
			}
		}
		System.out.println();
	}

}

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

int main() {
  long int a, b, c, d;
  cin >> a >> b >> c >> d;
  long int p[4] = {a*c, a*d, b*c, b*d}, m = a*c;
  for(int i = 0;i<4; i++){
    m = max(m, p[i]);
  }
  cout << m << endl;
  return 0;
}

Measured memory_bytes: 3572
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		int N = S.Length;
		List<int> cnt = new List<int>();
		List<char> key = new List<char>();
		cnt.Add(1);
		key.Add(S[0]);
		for(int i=1;i<N;i++){
			if(S[i] == key[key.Count - 1]){
				cnt[cnt.Count - 1]++;
			} else {
				cnt.Add(1);
				key.Add(S[i]);
			}
		}
		
		if(cnt.Count == 1){
			long tot = N * K;
			Console.WriteLine(tot / 2);
			return;
		}
		
		int M = cnt.Count;
		long ans = 0;
		ans += cnt[0] / 2;
		ans += cnt[M - 1] / 2;
		for(int i=1;i<M-1;i++){
			ans += K * (cnt[i] / 2);
		}
		if(key[0] == key[M-1]){
			ans += (K - 1) * ((cnt[0] + cnt[M-1]) / 2);
		} else {
			ans += (K - 1) * (cnt[0] / 2);
			ans += (K - 1) * (cnt[M-1] / 2);
		}
		Console.WriteLine(ans);
		
	}
	String S;
	long K;
	public Sol(){
		S = rs();
		K = rl();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 11348
#include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <string>
using namespace std;
typedef long long ll;

int main(){
    int N,K;
    string S;
    cin >> N >> S; cin >> K;
    for(int i=1;i<=N;i++){
        if(i==K) continue;
        else{
            if(S[i-1]!=S[K-1]) S[i-1]='*';
        }
    }
    cout << S << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(void){
    int A,B,C,D,E,x,y,cou=0,cou2,v[20],w[20][20];
    char S[10],W[10],s[10],X,Y;
    scanf("%d %d %d",&A,&B,&C);
    for(int i=0;i<B;i++){
        scanf("%d",&v[i]);
    }
    for(int i=0;i<A;i++){
        for(int j=0;j<B;j++){
            scanf("%d",&w[i][j]);
        }
    }
    for(int i=0;i<A;i++){
        cou=0;
        for(int j=0;j<B;j++){
            cou+=v[j]*w[i][j];
        }
        cou+=C;
        if(cou>0){
            cou2++;
        }
    }
    printf("%d",cou2);
    return 0;
}

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

int main() {
    int X,  A, B;
    cin >> X >> A >> B;
    if(B - A <= 0) cout << "delicious" << endl;
    else if(B - A <= X) cout << "safe" << endl;
    else cout << "dangerous" << endl; 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#define REP(i, n) for(int i=0; i<n; i++)
#define REPR(i, n) for(int i=n; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 10000000000;
using namespace std;
typedef unsigned long ul;
typedef long long ll;
typedef pair<ll, ll> p;

int main(void) {
    ll D, G;
    cin >> D >> G;
    ll p[11], c[11];
    ll i, j;
    ll ans=100*D, scr, cnt;
    ll restM;
    for(i=1; i<=D; i++) {
        cin >> p[i] >> c[i];
    }
    
    for(i=0; i<1<<D; i++) {
        scr=0;
        cnt=0;
        restM=0;
        bool q[11]={false};
        for(j=1; j<=D; j++) {
            if(1&i>>(j-1)) {
                q[j]=true;
                scr+=100*j*p[j]+c[j];
                cnt+=p[j];
            } else {
                restM=j;
            }
        }
        if(scr<G) {
            ll s1=100*restM;
            ll need=(G-scr+s1-1)/s1;
            if(need>=p[restM])
                continue;
            cnt+=need;
        }
        
        ans=min(ans, cnt);
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
const ll inf = 1e9;
int main(){
    int q; cin >> q;
    set<ll> st;
    rep(i,q){
        ll com, x;
        cin >> com >> x;
        if(com == 0){
            st.insert(x);
            cout << st.size() << endl;
        }else if(com == 1)cout << ((st.find(x) != st.end())?1:0) << endl;
        else st.erase(x);
    }
    return 0;
}


Measured memory_bytes: 12468
#include <iostream>

using namespace std;

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

    long int i, tmp;
    tmp = x - k + 1;
    if(tmp < -1000000) {
        tmp = -1000000;
    }
    for(i=tmp; i<=(x+k-1); i++) {
        cout << i << ' ';
        if(i>=1000000) {
            break;
        }
    }

    cout << endl;

    return 0;
    
}

Measured memory_bytes: 256