akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int MOD = 1000000007;
const int MAX =200000;


int main() {
  int n, m;
  int ans = 0;
  bool cond = true;
  cin >> n >> m;
  if(m == 0 && n > 2) {
    ans = pow(10, n - 1);
    cout << ans << endl;
    return 0;
  } else if (m == 0 && n == 1) {
    ans = 0;
    cout << ans << endl;
    return 0;
  } else {
    int a, b;
    vector<P> digit(m);
    rep(i, m){
      cin >> a >> b;
      digit[i] = make_pair(a, b);
    }
    sort(digit.begin(), digit.end());
    rep(i,m) {
      if(n > 1 && digit[i].first == 1 && digit[i].second == 0) {
        cond = false;
        break;
      }
    }
    rep(i, m - 1) {
      if(digit[i].first == digit[i + 1].first) {
        if (digit[i].second != digit[i+1].second) {
          cond = false;
          break;
        } else {
          continue;
        }
      } else {
        ans += digit[i].second * pow(10, n - digit[i].first);
      }
    }
    ans += digit[m -1].second * pow(10, n - digit[m - 1].first);
    if(cond) {
      if(n > 1 && ans < pow(10, n - 1)) {
        cout << pow(10, n - 1) + ans << endl;
      } else {
        cout << ans << endl;
      }
    }else {
      cout << -1 << endl;
    }
    return 0;
  }
}


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

using namespace std;
const int maxn=1e5+20;
int a[maxn];


int main()
{
	string s;
	cin >> s;
	
	if(s[0] == 'S')
	{
		if(s[1] == 'A')
			cout << 1;
		else 
			cout << 7;	
	}	
	else if(s[0] == 'M')	
		cout << 6;
	else if(s == "TUE")
		cout << 5;
	else if(s[0] == 'W')
		cout << 4;
	else if(s == "THU")
		cout << 3;
	else if(s[0] == 'F')
		cout << 2;
	
	
}



Measured memory_bytes: 256
/**
 * auther: moririn_cocoa
 */
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define fi first
#define se second
#define ll long long
#define pll pair<ll,ll>
#define pq priority_queue
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

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

int main(int argc, const char * argv[]) {
  
  int A;
  int B;
  int C;
  
  cin >> A;
  cin >> B;
  cin >> C;
  
  if ( A + B >= C ) {
    
    cout << "Yes" << endl;
  }
  
  else {
    
    cout << "No" << endl;
  }
  
  return 0;
}


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

using namespace std;
typedef long long ll;
typedef long int li;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL<<60;

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

int main(){

  ll n;cin>>n;

  out(180*(n-2));




  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define FPEN freopen("in.txt", "r", stdin);
#define TEST(...)                                                              \
    { printf("! "), printf(__VA_ARGS__); }
#else
#define TEST(...)
#define FPEN
#endif
const int maxn = 200009;
typedef long long i64;
typedef pair<i64, i64> pi64;
typedef pair<int, int> pi;
const i64 MOD = 1e9 + 7;
class {
  public:
    void solve() {
        i64 n, k;
        cin >> n >> k;
        i64 ans = 0;
        for (i64 i = k; i <= n + 1; i++) {
            i64 Min = (0 + i - 1) * (i) / 2, Max = (n + n - i + 1) * (i) / 2;
            ans += (Max - Min + 1);
            ans %= MOD;
        }
        cout << ans << "\n";
    }
} NSPACE;
int main() {
    // FPEN;
    ios_base::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    NSPACE.solve();
}

Measured memory_bytes: 3644
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <iomanip>
#include <typeinfo>
#include <iterator>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <set>
#include <numeric>
using namespace std;

#define sortall(container) (sort(container.begin(), container.end()))
#define yn(cond) ((cond) ? (cout << "Yes" << endl) : (cout << "No" << endl))
#define YN(cond) ((cond) ? (cout << "YES" << endl) : (cout << "NO" << endl))
#define LLONG_MAX numeric_limits<long long>::max()
#define INT_MAX numeric_limits<int>::max()

typedef long long       ll;
typedef vector<int>     vi;
typedef vector<ll>      vll;
typedef vector<double>  vd;
typedef vector<bool>    vb;
typedef vector<string>  vs;
typedef vector<char>    vc;
typedef pair<int, int>  pii;
typedef pair<ll, ll>    pll;
typedef vector<pii>     vpii;
typedef vector<pll>     vpll;
typedef vector<vll>		vvll;
typedef vector<vi>		vvi;
typedef vector<vb>		vvb;
typedef vector<vc>		vvc;

typedef struct edge_ {
	ll to;
	ll cost;
} edge;

constexpr double	PI = 3.14159265358979323846;
constexpr ll		INF = 1 << 15;
constexpr ll		MOD = (ll)1e9 + 7;
constexpr double	EPS = 1e-7;
constexpr int		dy4[4] = { 0, 1, 0, -1 };
constexpr int		dx4[4] = { 1, 0, -1, 0 };
constexpr int		dy8[8] = { 0, 1, 1, 1, 0, -1, -1, -1 };
constexpr int		dx8[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };

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 (const T& x : vec) os << x << " ";
	return os;
}

template<typename S, typename T>
istream& operator >> (istream& is, pair<S, T>& p) {
	is >> p.first >> p.second;
	return is;
}

template<typename S, typename T>
ostream& operator << (ostream& os, const pair<S, T>& p) {
	os << "{" << p.first << " " << p.second << "}";
	return os;
}

template <typename T>
void say(vector<T>& vec, string pad = " ") {
	for (const T& elem : vec)
		cout << elem << pad;
}


/******************************************************************************/
/**********************         Don't make WA !!         **********************/
/******************************************************************************/


int main()
{
	vi a(3);
	cin >> a;
	sortall(a);
	yn(a[0] + a[1] == a[2]);

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
using namespace std;

template<typename Int = int>
struct PrimalDual {
    struct Edge {
        int dst;
        Int cap;
        Int flow;
        Int cost;
        int rev; 
        bool isRev;
        Edge(int dst, Int cap, Int flow, Int cost, int rev, bool isRev)
            :dst(dst), cap(cap), flow(flow), cost(cost), rev(rev), isRev(isRev) {
        }
    };

    int n;
    vector<vector<Edge>> g;
    PrimalDual(int n_) : n(n_), g(vector<vector<Edge>>(n_)) {}
    void addEdge(int src, int dst, Int cap, Int cost) {
        g[src].emplace_back(dst, cap, 0, cost, g[dst].size(), false);
        g[dst].emplace_back(src, cap, cap, -cost, g[src].size() - 1, true);
    }
    Int solve(int s, int t, Int f) {
        constexpr Int INF = numeric_limits<Int>::max();
        Int res = 0;
        vector<Int> h(g.size()), dist(g.size());
        vector<int> prevv(g.size()), preve(g.size());
        while (f > 0) {
            priority_queue<pair<Int, int>> q;
            fill(dist.begin(), dist.end(), INF);
            dist[s] = 0;
            q.emplace(0, s);
            while (q.size()) {
                int d, v;
                tie(d,v) = q.top();
                q.pop();
                d = -d;
                if (dist[v] < d) continue;
                for(int i = 0; i < (int)g[v].size(); ++i){
                    Edge &e = g[v][i];
                    if (e.cap - e.flow > 0 && dist[e.dst] > dist[v] + e.cost + h[v] - h[e.dst]) {
                        dist[e.dst] = dist[v] + e.cost + h[v] - h[e.dst];
                        prevv[e.dst] = v;
                        preve[e.dst] = i;
                        q.emplace(-dist[e.dst], e.dst);
                    }
                }
            }
            if (dist[t] == INF) return -1;
            for (int i = 0; i < n; ++i) h[i] += dist[i];
            Int d = f;
            for (int v = t; v != s; v = prevv[v]) {
                Edge &e = g[prevv[v]][preve[v]];
                d = min(d, e.cap - e.flow);
            }
            f -= d;
            res += d * h[t];
            for (int v = t; v != s; v = prevv[v]) {
                Edge &e = g[prevv[v]][preve[v]];
                e.flow += d;
                g[v][e.rev].flow -= d;
            }
        }
        return res;
    }
};

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, m, f;
    cin >> n >> m >> f;
    PrimalDual<int> pd(n);
    for (int i = 0; i < m; i++) {
        int u, v, c, d;
        cin >> u >> v >> c >> d;
        pd.addEdge(u, v, c, d);
    }
    cout << pd.solve(0, n - 1, f) << endl;
}

Measured memory_bytes: 3208
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)     (x).begin(),(x).end()
# define UNIQ(c)    (c).erase(unique(ALL((c))), end((c)))
# define mp         make_pair
# define eb         emplace_back
# define FOR(i,a,b) for(int i=(a);i<(b);++i)
# define REP(i,n)   FOR(i,0,n)
# define INIT       std::ios::sync_with_stdio(false);std::cin.tie(0);

int main() {
	int h, w;
	cin >> h >> w;
	vector<string> vec;
	for (int i = 0; i < h; i++) {
		string t;
		cin >> t;
		vec.emplace_back(t);
	}
	set<pair<int, int>> se;
	for (int i = 1; i < h - 1; i++) {
		for (int j = 1; j < w - 1; j++) {
			if (vec[i][j] == '.')continue;
			int cnt = 0;
			for (int k = -1; k <= 1; k++) {
				for (int l = -1; l <= 1; l++) {
					if (i == 0 && j == 0)continue;
					if (vec[i + k][j + l] == '.') {
						cnt++;
					}
				}
			}
			if (cnt >= vec[i][j] - '0') {
				se.insert(make_pair(i, j));
			}
		}
	}
	for (auto i : se) {
		vec[i.first][i.second] = '.';
	}
	int ans = 0;
	for (;; ans++) {
		if (se.empty())break;
		set<pair<int, int>> temp;
		for (auto i : se) {
			for (int j = -1; j <= 1; j++) {
				for (int k = -1; k <= 1; k++) {
					if (j == 0 && k == 0)continue;
					int x = i.first + j, y = i.second + k;
					if (vec[x][y] == '.')continue;
					int cnt = 0;
					for (int l = -1; l <= 1; l++) {
						for (int m = -1; m <= 1; m++) {
							if (l == 0 && m == 0)continue;
							if (vec[x + l][y + m] == '.') {
								cnt++;
							}
						}
					}
					if (cnt >= vec[x][y] - '0') {
						temp.insert(make_pair(x, y));
					}
				}
			}
		}
		se = temp;
		for (auto i : se) {
			vec[i.first][i.second] = '.';
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 3996
#include<bits/stdc++.h>
using namespace std;
int precalc[100010];
int main() {
  for (int j = 1; j <= 100000; j ++) {int k = j, s = 0; while (k) {s += k % 10; k /= 10;} precalc[j] = s;}
  int n; cin >> n;
  int m = 2147483647;
  for (int i = 1; i < n; i ++) m = min(m, precalc[i] + precalc[n - i]);
  cout << m << endl;
}

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

using namespace std;

int h, w, sz[5005];
char s[52][52];

int cnt = 0;
void dfs(int x, int y)
{
	s[x][y] = '.';
	if (x > 1 && s[x - 1][y] == '#') { sz[cnt]++; dfs(x - 1, y); }
	if (x < h && s[x + 1][y] == '#') { sz[cnt]++; dfs(x + 1, y); }
	if (y > 1 && s[x][y - 1] == '#') { sz[cnt]++; dfs(x, y - 1); }
	if (y < w && s[x][y + 1] == '#') { sz[cnt]++; dfs(x, y + 1); }
	return;
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> h >> w;
	bool check = false;
	for (int i = 1; i <= h; i++)
		for (int j = 1; j <= w; j++) cin >> s[i][j];
	for (int i = 1; i <= h; i++)
		for (int j = 1; j <= w; j++)
			if (s[i][j] == '#') { sz[++cnt] = 1; dfs(i, j); }
	for (int i = 1; i <= cnt; i++)
		if (sz[i] == 1) { check = true; break; }
	if (check) cout << "No" << endl;
	else cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 384
/*
    ##############################
    #  Author: Pratyush Gaurav   #
    #  College: NIT ROURKELA     #
    ##############################
*/
#include <bits/stdc++.h>

using namespace std;

typedef long long lli;
typedef long double ld;
typedef pair<lli, lli > plli;
typedef vector<lli> vlli;
typedef vector<plli > vplli;

#define scan(n) scanf("%lld",&n)
#define scan2(a,b) scanf("%lld %lld",&a,&b)
#define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define print(n) printf("%lld\n",n)
#define scanS(s) scanf("%s",&s)
#define printS(s) printf("%s",s)

#define ff first
#define ss second
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define repr(i,a) for(i = a ; i >= 0 ; i--)
#define REP(i,a,b) for(i = a ; i <= b ; i++)
#define REPR(i,a,b) for(i = a ; i >= b ; i--)
#define mem(a,b)memset(a,b,sizeof(a))
#define opt ios_base::sync_with_stdio(false);cin.tie(NULL);
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a)*((b)/gcd(a,b)))
#define sqr(x) ((x)*(x))
#define all(a) a.begin(),a.end()
#define pb push_back
#define popb pop_back

#define endl '\n'

const long long INF = 2000000000000;
const long long MOD = 1000000007;
const long long MAXN = 100005;

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

void solve() {
    lli a, b;
    cin >> a >> b;
    cout << (a * b - (a + b - 1));
}

int main()
{
    opt;
    lli t = 1;
    //cin >> t;

    while(t--)
        solve();
    return 0;
}

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

int main() {
  int n, count=29209; cin >> n;
  string s, t; cin >> s >> t;
  for (int i = 0; i < n; i++) {
    if (s.substr(i) == t.substr(0, n-i)) {
      count = i;
      break;
    }
  }
  if (count==29209)
    cout << 2*n << endl;
  else
    cout << count + n << endl;
  return 0;
}
    


Measured memory_bytes: 256
M=998244353
class Factorial:
    def __init__(self,n):
        self.f=f=[0]*(n+1)
        f[0]=b=1
        for i in range(1,n+1):f[i]=b=b*i%M
        self.inv=inv=[0]*(n+1)
        inv[n]=b=pow(self.f[n],-1,M)
        for i in range(n,0,-1):inv[i-1]=b=b*i%M
    def factorial(self,i):
        return self.f[i]
    def ifactorial(self,i):
        return self.inv[i]
    def comb(self,n,k):
        if n>=k:return self.f[n]*self.inv[n-k]*self.inv[k]%M
        else:return 0
comb=Factorial(10**5*5).comb
n,m,k=map(int,input().split())
print(sum(m*comb(n-1,i)*pow(m-1,~i+n,M)for i in range(k+1))%M)

Measured memory_bytes: 48408
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

int main() {
    int N, L;
    cin >> N >> L;
    vector<int> vec(N);
    rep(i, N) cin >> vec.at(i);

    int d = 0;
    int cnt = 0;
    bool flg = true;
    rep(i, N) {
        if(i > 0) {
            d += vec.at(i - 1);
        }
        dump(d);
        if(d <= L) {
            cnt++;
        } else {
            flg = false;
            break;
        }
    }

    if(flg) {
        d += vec.at(N - 1);
        if(d <= L) cnt++;
    }

    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#define MAX 100

static const int INFTY = (1<<21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

int n, M[MAX][MAX];

void dijkstra(){
   int minv;
   int d[MAX], color[MAX];
   
   for(int i=0; i<n; i++){
      d[i] = INFTY;
      color[i] = WHITE;
   }

   d[0] = 0;
   color[0] = GRAY; 
   while(1){
      minv = INFTY;
      int u = -1;
      for(int i=0; i<n;i++){
         if( minv > d[i] && color[i] != BLACK){
            u = i;
            minv = d[i];
         }
      }
      if( u == -1) break;
      color[u] = BLACK;
      for(int v = 0; v<n; v++){
         if(color[v] != BLACK && M[u][v] != INFTY){
            if(d[v] > d[u] + M[u][v]){
               d[v] = d[u] + M[u][v];
               color[v] = GRAY;
            }
         }
      }
   }
   
   for(int i = 0; i<n; i++){
      printf("%d ", i);
      if(d[i] == INFTY) printf("-1");
      else printf("%d", d[i]);
      printf("\n");
   }
}

int main(){
   scanf("%d", &n);
   for(int i=0; i<n; i++){
      for(int j=0; j<n; j++){
         M[i][j] = INFTY;
      }
   }
 
   int k, c, u, v;
   for(int i=0; i<n; i++){
      scanf("%d %d", &u, &k);
      for(int j=0; j<k;j++){
         scanf("%d %d", &v, &c);
         M[u][v] = c;
      }
   }

   dijkstra();

   return 0;
}


 


Measured memory_bytes: 2048
#include <stdio.h>

int popcount(int n){
  int s = 0;
  while (n > 0){
    if (n & 1)
      s++;
    n >>= 1;
  }
  return s;
}

int f_memo[200005];

int f(int n){
  if (n == 0)
    return 0;
  if (f_memo[n])
    return ~f_memo[n];
  return ~(f_memo[n] = ~(f(n % popcount(n)) + 1));
}

int N;
char X[200005];

int deltas_p[200005], deltas_m[200005];

int main(void){
  int c, p1, m1, delta_p, delta_m;
  int i;
  if(scanf("%d", &N) != 1)
    return 1;
  if(scanf("%200004s", X) != 1)
    return 1;
  c = 0;
  for (i=0; i<N; i++){
    if (X[i] == '1')
      c++;
  }

  p1 = m1 = 0;
  delta_p = delta_m = 1;
  for(i=N-1; i>=0; i--)
  {
    if(X[i] == '1'){
      p1 = (p1 + delta_p) % (c+1);
      if(c > 1)
        m1 = (m1 + delta_m) % (c-1);
    }

    deltas_p[i] = delta_p;
    deltas_m[i] = delta_m;
    delta_p = (delta_p * 2) % (c+1);

    if(c > 1)
      delta_m = (delta_m * 2) % (c-1);
  }

  for(i=0; i<N; i++){
    if(X[i] == '1'){
      if(c == 1)
        puts("0");
      else
        printf("%d\n", f((m1 + (c-1) - deltas_m[i]) % (c-1)) + 1);
    }
    else
      printf("%d\n", f((p1 + deltas_p[i]) % (c+1)) + 1);
  }

  return 0;
}


Measured memory_bytes: 4260
#include<iostream>
#include<cstring>

using namespace std;

char s[101];
bool c;

int main()
{
	cin>>s;
	short len=strlen(s);
	for(int i=0;i<len;i++)
	{
		if(s[i]=='C') c=true;
		else if(s[i]=='F'&&c)
		{
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
K = int(input())
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(A[K-1])


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

using namespace std;

int main()
{
	string s;
	cin >> s;
	int ans = 1e9;
	for (int i = 0; i < s.size()-2; i++)
			ans = min(ans, abs(753 - stoi(s.substr(i, 3))));
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    K, X = map(int, readline().split())
    if K * 500 >= X:
        print('Yes')
    else:
        print('No')
    
    return


if __name__ == '__main__':
    main()


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

using namespace std;

//平方数は元の数x,平方数yとして
//x >= 4y
//と考えられるからfor文は元の数のx/4までしか回さなくていい。

int main()
{
  string a, b;

  cin >> a >> b;

  a += b;

  int num = 0;
  for (int i = 0; i < a.length(); i++)
  {
    num *= 10;
    num += a[i] - '0';
  }

  for (int i = 0; i < num; i++)
  {
    if (i * i == num)
    {
      cout << "Yes" << endl;
      exit(0);
    }
  }

  cout << "No" << endl;
}


Measured memory_bytes: 256
/*
	0028:Mode Value
*/
#include	<iostream>

using namespace std;

int max(int a, int b);

int main(void) {
	int ds[100] = {0};
	int nMode = 0;
	
	while(1) {
		int a;
		
		cin >> a;
		if( cin.eof() ) { break; }
		ds[a-1]++;
	}
	for(int i = 0; i < 100; i++) {
		nMode = max(nMode, ds[i]);
	}
	for(int i = 0; i < 100; i++) {
		if(nMode == ds[i]) {
			cout << i+1 << endl;
		}
	}
}

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

Measured memory_bytes: 1160
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
using namespace std;
int Add_digit(int num){
	int sum=0;
	while(num>0){
		sum += num%10;
		num /= 10;
	}
	return sum;
}
int main()
{
	int n, a, b;
	cin >> n >> a >> b;

	int digit_sum;
	int ans=0;
	for(int i=1; i<=n; i++){
		digit_sum = Add_digit(i);
//		cout << digit_sum << " " << i << endl;
		if(digit_sum>=a && digit_sum<=b){
			ans+=i;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define INF (1 << 30)
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
const long long mod = 1e9+7;

using namespace std;
using ll = __int64_t;
using ull = unsigned long long;

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

bool comp(const pair<int, ll>& p1, const pair<int, ll>& p2){
    //return p1.second > p2.second;
    return p1.second < p2.second;
}

//a, bの最大公約数．a > b
ull gcd(ull a, ull b){
    if(b == 0) return a;
    return gcd(b, a%b);
}
//a, bの最小公倍数
ull lcm(ull a, ull b) {
    return a*(b/gcd(a, b));
}

void solve(){
    string s;
    int count=0;
    cin >> s;
    for(int i = 0; i < s.length(); i++){
        for(int j = i+1; j < s.length(); j++){
            if(s[i] == s[j]){
                count++;
            }
        }
    }
    if(count == 2){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

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

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a>b){
            System.out.println("a > b");
        }else if(a<b){System.out.println("a < b");
    }else{
        System.out.println("a == b");
    }
        sc.close();
    }
}


Measured memory_bytes: 26052
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD = 1000000007;
#define lcm(x, y) ((x) * (y) / __gcd((x), (y)))
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define debug(x) cout << #x << " : " << x << endl
#define part cout << "----------------------------------\n";
#include <iostream>

#define fastinput                     \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

int main()
{
    fastinput;
    LL n, i, j, k, t, temp, M, tc;
    string s;
    cin >> s;
    LL a1 = (s[0] - '0') * 10 + (s[1] - '0') * 1;
    LL a2 = (s[2] - '0') * 10 + (s[3] - '0') * 1;
    LL t1=0,t2=0;
    if(a1>=1 && a1<=12)
    {
        t1=1;
    }
    if(a2>=1 && a2<=12)
    {
        t2=1;
    }

    if(t1==1 && t2==1)
    {
        cout<<"AMBIGUOUS\n";
    }
    else if(t1==1)
    {
        cout<<"MMYY\n";
    }
    else if(t2==1)
    {
        cout<<"YYMM\n";
    }
    else
    {
        cout<<"NA\n";
    }

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main()
{
    char str[101];
    cin>>str;
    int len=strlen(str);
    for(int i=0;i<len;i+=2)
    {
        if(str[i]=='L')
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    for(int i=1;i<len;i+=2)
    {
        if(str[i]=='R')
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}


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

int main() {

  int s;
  cin >> s;

  vector<int> array(1001000);

  bool valid = true;

  int count = 2;

  array[s]++;

  while (valid) {

    if (s % 2 == 0) {
      s = s / 2;
    } else {
      s = 3 * s + 1;
    }

    if (array[s] != 0) {
      valid = false;
    } else {
      array[s]++;
      count++;
    }

  }

  cout << count << endl;

}

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

using namespace std;
vector<int>adj[100005];
int minDis[100005];
int color[100005],v[100005],d[100005],c[100005];
void dfs(int node,int Din,int CIN){
    if(Din<=minDis[node])return;
    minDis[node]=Din;
	if(color[node]==0)color[node]=CIN;
	for(int i=0;i<adj[node].size();i++){
		int to=adj[node][i];
		dfs(to,Din-1,CIN);
	}
}
int main(){
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++)minDis[i]=-1;
	for(int i=0;i<m;i++){
		int a,b;
		cin>>a>>b;
		a--,b--;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	int q;
	cin>>q;
	for(int i=0;i<q;i++){
		cin>>v[i]>>d[i]>>c[i];
	}
	for(int i=q;i>=0;i--)dfs(v[i]-1,d[i],c[i]);
	for(int i=0;i<n;i++)cout<<color[i]<<endl;
	return 0;
}

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

const ll INF= 1LL << 60;

//入力
ll N;
ll h[100010];
//dp
ll dp[100010];


void min(ll& a, ll& b){
  if(a<b){
    a=b;
  }
}

int main(){
  cin >>N;
  for(int i=0;i<N;i++) cin >>h[i];
  for(int i=0;i<100010;i++) dp[i]=INF;
  
  dp[0]=0;
  
  for(int i=1;i<N;i++){
    dp[i]=min(dp[i],dp[i-1]+abs(h[i]-h[i-1]));
    if(i>1) dp[i]=min(dp[i],dp[i-2]+abs(h[i]-h[i-2]));
  }
  
  cout<<dp[N-1]<<endl; 
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
  
typedef long long llt;
  
const int MaxN = 16;
  
int N, fullSub;
int Log[1 << MaxN];
llt A[MaxN][MaxN];
llt dp[1 << MaxN];
  
void init() {
  scanf("%d", &N); fullSub = (1 << N) - 1;
  for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j)
    scanf("%lld", &A[i][j]);
  
  for (int i = 2; i < (1 << N); ++i)
    Log[i] = Log[i >> 1] + 1;
}
  
inline llt Calc_sum(int S) {
  int st[MaxN], tp = 0;
  llt res = 0;
  
  while (S > 0) {
    st[tp++] = Log[S & -S];
    S -= S & -S;
  }
  
  for (int i = 0; i < tp - 1; ++i) for (int j = i + 1; j < tp; ++j)
    res += A[st[i]][st[j]];
  return res;
}
  
void solve() {
  memset(dp, 0x80, sizeof dp); dp[0] = 0;
  for (int S = 0; S < (1 << N); ++S) {
    int Q = fullSub - S;
    for(int T = Q; T &= Q; --T)
      dp[S | T] = max(dp[S | T], dp[S] + Calc_sum(T));
  }
  
  printf("%lld\n", dp[(1 << N) - 1]);
}
  
int main() {
  init();
  solve();
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
	int n, t[100], m, p[100], x[100], ans;
	cin >> n;
	ans = 0;
	for (int i = 0; i < n; i++) {
		cin >> t[i];
		ans += t[i];
	}
	cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> p[i] >> x[i];
	}
	
	for (int i = 0; i < m; i++)
		cout << ans + x[i] - t[p[i]-1] << endl;
	return 0;
}

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

#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

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

  ll Q, H, S, D;
  long double N;
  cin >> Q >> H >> S >> D >> N;
  double cp_q, cp_h, cp_s, cp_d;
  cp_q = Q / 0.25;
  cp_h = H / 0.5;
  cp_s = S;
  cp_d = D / 2.0;
  map<double, pair<ll, double>> values;
  values.insert(make_pair(cp_q, make_pair(Q, 0.25)));
  values.insert(make_pair(cp_h, make_pair(H, 0.5)));
  values.insert(make_pair(cp_s, make_pair(S, 1.0)));
  values.insert(make_pair(cp_d, make_pair(D, 2.0)));

  ll ans = 0ll;
  for (auto const &v : values) {
    if (N < v.second.second) {
      continue;
    }
    ll buy_count = floor(N / v.second.second);
    ans += buy_count * v.second.first;
    N -= buy_count * v.second.second;
    if (N <= 0) {
      break;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
inline bool chmax (int& a, int b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n, k;
  string s;
  cin >> n >> k >> s;
  char crr = '1';
  int cnt = 0;
  vector<int> a(0);
  a.push_back(0);
  for (int i = 0; i < n; i++) {
    if (crr != s[i]) {
      crr = s[i];
      a.push_back(cnt);
      cnt = 1;
    } else {
      cnt++;
    }
  }
  a.push_back(cnt);
  if (crr == '0') a.push_back(0);
  int sz = a.size();
  for (int i = 1; i < sz; i++) a[i] += a[i - 1];
  int ret = 0;
  int l(1), r(2 * k + 2);
  for (; r <= sz; l += 2, r += 2) {
    chmax(ret, a[r - 1] - a[l - 1]);
  }
  if (2 * k + 2 > sz) ret = n;
  cout << ret << endl;
  return 0;
}

Measured memory_bytes: 1020
#include <iostream>
using namespace std;
int main(){
    int a;
    cin >> a;
    int tmp;
    int c=0;
    for (int i = 0; i < a; i++) {
		cin >> tmp;
		if(tmp%2 == 0 and tmp%3 != 0 and tmp%5 != 0){
		    c=1;
		}
	}
    if(c ==0){
        cout << "APPROVED";
    }else{
        cout << "DENIED";
    }
    return 0;
}

Measured memory_bytes: 256
candidates = input()
T, A = map(int, input().split())
heights = input().split()
ans = []
for i in range(len(heights)):
    if T - int(heights[i])*0.006 >= A:
        ans.append((T - int(heights[i])*0.006) - A)
    else:
        ans.append(A - (T - int(heights[i])*0.006))
answer = ans.index(min(ans))
print(answer + 1)

Measured memory_bytes: 3064
#include <stdio.h>

#define N 1000000

int h[ N + 1 ] = { 0 };

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int i, j, k;

  for ( k = 1; k <= N; k *=2 )
  for ( j = k; j <= N; j *=3 )
  for ( i = j; i <= N; i *=5 )
  {
    h[ i ] = 1;
  }
  for ( i = 1; i <= N; ++i )
  {
    h[ i ] += h[ i - 1 ];
  }

  for ( ; ; )
  {
    int m, n;

    scanf ( "%d", &m );
    if ( !( m ) ) break ;
    scanf ( "%d", &n );

    printf ( "%d\n", h[ n ] - h[ m - 1 ] );
  }

  return ( 0 );
}

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

// INT VS LL

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

    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i){
    	cin >> a[i];
    }
    ll ans = 0;
    for (int i = 0; i < n; ++i){
    	for (int j = i + 1; j < n; ++j){
    		if (a[i] == a[j]) continue;
    		for (int k = j + 1; k < n; ++k){
    			if (a[k] == a[i] || a[k] == a[j]) continue;
    			vector<int> cur(3);
    			cur[0] = a[i], cur[1] = a[j], cur[2] = a[k];
    			sort(cur.begin(), cur.end());
    			if (cur[0] + cur[1] > cur[2]) ans++;
    		}
    	}
    }
    cout << ans << '\n';
    return 0;
}

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

int main() {
  int64_t N, M;
  cin >> N >> M;
  int64_t total = 0;
  rep(i, M){
    int64_t p;
    cin >> p;
    total += p;
  }
  M = N - total;
  if(M >= 0) cout << M;
  else cout <<-1;
  }
  
  

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

int main(){
  int h,w,n,a[10000],p=1;
  int c[110][110];
  scanf("%d %d",&h,&w);
  scanf("%d",&n);
  for(int i=0;i<n;i++)
    scanf("%d",&a[i]);
  for(int i=0;i<h;i++){
    if(i%2==0)
      for(int j=0;j<w;j++){
        if(a[p-1]!=0){
          c[i][j]=p;
          a[p-1]--;
        }
        else{
          p++;
          c[i][j]=p;
          a[p-1]--;
        }
      }
    else{
      for(int j=w-1;j>=0;j--){
        if(a[p-1]!=0){
          c[i][j]=p;
          a[p-1]--;
        }
        else{
          p++;
          c[i][j]=p;
          a[p-1]--;
        }
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++)
      printf("%d ",c[i][j]);
    printf("\n");
  }
}

Measured memory_bytes: 256
#include "stdio.h"

int main()
{
	//入力用の変数
	int N = 0, RATE[110];
	for (int i = 0; i < 110; i++) {
		RATE[i] = 0;
	}

	//色が存在するかどうかを見る変数
	//色は全部は８種類だが、レート3200以上が何人いるかを確認するため要素は９つとる
	int COLOR[9];
		for (int i = 0; i < 9; i++) {
			COLOR[i] = 0;
		}

	//色の最小値と最大値
	int MIN = 0, MAX = 0;

	//標準入力
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &RATE[i]);
	}

	//全部のレートを確認し、
	//3199まではしつこくifを使って色の区分を判定する。
	//色に対応するレートの人が存在するところは１にする。
	for (int i = 0; i < N; i++) {
		if ((RATE[i] >= 1) && (RATE[i] <= 399))
			COLOR[0] = 1;

		if ((RATE[i] >= 400) && (RATE[i] <= 799))
			COLOR[1] = 1;

		if ((RATE[i] >= 800) && (RATE[i] <= 1199))
			COLOR[2] = 1;

		if ((RATE[i] >= 1200) && (RATE[i] <= 1599))
			COLOR[3] = 1;

		if ((RATE[i] >= 1600) && (RATE[i] <= 1999))
			COLOR[4] = 1;

		if ((RATE[i] >= 2000) && (RATE[i] <= 2399))
			COLOR[5] = 1;

		if ((RATE[i] >= 2400) && (RATE[i] <= 2799))
			COLOR[6] = 1;

		if ((RATE[i] >= 2800) && (RATE[i] <= 3199))
			COLOR[7] = 1;

		if (RATE[i] >= 3200)
			COLOR[8]++;
	}

	//最小値と最大値を計算する
	for (int i = 0; i < 9; i++) {
		//i=7までは色があれば１なので和をとる
		//i=8のときは、そこまでで決まった最小値に、好きに色を選べる人の人数を足して最大値を決める
		if (i <= 7)
			MIN = MIN + COLOR[i];
		else
			MAX = MIN + COLOR[8];
	}

	//上の計算方法だと、3200以上の人しかいなければ最小値は０になってしまうが、これは誤り。
	//必ず１つは色が使われる。
	if (MIN == 0)
		MIN = 1;

	//色は全部で８種類なので、どう頑張っても最大値は８までである。
	//if (MAX > 8)
	//	MAX = 8;

	//求める最小値と最大値を表示する。
	printf("%d %d", MIN, MAX);
	

    return 0;
}

/*
とりうる色は全部で８種類＋α（好きな色はその８種類以外でもいいため）。
3199までの人はレートによって固定の色となるが、
3200以上の人は好きな色を選べる。
すなわち、3199までの人を調べた時点で最小の数が決まり、
最大の数は3200以上の人の人数をそれに足した数と言える。
*/


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<vector<int>> G(N);
  rep(i, N-1) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  vector<int> col(N, -1);
  vector<vector<int>> group(2);
  function<void(int, int)> dfs = [&](int tmp, int par) {
    col[tmp] = (par==-1 ? 0 : 1-col[par]);
    group[col[tmp]].push_back(tmp);
    for(int ne: G[tmp]) {
      if(ne != par) dfs(ne, tmp);
    }
  };
  dfs(0, -1);
  vector<int> ans(N);
  if((int)group[0].size() > N/3 && (int)group[1].size() > N/3) {
    int tmp = 1;
    int tmp2 = 3;
    for(int i: group[0]) {
      if(tmp <= N) {
        ans[i] = tmp;
        tmp += 3;
      } else {
        ans[i] = tmp2;
        tmp2 += 3;
      }
    }
    tmp = 2;
    for(int i: group[1]) {
      if(tmp <= N) {
        ans[i] = tmp;
        tmp += 3;
      } else {
        ans[i] = tmp2;
        tmp2 += 3;
      }
    }
  } else {
    int small = ((int)group[0].size() > (int)group[1].size());
    int tmp = 3;
    for(int i: group[small]) {
      ans[i] = tmp;
      tmp += 3;
    }
    int tmp2 = 1;
    for(int i: group[1-small]) {
      if(tmp <= N) {
        ans[i] = tmp;
        tmp += 3;
      } else {
        ans[i] = tmp2;
        tmp2++;
        if(tmp2 % 3 == 0) tmp2++;
      }
    }
  }
  rep(i, N) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}


Measured memory_bytes: 21108
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define sz(x) int(x.size())
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
#define FORV(i, v) for (auto i = v.begin(); i != v.end(); i++)
using namespace std;

using ll = long long;
using P = pair<int, int>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1001001001;
const long long INFLL = LLONG_MAX / 3;
const double eps = (1e-9);

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

  int h, w;
  cin >> h >> w;
  vector<vector<int>> a(h, vector<int>(w));
  rep(i, h) rep(j, w) cin >> a[i][j];
  vector<vector<int>> ans;
  rep(i, h) {
    rep(j, w) {
      if (a[i][j] %2 != 0) {
        if (j < w-1) {
          vector<int> tmp = {i, j, i, j+1};
          ans.push_back(tmp);
          a[i][j]--;
          a[i][j+1]++;
        } else if (i < h - 1) {
          vector<int> tmp = {i, j, i+1, j};
          ans.push_back(tmp);
          a[i][j]--;
          a[i+1][j]++;
        }
      }
    }
  }

  cout << ans.size() << endl;
  for (auto& v : ans) {
    cout << v[0]+1 << " " << v[1]+1 << " " << v[2]+1 << " " << v[3]+1 << endl;
  }

  return 0;
}


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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

typedef long long LL;

int main(){
  int q;
  cin >> q;
  int n;
  int x;
  int count;
  for(int i=0;i<q;i++){
    cin >> n;
    count=0;
    while(n>=10){
      x=0;
      for(int i=10;i<=n;i*=10){
        x=max(x,(n/i)*(n%i));
      }
      n=x;
      count++;
    }
    cout << count << endl;
  }
  return 0;
}



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

int main(){
    int num[26] = {};
    char a;
    while(scanf("%c", &a) != EOF){
        a = tolower(a);
        if(isalpha(a)){
            num[a - 'a']++;
        }
    }
    for(int i = 0; i < 26; i++){
        printf("%c : %d\n", i+'a', num[i]);
    }
    return 0;
}


Measured memory_bytes: 3156
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001


int main(){
    int a, b, c; cin >> a >> b >> c;
    if(a==b) cout << c << endl;
    else if(b==c) cout << a << endl;
    else cout << b << endl;
    
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python

n = int(input())
a = list(map(int, input().split()))

l = a[0]
r = sum(a)-l
ans = abs(l-r)

for i in range(1, n-1):
    l += a[i]
    r -= a[i]
    if abs(l-r) <= ans:
        ans = abs(l-r)

print(ans)


Measured memory_bytes: 30516
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
int main()
{
    int N;
    cin >> N;
    if(N%1000 == 0){
        cout << 0 << endl;
    }else{
        cout << 1000 - N%1000 << endl;
    }
    return 0;
}


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

#define ln                '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fm, to)    for (int i = fm; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

const int nsz = 1e5;
const num inf = 0x3f3f3f3f3f3f3f3f;
int n, m, a[nsz + 5];
num t, dp[nsz + 5], ans;

struct segment_tree {
	#define ls  (u << 1)
	#define rs  (u << 1 | 1)
	int fm[4 * nsz + 5];
	num mn[4 * nsz + 5], del[4 * nsz + 5];
	
	void inline down(int u) {
		if (!del[u])  return;
		mn[ls] += del[u];
		mn[rs] += del[u];
		del[ls] += del[u];
		del[rs] += del[u];
		del[u] = 0;
	}
	
	void init(int u = 1, int l = 0, int r = n) {
		if (l == r) {
			fm[u] = l;
			return;
		}
		int md = (l + r) >> 1;
		init(ls, l, md);
		init(rs, md + 1, r);
		fm[u] = fm[ls];
	}
	
	void upd(int el, int er, int val, int u = 1, int l = 0, int r = n) {
		if (l >= el && r <= er) {
			mn[u] += val;
			del[u] += val;
			return;
		}
		down(u);
		int md = (l + r) >> 1;
		if (el <= md) {
			upd(el, er, val, ls, l, md);
		}
		if (er > md) {
			upd(el, er, val, rs, md + 1, r);
		}
		fm[u] = mn[ls] < mn[rs] ? fm[ls] : fm[rs];
		mn[u] = min(mn[ls], mn[rs]);
	}
	
	pair<num, int> qry(int el, int er, int u = 1, int l = 0, int r = n) {
		if (l >= el && r <= er)  return make_pair(mn[u], fm[u]);
		down(u);
		int md = (l + r) >> 1, fm = -1;
		num mn = inf;
		pair<num, int> res;
		if (el <= md) {
			res = qry(el, er, ls, l, md);
			mn = res.first, fm = res.second;
		}
		if (er > md) {
			res = qry(el, er, rs, md + 1, r);
			fm = mn < res.first ? fm : res.second, mn = min(mn, res.first);
		}
		return make_pair(mn, fm);
	}
};
segment_tree tr;

num f(int i, int j) {
	return t - 2LL * (a[i] - a[j + 1]);
}

num calc(int i, int j) {
	return dp[j] + 3LL * a[i] - a[j] - 2LL * a[j + 1] + max(0LL, t - 2 * (a[i] - a[j + 1]));
}

int main() {
	ios::sync_with_stdio(0);
	cin >> n >> m >> t;
	cont (i, n) {
		cin >> a[i];
	}
	tr.init();
	int j = 0;
	tr.upd(0, 0, dp[0] - a[0] - 2 * a[1] + max(0LL, t - 2 * (a[0] - a[1])));
	cont (i, n) {
		for (; j < i && f(i, j) <= 0; tr.upd(j, j, -f(i - 1, j)), ++j);
		tr.upd(j, i - 1, -2 * (a[i] - a[i - 1]));
		pair<num, int> tmp = tr.qry(0, i - 1);
		int p = tmp.second;
		dp[i] = calc(i, p);
		tr.upd(i, i, dp[i] - a[i] - 2 * a[i + 1] + max(0LL, t - 2 * (a[i] - a[i + 1])));
	}
	ans = dp[n] + m - a[n];
	cout << ans << ln;
}

Measured memory_bytes: 8704
import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String a[] = sc.next().split("");
    String b[] = sc.next().split("");
    String c[] = sc.next().split("");
    System.out.println(a[0] + b[1] + c[2]);
  }
}

Measured memory_bytes: 23124
// https://atcoder.jp/contests/abc126/tasks/abc126_c

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;

typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define INF (1e9)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
// int gcd(long a, long b) { return b ? gcd(b, a % b) : a; }
// int lcm(long a, long b) { return a * b / gcd(a, b); }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k, t, cnt;
    cin >> n >> k;
    double ans = 0, tmp = 1.0 / n;
    for (int i = 1; i <= n; i++) {
        t = i;
        cnt = 0;
        while (k > t) {
            t = t << 1;
            cnt++;
        }
        ans += tmp / (1 << cnt);
    }
    cout << setprecision(12) << ans << endl;

    return 0;
}

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

using namespace std;
typedef long long ll;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    const ll mod=1000000007;
    auto add=[&](ll &a,ll b){a=(a+(b%mod)+mod)%mod;};
    ll n;
    cin >> n;
    ll res=0;
    vector<ll> d(n+1,0);
    d[1]=1;
    if(n>=2) d[2]=mod-1;
    ll now=0;
    for(ll i=1;i<=n-1;i++)
    {
        add(now,d[i]);
        //cout << i << ": " << now << endl;
        add(res,(now*(n-1)%mod)*(n-1));
        add(res,(i+1-(i==n-1))*now);
        add(d[i+1],now);
        if(i+2<=n) add(d[i+2],-now);
        if(i+3<=n) add(d[i+3],now);
    }
    add(now,d[n]);
    //cout << n << ": " << now << endl;
    add(res,now*n);
    cout << res << "\n";
    return 0;
}


Measured memory_bytes: 11092
from collections import deque

H,W = map(int,input().split())
W += 1
M = [[0]*(W+1) for _ in range(H+1)]
for i in range(H):
    M[i+1][1:] = list(map(int,input().split())) + [1]

h_table = [[0]*(W+1) for _ in range(H+1)]
for h in range(1,H+1):
    for w in range(1,W+1):
        if M[h][w] == 0:
            h_table[h][w] = h_table[h-1][w] +1
        else:
            h_table[h][w] = 0

max_S = 0
for h in range(1,H+1):
    stuck = deque()
    hist = h_table[h][:]
    for w in range(1,W+1):
        if stuck == deque() or stuck[-1][0] < hist[w]:
            stuck.append([hist[w],w])
        elif stuck[-1][0] > hist[w]:
            while 1:
                rect = stuck.pop()
                max_S = max(max_S,rect[0]*(w-rect[1]))
                if stuck == deque() or stuck[-1][0] <= hist[w]:
                    break
            if stuck == deque() or stuck[-1][0] < hist[w]:
                stuck.append([hist[w],rect[1]])
            

print(max_S)
                










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

int main(void) {
    int64_t N,M,A;
    cin >> N >> M;


    priority_queue<int64_t> q;
    for(int i=0;i<N;i++) {
        cin >> A;
        q.push(A);
    }

    int64_t a;
    for(int i=0;i<M;i++) {
        a = q.top();
        a /= 2;
        q.pop();
        q.push(a);
    }

    int64_t sum = 0;
    while(q.size()) {
        sum += q.top();
        q.pop();
    }
//    cout << accumulate(A.begin(), A.end(),0) << "\n";
    cout << sum << "\n";
    return 0;
}


Measured memory_bytes: 1400
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

ll h,w;

int main(){
    cin >> h >> w;
    ll ans = mod;

    if(w%3==0 or h%3==0){
        cout << 0 << endl;
        return 0;
    }

    chmin(ans,min(w,h));


    rep(x,w){
        if(x==0) continue;
        if(w-x==0) continue;
        ll t1 = x * h;
        ll t2 = (w-x) * (h/2);
        ll t3 = h*w - t1 - t2;
        //cout << t1 <<  " " << t2 << " " << t3 << endl;
        chmin(ans , max(abs(t1-t2),max(abs(t1-t3),abs(t2-t3))));
    }

    rep(x,h){
        if(x==0) continue;
        if(h-x==0) continue;
        ll t1 = x * w;
        ll t2 = (h-x) * (w/2);
        ll t3 = h*w - t1 - t2;
        chmin(ans , max(abs(t1-t2),max(abs(t1-t3),abs(t2-t3))));
    }

    cout << ans << endl;
}


Measured memory_bytes: 256