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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

constexpr double D_INF = 1e+60;

using Pos = complex<double>;
using Pi = pair<double, ll>;

double distance(const Pos& a, const Pos& b) {
    return sqrt(norm(a - b));
}

double dist[1005][1005];

void solve() {
    Pos xs, xt;
    double x, y;
    cin >> x >> y;
    xs.real(x), xs.imag(y);
    cin >> x >> y;
    xt.real(x), xt.imag(y);
    ll N;
    cin >> N;
    vector<pair<Pos, double>> bs(N);
    for (ll i = 0; i < N; i++) {
        Pos c(2);
        double r;
        double xi, yi;
        cin >> xi >> yi >> r;
        c.real(xi), c.imag(yi);
        bs[i] = {c, r};
    }

    for (ll i = 0; i < N + 2; i++) {
        for (ll j = 0; j < N; j++) {
            dist[i][j] = D_INF;
        }
    }
    for (ll i = 0; i < N + 2; i++) {
        dist[i][i] = 0.0;
    }

    // バリア同士
    for (ll i = 0; i < N; i++) {
        for (ll j = i + 1; j < N; j++) {
            double d = distance(bs[i].first, bs[j].first) - bs[i].second - bs[j].second;
            if (d > 0.0) {
                dist[i][j] = dist[j][i] = d;
            }
            else {
                dist[i][j] = dist[j][i] = 0.0;
            }
        }
    }

    // スタートとバリア
    for (ll i = 0; i < N; i++) {
        double d = distance(xs, bs[i].first) - bs[i].second;
        if (d > 0.0) {
            dist[i][N] = dist[N][i] = d;
        }
        else {
            dist[i][N] = dist[N][i] = 0.0;
        }
    }

    // ゴールとバリア
    for (ll i = 0; i < N; i++) {
        double d = distance(xt, bs[i].first) - bs[i].second;
        if (d > 0.0) {
            dist[i][N + 1] = dist[N + 1][i] = d;
        }
        else {
            dist[i][N + 1] = dist[N + 1][i] = 0.0;
        }
    }

    // スタートとゴール
    {
        double d = distance(xs, xt);
        dist[N][N + 1] = dist[N + 1][N] = d;
    }

    vector<double> costs(N + 2, D_INF);
    priority_queue<Pi, vector<Pi>, greater<Pi>> pq;
    costs[N] = 0.0;
    pq.emplace(0.0, N);
    while (!pq.empty()) {
        double co;
        ll idx;
        tie(co, idx) = pq.top();
        pq.pop();
        if (co > costs[idx]) continue;
        for (ll i = 0; i < N + 2; i++) {
            double nco = co + dist[idx][i];
            if (nco >= costs[i]) continue;
            pq.emplace(nco, i);
            costs[i] = nco;
        }
    }

    cout << setprecision(20) << costs[N + 1] << endl;
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif
#ifdef FILEOUTPUT
    ofstream ofs("./in_out/output.txt");
    cout.rdbuf(ofs.rdbuf());
#endif
    solve();
    cout << flush;
    return 0;
}

Measured memory_bytes: 13940
// "header" {{{
#pragma GCC optimize("Ofast")

#include <cassert>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <tuple>
#include <iomanip>
#include <climits>
#include <cstdlib>

using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int>
#define int int64_t
#define double long double
#define Fixed fixed << setprecision(10)
#define moke_pair make_pair

constexpr int INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int64_t mod1 = 1000000007;
constexpr int64_t mod2 = 998244353;

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

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class T,class U> using umap = unordered_map<T,U>;

inline int64_t updiv(int64_t n,int64_t d){ return ((n + d -1) / d); }
inline int square(int a){ return a * a; }

int gcd(int a,int b){ return b ? gcd(b,a % b) : a;}
int lcm(int a,int b){ return a / gcd(a,b) * b;}
// }}}

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

    int n,k;
    cin >> n >> k;
    vector<bool> ng(10);

    rep(i,k){
        int d;
        cin >> d;
        ng[d] = true;
    }

    for(int i = n;;++i){
        int tmp = i;
        while(tmp){
            if(ng[tmp % 10]) goto jump;
            tmp /= 10;
        }
        return cout << i << '\n',0;
jump:;
    }

    return 0;
}

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

int main(int argc, char const* argv[])
{
	string str;
	int numberOfH;
	while (cin >> str &&  str != "-") {
		cin >> numberOfH;
		for (int i=0; i<numberOfH; i++) {
			int h;
			cin >> h;
			string tmpStr = str.substr(0, h);
			str = str.substr(h, str.size());
			str += tmpStr;
		}
		cout << str << endl;
	}
	return 0;
}


Measured memory_bytes: 1220
using System;
using System.Text;
using System.Collections.Generic;
 
public class node
{
    public node parent;
    public node rightChild;
    public node leftChild;
    public int key;
}
 
public class Test
{
    public static int[] preorderKey, inorderKey;
    public static int precount, incount;
 
    public static void Main()
    {
 
        int n = int.Parse(Console.ReadLine());
        List<node> tree = new List<node>();
 
        for(int i = 0; i < n ; i++) {
            string[] atom = Console.ReadLine().Split(" ".ToCharArray());
 
            switch(atom[0][0]){
                case 'i':
                    Insert(int.Parse(atom[1]), tree);
                    break;
 
                case 'p':
                    Print(tree.ToArray());
                    break;
            }
        }
    }
 
    public static void Insert(int v ,List<node> T)
    {
        node y = null;
 
        node z = new node();
		z.key = v;
		T.Add(z);
 
        if(T.Count == 1) return;
        node x = T[0];
 
        while(x != null) {
            y = x;
            if(v < x.key) x = x.leftChild;
            else x = x.rightChild;
        }
        z.parent = y;
 
        if(y == null) {
 
        } else if (v < y.key) {
            y.leftChild = T[T.Count - 1];
        } else {
            y.rightChild = T[T.Count - 1];
        }
    }
 
    public static void Print(node[] T)
    {
        preorderKey = new int[T.Length];
        inorderKey = new int[T.Length];
        precount = 0;
        incount = 0;
 
        node root = GetRoot(T);
        Inorder(root, T);
        Preorder(root, T);
 
        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < T.Length; i++) {
            sb.Append(" " + inorderKey[i]);
        }
        Console.WriteLine(sb.ToString());
        sb = new StringBuilder();
        for(int i = 0; i < T.Length; i++) {
            sb.Append(" " + preorderKey[i]);
        }
        Console.WriteLine(sb.ToString());
 
    }
 
    public static void Preorder(node t, node[] tree)
    {
        preorderKey[precount++] = t.key;
        if(t.leftChild != null) Preorder(t.leftChild, tree);
        if(t.rightChild != null) Preorder(t.rightChild, tree);
    }
 
    public static void Inorder(node t, node[] tree)
    {
        if(t.leftChild != null) Inorder(t.leftChild, tree);
        inorderKey[incount++] = t.key;
        if(t.rightChild != null) Inorder(t.rightChild, tree);
    }
 
    public static node GetRoot(node[] T)
    {
        if ( T ==  null ) return null;
        if ( T.Length == 0) return null;
 
        node u = T[0];
        while(u.parent != null) {
            u = u.parent;
        }
 
        return u;
    }
 
}

Measured memory_bytes: 88900
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	int n;
	char c;
	int s=0,o=0;
	while(scanf("%d%c",&n,&c),n){
		if(n==1)o++;
		if(n>=10)s+=10;
		else s+=n;
		if(c!=32){
			if(s>21)cout<<0<<endl;
			else{
				if(o&&s<=11)cout<<s+10<<endl;
				else cout<<s<<endl;
			}
			s=o=0;
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#include <unordered_map>
#define int long long int
#define double long double
#define endl "\n"
#define PI 3.141592653589793238462643383279502884
#define sp(x)   setprecision(x)
#define ceil(a,b)   (a+(b-1))/b
#define LCM(a,b)    (a*b)/__gcd(a,b)
#define all(v)  v.begin(),v.end()
#define alls(s,v)  s.begin(),s.end(),v
#define gena(arr,n,nxt)  generate(arr,arr+n, nxt)
#define genv(v,nxt)  generate(v.begin(),v.end(), nxt)
#define base ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define exit return 0;
using namespace std;
const int N=1000000;
bool prime[N];
void sieve()
{
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<100000000; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<100000; i += p)
                prime[i] = false;
        }
    }
}
int nxt(){int x;cin >> x;return x;}
int factorial[N], arr[N];
int power(int x, int y){
    if (y == 0)
        return 1;
    int p = power(x, y/2) % 1000000007;
    p = (p * p) % 1000000007;
    return (y%2 == 0)? p : (x * p) % 1000000007;
}
int inv(int a){
	return power(a, 1000000005);
}
int f(int a, int b, int c, int d){
	int x = c - a;
	int y = d - b;
	y = y + x;
	return factorial[y] * arr[x] % 1000000007 * arr[y-x] % 1000000007;
}
int32_t main()
{
    base
    factorial[0] = 1;
	arr[0] = 1;
	for(int i = 1; i < N; i++){
		factorial[i] = (factorial[i-1]*i) % 1000000007;
		arr[i] = inv(factorial[i]);
	}
	int H=nxt(),W=nxt(),h=nxt(),w=nxt();
	int ans = 0;
	for(int i = 0; i < H-h; i++){
		ans += f(0, 0, i, w-1) * f(i, w, H-1, W-1);
		ans %= 1000000007;
	}
	cout << ans;
    exit
}



Measured memory_bytes: 16640
// Last Change: 06/01/2019 23:16:31.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}
} // namespace NS

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

  vector<vector<ll>> V(N);
  vector<ll> T(N, 0);
  ll a, b;
  for (ll i = 0; i < N - 1; ++i) {
    cin >> a >> b;
    --a;
    --b;
    ++T[a];
    ++T[b];
    V[a].push_back(b);
    V[b].push_back(a);
  }

  ll startPos = 0, maxVal = 0;
  for (ll i = 0; i < N; ++i) {
    if (T[i] > maxVal) {
      maxVal = T[i];
      startPos = i;
    }
  }

  vector<ll> C(N);
  ll ans = 0;
  for (auto &&e : C) {
    cin >> e;
    ans += e;
  }
  sort(C.begin(), C.end(), greater<ll>());
  ans -= C[0];

  fill(T.begin(), T.end(), 0);

  queue<ll> q;
  q.push(startPos);
  ll cnt = 0;
  while (!q.empty()) {
    T[q.front()] = C[cnt];
    ++cnt;
    for (auto &&e : V[q.front()]) {
      if (T[e] == 0) {
        q.push(e);
      }
    }
    q.pop();
  }

  cout << ans << endl;
  for (auto &&e : T) {
    cout << e << ' ';
  }
  cout << endl;

  //NS::LoopUntilZeroInpput();
}


Measured memory_bytes: 1272
class Card:
    def __init__(self, suit: str, value: int):
        self.suit = suit
        self.value = value

    def __str__(self):
        return self.suit + self.value


N = int(input())
cards1 = [Card(card[0], card[1]) for card in list(map(str, input().split()))]
cards2 = [*cards1]


def bubbleSort(cards: list, n: int):
    for i in range(n):
        for j in reversed(range(i+1, n)):
            if cards[j-1].value > cards[j].value:
                cards[j-1], cards[j] = cards[j], cards[j-1]
    return cards


def selectionSort(cards: list, n: int):
    for i in range(n):
        minj = i
        for j in range(i, n):
            if cards[minj].value > cards[j].value:
                minj = j
        cards[i], cards[minj] = cards[minj], cards[i]
    return cards


def isStable(cards1: list, cards2: list, n: int):
    for i in range(n):
        if cards1[i].suit != cards2[i].suit:
            return False
    return True


bubbleSort(cards1, N)
selectionSort(cards2, N)
print(*cards1)
print('Stable')
print(*cards2)
print('Stable' if isStable(cards1, cards2, N) else 'Not stable')



Measured memory_bytes: 5620
// :)
// "Khodaya, be man "Tagwaye setiz" biamooz ta
//  dar anbuh masuliat nalaghzam ..." -Shariati
#include <bits/stdc++.h>
using namespace std;

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

#define F first
#define S second

const int MAX = 1e5+9;
const ll MOD = 1e9+7;

ll dp[70][5][5][5][5]; // [n][c1][c2][c3][c4]

int main () {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int n;
	string s1, s2;
	cin >> n >> s1 >> s2;
	if (s1[0] == s2[0])
			dp[0][1][1][1][1] = dp[0][2][2][1][1] = dp[0][3][3][1][1] = 1;
	else {
		for (int i=1; i <= 3; i++)
		for (int t=1; t <= 3; t++)
			if (i != t)
				dp[1][i][t][i][t] = 1;
	}
	for (int i=1; i < n; i++) {
		if (s1[i] == s2[i]) {
			for (int c=1; c <= 3; c++)
				for (int c1=1; c1 <= 3; c1++)
				for (int c2=1; c2 <= 3; c2++) {
					if (c1 == c || c2 == c) continue;
					for (int c3=1; c3 <= 3; c3++)
					for (int c4=1; c4 <= 3; c4++)
						dp[i][c][c][c1][c2] = (dp[i][c][c][c1][c2] + dp[i-1][c1][c2][c3][c4]) % MOD;
				}
			continue;
		}
		if (s1[i] == s1[i-1] && s2[i] == s2[i-1] && i != 1) {
			for (int c=1; c <= 3; c++)
			for (int d=1; d <= 3; d++) {
				if (c == d) continue;
				for (int c1=1; c1 <= 3; c1++)
				for (int c2=1; c2 <= 3; c2++) {
					if (c1 == c || c2 == d) continue;
					for (int c3=1; c3 <= 3; c3++)
					for (int c4=1; c4 <= 3; c4++)
						dp[i][c][d][c][d] = (dp[i][c][d][c][d] + dp[i-2][c1][c2][c3][c4]) % MOD;
				}
			}
		}
		if (s1[i] == s1[i-1] && s2[i] != s2[i-1]) {
			for (int c=1; c <= 3; c++)
				for (int c2=1; c2 <= 3; c2++)
				for (int c3=1; c3 <= 3; c3++) {
					if (c == c2 || c == c3) continue;
					for (int c4=1; c4 <= 3; c4++)
						dp[i][c][0][c][c2] = (dp[i][c][0][c][c2] + dp[i-1][0][c2][c3][c4]) % MOD;
				}
		}
		if (s1[i] != s1[i-1] && s2[i] == s2[i-1]) {
			for (int c=1; c <= 3; c++)
				for (int c1=1; c1 <= 3; c1++)
				for (int c4=1; c4 <= 3; c4++) {
					if (c == c1 || c == c4) continue;
					for (int c3=1; c3 <= 3; c3++)
						dp[i][0][c][c1][c] = (dp[i][0][c][c1][c] + dp[i-1][c1][0][c3][c4]) % MOD;
				}
		}
	}
	ll res = 0;
	for (int c1=1; c1<=3; c1++)
	for (int c2=1; c2<=3; c2++)
	for (int c3=1; c3<=3; c3++)
	for (int c4=1; c4<=3; c4++)
		res = (res + dp[n-1][c1][c2][c3][c4]) % MOD;
	cout << res << "\n";
}

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

int main() {
  char c;
  cin>>c;
  if (c=='a'||c=='i'||c=='u'||c=='e'||c=='o'){
    cout<<"vowel"<<endl;
  }
  else{
    cout<<"consonant"<<endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
    char s[4] = {};
    scanf("%s", s);
    int a=s[0]-'0', b=s[1]-'0', c=s[2]-'0', d=s[3]-'0';
    if      (a+b+c+d==7) printf("%d+%d+%d+%d", a, b, c, d);
    else if (a+b+c-d==7) printf("%d+%d+%d-%d", a, b, c, d);
    else if (a+b-c+d==7) printf("%d+%d-%d+%d", a, b, c, d);
    else if (a+b-c-d==7) printf("%d+%d-%d-%d", a, b, c, d);
    else if (a-b+c+d==7) printf("%d-%d+%d+%d", a, b, c, d);
    else if (a-b+c-d==7) printf("%d-%d+%d-%d", a, b, c, d);
    else if (a-b-c+d==7) printf("%d-%d-%d+%d", a, b, c, d);
    else if (a-b-c-d==7) printf("%d-%d-%d-%d", a, b, c, d);
    puts("=7");
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
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; }

// ??????????????? ????°?
#define MAX_N 2000010
int heap[MAX_N], sz = 0;
void push(int x) {
	int v = sz++;
	while (v > 0) {
		int p = (v - 1) / 2;
		if (heap[p] <= x)break;
		heap[v] = heap[p];
		v = p;
	}
	heap[v] = x;
}
int pop() {
	int ret = heap[0];
	int back = heap[--sz];
	int v = 0;
	while (v * 2 + 1 < sz) {
		// l ??¨ r ??????????°???????????????¨???????????????
		int l = v * 2 + 1, r = v * 2 + 2;
		int u = (r >= sz || heap[l] < heap[r]) ? l : r;
		// ???????????¢???????????????
		if (heap[u] >= back)break;
		heap[v] = heap[u]; 
		v = u;
	}
	heap[v] = back;
	return ret;
}
int top() {
	return heap[0];
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	for (string s; cin >> s;) {
		if (s[0] == 'i') {
			int a; cin >> a;
			push(-a);
		}
		else if (s[1] == 'x') {
			cout << -pop() << endl;
		}
		else {
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 6980
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=10005,INF=1<<29;
typedef vector<vector<int>> mat;
vector<int> dh={0,1,0,-1},dw={1,0,-1,0};
int ans,H,W,X;
void DFS(mat S,int turn){
    if(turn==4){
        mat cha(H,vector<int>(W));
        cha[0][0]=1;
        queue<pair<int,int>> Q;
        Q.push({0,0});
        
        while(!Q.empty()){
            int i=Q.front().first,j=Q.front().second;
            Q.pop();
            for(int k=0;k<4;k++){
                int h=i+dh[k],w=j+dw[k];
                if(h<0||h>=H||w<0||w>=W) continue;
                if(cha[h][w]) continue;
                if(S[h][w]==S[i][j]){
                    cha[h][w]=1;
                    Q.push({h,w});
                }
            }
        }
        
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
                if(cha[i][j]) S[i][j]=X;
                cha[i][j]=0;
            }
        }
        
        int cnt=0;
        
        cha[0][0]=1;
        Q.push({0,0});
        
        while(!Q.empty()){
            int i=Q.front().first,j=Q.front().second;
            Q.pop();
            for(int k=0;k<4;k++){
                int h=i+dh[k],w=j+dw[k];
                if(h<0||h>=H||w<0||w>=W) continue;
                if(cha[h][w]) continue;
                if(S[h][w]==S[i][j]){
                    cha[h][w]=1;
                    Q.push({h,w});
                }
            }
        }
        
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
                if(cha[i][j]) cnt++;
            }
        }
        
        ans=max(ans,cnt);
    }else{
        for(int to=1;to<=6;to++){
            mat cha(H,vector<int>(W)),T(H,vector<int>(W));
            
            queue<pair<int,int>> Q;
            cha[0][0]=1;
            Q.push({0,0});
            while(!Q.empty()){
                int i=Q.front().first,j=Q.front().second;
                Q.pop();
                for(int k=0;k<4;k++){
                    int h=i+dh[k],w=j+dw[k];
                    if(h<0||h>=H||w<0||w>=W) continue;
                    if(cha[h][w]) continue;
                    if(S[h][w]==S[i][j]){
                        cha[h][w]=1;
                        Q.push({h,w});
                    }
                }
            }
            
            for(int i=0;i<H;i++){
                for(int j=0;j<W;j++){
                    if(cha[i][j]) T[i][j]=to;
                    else T[i][j]=S[i][j];
                }
            }
            
            DFS(T,turn+1);
        }
    }
}

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        cin>>H>>W>>X;
        if(H+W+X==0) break;
        ans=0;
        mat S(H,vector<int>(W));
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
                cin>>S[i][j];
            }
        }
        DFS(S,0);
        
        cout<<ans<<endl;
    }
}




Measured memory_bytes: 3240
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 7;
const int M = 1e6 + 7;
const int INF = 1e9 + 7;
string s;
set <int> st1, st2;
int main()
{
    int n, k, c;
    cin >> n >> k >> c;
    cin >> s;
    for(int i = 0; i < s.size(); i++)
    {
        if(s[i] == 'x')
            continue;
        st1.insert(i);
        i += c;
    }
    for(int i = s.size() - 1; i >= 0; i--)
    {
        if(s[i] == 'x')
            continue;
        st2.insert(i);
        i -= c;
    }
    if(st1.size() > k || st2.size() > k);
    else
    {
        for(int i:st1)
        {
            if(st2.count(i))
                cout << i + 1 << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 20484
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#include <fstream>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int,int>
#define MA make_pair
#define LLI long long int
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define POS(i) cout<<(i?"POSSIBLE":"IMPOSSIBLE")<<endl
#define Pos(i) cout<<(i?"Possible":"Impossible")<<endl
#define co(i) cout<<i<<endl
using namespace std;
//
const int INF=1e9+7;
const int MOD=1e9+7;
//

int main(){
    string s; cin>>s;
    int a=-1,b=-1;
    FOR(i,0,s.size()-1){
        if(s[i]==s[i+1]){
            a=i+1;
            b=i+2;
        }
    }
    FOR(i,0,s.size()-2){
        if(s[i]==s[i+2]){
            a=i+1;
            b=i+3;
        }
    }
    cout<<a<<" "<<b<<endl;
}


Measured memory_bytes: 512
#include<stdio.h>

int main()
{
	int loop,right,left,data;
	int i,j;
	scanf("%d",&loop);
	while(loop-->0)
	{
		right=left=j=0;
		for(i=0;i<10;i++)
		{
			scanf("%d",&data);
			if(data>right)
				right=data;
			else if(data>left)
				left=data;
			else
				j=1;
		}
		if(j==1)
			printf("NO\n");
		else
			printf("YES\n");
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
using namespace std;

signed main(){
	int n;
	vector<int> now,nxt;
	cin >> n;
	for(int i = 0;i < (1 << n);i++){
		int a;
		cin >> a;
		now.push_back(a);
	}
	for(int i = 0;i < n;i++){
		for(int j = 0;j < now.size();j += 2){
			if(now[j] > now[j + 1]) swap(now[j],now[j + 1]);
			if(now[j] == now[j + 1]) nxt.push_back(now[j]);
			else nxt.push_back(now[j + 1] - now[j]);
		}
		now = nxt;
		nxt.clear();
	}
	cout << now[0] << endl;
	return 0;
}

Measured memory_bytes: 4336
import sys
input=lambda: sys.stdin.readline().rstrip()
n,m,x=map(int,input().split())
A=[[int(i) for i in input().split()] for _ in range(n)]
ans=float("inf")
for i in range(2**n):
  B=[0]*(m+1)
  for j in range(n):
    if i&(1<<j):
      for k in range(m+1):
        B[k]+=A[j][k]
  if min(B[1:])>=x:
    ans=min(ans,B[0])
print(-1 if ans==float("inf") else ans)


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

int gcd(int x, int y); //greatest common divisor 最大である共通の約数 -> 最大公約数 

int main()
{

    //データ定義
    int numX, numY;

    //データ入力
    cin >> numX >> numY;

    //最大公約数を求めて、出力
    cout << gcd(numX, numY) << endl;

    return 0;
}
/***************************************/
int gcd(int x, int y){
    
    int r;

    if(x < y){
        swap(x, y);
    }

    while(y > 0){
        r = x % y;
        x = y;
        y = r;
    }

    return x;
}


Measured memory_bytes: 3124
# s,tの重なりがN 全部から徐々にずらす O(N**2)
n = int(input())
s = input()
t = input()
for i in range(n, -1, -1):
    if s[n - i :] == t[:i]:
        print(2 * n - i)
        exit()
print(2 * n)



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

int main(){
	int n;

	cin >> n;

	n = n % 10;

	if(n == 3){
		cout << "bon" << endl;
	}else if(n == 0 || n == 1 || n == 6 || n == 8){
		cout << "pon" << endl;
	}else{
		cout << "hon" << endl;
	}

	return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <cmath>

using namespace std;

void solve()
{
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 0; i < n; ++i)
	{
		int a;
		cin >> a;
		bool flag = true;
		for (int i = 2; i <= sqrt(a); ++i)
		{
			if (a % i == 0)
			{
				flag = false;
				break;
			}
		}
		if (flag)
		{
			++ans;
		}
	}
	cout << ans << endl;
}

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

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

int main()
{
  char a,b,c;
  string s;
  int cnt = 0;
  cin >> s;
  a = s[0];
  b = s[1];
  c = s[2];
  if(a == 'R' || b == 'R' || c == 'R') cnt = 1;
  if(a == 'R') {
    if(a == b) cnt++;
  }
  if(b == 'R') {
    if(b == c) cnt++;
  }

  cout << cnt << endl;
}

Measured memory_bytes: 3620
#include <stdio.h>
#include <math.h>
int main() {
    int m, next_angle;
    double x = 0.0, y = 0.0;
    double prev_angle = M_PI_2;
    while (1) {
        scanf(" %d,%d", &m, &next_angle);
        if (m == 0 && next_angle == 0)
            break;
        x -= m * cos(prev_angle);
        y += m * sin(prev_angle);
        prev_angle += (double)next_angle * M_PI / 180;
    }
    printf("%d\n%d\n", (int)x, (int)y);
    return 0;
}

Measured memory_bytes: 604
#include <iostream>
#include <string>
#include <vector> 
#include <algorithm>
#include <functional>
using namespace std;

int main() {
  //input
  int a;
  cin >> a;

  //process
  a = a % 10;
  
  if(a == 3) {
	cout << "bon" << endl;
  }
  else if (a == 0 || a == 1 || a == 6 || a == 8) {
	cout << "pon" << endl;
  }
  else {
	cout << "hon" << endl;
  }
  
}

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

Measured memory_bytes: 3080
<?php
fscanf(STDIN, "%d", $n);
$a =  substr($n, 0, 1);
$b = substr($n, 1, 1);
$c = substr($n, 2, 1);

if($a == 7 || $b == 7 || $c == 7){
  echo "Yes";
} else {
  echo "No";
};

?>

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

int main() {
  long long M;
  cin >> M;
  long long a = 0;
  
  for (long long i = 1; i * i <= M; i++) {
    if (M % i == 0) {
      a = i;
    }
  }
  
  long long sum;
  sum = M/a + a -2;
  cout << sum << endl;
  
}


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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())

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

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

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

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<pair<T, T>>& vp) {
	for (int i = 0; i < vp.size(); ++i) {
		s << "(" << vp[i].first << "," << vp[i].second << ")" << ( i+1 == vp.size() ? "" : ",\t" );
	}
	return s;
}

// 多重vector
// auto dp=make_v<int>(4,h,w) みたいに使える
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...));
}

// 多重vectorのためのfill
// fill_v(dp,0) みたいに使える
template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//main code

int main(int argc, char const* argv[])
{
	string s;
	cin >> s;
	int n = s.size();
	int ans = 0;
	for (int i = 0; i < n/2; i++) {
		if (s[i] != s[n-1-i]) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
def c_honest_or_unkind_2():
    N = int(input())
    Answers = []
    for _ in range(N):
        a = int(input())
        Answers.append([[int(i) for i in input().split()] for j in range(a)])

    ret = -1
    for bits in range(1 << N):
        honests = set()
        for k in range(N):
            if (bits >> k) & 1 == 1:
                honests.add(k)

        is_contradict = False
        for k, answer in enumerate(Answers):
            if k not in honests:
                continue  # k 人目は不親切な人としたので証言を調べない

            for x, y in answer:
                x -= 1
                # 証言に矛盾が生じた
                if (y == 0 and x in honests) or (y == 1 and not x in honests):
                    is_contradict = True
                    break
            if is_contradict:
                break  # 1つでも矛盾があれば全証言に矛盾があるとする
        else:
            # 全証言に矛盾がなかったので正直者の人数を更新する
            ret = max(ret, len(honests))
    return ret

print(c_honest_or_unkind_2())

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<stack>

using namespace::std;

int main(){
  stack<int> st;
  int i = 0;
  int val = 0;

  while(scanf("%d", &val) != EOF){
    if(val == 0){
      cout << st.top() << endl;
      st.pop();
      continue;
    }
    st.push(val);
  }

  return 0;
}

Measured memory_bytes: 1212
import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
n=int(input())
a=list(map(int,input().split()))
suma=sum(a)
cnt=0
i=0
while(cnt<suma/2):
    cnt+=a[i]
    i+=1
cnt2=cnt-a[i-1]
half=float(suma)/2
# print(half)
nerai=min(abs(suma-cnt-half),abs(cnt-half),abs(cnt2-half),abs(suma-cnt2-half))
print(int(nerai*2))

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

int main(){
	int H = 1;
	int W = 1;

	cin >> H >> W;
	while(H != 0 & W != 0){
		for(int h=0; h<H; h++){
			for(int w=0; w<W; w++){
				if(h == 0 | h == H-1) {cout << "#";}
				else{
					if(w == 0 | w == W-1) {cout << "#";}
					else {cout << ".";}
				}
			}
			cout << "" << endl;
		}
		cout << "" << endl;
		cin >> H >> W;
	}

	return 0;
}

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

int main(void){
  for(;;){
    int n, m;
    cin >> n >> m;
    if(n == 0 && m == 0){ return 0; }

    int p[m][n];
    for(int j = 0 ; j < m ; j++){
      for(int k = 0 ; k < n ; k++){
	cin >> p[j][k];
      }
    }

    int sum[n];
    for(int k = 0 ; k < n ; k++){
      sum[k]=0;
      for(int j = 0 ; j < m ; j++){
	sum[k] += p[j][k];
      }
    }

    int max=-1;
    for(int k = 0 ; k < n ; k++){
      if(max < sum[k]){
	max = sum[k];
      }
    }

    cout << max << endl;
  }
}



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

using ll = long long;
#define ALL(c) (c).begin(), (c).end()
const int MOD = 1000000007;

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

    if (n == 1 && m == 1) {
        cout << 1 << endl;
    } else if (n == 1 && m > 1) {
        cout << m - 2 << endl;
    } else if (n > 1 && m == 1) {
        cout << n - 2 << endl;
    } else {
        cout << (n - 2) * (m - 2) << endl;
    }
}


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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;

//status unsolved
long long log(long long x,long long e){
    long long ret=1;
    while(x>=e){
        ret++;
        x/=e;
    }
    return ret;
}

int main(){
    long long  n,k;
    cin>>n>>k;

    long long A[n+1];
    rep2(i,n)cin>>A[i];
    
    int end=min(k,(long long)42);
    
    rep(l,end){
        long long light[n+2]={};
        rep2(i,n){
        light[max(i-(A[i]),(long long)1)]++;
        light[min(i+1+A[i],n+1)]--;
        //light[max(i-(k+A[i]-1),(long long)1)]++;
        //light[min(i+k+A[i],n+1)]--;
        }
    long long ans[n+1]={};
        ans[0]=0;
        rep2(i,n){
        //cout<<light[i]<<" ";
        }
    //cout<<endl;
        rep2(i,n){
        ans[i]=ans[i-1]+light[i];
        if(l==end-1)cout<<ans[i]<<" ";
        A[i]=ans[i];
        }
    }
    
    return 0;

}
/*


*/


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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	long long int n;
	cin>>n;
	if(n>=30){
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}
	return 0;
}

Measured memory_bytes: 3648
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

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

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let a: isize = iterator.next().unwrap().parse().unwrap();
    let b: isize = iterator.next().unwrap().parse().unwrap();
    let x: isize = iterator.next().unwrap().parse().unwrap();

    if a > x || x > a + b {
        "NO".to_string()
    } else {
        "YES".to_string()
    }
}


Measured memory_bytes: 2132
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#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 ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int a,b;
    cin >> a >> b;
    cout << max({a+b,a-b,a*b}) << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long int
#define inf 1000000000000
#define hell (int)(1e9+7)

using namespace std;

void solve(){
    string s,t;
    cin>>s>>t;
    int x,y;
    cin>>x>>y;
    string u;
    cin>>u;
    if(s==u)
        x--;
    else
        y--;
    cout<<x<<" "<<y;
}

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
	return 0;
}


Measured memory_bytes: 256
use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).ok();
    let n = input.trim().parse().unwrap();

    let mut input = String::new();
    io::stdin().read_line(&mut input).ok();

    let mut v: Vec<usize> = Vec::new();
    for z in input.trim().split_whitespace() {
        v.push(z.parse().unwrap());
    }

    let mut v2: Vec<usize> = Vec::new();
    v.sort();

    for z in 0..n {
        let mut buf;
        if z == 0 {
            buf = v[z];
        } else {
            buf = v[z] - v[z - 1];
        }

        v2.push(buf);
    }

    println!("{}", v2[n / 2]);
}

Measured memory_bytes: 8444
input1 = input("").split(" ")
Q = int(input1[0])
H = int(input1[1])
S = int(input1[2])
D = int(input1[3])
N = int(input(""))

print((N%2) * min(Q*4,H*2,S) + (N//2) * min(Q*8,H*4,S*2,D))

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

using namespace std;

typedef long long ll;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

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

	int x, n;
	cin >> x >> n;

	set<int> st;
	rep(i, n) {
		int p;
		cin >> p;

		st.insert(p);
	}

	if(st.count(x) == 0){
		cout << x << endl;
		exit(0);
	}

	for(int i = 1; i <= 150; i++){
		if(st.count(x - i) == 0){
			cout << x - i << endl;
			exit(0);
		}

		if(st.count(x + i) == 0){
			cout << x + i << endl;
			exit(0);
		}
	}
}


Measured memory_bytes: 3656
import sys
import itertools
from collections import Counter
sys.setrecursionlimit(10**8)
if __name__ == "__main__":
    N = int(input())
    A = input().split()
    counter = Counter(A)
    result = 0
    for c in counter.values():
        result += c*(c-1)//2
    for a in A:
        k = counter[a]
        print(result - k*(k-1)//2 + (k-1)*(k-2)//2)

Measured memory_bytes: 26784
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    istream& in(cin);
    ostream& out(cout);
    int a,b,m,s,t,u,ans{},X{INT_MAX},Y{INT_MAX};
    in>>a>>b>>m;
    vector<int> x(a),y(b);
    for(auto&i:x) in>>i,X=min(X,i);
    for(auto&i:y) in>>i,Y=min(Y,i);
    ans=X+Y;
    fr(i,m){
        in>>s>>t>>u;
        --s,--t;
        ans=min(ans,x[s]+y[t]-u);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
# import sys
# input = sys.stdin.readline
import itertools
import collections
from decimal import Decimal
from functools import reduce


# 持っているビスケットを叩き、1枚増やす
# ビスケット A枚を 1円に交換する
# 1円をビスケット B枚に交換する
def main():
    n = int(input())
    numbers = input_list()
    ans = []
    s = reduce(lambda a, b: a ^ b, numbers)
    for i in range(n):
        ans.append(s ^ numbers[i])
    print(*ans)


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


def bfs(H, W, black_cells, dist):
    d = 0
    while black_cells:
        h, w = black_cells.popleft()
        d = dist[h][w]
        for dy, dx in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            new_h = h + dy
            new_w = w + dx
            if new_h < 0 or H <= new_h or new_w < 0 or W <= new_w:
                continue
            if dist[new_h][new_w] == -1:
                dist[new_h][new_w] = d + 1
                black_cells.append((new_h, new_w))
    return d


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


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()


Measured memory_bytes: 117872
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int A,B,C,D;
	cin >> A >> B >> C >> D;
	//A:高橋君のモンスターの体力
	//B:高橋君のモンスターの攻撃力
	//C:青木君のモンスターの体力
	//D:青木君のモンスターの攻撃力
	while(1) {
		C -= B;
		if (C <= 0 ) {
			cout << "Yes" << endl;
			break;
		}
		A -= D;
		if (A <= 0) {
			cout << "No" << endl;
			break;
		}
	}
}

Measured memory_bytes: 3608
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <cstring>
#include <math.h>
#include <set>
#include <vector>
#include <algorithm>
#include <map>
#pragma warning(disable:4996)

using namespace std;

typedef long long ll;
#define INF 0x3f3f3f3f
#define ESP 1e-8;
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
const double PI = acos(-1.0);

int main() {
	int a, b;
	while (scanf("%d%d", &a, &b) != EOF) {
		if (a % 2 == 0 || b % 2 == 0)
			printf("No\n");
		else
			printf("Yes\n");
	}

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Security.Cryptography;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const char White = '.';
    const char Black = '#';
    const long Mod = 1000000007;

    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        checked {
            object ret = process(new StreamReader(Console.OpenStandardInput()));
            Console.WriteLine(ret);
        }
#endif
    }

    static object process(TextReader input) {
        var n = int.Parse(input.ReadLine());
        var ary = ToIntArray(input.ReadLine(), n);

        long sum = 1;

        if(ary.Any(x=>x==0)) return 0;

        try {
            checked {
                foreach (var a in ary) {
                    sum *= a;
                    if(sum > 1000000000000000000) return -1;
                }
            }
        } catch(Exception ex) {
            return -1;
        }

        return sum;
    }

    static long[] ToIntArray(string strs, int n) {
        var ret = new long[n];
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = long.Parse(spl[i]);
        return ret;
    }
}

Measured memory_bytes: 41952
N, Y = gets.strip.split(' ').map(&:to_i)
x, y, z = -1, -1, -1
(0..N).each do |i|
  (0..(N-i)).each do |j|
    sum = 10000*i + 5000*j + 1000*(N-i-j)
    if sum == Y
      x, y, z = i, j, N-i-j
    end
  end
end
puts "#{x} #{y} #{z}"

Measured memory_bytes: 1788
using System;

namespace _0554
{
    class Program
    {
        static void Main(string[] args)
        {
           int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int  c = int.Parse(Console.ReadLine());
    int d = int.Parse(Console.ReadLine());
            int ans = a + b + c + d;
            int m = ans % 60;
            int h = ans / 60;
            Console.WriteLine(h);
            Console.WriteLine(m);


        }
    }
}

Measured memory_bytes: 9096
input()
towers = list(map(int, input().split()))
#print(towers)
ans = []
count = 0
for x in range(len(towers)-1):
  if towers[x] >= towers[x+1]:
    count+=1
  else:
    ans.append(count)
    count = 0

ans.append(count)

#print(ans)
print(max(ans))

Measured memory_bytes: 20680
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define n_l '\n'

#ifndef ONLINE_JUDGE
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl
template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(const string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(const bool b) { return (b ? "true" : "false"); } string to_string(const char c){ return string({c}); } template<size_t N> string to_string(const bitset<N> &b, int x1=0, int x2=1e9){ string t = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } return '"' + t + '"'; } template <typename A, typename... C> string to_string(const A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(const pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(const A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += n_l; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += n_l; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if(l_v_l_v_l == 0) res += n_l; return res; } void dbgm(){;} template<typename Heads, typename... Tails> void dbgm(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgm(T...); } 
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgm(__VA_ARGS__); cout << endl
#endif

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define forn(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef double db;
typedef vector<vi> vvi;
const ll mod=1000000007;
const ll N=200005; //check this
int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};

ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll powb(ll a,ll b) {ll res=1;a ; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a;a=a*a;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

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

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    string s;
    cin>>s;
    cout<<s[0]<<s[1]<<s[2];
}


Measured memory_bytes: 3612
/*************************************************************************
>>> Author: WindCry1
>>> Mail: lanceyu120@gmail.com
>>> Website: https://windcry1.com
>>> Date: 12/30/2019 11:03:37 PM
*************************************************************************/
//#pragma GCC optimize(3)
//#pragma GCC diagnostic error "-std=c++11"
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cctype>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <iostream>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <stack>
#include <bitset>
#include <iomanip>
#include <list>
#include <sstream>
#include <fstream>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#define endl '\n'
#define ALL(x) x.begin(),x.end()
#define ll long long
#define ull unsigned long long
#ifdef WindCry1
#define DEBUG(x) cout<<#x<<" : "<<x<<endl;
#endif
#define lowbit(x) x&(-x)
#define ls u<<1
#define rs u<<1|1
using namespace std;
template<typename T> inline T MIN(const T &a,const T &b) {return a<b?a:b;}
template<typename T> inline T MAX(const T &a,const T &b) {return a>b?a:b;}
template<typename T,typename ...Args> inline T MIN(const T &a,const T &b,Args ...args) {return MIN(MIN(a,b),args...);}
template<typename T,typename ...Args> inline T MAX(const T &a,const T &b,Args ...args) {return MAX(MAX(a,b),args...);}
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;
const int dir[4][2]={-1,0,1,0,0,-1,0,1};
int a[100010];
int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#ifdef WindCry1
	freopen("C:\\Users\\LENOVO\\Desktop\\in.txt","r",stdin);
#endif
	int h,n;cin>>h>>n;
	ll sum=0;
	for(int i=1;i<=n;i++) cin>>a[i],sum+=a[i];
	if(sum>=h){
		cout<<"Yes"<<endl;
	}
	else cout<<"No"<<endl;
	return 0;
}



Measured memory_bytes: 640
def kaibun(n):
    if str(n)[0]==str(n)[-1] and str(n)[1]==str(n)[-2]:
        return True
    else:
        return False

a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    if kaibun(i):
        ans+=1
print(ans)

Measured memory_bytes: 9076