akhauriyash/Code-Regression huggingface dataset:
import queue
def main():
    h, w = map(int, input().split())
    st = [[1]*(w+2) for _ in range(h+2)]
    for i in range(h):
        s = input()
        for j in range(w):
            if s[j] == ".":
                st[i+1][j+1] = 0
    ans = 0
    for i in range(1, h+2):
        for j in range(1, w+2):
            if st[i][j] == 0:
                fs = [[float("inf")]*(w+2) for _ in range(h+2)]
                q = queue.Queue()
                fs[i][j] = 0
                q.put([i, j])
                while not q.empty():
                    y, x = q.get()
                    if st[y-1][x] == 0 and fs[y-1][x] > fs[y][x] + 1:
                        fs[y-1][x] = fs[y][x] + 1
                        q.put([y-1, x])
                    if st[y+1][x] == 0 and fs[y+1][x] > fs[y][x] + 1:
                        fs[y+1][x] = fs[y][x] + 1
                        q.put([y+1, x])
                    if st[y][x-1] == 0 and fs[y][x-1] > fs[y][x] + 1:
                        fs[y][x-1] = fs[y][x] + 1
                        q.put([y, x-1])
                    if st[y][x+1] == 0 and fs[y][x+1] > fs[y][x] + 1:
                        fs[y][x+1] = fs[y][x] + 1
                        q.put([y, x+1])
                    if ans < fs[y][x]:
                        ans = fs[y][x]
    print(ans)

if __name__ == "__main__":
    main()


Measured memory_bytes: 9704
#include <cstdio>

using namespace std;


int n, m, K;
int main() {
	scanf("%d%d%d", &n, &m, &K); bool can = false;
	for (int i = 0; i <= n; ++i)
		for (int j = 0; j <= m; ++j) {
			if ((n - i) * j + (m - j) * i == K) can = true;;
		}

	printf("%s\n", can ? "Yes" : "No");

	return 0;
}

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

const int mxn = 1e5 + 5;
vector<int> adj[mxn];
vector<int> block[mxn];
int sizeofcc[mxn], fcircle[mxn];
bool vis[mxn];
int s;

void dfs(int node, int cc){
    s++;
    vis[node] = 1;
    fcircle[node] = cc;
    for(int x : adj[node]){
        if(!vis[x]) dfs(x, cc);
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    //good luck kittu!
    int n, m, k, x, y;
    cin>>n>>m>>k;
    while(m--){
        cin>>x>>y;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }

    int cc = 1;
    for(int i = 1; i<=n; i++){
        if(!vis[i]){
            s = 0;
            dfs(i, cc);
            sizeofcc[cc] = s;
            cc++;
        }
    }

    vector<int> ans(n+1);
    for(int i = 1; i<=n; i++) ans[i] = sizeofcc[fcircle[i]] - 1 - adj[i].size();
//                                    friend + candidate - friends
    while(k--){
        cin>>x>>y;
        if(fcircle[x]==fcircle[y]){
            ans[x]--;
            ans[y]--;
        }
    }
  
    for(int i = 1; i<=n; i++) cout<<ans[i]<<" ";
    return 0;
}

Measured memory_bytes: 9984
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <array>
#include <functional>
#include <algorithm>
#include <numeric>
#include <string>
#include <stack>

int main()
{
	//std::cout << std::fixed << std::setprecision(15);

	std::string s;
	std::cin >> s;

	if (s == "SUN")
	{
		std::cout << 7 << std::endl;
	}
	else if (s == "MON")
	{
		std::cout << 6 << std::endl;
	}
	else if (s == "TUE")
	{
		std::cout << 5 << std::endl;
	}
	else if (s == "WED")
	{
		std::cout << 4 << std::endl;
	}
	else if (s == "THU")
	{
		std::cout << 3 << std::endl;
	}
	else if (s == "FRI")
	{
		std::cout << 2 << std::endl;
	}
	else if (s == "SAT")
	{
		std::cout << 1 << std::endl;
	}

	return 0;
}

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

const int INF = 1001001001;

int main() {
  int n, k;
  string s;

  cin >> n >> s >> k;


  k--;

  for(int i = 0; i < n; i++){
    if(s[k] == s[i]) {
      cout<<s[i];
    }else cout<<"*";
  }

  return 0;
}

Measured memory_bytes: 256
//#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;


// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T>
constexpr int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F>
constexpr int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T>
void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C>
void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U>
constexpr void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U>
constexpr void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C>
constexpr void reverse(C& c) { reverse(ALL(c)); }
template<typename C>
constexpr void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred>
constexpr void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
#define PI (2*acos(0.0))
#define EPS (1e-9)
#define MOD (int)(1e9+7)
#pragma endregion


int main()
{
    vd v;
    double h;
    while(cin>>h) {
        v.push_back(h);
    }

    sort(v);
    P(v[v.size()-1]-v[0]);
    return 0;
}

Measured memory_bytes: 3244
/* Simplicity and Goodness */

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>

using namespace std;
// using namespace __gnu_pbds;
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

void my_dbg() { cout << endl; }
template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B) { cout << ' ' << A; my_dbg(B...); }
#define dbg(...)  cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)

#define scn(n) scanf("%d", &n)
#define lscn(n) scanf("%lld", &n)
#define pri(n) printf("%d ", (int)(n))
#define prin(n) printf("%d\n", (int)(n))
#define lpri(n) printf("%lld ", n)
#define lprin(n) printf("%lld\n", n)
#define rep(i,a,b) for(int i=a; i<(int)b; i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;

const int inf = INT_MAX;
const int ninf = INT_MIN;
const int mod = 1e9+7;
const int maxN = 1e6+2;


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

   int l = -2, r = -2;

   for(int i = 0; i + 1 < (int) s.size(); i ++) {
      if(s[i] == s[i + 1]) {
         l = i, r = i + 1;
         break;
      }
   }

   for(int i = 0; i + 2 < (int) s.size(); i ++) {
      set<char> unique;
      for(int j = i; j < i + 3; j ++) {
         unique.insert(s[j]);
      }
      if((int) unique.size() <= 2) {
         l = i, r = i + 2;
         break;
      }
   }

   printf("%d %d\n", l + 1, r + 1);
}

Measured memory_bytes: 3840
#include<cstdio>
#include<complex>
#include<cmath>

#define Re real()
#define Im imag()
#define Eps 1e-6
using namespace std;

typedef complex<double> Point;
typedef complex<double> Vector;

double dot(Point a,Point b)
{
    return (conj(a)*b).Re;
}

double cross(Point a,Point b)
{
    return (conj(a)*b).Im;
}

bool isParallel(Point a1,Point a2,Point b1,Point b2)
{
    return fabs(cross(a2-a1, b2-b1)) < Eps;
}

bool isOrthogonal(Point a1,Point a2,Point b1,Point b2)
{
    return fabs(dot(a2-a1, b2-b1)) < Eps;
}

int main()
{
    int vol;
    double x1,x2,y1,y2,m1,m2,n1,n2;
    scanf("%d",&vol);
    while(vol--)
    {
        scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&m1,&n1,&m2,&n2);
        Point p1(x1,y1),p2(x2,y2),q1(m1,n1),q2(m2,n2);
        if(isParallel(p1,p2,q1,q2)) printf("2\n");
        else if(isOrthogonal(p1,p2,q1,q2)) printf("1\n");
        else printf("0\n");
    }
    return 0;
}

Measured memory_bytes: 1056
import java.util.ArrayDeque;
import java.util.Scanner;

public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      ArrayDeque<Integer> stack = new ArrayDeque<>();
      
      while(sc.hasNext()) {
         int command = Integer.parseInt(sc.nextLine());
         if(command == 0) {
            System.out.println(stack.pop());
         } else {
            stack.push(command);
         }
      }
   }
}


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

int main() {
	int k;
	int a,b,r;
	cin>>k>>a>>b;
	int q=a/k;
	r=a%k;
	if(r==0) {
		cout<<"OK"<<endl;
	}
	else {
		q+=1;
		if(k*q<=b) {
			cout<<"OK"<<endl;
		}
		else {
			cout<<"NG"<<endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3624
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define str to_string
#define endl "\n"
#define PI 3.141592653589
using namespace std;
using lint = long long;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

//AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC
int main(){
    vector<int> vec={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};
    int x;cin>>x;
    cout<<vec[x-1]<<endl;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
//#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define oo 0x3f3f3f3f
#define OO 0x3f3f3f3f3f3f3f3f
#define popcount(n) __builtin_popcount(n)
#define popcountll(n) __builtin_popcountll(n)

using namespace std;
//using namespace __gnu_cxx;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const double PI = acos(-1.0), EPS = 1e-6;
const long long inf = 2e12 + 12;
const int MAXN = 100005, MAXM = 1003, Mod = 1000000007 , MAXLog = 20;

long long f(vector<int> &arr, int b) {
    long long ret = 0;
    for (int i = 0; i < arr.size(); ++i) {
        ret += abs(arr[i] - (b + i + 1));
    }
    return ret;
}

int main() {
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "rt", stdin);
//    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), cout.precision(9), cout << fixed;

    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; ++i) {
        cin >> arr[i];
    }
    int l = -1e9, r = 1e9;
    while (l < r) {
        int m = l + (r - l) / 2;
        if (f(arr, m) > f(arr, m + 1))
            l = m + 1;
        else
            r = m;
    }

    cout << f(arr, l) << '\n';


    return 0;
}


Measured memory_bytes: 1024
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
n=int(input())
t=prime_factorize(n)
t.append(0)
count=0
num=1
answer=0
for i in range(len(t)-1):
    if num==1:
        answer+=1
        if t[i]==t[i+1]:
            num+=1
    else:
        count+=1
        if t[i]!=t[i+1] and count!=num:
            num=1
            count=0
        elif count==num:
            answer+=1
            count=0
            if t[i]==t[i+1]:
                num+=1
            else:
                num=1
if n==1:
    answer=0
print(answer)

Measured memory_bytes: 9252
#pragma region template
#include <bits/stdc++.h>
#define all(a) (a).begin(),(a).end()
#define rep(i,n) for(ll i=0,i##_len=(n);i<i##_len;i++)
#define rep2(i,a,b) for(ll i=(a),i##_len=(b);i<=i##_len;i++)
#define rrep(i,n) ll i=(n);ll now=-1;while(i--&&(now++||1))
#define Yes(n) cout<<((n)?Yes:No)
#define vint vector<int>
#define vll vector<ll>
#define vstr vector<string>
#define vbl vector<bool>
#define pb push_back
using namespace std;
using ll = long long;

static inline void ignore_ret(int x) {x++;}
template<class T> inline bool chmax(T&a,const T&b){if(a<b){a=b;return true;}return false;}
template<class T> inline bool chmin(T&a,const T&b){if(a>b){a=b;return true;}return false;}
template<class T> inline T gcd_vec(vector<T>v){T r=v.at(0);for(T i=1;i<v.size();i++)r=gcd(r,v.at(i));return r;}
template<class T> inline T lcm_vec(vector<T>v){T r=v.at(0);for(T i=1;i<v.size();i++)r=lcm(r,v.at(i));return r;}
template<class T> inline T factorial(T n){if(n==0)return 1;T r=1;for(T i=2;i<=n;i++)r*=i;return r;}
template<class T> inline T nCr(T n,T k){if(n<k||n<0||k<0)return 0;T r=1;k=min(k,n-k);for(T i=n-k+1;i<=n;i++)r*=i;return r/factorial(k);}
template<class T> inline T dot_product(vector<T>u,vector<T>v){T r=0;for(T i=0;i<u.size();i++)r+=u.at(i)*v.at(i);return r;}
template<class T> inline T sum(vector<T>v){return reduce(all(v),0LL);}
#pragma endregion template

void solve(string S, string T, ll A, ll B, string U) {
  if (S == U) cout << A - 1 << " " << B << endl;
  else cout << A << " " << B - 1 << endl;
}

int main() {
  string S;
    cin >> S;
    string T;
    cin >> T;
    ll A;
    ignore_ret(scanf("%lld",&A));
    ll B;
    ignore_ret(scanf("%lld",&B));
    string U;
    cin >> U;
  solve(S, T, A, B, U);
  return 0;
}


Measured memory_bytes: 256
data_1 =[1,3,5,7,8,10,12]
data_2 =[4,6,9,11]
x,y = map(int,input().split())
if x in data_1 and y in data_1:
    print('Yes')
elif x in data_2 and y in data_2:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 8948
import itertools as it

H, W = map(int, input().split())

N = int(input())

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

grid = [[-1]*W for _ in range(H)]

h = 0
w = 0
rotation = it.cycle([(0, 1), (1, 0), (0, -1), (-1, 0)])
dy, dx = next(rotation)
for j, x in enumerate(a, 1):
    for _ in range(x):
        grid[h][w] = str(j)
        y = h + dy
        x = w + dx
        if not(0 <= y < H and 0 <= x < W) or grid[y][x] != -1:
            dy, dx = next(rotation)
            h += dy
            w += dx
        else:
            h = y
            w = x

for row in grid:
    print(" ".join(row))


Measured memory_bytes: 3828
#include <bits/stdc++.h>
#include <math.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define PI 3.14159265359
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  string s;
  cin >> s;
  if (s[s.size() - 1] == 's') {
    cout << s + "es" << endl;
    return 0;
  } else {
    cout << s + "s" << endl;
    return 0;
  }

}
/*
*/


Measured memory_bytes: 3628
from bisect import bisect_left
from collections import deque

n = int(input())
a = [int(input()) for _ in range(n)]
res = deque([a[0]])
for x in a[1:]:
    if x <= res[0]:
        res.appendleft(x)
    else:
        res[bisect_left(res, x) - 1] = x

print(len(res))



Measured memory_bytes: 8828
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int[] values = new int[2];
        values[0] = Integer.parseInt(tokenizer.nextToken());
        values[1] = Integer.parseInt(tokenizer.nextToken());
        int k = Integer.parseInt(tokenizer.nextToken());
        int index = 0;
        for (int i = 0; i < k; i++) {

            if (values[index] % 2 != 0)
                values[index]--;


            int amounts = values[index] / 2;
            values[index] -= amounts;
            index++;
            index = index % 2;

            values[index] += amounts;
        }


        System.out.println(values[0] + " " + values[1]);

    }
}


Measured memory_bytes: 21972
import sys
import numpy as np
import math
import copy
input = sys.stdin.readline
 
N = int(input())
A = np.array(list(map(int,input().split())))
if N ==1:
    ans = 0
else:
    r = np.array(list(range(1,N+1)))
    B = np.array(sorted(A-r))
    ans = float('inf')
    for i in range(max(N//2-1,0),min(N//2+2,N)):
        c = list(map(abs,(B - B[i])))
        ans = min(ans,sum(c))
print(ans)


Measured memory_bytes: 49604
from collections import deque
n,m = map(int,input().split())
visited = [-1 for _ in range(n)]
g = [[] for _ in range(n)]
for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)
pos = 0
que = deque([])
if g[0]:
    visited[0] = 0
    for nx in g[0]:
        que.append((nx, 0))
while que:
    to, now = que.popleft()
    if visited[to] != -1:
        continue
    else:
        visited[to] = now
        for nx in g[to]:
            que.append((nx, to))
visited = visited[1:]
if -1 in visited:
    print('No')
else:
    print('Yes')
    for k in visited:
        print(k+1)

Measured memory_bytes: 52396
#include<iostream>
#include<cstring>
#include<cmath>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<set>
#include<sstream>
#include<string>
#include<vector>
#include<cstdio>
#include<ctime>
#include<bitset>
#include<algorithm>
#include<string>
#include<unordered_map>
using namespace std;
typedef long long ll;
#define lson l , mid , rt << 1
#define rson mid + 1 , r , rt << 1 | 1

int read() {
	int ans = 0, flag = 1;
	char ch = getchar();
	while ((ch > '9' || ch < '0') && ch != '-') ch = getchar();
	if (ch == '-') flag = -1, ch = getchar();
	while (ch >= '0' && ch <= '9') ans = ans * 10 + ch - '0', ch = getchar();
	return ans * flag;
}



int main()
{
	int n = read();
	int a[200010];
	for (int i = 1; i <= n; i++)
	{
		a[i] = read();
	}
	int q = 1;
	int ans = 0;
	for (int i = 1; i <= n; i++)
	{
		if (a[i] == q)
		{
			q++;
			ans++;
		}
	}
	if (ans == 0)
	{
		printf("-1\n");
	}
	else
	{
		printf("%d\n", n - ans);
	}
	
	return 0;
}









Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>

#define INF_LL 9000000000000000000
#define INF 2000000000

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

using namespace std;

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

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

int main(void){
	int N, M;
	int D[1000], C[1000];
	ll dp[1001][1001];
	cin >> N >> M;
	REP(i, N){
		cin >> D[i];
	}
	REP(i, M){
		cin >> C[i];
	}

	REP(i, 1001){
		fill(dp[i], dp[i]+1001, INF);
	}
	REP(i, M){
		dp[0][i] = 0;
	}
	FOR(i, 1, N+1){
		REP(j, M){
			dp[i][j] = min(dp[i][j-1], dp[i-1][j-1] + D[i-1] * C[j]);
		}
	}
	int ans = INF;
	REP(i, M){
		ans = min((ll)ans, dp[N][i]);
	}
	cout << ans << endl;
}

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

int main() {
  int n;
  int64_t Ln = 2;
  int64_t Ln1 = 1;
  int64_t Ln2 = 1;
  cin >> n;
  
  for (int i = 1; i < n; i++) {
    Ln2 = Ln + Ln1;
    Ln = Ln1;
    Ln1 = Ln2;
  }
  
  cout << Ln2 << endl;
}

Measured memory_bytes: 256
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;

#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_vec::<i32>();

    let (a, b) = (line[0], line[1]);

    println!("{}", cmp::max(a+b, cmp::max(a-b, a*b)));
}


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

string s;
int dp[12][11][2];

int solve(int idx,int last,int h){
    if(idx==s.size())return 1;
    if(dp[idx][last][h]!=-1)return dp[idx][last][h];

    
    int low=0;
    int high=9;

    if(last!=10){
        low=max(0,last-1);
        high=min(9,last+1);
    }

    if(h)high=min(s[idx]-'0',high);

    int top=s[idx]-'0';

    int &ret=dp[idx][last][h]=0;
    for(int i=low;i<=high;i++)ret+=solve(idx+1,(last==10 && i==0)?10:i,(h && i==top)?1:0);

    return ret;
}
bool check(long long n,long long cnt){
    s=to_string(n);
    memset(dp,-1,sizeof(dp));

    long long ret=solve(0,10,1);
    //cout<<s<<" "<<ret<<endl;
    return ret-1>=cnt;
}

int main(){
    /*#ifndef ONLINE_JUDGE
        freopen("in.txt","r",stdin);
        freopen("out.txt","w",stdout);
    #endif*/
    
    
    int n;
    scanf("%d",&n);

    /*s=to_string(3234566667LL);
    memset(dp,-1,sizeof(dp));
    cout<<solve(0,10,1)<<endl;*/

    long long l=1,r=3234566667LL;
    long long ans=0;
    while(l<=r){
        long long m=(l+r)/2LL;

        if(check(m,n)){
            ans=m;
            r=m-1;
        }
        else l=m+1;
    }    
    printf("%lld\n",ans);

    
    return 0;
}


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

int main(){
  int h,w,k;cin>>h>>w>>k;
  vector<vector<int>> a(7,vector<int>(7,0));
  int res=0;
  int black=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
        char c;cin>>c;
      if(c=='#')a[i][j]=1;
    }
  }
  for(int bit1=0;bit1<(1<<h);bit1++){
      for(int bit2=0;bit2<(1<<w);bit2++){
        int count=0;
        for(int x=0;x<h;x++){
            for(int y=0;y<w;y++){
                if(bit1&(1<<x) && bit2&(1<<y)){
                    if(a[x][y])count++;
                    }     
                }
            }
          if(count==k)res++;
        }
    }
  cout<<res<<endl;

}


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

const int INF = 2e9;
int N;
int a[105], b[105], c[105], d[105];
int pu[105], pv[105], dst[105];
int res;
vector<int> G[105];
queue<int> Q;

bool bfs() {
	for (int i = 0; i < N; ++i) {
		if (pu[i] ^ N) dst[i] = INF;
		else dst[i] = 0, Q.push(i);
	}
	dst[N] = INF;
	while (Q.size()) {
		int u = Q.front(); Q.pop();
		if (dst[u] < dst[N]) for (int v : G[u]) if (dst[pv[v]] == INF) dst[pv[v]] = dst[u] + 1, Q.push(pv[v]);
	}
	return dst[N] != INF;
}

bool dfs(int u) {
	if (u == N) return 1;
	for (int v : G[u]) if (dst[pv[v]] == dst[u] + 1 && dfs(pv[v])) return pu[u] = v, pv[v] = u, 1;
	dst[u] = INF;
	return 0;
}

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

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

	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			if (c[j] > a[i] && d[j] > b[i]) G[i].push_back(j);
		}
	}

	fill(pu, pu + N, N);
	fill(pv, pv + N, N);

	while (bfs()) for (int i = 0; i < N; ++i) if (pu[i] == N && dfs(i)) res++;
	printf("%d\n", res);
}

Measured memory_bytes: 256
#include <stdio.h>
int main (void)
{
	int W,H,x,y,r;
	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if(0<W&&W<=100)
	{
		if(0<H&&H<=100)
		{
			if(0<r&&r<=100)
			{
				if(-100<=x&&x<=100)
				{
					if(-100<=y&&y<=100)
					{
						if(x-r>=0&&x+r<=W)
						{
							if(y-r>=0&&y+r<=H)
							{
								printf("Yes\n");
							}
							else
							{
								printf("No\n");
							}
						}
						else
						{
							printf("No\n");
						}
					}
					else
					{
						printf("No\n");
					}
				}
				else
				{
					printf("No\n");
				}
			}
			else
			{
				printf("No\n");
			}
		}
		else
		{
			printf("No\n");
		}
	}
	else
	{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 584
import core.bitop;
import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.format;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
  int n = readln.chomp.to!int;
  int[] a = readln.chomp.split.map!(to!int).array;

  int one = 0;
  bool notwo = true;
  int four = 0;
  foreach (v; a) {
    if (v % 4 == 0) {
      ++four;
      continue;
    }
    if (v % 2 == 0) {
      notwo &= false;
      continue;
    }
    ++one;
  }
  writeln = one <= four + notwo ? "Yes" : "No";
}


Measured memory_bytes: 4148
#include <iostream>
using namespace std;
 
pair<int, int> getResult(const string &s){
  const size_t sSize = s.size();
  pair<int, int> range = {-1, -1};
  if(sSize < 2){
    return range;
  }
  if(sSize == 2){
    if(s[0] == s[1]){
      range.first = 1;
      range.second = 2;
    }
    return range;
  }
 
  for(int i = 0; i + 2 < sSize; i++){
    if((s[i] == s[i+1]) || (s[i] == s[i+2]) || (s[i+1] == s[i+2])){
      range.first = i + 1;
      range.second = i + 3;
      break;
    }
  }
  return range;
}
 
int main(){
  string s;
  cin >> s;
  pair<int, int> result = getResult(s);
  cout << result.first << " " << result.second << endl;
}

Measured memory_bytes: 3264
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define REP(i, start, end) for (int i = start, i##Len = (end); i < i##Len; ++i)
#define REPR(i, start, end) for (int i = start, i##Len = (end); i > i##Len; --i)
using ll = long long;
using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    REP(i, 0, n)
    cin >> a[i];

    auto solve = [&](ll x) {
        ll cnt = 0;
        for (auto &l : a)
            cnt += l / x;
        return cnt > k;
    };

    ll ok = 0, ng = 1e9 + 1;
    while (abs(ok - ng) > 1)
    {
        ll mid = (ok + ng) / 2;
        if (solve(mid))
            ok = mid;
        else
            ng = mid;
    }

    ll cnt = 0;
    if (ok == 0)
    {
        cout << 1 << endl;
        return 0;
    }
    for (auto &l : a)
    {
        cnt += (l % ok > 0 ? l / ok : l / ok - 1);
    }
    cout << (cnt > k ? ok + 1 : ok) << endl;
}

Measured memory_bytes: 4776
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){

    cin.tie(0);
   	ios::sync_with_stdio(false);

    int a,b;
    cin>>a>>b;

    if((b*2)-a>=0){
        cout<<0<<endl;
    }else{
        cout<<a-(b*2)<<endl;
    }


    return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
#define rep(i,n) for (ll i=0;i<(n);++i)
#define rep2(i,a,b) for (ll i=(a);i<(b);++i)
#define debug(x) cout << #x << '=' << x << endl
#define all(v) (v).begin(),(v).end()
const ll MOD=1e9+7;
//const ll MOD=998244353;
const ll INF=1e9;
const ll IINF=1e18;
const double EPS=1e-8;
const double pi=acos(-1);

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

//Be careful MOD=1e9+7
const int MAX = 510000;
vector<ll> fac(MAX),finv(MAX),inv(MAX),invsum(MAX+1);
void COMinit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    rep2(i,2,MAX){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if (n<k) return 0;
    if (n<0||k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];
    COMinit();
    ll ans=0;
    invsum[0]=0;
    rep(i,MAX) invsum[i+1]=(invsum[i]+inv[i+1])%MOD;
    rep(i,N) ans=(ans+A[i]*fac[N]%MOD*((invsum[i+1]+invsum[N-i]-1)%MOD)%MOD)%MOD;
    cout << ans << endl;
}

Measured memory_bytes: 17024
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define sim template < class c
#define int long long
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << '\n'; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef tree< pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long ll;
const ll MOD = 1e9 + 7 ;
const ll N = 2e5 + 10 ;
const ll INF = 1e18 + 10 ;
signed main(){
    fastio
    int n ;
    cin >> n ;
    for(int i = 1; i < n + 1; i++){
        int cnt = 0 ;
        for(int j = 1; j < 101 && j * j < i; j++){
            for(int k = 1; k < 101 && j * j + k * k < i; k++){
                for(int z = 1; z < 101 && j * j + k * k + z * z + j * k + k * z + z * j <= i; z++){
                    if ( j * j + k * k + z * z + j * k + k * z + z * j == i ) cnt++;
                }
            }
        }
        cout << cnt << endl;
    }
    return 0; 
}

Measured memory_bytes: 3644
import sys
n,m=map(int,input().split())
x=list(map(int,input().split()))
if n >= m:
  print(0)
  sys.exit()
x.sort()
diff=[x[i+1]-x[i] for i in range(m-1)]
#print(diff)
print(sum(sorted(diff)[:m-n]))

Measured memory_bytes: 20616
#include <cstdio>
#include <algorithm>
using namespace std;
int n,m,x;
int c[15],a[15][15],b[15],d[15],len,sum=100000000,cost;
void init(){
	int i,j;
	scanf("%d%d%d",&n,&m,&x);
	for(i=1;i<=n;i++){
		scanf("%d",&c[i]);
		for(j=1;j<=m;j++)
			scanf("%d",&a[i][j]);
	}
}
void dfs(int step){
	int i,j,k;
	if(step==len+1){
		//printf("step=%d len=%d\n",step,len);
		//for(j=1;j<=len;j++)printf("%d ",b[j]);
		//printf("\n");
		for(k=1;k<=m;k++)d[k]=0;
		for(j=1;j<=len;j++)
			for(k=1;k<=m;k++)
				d[k]+=a[b[j]][k];
		//for(k=1;k<=m;k++)printf("%d ",d[k]);
		//printf("\n");
		for(k=1;k<=m;k++)
			if(d[k]<x)return;
		cost=0;
		for(j=1;j<=len;j++)cost+=c[b[j]];
		//printf("cost=%d\n",cost);
		sum=min(sum,cost);
		return ;
	}
	for(i=b[step-1]+1;i<=n;i++)
		b[step]=i,dfs(step+1);
}
int main(){
	init();
	for(len=1;len<=n;len++)
		b[0]=0,dfs(1);
	if(sum==100000000)printf("-1\n");
	else printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 3204
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
#define ld long double
int main(){
    int x;
    cin>>x;
    int k = x/200;
    cout<<10-k<<endl;
}

Measured memory_bytes: 3668
n=int(input())
A=[0]+list(map(int,input().split()))+[0]
cost=sum(abs(A[i+1]-A[i]) for i in range(n+1))
for i in range(1,n+1):
  print(cost-abs(A[i+1]-A[i])-abs(A[i]-A[i-1])+abs(A[i+1]-A[i-1]))

Measured memory_bytes: 14048
#include<stdio.h>

int n;
int A[2000];

int solve(int i, int m){

	int res;
	
	if( m == 0 ){
		return 1;
	}else if( i >= n ){
		return 0;
	}
	
	res = solve(i + 1, m) || solve(i + 1, m - A[i]);
	return res;
}
	
int main( void ){
	
	int q;
	int i;
	int m[2000];
	
	scanf( "%d" , &n );
	
	for( i = 0; i < n; i++ ){
		scanf( "%d" , &A[i] );
	}
	
	scanf( "%d" , &q );
	
	for( i = 0; i < q; i++ ){
		scanf( "%d" , &m[i] );
	}
	
	for( i = 0; i < q; i++ ){
		if( solve( 0 , m[i] ) == 1 ){
			printf( "yes\n" );
		}else{
			printf( "no\n" );
		}
	}
	
}


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

int main(){
  int N;
  cin >>N;
  vector<long long> lucas(86);
    lucas[0]=2;
  lucas[1]=1;
  for(int i=2;i<=N;i++){
  lucas[i]=lucas[i-1]+lucas[i-2];
  }
  cout<<lucas[N]<<endl;
}
  
        
        
      

Measured memory_bytes: 256
#include <stdio.h>

int date;

int main(){
    scanf("%d", &date);
    int r = date % 100, l = date / 100;
    if(1 <= l && l <= 12){
        if(1 <= r && r <= 12) printf("AMBIGUOUS\n");
        else printf("MMYY\n");
    }
    else{
        if(1 <= r && r <= 12) printf("YYMM\n");
        else printf("NA\n");
    }
}

Measured memory_bytes: 128
main()
{
  int n,i,a[10],b[10],aa,bb,c,x;
  scanf("%d",&n);
  for(;n--;)
    {
      a[0]=b[0]=aa=bb=0;
      for(i=x=0;i<10;i++)
	{
	  scanf("%d",&c);
	  if(x!=0)continue;
	  if(a[aa]>=c && b[bb]>=c)
	    x=-1;
	  else
	    {
	      if(a[aa]<c && (a[aa]>b[bb] || b[bb]>=c))
		aa++,a[aa]=c;
	      else
		bb++,b[bb]=c;
	    }
	}
      puts(x?"NO":"YES");
    }
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
#include<queue>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<set>
#include<map>
#include<vector>

using namespace std;
const int maxn = 1e4 + 7;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double pi = acos(-1.0);
typedef long long ll;

int n, m, sum;
int main(){
	cin >> n >> m;
	int a;
	while(m--){
		cin >> a;
		sum += a;
	}
	if(sum == n) cout << "0\n";
	else if(sum > n) cout << "-1\n";
	else cout << n - sum << endl;
}

Measured memory_bytes: 3632
N = int(input())
L = list(map(int,input().split()))
ans = 0
for i in range(N):
    for j in range(i):
        for k in range(j):
            if (max(L[i],L[j],L[k]) * 2 < L[i] + L[j] + L[k]) and (L[i] != L[j]) and(L[j] != L[k])and(L[k] != L[i]):
                ans += 1
print(ans)

Measured memory_bytes: 9208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
int main(){
  ll n,m,ans=0;
  cin>>n>>m;
  vll a(n),b(m),c(m);
  for (ll i=0;i<n;i++) cin>>a[i];
  for (ll i=0;i<m;i++) cin>>b[i]>>c[i];
  sort(a.begin(),a.end());
  vector<pair<ll, ll>> cb(m);
  for (ll i=0;i<m;i++) {
    cb[i] = make_pair(c[i],b[i]);
  }
  sort(cb.begin(),cb.end());
  reverse(cb.begin(),cb.end());

  ll k=0;
  for (ll i=0;i<m;i++) {
    if (i>0) {
        k+=cb[i-1].second;
    }
    for (ll j=0;j<cb[i].second;j++) {
      if (k+j>=n) {
        break;
      }
      if (a[k+j]<cb[i].first) {
        a[k+j]=cb[i].first;
      }
    }
  }
  for (ll i=0;i<n;i++) {
    ans += a[i];
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 4224
#syakyo https://atcoder.jp/contests/dp/submissions/3956913
s=input()
t=input()

dp=[[0]*len(s) for i in range(len(t))]
dp[0][0]=0

for i in range(len(t)):
    for j in range(len(s)):
        if s[j]==t[i]:
            if i==0 or j==0:
                dp[i][j]=1
            else:
                dp[i][j]=dp[i-1][j-1]+1
        else:
            dp[i][j]=max(dp[i][j-1],dp[i-1][j])
ans=""
j=len(t)-1
i=len(s)-1

while 1:
    if j==0:
        if dp[0][i]==1:
            ans+=t[0]
        break
    if i==0:
        if dp[j][0]==1:
            ans+=s[0]
        break
    else:
        if dp[j][i]==dp[j-1][i]:
            j-=1
        elif dp[j][i]==dp[j][i-1]:
            i-=1
        else:
            ans+=t[j]
            j-=1
            i-=1
print(ans[::-1])


Measured memory_bytes: 112476
import fileinput

input = fileinput.input().readline

N,M = map(int,(input().split()))

seta,setb = set(),set()

for m in range(M):
    a,b = map(int,(input().split()))
    if a == 1:
        seta.add(b)
    if b == N:
        setb.add(a)
        
if seta & setb:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Measured memory_bytes: 19148
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <string.h>
#include <map>
#include <math.h>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

using namespace std;
int main (void)
{
	double a,A,b,B;
	cin >> a >> A >> b >> B;

/*============================================================================================
 *
 * (????????????????±?????????????????????????????????¶??????????????????????????¬)
 *
============================================================================================*/

	cout << fixed << setprecision(6) << sqrt((a - b) * (a - b) + (A - B) * (A - B)) << endl;
}

Measured memory_bytes: 3276
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
 vector<int>moji(N);
  for(int i=0;i<N;i++){
  cin>>moji.at(i);
  }
  int count=0;
  for(int i=0;i<N;i++){
  	if(moji.at(i)%2==1 && (i+1)%2==1){
    count++;
    }
  }
  cout<<count;
}

Measured memory_bytes: 3628
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	char c; cin>>c; c++;
	cout << c << endl;


  return 0;
}


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

a = [0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

if a[n - 1] == 1:
	print('Yes')
else:
	print('No')

Measured memory_bytes: 3064
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	x := readInt()
	y := readInt()
	fmt.Println(solve(x, y))
}

func solve(x, y int) int {
	return x + (y / 2)
}

func read() string {
	sc.Scan()
	return sc.Text()
}

func readInt() int {
	i, e := strconv.Atoi(read())
	if e != nil {
		panic(e)
	}
	return i
}


Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] p = new int[n];
		for (int i = 0; i < n; i++) {
			p[i] = Integer.parseInt(br.readLine());
		}
		br.close();

		boolean[] b = new boolean[n + 1];
		b[n] = true;
		boolean[] c = new boolean[n + 1];
		for (int i = 0; i < n; i++) {
			if (!c[p[i] - 1]) {
				b[p[i] - 1] = true;
			}
			c[p[i]] = true;
		}

		int max = 0;
		int cnt = 1;
		for (int i = 1; i <= n; i++) {
			if (b[i]) {
				max = Math.max(max, cnt);
				cnt = 1;
			} else {
				cnt++;
			}
		}
		System.out.println(n - max);
	}
}


Measured memory_bytes: 36908
#include <iostream>
#include <vector>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <climits>
#include <iomanip>
#include <deque>
#include <limits>

using namespace std;

int main()
{
  int X, Y, Z;

  cin >> X >> Y >> Z;

  swap(X, Y);
  swap(X, Z);

  cout << X << " " << Y << " " << Z << endl;
  return 0;
}


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

vector<int> v[111111];
ll dp[111111];
void dfs(int x) {
  if(dp[x]!=-1) return;
  dp[x]=0;
  rep(i,v[x].size()) {
    int y=v[x][i];
    dfs(y);
    dp[x]=max(dp[x],dp[y]+1);
  }
}

void Main() {
  memset(dp,-1,sizeof(dp));
  ll n,m;
  cin >> n >> m;
  rep(i,m) {
    int x,y;
    cin >> x >> y;
    x--,y--;
    v[x].pb(y);
  }
  rep(i,n) dfs(i);
  ll ans=0;
  rep(i,n) ans=max(ans,dp[i]);
  pr(ans);
}

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


Measured memory_bytes: 8960
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

void solve() {
	int a, b, c; cin >> a >> b >> c;
	if (a == b && b == c) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}
int main() {
	solve();
	//stop
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
       		String[] strStdIn = new String[4];
		int i = 0;
		while (i != 4) {
			strStdIn[i] = scanner.nextLine();
			i++;
		}

		int totalLiving = Integer.parseInt(strStdIn[0]);
		int initialLiving = Integer.parseInt(strStdIn[1]);
		int initialCost = Integer.parseInt(strStdIn[2]);
		int latterCost = Integer.parseInt(strStdIn[3]);
		
		int latterLivingDate = totalLiving - initialLiving;

		int totalCost = 0;

		if ( (initialLiving == 0) || (latterLivingDate <= 0) ) {
			totalCost = initialCost * totalLiving;
		} else {
			totalCost = latterCost * latterLivingDate + initialCost * (totalLiving - latterLivingDate);
		}
		
		String returnString = Integer.toString(totalCost);

        	System.out.println(totalCost);
    }
}

Measured memory_bytes: 9428
function readInt(str) {
  return parseInt(str, 10);
}
function Main(raw: string) {
  const input = raw.split("\n");
  const [N, Q] = input[0].split(" ").map(readInt);
  const S = input[1];
  const l = [];
  const r = [];
  for (let i = 0; i < Q; i++) {
    const [li, ri] = input[i + 2].split(" ").map(readInt);
    l.push(li - 1);
    r.push(ri - 1);
  }
  // console.log(N,Q,S,l,r);
  const count = new Array(N);
  count[0] = 0;
  for (let i = 1; i < N; i++) {
    if (S[i - 1] == "A" && S[i] == "C") {
      count[i] = count[i - 1] + 1;
    } else {
      count[i] = count[i - 1];
    }
  }
  for (let i = 0; i < Q; i++) {
    console.log(count[r[i]]-count[l[i]]);
  }
}

//DO NOT EDIT
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 50932
#include<bits/stdc++.h>
using namespace std;
long long int GCD(long long int a,long long int b)
{
    if(a==0)
        return b;
    return GCD(b%a,a);
}
long long int LCM(long long int a,long long int b)
{
    return ((a/GCD(a,b))*b);
}
int main()
{
    long long int a,b;
    cin>>a>>b;
    cout<<LCM(a,b)<<endl;
    return 0;
}

Measured memory_bytes: 256
require 'prime'

n = gets.chomp.to_i

c = 0
(2..n).each do |i| 
  if i % 2 == 0 then
    next
  end
  
  if Prime.prime_division(i).map{|p, x| x + 1}.reduce(:*) == 8 then
    c += 1
  end
end
  
puts c.to_s

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

int main(){
    int a,b,k; cin>>a>>b>>k;

    if(a-b < (2 - 2*k) ){

    for(int i=a; i<=a+k-1; i++)cout<<i<<endl;

    for(int i=b-k+1; i<=b; i++)cout<<i<<endl;

    }

    else{
        for(int i=a; i<=b; i++) cout<<i<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  l.sort()

  if n%2==0:
    for i in range(n):
      if (i//2)*2+1!=l[i]:
        return 0
    return pow(2,n//2)%mod

  else:
    if l[0]!=0:
      return 0
    l=l[1:]
    for i in range(n-1):
      if (i//2)*2+2!=l[i]:
        return 0
    return pow(2,n//2)%mod

print(main())


Measured memory_bytes: 16300
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = readLn >>= putStrLn . which "YES" "NO" . ( `elem` [ 7, 5, 3 ] )


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

int main() {
  int64_t N;
  cin >> N;
  vector<int64_t> d(N);
  rep(i, N) cin >> d[i];
  
  sort(d.begin(), d.end());
  
  if(d[N/2 - 1] == d[N/2]){
    cout << 0 << endl;
    return 0;
  }else{
    cout << d[N/2]-d[N/2-1] << endl;
  }

}

Measured memory_bytes: 1024