akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf (1<<30)

int main(){
  int n,m,k,black;
  cin>>n>>m>>k;
  bool ok=false;

  for(int i=0;i<=n;++i){
    for(int j=0;j<=m;++j){
      black=(n-i)*j+(m-j)*i;
      if(black==k)ok=true;
    }  
  }
  if(ok)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] H = new long[N];
		for (int i = 0; i < N; ++i)
			H[i] = sc.nextLong();
		boolean ans = true;
		for (int i = 0; i < N; ++i) {
			if (i == 0 || H[i - 1] <= H[i] - 1)
				--H[i];
			ans &= i == 0 || H[i - 1] <= H[i];
		}
		System.out.println(ans ? "Yes" : "No");
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}

Measured memory_bytes: 52160
use proconio::*;
use proconio::marker::*;

#[fastout]
fn run() {
    input! {
        h: usize,
        w: usize,
        k: usize,
        s: [Chars; h],
    }
    let s: Vec<Vec<usize>> = s.into_iter().map(|s| s.into_iter().map(|s| (s == '#') as usize).collect()).collect();
    let mut ans = 0;
    for i in 0..(1 << h) {
        for j in 0..(1 << w) {
            let mut cnt = 0;
            for (x, s) in s.iter().enumerate() {
                for (y, s) in s.iter().enumerate() {
                    cnt += *s & ((i >> x) & 1) & ((j >> y) & 1);
                }
            }
            if cnt == k {
                ans += 1;
            }
        }
    }
    println!("{}", ans);
}

fn main() {
    run();
}


Measured memory_bytes: 2208
#include<bits/stdc++.h>
using namespace std;
int main()
{
	char a[4][4];
	for(int i=1;i<=3;i++)
	for(int j=1;j<=3;j++)
	cin>>a[i][j];
	cout<<a[1][1]<<a[2][2]<<a[3][3];
	return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
	line := nextLine()
	parts := strings.Split(line, " ")
	a, _ := strconv.Atoi(parts[0])
	b, _ := strconv.Atoi(parts[1])
	c, _ := strconv.Atoi(parts[2])

	m := b / a
	if m <= c {
		fmt.Println(m)
	} else {
		fmt.Println(c)
	}
}


Measured memory_bytes: 640
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a, b, c;
    cin >> a >> b >> c;
    set<set<ll>> cookie_set;
    int ans = 0;
    while(a % 2 == 0 and b % 2 == 0 and c % 2 == 0) {
        set<ll> temp;
        temp.insert(a);
        temp.insert(b);
        temp.insert(c);
        if(cookie_set.count(temp) > 0) {
            cout << -1 << endl;
            return 0;
        }
        cookie_set.insert(temp);
        ll new_a = (b + c) / 2;
        ll new_b = (c + a) / 2;
        ll new_c = (a + b) / 2;
        a = new_a;
        b = new_b;
        c = new_c;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
    int n;
    long ans = 0;
    cin >> n;
    vector<long> L(n+1);
    for(int i = 1; i <= n; i++){
        cin >> L[i];
    }
    for(int i = 1; i <= n-2; i++){
        for(int j = i+1; j <= n-1; j++){
            for(int k = j+1; k <= n; k++){
                if(L[i]+L[j] > L[k] && L[j]+L[k] > L[i] && L[k]+L[i] > L[j]){
                    if(L[i] != L[j] && L[j] != L[k] && L[i] != L[k]){
                        ans++;
                    }
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
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;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  int x,y,z,K;
  cin >> x >> y >> z >> K;
  vector<ll> a(x);
  rep(i,x) cin >> a[i];
  vector<ll> b(y);
  rep(i,y) cin >> b[i];
  vector<ll> c(z);
  rep(i,z) cin >> c[i];
  sort(all(a)); reverse(all(a));
  sort(all(b)); reverse(all(b));
  sort(all(c)); reverse(all(c));
  ll l=2,r=3e10+1;
  while(r-l!=1){
    ll mid=(l+r)/2;
    bool ok=[&]{
      int cnt=0;
      rep(i,x)rep(j,y)rep(k,z){
        if(a[i]+b[j]+c[k]<mid) break;
        cnt++;
        if(cnt==K) return true;
      }
      return false;
    }();
    if(ok) l=mid;
    else r=mid;
  }
  priority_queue<ll> q;
  rep(i,x)rep(j,y)rep(k,z){
    if(a[i]+b[j]+c[k]>=l+1) q.push(a[i]+b[j]+c[k]);
    if(a[i]+b[j]+c[k]<l+1) break;
  }
  while(q.size()!=K){
    q.push(l);
  }
  while(q.size()){
    cout << q.top() << endl;
    q.pop();
  }
}

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

using namespace std;

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

  int Ee = 0, Ew = 0, We = 0, Ww = 0;
  for(int i = 1; i < n; i++) {
    if(s[i] == 'E') {
      Ee++;
    }
    else {
      Ew++;
    }
  }

  int mn = Ee;
  for(int i = 1; i < n - 1; i++) {
    if(s[i - 1] == 'E') {
      We++;
    }
    else {
      Ww++;
    }
    if(s[i] == 'E') {
      Ee--;
    }
    else {
      Ew--;
    }

    mn = min(mn, Ee + Ww);
  }
  if(s[n - 2] == 'E') {
      We++;
  }
  else {
    Ww++;
  }
  if(s[n - 1] == 'E') {
    Ee--;
  }
  else {
    Ew--;
  }
  mn = min(mn, Ww);

  cout << mn << endl;
}

Measured memory_bytes: 900
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
 
const int INF = 1e9;
 
int main()
{
  int n;
  cin >> n;
  int taro = 0, hanako = 0;
  for (int i = 0; i < n; ++i) {
    string s1, s2;
    cin >> s1 >> s2;
    if (s1 == s2) { ++taro, ++hanako; }
    else if (s1 > s2) { taro += 3; }
    else { hanako += 3; }
  }
  fprintf(stdout, "%d %d\n", taro, hanako);
  return 0;
}

Measured memory_bytes: 3268
import java.util.*;
import java.io.*;
public class Main 
{
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader (System.in));
		int n = Integer.parseInt(br.readLine());
		String[] arr = br.readLine().split(" ");
		int current_number = 1;
		for (int i = 0; i < n; i++) {
			int current_value = Integer.parseInt(arr[i]);
			if (current_number == current_value) {
				current_number++;
			}
		}
		if (current_number == 1) System.out.println(-1);
		else System.out.println(n - (current_number - 1));
	}
}


Measured memory_bytes: 61216
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
int n,ans=25;
int main(){
  cin>>n;
  vector<int>d(n+1,0);
  rep(i,n)cin>>d[i];
  sort(d.begin(),d.end());
  rep(i,n+1)if(i&1)d[i]=24-d[i];
  sort(d.begin(),d.end());
  rep(i,n)if(d[i+1]-d[i]<ans)ans=d[i+1]-d[i];
  cout<<min(ans,24-d[n])<<endl;
  return 0;
}


Measured memory_bytes: 3600
//ProblemA.cpp

#include <iostream>

static std::istream & ip = std::cin;
static std::ostream & op = std::cout;

#if OJ_MYPC
#include <ojio.h>
#endif

#ifndef OPENOJIO
#define OPENOJIO
#endif

#if 1 || DEFINE
/***************************************************************/
typedef unsigned long long u64;
typedef long long s64;

typedef unsigned uint;

#define ABS(x) ((x) > 0 ? (x) : -(x))

#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))

#define MIN3(x, y, z) MIN(x, MIN(y, z))
#define MAX3(x, y, z) MAX(x, MAX(y, z))

#define FillZero(arr) memset(arr, 0, sizeof(arr));

/***************************************************************/
#endif //1 || DEFINE

#include <string>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <stack>
#include <utility>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>

#include <list>

//001
//op << setfill('0') << setw(3) << setiosflags(ios::right) << 1;

//op << fixed << setprecision(20);

using namespace std;

//ProblemA.cpp

int main(int argc, char* argv[])
{
	OPENOJIO;

	string s;
	ip >> s;

	list<char> ls;
	for (auto c : s) ls.push_back(c);

	auto it = ls.begin();
	while (it != ls.end())
	{
		if (*it != 'T' || it == ls.begin()) { ++it; continue; }

		auto tit = it;
		--tit;
		if (*tit == 'S') {
			ls.erase(tit);
			it = ls.erase(it);
		}
		else
			++it;
	}

	op << ls.size() << endl;

	return 0;
}
/***************************************************************/


Measured memory_bytes: 6660
N = int(input())
lst = [ input() for _ in range(N) ]

M = int(input())
f = False
for _ in range(M):
	s = input()
	if s in lst:
		if f==False:
			f=True
			print("Opened by",s)
		else:
			f=False
			print("Closed by",s)
	else:
		print("Unknown",s)

Measured memory_bytes: 7732
n, m = map(int, input().split())
arr = [int(input()) for _ in range(m)]
broken = set(arr)

mod = 10 ** 9 + 7

dp = [0] * (n + 1)
dp[0] = 1


for i in range(1, n + 1):
    if i in broken:
        continue

    if i == 1:
        dp[1] = dp[0]
        continue

    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= mod

print(dp[n])


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

bool Pal(string s) {
  string t = s;
  reverse(t.begin(), t.end());
  
  return s == t;
}

int main() {
  string s;
  cin >> s;
  int n = s.size();
  
  if (Pal(s) && Pal(s.substr(0, (n-1)/2)))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  
  return 0;
  
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int a[100],V=-1,i,j,f,W,Q,id,w;
	char c;
	while(scanf("%d%d",&W,&Q),W)
	{
		for(i=0;i<W;++i)a[i]=V;
		while(Q--)
		{
			scanf(" %c",&c);
			if(c-'w')
			{
				scanf("%d%d",&id,&w);
				for(i=0;i<W-w+1;++i)
				{
					for(f=j=0;j<w;++j)if(a[i+j]!=V)f++;
					if(!f)
					{
						for(j=0;j<w;++j)a[i+j]=id;
						printf("%d\n",i);
						goto E;
					}
				}
				puts("impossible");
E:;
			}
			else
			{
				scanf("%d",&id);
				for(i=0;i<W;++i)if(a[i]==id)a[i]=V;
			}
		}
		puts("END");
	}
}

Measured memory_bytes: 0
import java.util.*;

import java.io.*;

public class Main {
	static PrintWriter out;
	static StringBuilder sb;
	static long mod = 1000000007;
	static int inf = (int) 1e15;
	static ArrayList<Integer>[] ad;
	static int n;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m];
		int[] c = new int[m];
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt()-1;
			c[i] = sc.nextInt();
		}
	K:	for (int i = 0; i < 1000; i++) {
			String s = "" + i;
			if (s.length() != n)
				continue;
			for(int j=0;j<m;j++)
				if(a[j]>=s.length() || s.charAt(a[j])-'0'!=c[j])
					continue K;
			System.out.println(i);
			return;
		}
		System.out.println(-1);
		out.flush();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

Measured memory_bytes: 24916
#include <bits/stdc++.h>
#define ll long long
using namespace std;
template<class T>inline void read(T &res)
{
    char c;
    T flag=1;
    while((c=getchar())<'0'||c>'9')if(c=='-')flag=-1;
    res=c-'0';
    while((c=getchar())>='0'&&c<='9')res=res*10+c-'0';
    res*=flag;
}
int main()
{
    char a[1005];
    scanf("%s",a);
    printf("%c%c%c\n",a[0],a[1],a[2]);
}


Measured memory_bytes: 3824
#include <iostream>

using namespace std;

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

int main(){
	int n;
	cin >> n;
	int p, s = 0, m = 0;
	rep(i,n) {
		cin >> p;
		s += p;
		m = max(m, p);
	}
	cout << s - m / 2 << endl;
	return 0;
}


Measured memory_bytes: 256
// ?????¬???????????¬??????

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

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

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

int solve(int N, vector<int> h) {
    // ??????
    h.push_back(0); N++;

    // height, position
    int ans = 0;
    stack<pii> S;
    rep(i,0,N+1) {
        if(S.empty()) S.push(pii(h[i], i));

        if     (S.top().first < h[i])
            S.push(pii(h[i], i));
        else if(S.top().first > h[i]) {
            int lastpos = 0;
            while(!S.empty() && S.top().first >= h[i]) {
                lastpos = S.top().second;
                chmax(ans, S.top().first * (i-lastpos));
                S.pop();
            }
            S.push(pii(h[i], lastpos));
        }
    }
    return ans;
}

signed main() {
    int N; cin >> N;
    vector<int> h(N);
    rep(i,0,N) cin >> h[i];
    cout << solve(N, h) << endl;
    return 0;
}

Measured memory_bytes: 6036
import math
ae = [int(input()) for _ in range(5)]
if all([a%10==0 for a in ae]):
    min_ae = 0
else:
    min_ae = 9
num = 0
for a in ae:
    s = str(a)
    if s[-1] == "0":
        pass
    else:
        min_ae = min(int(s[-1]), min_ae)
    if min_ae==int(s[-1]):
        num = a
ae.remove(num)
ceil_ae = [math.ceil(a/10)*10 for a in ae]
print(num + sum(ceil_ae))


Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define first_more_idx(ve, num) upper_bound(all(ve), num)-ve.begin() // idx = first_more_idx(ve,num); if(idx = ve.size()) , then not exist
#define first_lessequal_idx(ve, num) lower_bound(all(ve), num)-ve.begin()
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > // only sort first param
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll power(ll x, ll n){if(n == 0) return 1;return  (n%2)? x*power(x, n-1)%MOD : power(x*x%MOD, n/2);}

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

    ll A, B ;
    cin >> A >> B ;
    
    
    if(B == 1){
        cout << 0 << endl;
        return 0;
    }
    
    ll ans = 1;
    
    while(true){
        ll num = A * ans - (ans - 1);
        if(num >= B){
            cout << ans << endl;
            return 0;
        }
        ans ++;
    }
    

    


    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


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

#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()

using namespace std;

const int INF = 1e18 + 9;
const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
int dp[100005];
int ice[100005];int n,t;
int f(int now){
    if(dp[now]>-1){}
    else if(now==0){
        if(ice[now]>ice[now+1]){
            dp[now]=t-ice[now];
        }else{
            dp[now]=f(now+1)+t-ice[now];
        }
    }else if(now==(n-1)){
        if(ice[now]>ice[now-1]){
            dp[now]=t-ice[now];
        }else{
            dp[now]=f(now-1)+t-ice[now];
        }
    }else{
        if(ice[now]>ice[now-1]&&ice[now]>ice[now+1]){
            dp[now]=t-ice[now];
        }else if(ice[now]>ice[now-1]){
            dp[now]=f(now+1)+t-ice[now];
        }else if(ice[now]>ice[now+1]){
            dp[now]=f(now-1)+t-ice[now];
        }else{
            dp[now]=max(f(now-1),f(now+1))+t-ice[now];
        }
    }

    return dp[now];
}
signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >>t;
    rep(i,0,n){
        cin >> ice[i];
    }
    rep(i,0,100005){
        dp[i]=-1;
    }
    int ans=0;
    rep(i,0,n){
        int y=f(i);
        ans=max(ans,y);
        //cout << i << "=" << y << endl;
    }
    cout << ans << endl;
    return 0;
}

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

void	write_1line(int W, int h_idx)
{
	char	first = '#', second = '.';
	if (h_idx % 2)
		swap(first, second);
	for (int j = 0; j < W; ++j) {
		if (j % 2)
			cout << second;
		else
			cout << first;
	}
	cout << "\n";
}

int	main()
{
	int	H, W;
	while (cin >> H >> W) {
		if (H == 0 && W == 0) break;
		for (int i = 0; i < H; ++i)
			write_1line(W, i);
		cout << endl;
	}
}



Measured memory_bytes: 3116
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;

#define B       (cout << "Sehen Sie mich!" << endl)
#define VB(val) (cout << val << endl)

inline int ctoi(const char c){
        if('0' <= c && c <= '9') return (c -'0');
        return -1;
}

int main()
{
        char c[2][3] = {};

        for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                        cin >> c[i][j];
                }
        }

        for (int i = 0; i < 3; i++) {
                if (c[0][i] != c[1][2 - i])
                        goto out;
        }

        VB("YES");
        return 0;
out:
        VB("NO");
}

Measured memory_bytes: 256
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
using namespace std;
//#include <vector>
//#include <stack>
//#include <queue>

/*
#include <math.h>
int standerd = int(pow(10.0,9.0)) + 7;
*/
string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 
 

int main(){

    int A;
    int B;
    
    cin >> A;
    cin >> B;

    cout << (A * 3 + B)/2;

}

Measured memory_bytes: 256
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *					# ll = deepcopy(l)
from heapq import *					# heappush(hp,x)
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize				# minn = -maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *				# pre = [0] + list(accumulate(l))
from decimal import Decimal 		# a = Decimal(a)	# use this for math questions
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''
6 5
4 7 10 6 5
'''

def solve(l,x,n):
	n = len(l)
	diff,ans = maxsize,0
	for i in range(102):
		if(i not in l and abs(i-x) < diff):
			diff = abs(i-x)
			ans = i
	return ans
	

X,N = map(int, input().split())
l = list(map(int, stdin.readline().rstrip().split()))
ans = solve(l,X,N)
print(ans)



Measured memory_bytes: 11020
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100003,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int a,b,c,d;cin>>a>>b>>c>>d;
    if(b+1==d) cout<<0<<endl;
    else cout<<1<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
    int N, H[110000];
    int i;
    int ans=0;

    scanf("%d", &N);
    for(i=0; i<N; i++){
        scanf("%d", &H[i]);
    }

    for(i=N-1; i>0; i--){
        if(H[i-1]>H[i]){
            H[i-1]=H[i-1]-1;
        }
        if(H[i-1]>H[i]){
            ans=1;
        }
    }

    if(ans==0){
        printf("Yes");
    }else{
        printf("No");
    }

    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
// Welcome to my source code!

int main() {
    IOS
    int n, y;
    cin >> n >> y;
    int a = -1, b = -1, c = -1;
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= n-i; j++) {
            int f = n - i - j;
            if (f >= 0 && y == 10000 * i + 5000 * j + 1000 * f) {
                a = i; b = j; c = f;
                break;
            }
        }
    }
    cout << a << ' ' << b << ' ' << c << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(void){
  char S[200001];
  char T[200001];
  int i=0;
  int s=0;
  scanf("%s",S);
  scanf("%s",T);
  while(S[i]!='\0'){
    if(S[i]!=T[i]){
      s=s+1;
    }
    i++;
  }
  printf("%d\n",s);
  return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	string s, t;
	cin >> s >> t;

	bool ok = false;
	int N = s.size();
	for(int i = 0; i < N; i++){
		if(s == t) ok = true;
		s = s.substr(1) + s[0];
	}
	if(ok) cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
 
ans = [0] * (max(A) + 2)
 
for a in A:
    if a == 0:
        ans[a] += 1
        ans[a + 1] += 1
    if a != 0:
        ans[a - 1] += 1
        ans[a] += 1
        ans[a + 1] += 1
print(max(ans))

Measured memory_bytes: 20592
import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        int c = 0;
        for (int i = 1; i < s.length(); i++) {
            if(s.charAt(i) != s.charAt(i-1)){
                c++;
            }
        }
        System.out.println(c);
    }
}


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

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef unordered_set<int> si;
typedef pair<int, int> pp;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)


template <typename T>
void printV(vector<T> A) {
    if (A.empty()) cerr << "EMTPY\n";
    else { 
        cerr << "\n[";
        for (int i = 0; i < A.size() -1 ; ++i) {
            cerr << A[i] << ", ";
        }
        if (A.size()) cerr << A.back() << "]\n";
    }
}


template <typename T>
void printVV(vector<vector<T>> A) {
    cerr << "\n[";
    for (auto v : A) {
        printV<T>(v);
    }
    cerr << "]\n";
}

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cerr << name << ": " << arg1 << endl;
}

template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&& ...args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << " |";
    __f(comma + 1, args...);
}

const int N = 10;
int arr[N];
int arr1[N];


void solve(int n) {
    vector<int> pos (n);
    for (int i = 0; i < n; ++i) { pos[i] = i +1; }
    vector<int> fact(n);
    fact[n-2] = 1;
    for (int i = n-3, s = 2; i >= 0; --i, ++s) fact[i] = fact[i+1] * s;

    int a = 1, b = 1;
    for (int i = 0; i < n-1; ++i) {
        auto it = lower_bound(pos.begin(), pos.end(), arr[i]);
        int idx = it - pos.begin();
        pos.erase(it);
        a = a + (idx * fact[i]);
    }

    pos.resize(n);
    for (int i = 0; i < n; ++i) { pos[i] = i +1; }
    for (int i = 0; i < n-1; ++i) {
        auto it = lower_bound(pos.begin(), pos.end(), arr1[i]);
        int idx = it - pos.begin();
        pos.erase(it);
        b = b + (idx * fact[i]);
    }

    cout << abs(a - b) << '\n';
    
}

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

    for (int i = 0; i < n; ++i) cin >> arr[i];
    for (int i = 0; i < n; ++i) cin >> arr1[i];

    solve(n);

    return 0;
}



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

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

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

class Prints {
private:
    class __Prints {
    public:
        __Prints(const char* sep, const char* term) : sep(sep), term(term) {}
        template <class... Args>
        void operator()(Args&&... args) const { print(std::forward<Args>(args)...); }

    private:
        const char *sep, *term;
        void print() const { std::cout << term; }
        void print_rest() const { std::cout << term; }
        template <class T, class... Tail>
        void print(T&& head, Tail&&... tail) const { std::cout << head, print_rest(std::forward<Tail>(tail)...); }
        template <class T, class... Tail>
        void print_rest(T&& head, Tail&&... tail) const { std::cout << sep << head, print_rest(std::forward<Tail>(tail)...); }
    };

public:
    Prints() {}
    __Prints operator()(const char* sep = " ", const char* term = "\n") const { return __Prints(sep, term); }
    template <class T>
    void print_vec(const std::vector<T>& vec, const char* sep = " ", const char* term = "\n") const {
        const size_t sz = vec.size();
        for (size_t i = 0; i < sz; i++) std::cout << vec[i] << (i == sz - 1 ? term : sep);
    }
};

Prints prints;

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

void solve() {
    ll N;
    cin >> N;
    Vl ns(N + 1);
    for (ll i = 1; i <= 100; i++) {
        for (ll j = 1; j <= 100; j++) {
            for (ll k = 1; k <= 100; k++) {
                ll t = i * i + j * j + k * k + i * j + j * k + k * i;
                if (t <= N) {
                    ++ns[t];
                }
            }
        }
    }
    for (ll i = 1; i <= N; i++) {
        prints()(ns[i]);
    }
}

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

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

Measured memory_bytes: 3692
#include <bits/stdc++.h>
using namespace std;
int main() {
  stack<int> st;
  string s;
  while(cin >> s){
    if ( isdigit(s[0])){
      st.push(atoi(s.c_str()));
    } else {
      int a = st.top(); st.pop();
      int b = st.top(); st.pop();

      if(s == "+") st.push(b + a);
      if(s == "-") st.push(b - a);
      if(s == "*") st.push(b * a);
    }
  }
  cout << st.top() << endl;
}


Measured memory_bytes: 3172
/* monkukui 競技プログラミング用のテンプレート  (ここから) */
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
using ll = long long int;
using lnt = long long int;
using Graph = vector<vector<int>>;
using Wgraph = vector<vector<pair<int, long long int>>>;
constexpr long long int INF = 1001001001001001LL;
constexpr long long int MOD = 1000000007LL;
constexpr double PI = 3.1415926535897932;
constexpr long long int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
constexpr long long int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
inline void yes(){ cout << "yes" << endl; }
inline void Yes(){ cout << "Yes" << endl; }
inline void YES(){ cout << "YES" << endl; }
inline void no(){ cout << "no" << endl; }
inline void No(){ cout << "No" << endl; }
inline void NO(){ cout << "NO" << endl; }
inline void possible(){ cout << "possible" << endl; }
inline void Possible(){ cout << "Possible" << endl; }
inline void POSSIBLE(){ cout << "POSSIBLE" << endl; }
inline void impossible(){ cout << "impossible" << endl; }
inline void Impossible(){ cout << "Impossible" << endl; }
inline void IMPOSSIBLE(){ cout << "IMPOSSIBLE" << endl; }

#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = 1; i <= (n); i++)
#define DREP(i,n) for(int i = (n)-1; i >= 0; i--)
#define SREP(i,s,t) for(int i = s; i < t; i++)
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define PB push_back

/* monkukui 競技プログラミング用のテンプレート (ここまで)*/

int main(){
  
  int n; cin >> n;
  int ans = 0;
  for(int i = 1; i < n; i++) {
    int j = n - i;
    if(i >= j) break;
    ans++;
  } 
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 384
// youtubeの公式解説動画を見て
#include<iostream>
#include<vector>
using namespace std;
typedef long long ll;

// A + B = A xor B + (A & B)*2

int main(){
    int n;
    cin >> n;
    vector<ll> v(n);
    ll s = 0;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        s ^= v[i];
    }
    ll ans = s; // A+B = A^B
    // sで1が立っている桁についてはどう塗り分けようがA&Bのその桁は0　
    // どう頑張ったって0なので考えない
    for(int i = 0; i < n; i++)  v[i] &= ~s; 
    
    // 掃き出し
    int rnk = 0;
    vector<int> top(61); 
    for(int i = 60; i >= 0; i--){
        int j = rnk;
        for(; j < n; j++){
            if(v[j]>>i&1){
                swap(v[rnk], v[j]);
                break;
            }
        }
        if(j == n)  continue;
        top[rnk] = i;
        for(int k = 0; k < n; k++){
            if(rnk == k)    continue;
            if(v[k]>>i&1)   v[k] ^= v[rnk];
        }
        rnk++;
    }
    
    ll x = 0;
    for(int i = 60; i >= 0; i--){
        ll nx = x + (1ll<<i);
        ll b = nx;
        for(int j = 0; j < rnk; j++){
            if(b>>top[j]&1) b ^= v[j];
        }
        if((b&nx) == 0){
            x = nx;
        }
    }
    ans += x * 2; // (A&B)*2 を足しこむ
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
using namespace std;
int main(){
  int a,count=0;
  char b;
  cin>>a;
  for(int i=0;i<a;i++){
    cin>>b;
    if(b=='Y')
      count++;
  }
  if(count>0)
    cout<<"Four"<<endl;
  else
    cout<<"Three"<<endl;
}

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

#define P 998244353
#define M 600010

using namespace std;

int n, A[M], L[M], R[M], Fac[M], QL[M], QR[M], Nw[M];

int isq2[M];

vector <int> arrg;

void GG() {
    puts("0");
    exit(0);
}

int main() {
    scanf("%d", &n);
    for(int i = 0; i <= n; i++) Fac[i] = !i ? 1 : (long long) Fac[i - 1] * i % P;
    for(int i = 1; i <= n; i++) scanf("%d", &A[i]);
    int fir1 = 1;
    while(fir1 <= n && A[fir1] == 1) fir1++;
    if(fir1 > n) return printf("%d\n", Fac[n]), 0; else {
        int ff = fir1;
        while(fir1 <= n && A[fir1] != 1) fir1++;
        if(fir1 > n) {
            if(ff == 1) GG();
            else fir1 = 1;
        }
    }
    for(int i = 1; i < fir1; i++) A[i + n] = A[i];
    for(int i = 1; i <= n; i++) A[i] = A[i + fir1 - 1];
    for(int i = 1; i <= n; i++) {
        if(A[i] != A[i - 1]) {
            if(L[A[i]]) GG();
            L[A[i]] = i;
            R[A[i - 1]] = i - 1;
        }
    }
    R[A[n]] = n;
    arrg.clear();
    arrg.push_back(R[1]);
    A[n + 1] = 1;
    QL[1] = (QR[1] = R[1]);
    for(int i = 2; i <= n; i++) {
        if(!L[i]) {
            isq2[(int) arrg.size() - 1]++;
            continue;
        }
        if(R[i] - L[i] > R[1] - L[1]) GG();
        bool b1 = A[L[i] - 1] < i, b2 = A[R[i] + 1] < i;
        if(!b1 && !b2) {
            if(R[i] - L[i] != R[1] - L[1]) GG();
            QL[i] = (QR[i] = R[i]);
        } else if(!b1 && b2) {
            QL[i] = (QR[i] = L[i] + R[1] - L[1]);
        } else if(b1 && !b2) {
            QL[i] = (QR[i] = R[i]);
        } else {
            QL[i] = R[i];
            QR[i] = L[i] + R[1] - L[1];
        }
        for(int j = (b1 ? L[i] : L[i] + R[1] - L[1]); j <= (b2 ? R[i] + R[1] - L[1] : R[i]); j++)
            arrg.push_back((j - 1) % n + 1);
    }
    long long ans = 1;
    for(int i = 1; i <= n; i++) if(QL[i]) {
        int nw = 0;
        for(int j = QL[i]; j <= QR[i]; j++)
            if(!Nw[(j - 1) % n + 1]) nw++;
        if(!nw) GG();
        ans = (long long) ans * nw % P;
        for(int j = QL[i]; j <= QR[i]; j++)
            if(!Nw[(j - 1) % n + 1]) {
                Nw[(j - 1) % n + 1] = 1;
                break;
            }
    }
    assert(arrg.size() == n);
    int nw = 0;
    for(int i = 0; i < n; i++) {
        if(!Nw[arrg[i]]) nw++;
        while(isq2[i]--) ans = ((long long) ans * nw--) % P;
    }
    printf("%lld\n", (ans % P + P) % P);
    return 0;
}


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

int main() {
  int h1, m1, h2, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  int oki = (h2 * 60 + m2) - (h1 * 60 + m1);
  cout << oki - k << endl;
  return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;

int main() {
  vector<int> maximum(5);
  vector<int> minimum(5);
  rep(i, 5) {
    cin >> minimum[i];
    if(minimum[i] % 10 == 0) maximum[i] = minimum[i];
    else maximum[i] =((minimum[i] / 10) + 1)*10;
  }
  int cmp = -1;
  int sum = 0;
  rep(i, 5) {
    sum += maximum[i];
    int tmp = abs(maximum[i] - minimum[i]);
    if(tmp >cmp) {
      cmp = tmp;
    }
  }
  int ans = sum - cmp;
  cout << ans << endl;
}
  

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
int a;
int main(){
    cin>>a;
    switch(a){
        case 19:cout<<"Yes";break;
        case 29:cout<<"Yes";break;
        case 39:cout<<"Yes";break;
        case 49:cout<<"Yes";break;
        case 59:cout<<"Yes";break;
        case 69:cout<<"Yes";break;
        case 79:cout<<"Yes";break;
        case 89:cout<<"Yes";break;
        case 90:cout<<"Yes";break;
        case 91:cout<<"Yes";break;
        case 92:cout<<"Yes";break;
        case 93:cout<<"Yes";break;
        case 94:cout<<"Yes";break;
        case 95:cout<<"Yes";break;
        case 96:cout<<"Yes";break;
        case 97:cout<<"Yes";break;
        case 98:cout<<"Yes";break;
        case 99:cout<<"Yes";break;
        default:cout<<"No";break;
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
using ll = long long;

void print_ans(bool flag){
    if(flag){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }   
}

int main(){
    string a, b, c;
    cin >> a >> b >> c;
    print_ans(a[a.size()-1] == b[0] && b[b.size()-1] == c[0]);
    return 0;
}


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

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijo(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i <=n;i++){
    num*=yakusu[i];
  }
  return num;
}


//cout<<""<<endl;
int main(){
  int H,A;cin>>H>>A;
  cout<< (H+A-1)/A<<endl;
 
}





Measured memory_bytes: 256
M=10**9+7
n,s=open(0)
n=int(n)
a=s[0]<'W'>s[-2]
while n:a=a*n%M;n-=1
l=1
r=f=0
for b,c in zip(s,s[1:-1]):f^=b==c;a=a*(l-r)**f%M;r+=f;l+=f^1
print(a*(l==r))

Measured memory_bytes: 3512
using System;


public class hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        var dp = new long[n , 21];
        for (int i = 0; i < n ; i++)
            for (int j = 0; j < 21; j++) dp[i, j] = -1;
        for (int i = 0; i < 21; i++) dp[0, i] = 0;
        dp[0, a[0]] = 1;
        for (int k = 0; k <= n-2; k++)
        {
            for (int B = 0; B <= 20; B++)
            {
                dp[k + 1, B] = DP(dp, k, B - a[k + 1]) + DP(dp, k, B + a[k + 1]);
            }
        }
        Console.WriteLine(dp[n - 2, a[n - 1]]);
    }
    public static long DP (long[,] dp ,int k , int B)
    {
        if (B < 0 | B > 20) return 0;
        return dp[k, B];
    }

}

Measured memory_bytes: 9216
#include<iostream>
using namespace std;
int main(){
	cin.tie(0);
    ios::sync_with_stdio(false);
	int n;
	cin>>n;
	if(n==1)cout<<"Hello World";
	else{
		int a,b;
		cin>>a>>b;
		cout<<a+b;
	}
	return 0;
}


Measured memory_bytes: 256
import sys, itertools, fractions, math, collections, heapq
sys.setrecursionlimit(10**7)
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

a, b = LI()
ans = 0
total = 1
while total < b:
    total += a-1
    ans+=1
print(ans)

Measured memory_bytes: 5668
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

int a,b,c,N,state[302],aa[1002],bb[1002],cc[1002],r[1002];

void solve() {
  rep(i,a+b+c) state[i] = 2;
  rep(i,N) cin>>aa[i]>>bb[i]>>cc[i]>>r[i];
  rep(i,N) { aa[i]--; bb[i]--; cc[i]--; }
  rep(i,N) {
    if(r[i]) {
      state[aa[i]] = state[bb[i]] = state[cc[i]] = 1;
    }
  }
  rep(i,N) {
    if(!r[i]) {
      if(state[aa[i]] == 1 && state[bb[i]] == 1) state[cc[i]] = 0;
      else if(state[aa[i]] == 1 && state[cc[i]] == 1) state[bb[i]] = 0;
      else if(state[bb[i]] == 1 && state[cc[i]] == 1) state[aa[i]] = 0;
    }
  }
  rep(i,a+b+c) cout<<state[i]<<endl;
}

int main() {
  while (cin>>a>>b>>c,a) {
    cin>>N;
    solve();
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<stdbool.h>
using namespace std;
int main(){
    long long int X,p;
    cin >> X;
    p = 0;
    for (long long int i = 0;;i++){
    bool isPrime = true;
        for (long long int j = 2; j <= (X+i) / 2; ++j) {
        if ((X+i) % j == 0) {
        isPrime = false;
        break;
        }
        }
    if(!isPrime){
        p = p+1;
    }
    else break;
    }
    cout << X + p;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c, k; cin >> a >> b >> c >> k;
  if(a < b) swap(a, b);
  if(a < c) swap(a, c);
  int ans = (a<<k) + b + c;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
N=int(input())
SN=[input() for _ in range(N)]
M=int(input())
TM=[input() for _ in range(M)]

SNdict={}
TMdict={}

for name in SN:
    if name in SNdict.keys():
        SNdict[name]+=1
    else:
        SNdict[name]=1
for name in TM:
    if name in TMdict.keys():
        TMdict[name]+=1
    else:
        TMdict[name]=1
       
ret=0
for name in SNdict:
    tmp=0
    if name in TMdict.keys():
        tmp=TMdict[name]
    tmp=SNdict[name]-tmp
    ret=max(ret,tmp)
print(ret)


Measured memory_bytes: 3064
// WIP

#include <bits/stdc++.h>
using namespace std;

// Utility
#define ALL(X) (X).begin(), (X).end()
#define FOR(I, X, Y) for (int I = (X); I < (Y); I++)
using ll = int64_t;
using ull = uint64_t;
template<typename T> struct is_container {
template<typename C> static char test(typename C::const_iterator*); template<typename> static int test(...);
static bool const value = sizeof(test<T>(nullptr)) == sizeof(char) && !std::is_same<std::string, T>::value;
};
namespace std {
template<class ...Ts>        istream& operator>>(istream& i, tuple<Ts...>& x) { apply([&](auto&&... ys){ ((i >> ys), ...); }, x); return i; }
template<class T1, class T2> istream& operator>>(istream& i, pair<T1, T2>& x) { i >> x.first >> x.second; return i; }
template<class T, enable_if_t<is_container<T>::value, int> = 0>
istream& operator>>(istream& i, T& x) { for (auto& y : x) { i >> y; } return i; }
}

// Debugging
#ifndef DEBUG
#define DEBUG 0
#endif
#define dbg(X) do { if (DEBUG) { cout << #X ": " << (X) << endl << flush; } } while (0)
#define dbg2(X) do { if (DEBUG) { cout << #X ":" << endl; for (auto& __x : (X)) { cout << __x << endl << flush; } } } while (0)
#define dbgv(...) do { if (DEBUG) { cout << "(" #__VA_ARGS__ "): " << make_tuple(__VA_ARGS__) << endl << flush; } } while (0)
namespace std {
template<class ...Ts>        ostream& operator<<(ostream& o, const tuple<Ts...>& x) { o << "("; apply([&](auto&& y, auto&&... ys){ o << y; ((o << ", " << ys), ...); }, x); o << ")"; return o; }
template<class T1, class T2> ostream& operator<<(ostream& o, const pair<T1, T2>& x) { o << tie(x.first, x.second); return o; }
template<class T, enable_if_t<is_container<T>::value, int> = 0>
ostream& operator<<(ostream& o, const T& x) { o << "{"; for (auto it = x.begin(); it != x.end(); it++) { if (it != x.begin()) { o << ", "; } o << *it; } o << "}"; return o; }
}

// Main
void mainCase() {
  string s;
  cin >> s;
  int n = s.size(); // <= 10^6
  const int m = 2019; // gcd(m, 10) = 1

  vector<int> ls(n + 1);
  reverse(ALL(s));
  int d = 1;
  FOR(i, 0, n) {
    ls[i + 1] = (ls[i] + d * (s[i] - '0')) % m;
    d = (d * 10) % m;
  }
  dbg(ls);

  map<int, int> cnts;
  for (auto x : ls) { cnts[x]++; }

  ll res = 0;
  FOR(i, 0, n) {
    cnts[ls[i]]--;
    res += cnts[ls[i]];
  }
  cout << res << endl;
}

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);
  mainCase();
  return 0;
}

/*
python misc/run.py atcoder/abc164/d/main.cpp --check

%%%% begin
1817181712114
%%%%
3
%%%% end
*/


Measured memory_bytes: 4288
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define fr(i,c) for(__typeof(c.begin()) i=c.begin();i!=c.end();i++)
#define pb push_back
#define mp make_pair
#define all(c) c.begin(),c.end()
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;
const int inf=(int)1e9;
const double EPS=1e-9, INF=1e12;

int n,m,a[100],b[100];
double dp[1<<14],p;
int main(){
	cin>>n>>m>>p;
	p/=100;
	rep(i,m)cin>>a[i]>>b[i], a[i]--, b[i]--;
	
	rep(i,1<<n)if(i){
		int l=0;
		for(;!(l&i);l++);
		dp[i]=1;
		for(int s=i;s;s=s-1&i){
			if(s==i||!(s&l))continue;
			double tmp=dp[s];
			rep(j,m)if((i&1<<a[j])&&(i&1<<b[j])&&(s>>a[j]&1)!=(s>>b[j]&1))tmp*=p;
			dp[i]-=tmp;
		}
	}
	printf("%.12f\n",dp[(1<<n)-1]);
	return 0;
}

Measured memory_bytes: 1048
#include <bits/stdc++.h>
#define lli long long int 
#define N 2e5 + 5
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

int n,k;

int main(){
	IOS;
cin>>n>>k;
vector<int> vis(n+1,0);
for(int i=0;i<k;i++)
{
	int d;
	cin>>d;
	for(int j=0;j<d;j++){
		int s;
		cin>>s;
		if(!vis[s])
		vis[s]=1;
	}
	
}
int c=0;

	for(int i=1;i<n+1;i++){
		if(!vis[i])
		c++;
	}
	cout<<c;




}
	


Measured memory_bytes: 3608