akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

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;}

const ll mod=1e9+7;

struct LazySegmentTree{
private:
    ll n;
    vector<ll> node, lazy;
public:
    LazySegmentTree(vector<ll> v){
        ll sz=(ll)v.size();
        n=1;
        while(n<sz) n*=2;
        node.resize(2*n-1);
        lazy.resize(2*n-1,0);
        rep(i,sz) node[i+n-1]=v[i];
        for(ll i=n-2;i>=0;i--) node[i]=node[2*i+1]+node[2*i+2];
    }
    void eval(ll k,ll l,ll r){
        if(lazy[k]!=0){
            node[k]+=lazy[k];
            if(r-l>1){
                lazy[2*k+1]+=lazy[k]/2;
                lazy[2*k+2]+=lazy[k]/2;
            }
            lazy[k]=0;
        }
    }
    void add(ll a,ll b,ll x,ll k=0,ll l=0,ll r=-1){
        if(r<0) r=n;
        eval(k,l,r);
        if(b<=l || r<=a) return;
        if(a<=l && r<=b){
            lazy[k]+=(r-l)*x;
            eval(k,l,r);
        }
        else{
            add(a,b,x,2*k+1,l,(l+r)/2);
            add(a,b,x,2*k+2,(l+r)/2,r);
            node[k]=node[2*k+1]+node[2*k+2];
        }
    }
    ll getsum(ll a,ll b,ll k=0,ll l=0,ll r=-1){
        if(r<0) r=n;
        if(b<=l || r<=a) return 0;
        eval(k,l,r);
        if(a<=l && r<=b) return node[k];
        ll vl=getsum(a,b,2*k+1,l,(l+r)/2);
        ll vr=getsum(a,b,2*k+2,(l+r)/2,r);
        return vl+vr;
    }
};

int main()
{
    ll n,d,a;
    cin >> n >> d >> a;
    vector<pll> x(n);
    LazySegmentTree seg=LazySegmentTree(vector<ll>(n+1));
    rep(i,n){
        cin >> x[i].fi >> x[i].se;
    }
    sort(x.begin(),x.end());
    vector<ll> xx(n);
    
    rep(i,n){
        xx[i]=x[i].fi;
        seg.add(i,i+1,x[i].se);
    }
    ll ans=0;
    rep(i,n){
        if(seg.getsum(i,i+1)<=0) continue;
        auto it=upper_bound(xx.begin(),xx.end(),xx[i]+2*d)-xx.begin();
        ll val=seg.getsum(i,i+1);
        ll times=(val-1)/a+1;
        seg.add(i,it,-times*a);
        ans+=times;
    }
    cout << ans << endl;
    return 0;
} 


Measured memory_bytes: 13184
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    p,q,r = LI()
    print(p+q+r-max(p,q,r))
    return

#B
def B():
    n = I()
    w = LI()
    ans = float("inf")
    for i in range(n):
        m = sum(w[:i])
        l = sum(w[i:])
        ans = min(ans,abs(m-l))
    print(ans)
    return

#C
def C():
    n,m = LI()
    f = defaultdict(lambda : 1)
    for i in range(m):
        a = I()
        f[a] = 0
    dp = defaultdict(lambda : 0)
    dp[0] = 1

    for i in range(1,n+1):
        if f[i]:
            dp[i] = dp[i-1]+dp[i-2]
            dp[i] %= mod
        else:
            dp[i] = 0
    print(dp[n])
    return

#D
def D():
    h,w = LI()
    s = SR(h)

    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    C()


Measured memory_bytes: 28116
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
vector<int> c(26);
vector<vector<int>> s(365, vector<int>(26, 0));
vector<int> last(26, -1);
vector<int> t(365, -1);
int d;
inline int scoreing() {
    int res = 0;
    vector<int> tmp_last(26, -1);
    for(int i = 0; i < d; i++) {
        tmp_last[t[i]] = i;
        res += s[i][t[i]];
        for(int j = 0; j < 26; j++) {
            res -= c[j] * (i - tmp_last[j]);
        }
    }
    return res;
}
int main() {
    cin >> d;
    for(int i = 0; i < 26; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < d; i++) {
        for(int j = 0; j < 26; j++) {
            cin >> s[i][j];
        }
    }
    int score = 0;
    for(int i = 0; i < d; i++) {
        for(int j = 0; j < 26; j++) {
            score -= c[j] * (i - last[j]);
        }
        int ind = -1;
        int tmp = score;
        for(int k = 0; k < 26; k++) {
            if(tmp < score + s[i][k] + c[k] * (i - last[k])) {
                ind = k;
                tmp = score + s[i][k] + c[k] * (i - last[k]);
            }
        }
        t[i] = ind;
        last[t[i]] = i;
        score = tmp;
    }
    int max = 9000;
    int cnt = 0;
    std::mt19937 mt(0);
    while(cnt < max) {
        int rnd = mt() % d;
        // cout << ":" << rnd << endl;
        rnd = min(d - 1, rnd);
        int new_s = t[rnd];
        int now_sc = scoreing();
        for(int i = 0; i < 26; i++) {
            t[rnd] = i;
            if(now_sc < scoreing()) {
                now_sc = scoreing();
                new_s = i;
            }
        }
        t[rnd] = new_s;
        cnt++;
    }
    for(int i = 0; i < d; i++) {
        cout << t[i] + 1 << endl;
    }
}

Measured memory_bytes: 3656
import java.io.*;
import java.io.IOException;
import java.util.*;

@SuppressWarnings({"rawtypes", "unchecked"})
class Main {
    final static int INF = 1 << 28;
    final static long LNF = 1L << 60;
    final static double EPS = 1e-9;
    final static double GOLDEN_RATIO = (1.0 + Math.sqrt(5)) / 2.0;

    static final long MOD = 1_000_000_007;

    public static void main(String[] args) throws Exception {
        final MyScanner sc = new MyScanner();
        String S;
        S = sc.next();
        solve(S);
    }

    static void solve(String S){
        char[] a = S.toCharArray();
        int ans = 0;
        for (int i = 0; i < S.length() / 2; i++) {
            if(a[i]!= a[S.length() -1 - i]) ans++;
        }
        System.out.println(ans);
    }


    static class MyScanner {
 
        BufferedReader br;
        StringTokenizer st;
 
        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }
 
        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        String next() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }
 
        char nextChar() {
            return nn().charAt(0);
        }
 
        int nextInt() {
            return Integer.parseInt(nn());
        }
 
        long nextLong() {
            return Long.parseLong(nn());
        }
 
        double nextDouble() {
            return Double.parseDouble(nn());
        }
 
        Integer[] niArr0(int n) {
            Integer[] ar = new Integer[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Integer[] niArr1(int n) {
            Integer[] ar = new Integer[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }
 
        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
 
        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nextLong();
            }
            return ar;
        }
    }

}


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

vector<vector<pair<int,int> > >adj;

int loda1[10][10],loda2[10][10];

int parent[100005];
vector<pair<int,int> >temp;

signed main()
{
 
ios_base::sync_with_stdio(false);
cin.tie(NULL);  
cout.tie(0);   
 
 
#ifndef ONLINE_JUDGE
    if(fopen("INPUT.txt","r"))
    {
    freopen ("INPUT.txt" , "r" , stdin);
    freopen ("OUTPUT.txt" , "w" , stdout);
    }
#endif    

    string a;
    cin>>a;
    int n=a.length();

    a="#"+a;
    if(a[1]!='1'||a[n]=='1')
    {
        cout<<-1;
        return 0;
    }
    for(int i=1;i<=n/2;i++)
    {
        if(a[i]!=a[n-i])
        {
            cout<<-1;
            return 0;
        }
    }

    int x=1;
    parent[x]=1;

    for(int i=2;i<=n;i++)
    {
        if(a[i]=='1')
        {
            temp.push_back({parent[x],i});
            parent[i]=i;
            for(int j=x+1;j<i;j++)
            {
                parent[j]=i;
                temp.push_back({i,j});                
            }
            x=i;
        }        
    }
    for(int i=x+1;i<=n;i++)
    {
        temp.push_back({parent[x],i});
    }
    for(auto i:temp)
        cout<<i.first<<" "<<i.second<<'\n';
    
}

Measured memory_bytes: 5932
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int N = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		char[] s = sc.next().toCharArray();
		sc.close();
		s[5] = ' ';
		s[5+1+7] = ' ';
		out.println(new String(s));
	}
}


Measured memory_bytes: 23124
#include<iostream>
using namespace std;
int main()
{
  int a[3];
  int i;
  for(i=1;i<4;i++)
  {
    cin>>a[i];
  }
  int c1=0;
  int c2=0;
  for(i=1;i<4;i++)
  {
    if(a[i]==5)
    {
      c1++;
    } 
  }
    for(i=1;i<4;i++)
  {
    if(a[i]==7)
    {
      c2++;
    } 
  }
  if(c1==2&&c2==1)
  {
    cout<<"YES"<<endl;
  }
  else
  {
    cout<<"NO"<<endl;
  }
} 

Measured memory_bytes: 256
#include<bits/stdc++.h> 
using namespace std;
int main() 
{ 

 long long n,flag=0;
 cin>>n;
 while(n!=0)
 {
 	int temp=n%10;
 	if(temp==7)
 	{
 		flag=1;
 		break;
	 }
	 n/=10;
 }
 if(flag==1)
 cout<<"Yes\n";
 else
 cout<<"No\n";

}

Measured memory_bytes: 3620
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<string>
#include<cmath>
#include<queue>
#include<vector>
#include<sstream>
#include<algorithm>
#include<stack>
#include<bitset>
#include<map>
#include<unordered_map>
#include<set>
#define rep(i,n) for(int i=0;(i)<(n);i++)
#define rep1(i,n) for(int i=1;(i)<=(n);i++)
#define mst(a,b) memset(a,b,sizeof(a))
#define scd(a) scanf("%d",&a)
#define scdd(a,b) scanf("%d%d",&a,&b)
#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define dbg(a) cout<<"* "<< #a <<" : "<<a<<endl
#define fr first
#define se second
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ls x<<1
#define rs x<<1|1
#define lowbit(x) x&(-x)
#define ac cout<<ans<<endl
//#define DEBUG 0
using namespace std;
const double pi=acos(-1.0);
const double eps=1e-6;
const ull hashp=1e7+19;
const ll INF=0x3f3f3f3f3f3f3f3fll;
const int inf=0x3f3f3f3f;
const int mod=1e9+7;
const int maxn=1e5+100;

void solve()
{
	double a,b,x;
	cin>>a>>b>>x;
	if(x<=a*a*b/2){
		printf("%.10f\n",(double)90.0-atan((x*2)/(a*b*b))*180.0/pi);
	}
	else {
		printf("%.10f\n",(double)90.0-atan((a*a*a)/(2*a*a*b-2*x))*180.0/pi);
	}
}
int main(){
    //IOS;
    solve();
    return 0;
}


Measured memory_bytes: 256
/*input
6 3
2 1
2 3
4 1
4 2
6 1
2 6
4 6
6 5

*/

#include <iostream>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <cassert>
#include <algorithm>
#include <cstdlib>
#include <numeric>
#include <utility>
#include <tuple>
#include <climits>
#include <fstream>
#include <bitset>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <random>
#include <chrono>
#include <ios>
#include <iomanip>
#include <functional>
#include <array>

using namespace std;

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FORA(i, a) for (auto &i : a)
#define FORB(i, a, b) for (int i = a; i >= b; --i)
#define SZ(a) ((int) a.size())
#define ALL(a) begin(a), end(a)

typedef int64_t ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define fi first
#define se second

// start of code

const int MAXN = 1e5 + 7;
int N, M;
vector<int> G[MAXN], G2[MAXN];
int par[MAXN], order[MAXN], cnt = 0;
bool notRoot[MAXN], vis[MAXN];

void dfs(int u)
{
	for (int v : G[u]) {
		if (!vis[v]) {
			vis[v] = 1;
			dfs(v);
		}
	}
	order[u] = ++cnt;
	// cout << u << ": " << W[u] << endl;
}

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

	cin >> N >> M;
	M += N - 1;
	FOR(i, 0, M - 1) {
		int u, v;
		cin >> u >> v;
		G[u].push_back(v);
		G2[v].push_back(u);
		notRoot[v] = 1;
	}

	int root = 1;
	while (notRoot[root]) ++root;
	assert(G2[root].empty());
	assert(root <= N);

	vis[root] = 1;
	dfs(root);

	FOR(u, 1, N) {
		cout << (u == root ? 0 : *min_element(ALL(G2[u]), [&](int i, int j) { return order[i] < order[j]; })) << '\n';
	}

	return 0;
}


Measured memory_bytes: 15488
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Matrix;
static const int INF = 2000000000;



int main(){
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
struct nd{
  int key;
  struct nd *parent,*right,*left;
} ;


struct nd *root,*nil;

struct nd *find(struct nd *n,int z){
  while(n != nil && z != n->key){
    if(z < n->key){
      n = n->left;
    }
    else{
      n = n->right;
    }
  }
  return n;
}

  

void insert(int z){
  struct nd *x,*y;
  struct nd *n;
  y=nil;
  x=root;
  
  n=(struct nd *)malloc(sizeof(struct nd));
  n->key=z;
  n->left=nil;
  n->right=nil;
  
  while(x!=nil){
    y=x;
    if(n->key<x->key){
      x=x->left;
    }
    else{
      x=x->right;
    }
  }
  n->parent=y;
  if(y==nil){
    root=n;
  }
  else{
    if(n->key<y->key){
      y->left=n;
    }
    else {
      y->right=n;
    }
  }
}

void pri1(struct nd *n){
  if(n==nil){
    return ;
  }
  pri1(n->left);
  printf(" %d",n->key);
  pri1(n->right);
}

void pri2(struct nd *n){
  if(n==nil){
    return ;
  }
  printf(" %d",n->key);
  pri2(n->left);
  pri2(n->right);
}


    
int main(){
  int kazu,key;
  char cmd[20];
  int i,k,j;
  scanf("%d",&kazu);
  for(i=0;i<kazu;i++){
    scanf("%s",cmd);
    scanf("%d",&key);
    if(cmd[0]=='i'){
      insert(key);
    }
    else if(cmd[0]=='p'){
      pri1(root);
      printf("\n");
      pri2(root);
      printf("\n");
    }
    else if(cmd[0]=='f'){
      struct nd *tai=find(root,key);
      if(tai!=nil){
	printf("yes\n");
      }
      else{
	printf("no\n");
      }
    }
  }
  
  return 0;
}



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

using namespace std;

int main()
{
    int n;
    cin>>n;
    int a[n];
    int count[n+1]={0};
    for(int i=1;i<n;i++)cin>>a[i];
    for(int i=1;i<n;i++){
      count[a[i]]++;
    }for(int i=1;i<=n;i++){
        cout<<count[i]<<'\n';}

    return 0;
}


Measured memory_bytes: 5152
import java.util.*;
public class Main{
  	public static int gcd(int a,int b){
      return b==0?a:gcd(b,a%b);
    }
	public static void main(String args[]){
    	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int ar[]=new int[n];
        ar[0]=sc.nextInt();
        int ans=ar[0];
        for(int i=1;i<n;i++){
          ar[i]=sc.nextInt();
          ans=gcd(ans,ar[i]);
        }
      System.out.println(ans);
    }
}

Measured memory_bytes: 50856
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <cassert>
#include <string>
#include <memory.h>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cctype>
#include <iomanip>
#include <sstream>
#include <cctype>
#include <fstream>
#include <cmath>
using namespace std;

#define REP2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define REP(i, n) REP2(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
#define ITER(c) __typeof((c).begin())
#define PB(e) push_back(e)
#define FOREACH(i, c) for(ITER(c) i = (c).begin(); i != (c).end(); ++i)
#define MP(a, b) make_pair(a, b)
#define PARITY(n) ((n) & 1)

typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1000 * 1000 * 1000 + 7;
const double EPS = 1e-10;

bool exp(const string &str, size_t &cur, map<char, bool> &J){
  char ch = str[cur++];
  if(ch == 'T' || ch == 'F'){
    return ch == 'T';
  }
  
  if(isalpha(ch)){
    return J[ch];
  }

  
  if(ch == '-'){
    return !exp(str, cur, J);
  }

  assert(ch == '(');
  bool b1 = exp(str, cur, J);
  char op = str[cur++];
  if(op == '-') cur++;
  bool b2 = exp(str, cur, J);
  if(op == '*') b1 = b1 && b2;
  if(op == '+') b1 = b1 || b2;
  if(op == '-') b1 = !b1 || b2;
  cur++;
  return b1;
  return b1;
}

bool eval(string str, map<char, bool> &J){
  size_t cur = 0;
  return exp(str, cur, J);
}

int main(){
  string str;
  while(cin >> str && str != "#"){
    int ind = str.find("=");
    string str1 = str.substr(0, ind);
    string str2 = str.substr(ind + 1);

    bool valid = true;
    REP(mask, 1 << 12){
      map<char, bool> J;
      REP(j, 12) J['a' + j] = PARITY(mask >> j);
      valid &= eval(str1, J) == eval(str2, J);
    }
    cout << (valid ? "YES" : "NO") << endl;
  }
  return 0;
}

Measured memory_bytes: 1268
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>
#include <bitset>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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;}

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  int N; cin >> N;
  string S; cin >> S;
  string mae = S.substr(0, N), ushiro = S.substr(N, N);

  map<pair<string, string>, int> L, R;
  for (int bit = 0; bit < (1<<N); bit++){
    string a, b;
    for (int i = 0; i < N; ++i){
      if (bit & (1<<i)) a += mae[i];
      else b += mae[i];
    }
    L[{a, b}]++;
  }
  ll ans = 0;
  for (int bit = 0; bit < (1<<N); bit++){
    string a, b;
    for (int i = 0; i < N; ++i){
      if (bit & (1<<i)) a += ushiro[N - 1 - i];
      else b += ushiro[N - 1 - i];
    }
    ans += L[{a, b}];
  }
  cout << ans << endl;
}


Measured memory_bytes: 91904
//https://atcoder.jp/contests/abc122/tasks/abc122_d
#include<iostream>
#include<string.h>
using namespace std;
const long mod=1e9+7;
long N,memo[110][6][6][6][6];

//A=0,G=1,C=2,T=3
long judge(int now,int b3,int b2,int b1,int b){
  if(memo[now][b3][b2][b1][b]!=-1) return memo[now][b3][b2][b1][b];
  if(b3==0&&b2==1&&b==2) return 0;// AG?Cの場合
  if(b3==0&&b1==1&&b==2) return 0;// A?CGの場合
  if(b2==0&&b1==1&&b==2) return 0;// ?AGCの場合
  if(b2==0&&b1==2&&b==1) return 0;// ?ACGの場合
  if(b2==1&&b1==0&&b==2) return 0;// ?GACの場合
  if(now==N)return 1;
  //答えを再帰で求める
  long ans=0;
  for(int i=0;i<4;i++){
    ans+=judge(now+1,b2,b1,b,i);
  }
  return memo[now][b3][b2][b1][b]=ans%mod;
}
int main(){
  cin>>N;
  memset(memo,-1,sizeof(memo));
  cout<<judge(0,3,3,3,3)<<endl;
}


Measured memory_bytes: 1408
#include<iostream>
#include <string>
#include<vector>
#include<algorithm>
typedef long long ll;

using namespace std;
int main()
{
	int n;
	cin >> n;
	vector<int> as(3*n);
	for (int i = 0; i < 3 * n; i++) {
		cin >> as[i];
	}
	sort(as.begin(), as.end(), greater<int>());

	ll kotae=0;
	for (int i = 0; i < n; i++) {
		kotae += as[2 * i + 1];
	}
	cout << kotae;
	return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rREP(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    int res=0;
    rep(i,n) {
        int l,r;
        cin >> l >> r;
        res += r-l+1;
    }
    cout << res << endl;
}


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

int main(){
  int N,K,sum;
  cin>>N>>K;
  for(int i=0;i<N;i++){
    int p;
    cin>>p;
    //ロボットBが動くとき
    if(K-p<=p){
      sum+=(K-p)*2;
    }
    //ロボットAが動くとき
    else sum+=p*2;
  }
  cout<<sum<<endl;
}

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

#define ll long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;

ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        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;
}

ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
int main() {
    //COMint();
    string s=in<string>();
    int K=in();
    vector<string> substr;
    REP(i,s.length()){
        REP(j,K){
            if(i+j>=s.length())break;
            substr.push_back(s.substr(i,j+1));
            //debug(s.substr(i,j+1));
        }
    }
    sort(substr.begin(),substr.end());
    substr.erase(unique(substr.begin(),substr.end()),substr.end());
    print(substr[K-1]);


}

Measured memory_bytes: 1660
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

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


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

int main()
{
	int h, w;

	while (true){
		cin >> h >> w;

		if (!h && !w)
			break;

		for (int i = 0; i < h; i++){
			for (int j = 0; j < w; j++){

				if (((i + j) % 2) == 0)
					cout << "#";
				else
					cout << ".";
			}
			cout << endl;
		}
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
#define ll long long
#define umap unordered_map
using graph = vector<vector<int>>;
using graph2 = vector<vector<pair<int, int>>>;

ll mod(ll x, ll y){if(x>=0||x%y==0) return x%y;return y+x%y;} //mod including minus
ll dv0(ll x, ll y){if(x>=0||x%y==0)return x/y;return x/y-1;} //rnd down
ll dv1(ll x, ll y){if(x%y==0) return dv0(x,y);return dv0(x,y)+1;} //rnd up
ll M=1e9+7;
int quick_pow(int x,int p){
    int a=1,po=x;
    while(p){
        if(p&1)  a=1ll*a*po%M;
        po=1ll*po*po%M;p>>=1;
    }
    return a;
}
//Start from Here
int main(){
    int A, B, K;
    cin>>K>>A>>B;
    int x=A/K, y=B/K;
    if(x!=y){
        cout<<"OK"<<endl;
    }else if(A%K==0){
        cout<<"OK"<<endl;
    }else{
        cout<<"NG"<<endl;
    }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll int64_t
#define all(v) v.begin(), v.end()
#define bitrep(n) for(int bit=0;bit<(1<<n);bit++)

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

  if(N==1) cout << "Hello World" << endl;

  else if(N==2){
  int A,B;
  cin >> A >> B ;
    cout << A+B << endl;

  }
  
    

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
int main( void )
{
  int a,b,c,d,e,f;
  double x,y;
  while( 1 ){
    cin >> a >> b >> c >> d >> e >> f;
    if( cin.eof() ) break;
    x = (double)(c*e-b*f) / (a*e-b*d);
    y = (double)(a*f-c*d) / (a*e-b*d);
    if( x <= 0 && -0.0005 < x ) x = 0;
    if( y <= 0 && -0.0005 < y ) y = 0;
    printf( "%.3lf %.3lf\n", x, y );
  }
  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
#define ull unsigned long long
#define N 100005
#define mod 1000000007
#define boost ios_base::sync_with_stdio(false);cin.tie(0)
#define prec(n) fixed<<setprecision(n)

#define mii unordered_map<int,int>
#define mll unordered_map<ll,ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi  first

#define se second
#define pb push_back
#define mp make_pair
#define pp pop_back
#define vii vector<int>
#define vll vector<ll>
#define vpp vector<pii>
#define all(c) c.begin(),c.end()
#define tr(it,c) for(it = c.begin() ; it!=c.end() ; it++)
int inf = INT_MAX ;
ll modulo(ll num,ll MOD=mod){ return ((num%MOD)+MOD)%MOD;} // for negative integer
ll power(ll b,ll e,ll MOD=mod){ll ans=1; while(e){if(e%2) ans=(ans*b)%MOD; b=(b*b)%MOD; e/=2;} return ans;}
ll inv(ll num,ll MOD=mod){ return power(modulo(num),MOD-2,MOD); }
ll gcd(ll a,ll b){ return ((b==0) ? a:gcd(b,a%b));}

// int main(){
// 	boost;
//     string str;
//     cin>>str;
//     if(str[0]=='7'||str[1]=='7'||str[2]=='7')
//         cout<<"Yes";
//     else
//         cout<<"No";
// 	return 0;
// }

int main(){
	boost;
    int n;
    cin>>n;
    ll ans = 0;
    for(int i = 1;i<=n;i++){
        if(i%3!=0&&i%5!=0)
            ans = ans + i;
    }
    cout<<ans;
	return 0;
}

//Total solved problems:- 13


Measured memory_bytes: 3652
N, A, B = map(int, input().split())
S = list(input())

passed_foreigner = 0
passed_native = 0

for i in range(N):
    if S[i] == "a" and passed_foreigner + passed_native < A+B:
        print("Yes")
        passed_native += 1
    elif S[i] == "b" and passed_foreigner + passed_native < A+B and passed_foreigner < B:
        print("Yes")
        passed_foreigner += 1
    else:
        print("No")

Measured memory_bytes: 4708
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

void solve(){
  int ct = 0;
  int mx = INT_MIN;
  string str; cin>>str;
  for(int i = 0; i<str.length(); i++){
    if(str[i]=='R') ct++;
    else{
      mx = max(ct, mx);
      ct = 0;
    }
  }
  mx = max(ct, mx);
  cout<<mx<<endl;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	solve();
	return 0;
}


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

int main(){
  vector<int> sum;
  vector<string> truss;
  int a,b;
  while(cin>>a>>b) {
 sum.push_back(a+b);
  }
  for(int i=0;i<(int)sum.size();i++) { 
    truss.push_back(to_string(sum[i]));
  cout<<truss[i].size()<<endl;
  }
  return 0;
}



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

using namespace std;

#define MAX 200
#define INF INT_MAX
typedef pair<string,int> P;
typedef vector<string> Vec;

int N;
vector<P> vec;

int cost(Vec v){
  int res = 0;
  for(int i = 0 ; i < (int)v.size() ; i++){
    for(int j = 0 ; j < N ; j++){
      if(vec[j].first == v[i]){
        res += vec[j].second;
        break;
      }
    }
  }
  return res;
}

int main(){
  int M, K;

  while(cin >> N, N){
    map<string,Vec> mp;
    P in; 

    vec.clear();
    for(int i = 0 ; i < N ; i++){
      cin >> in.first >> in.second;
      vec.push_back(in);
    }

    string str, s, item;
    cin >> M;
    for(int i = 0 ; i < M ; i++){
      cin >> str >> K;
      for(int j = 0 ; j < K ; j++){
        cin >> s;
        mp[str].push_back(s);
      }
    }    

    map<string,Vec>::iterator it;
    for(int i = 0 ; i < 100 ; i++){
      for(it = mp.begin() ; it != mp.end() ; ++it){
        for(int j = 0 ; j < N ; j++){
          if(vec[j].first == it->first){
            vec[j].second = min(vec[j].second, cost(it->second));
          }
        }
      }
    }
    cin >> item;
    int ans = INF;
    for(int i = 0 ; i < N ; i++){
      if(vec[i].first == item){
        ans = vec[i].second;
        break;
      }
    }
  
    cout << ans << endl;
  }

  return 0;
}

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

int main()
{
    int n,m;
    int min=999999;
    int sum=0;
    int num1=0;
    int num[100];
    cin>>n>>m;
    for(int i=0;i<n;i++) {
        cin>>num[i];
        sum+=num[i];
        if(num[i]<min) min=num[i];
    }
    num1=n;
    num1+=(m-sum)/min;
    cout<<num1<<endl;
}


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;

#define PI (2*acos(0.0))
#define eps 1e-9
#define pb push_back
#define endl "\n"
#define watch(x) cout << (#x) << " is " << (x) << endl;
#define show(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi] << " "; cout << endl;
#define showpair(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi].first << " " << v[fi].second << endl;
#define ff first
#define ss second
#define fu cout << "lol" << endl;
#define precision(n) cout << fixed << setprecision(n);
#define lb lower_bound
#define up upper_bound
#define vscan for(i = 0;i<n;i++){cin>>in; v.pb(in);}
#define all(a) a.begin(), a.end()
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mem(a,val) memset(a,val,sizeof(a))
#define loop(i,n) for(i = 0; i < n; i++)
#define TC() ull T; cin>>T; while(T--)
#define IN(x) {scanf("%d",&x);}
#define LL(x) {scanf("%lld",&x);}
#define CC(x) {scanf("%c",&x);}
#define pfl(x) printf("%d\n",x)
#define pfll(x) printf("%lld\n",x)
#define newl puts("")
#define space printf(" ")
#define MOD 1000000007
#define speed ios_base::sync_with_stdio(false); cin.tie(NULL);


int main()
{
    int i = 0, j = 0, cs = 0, in;
    int n; cin>>n;
    int x = ceil(n/1000.0)*1000;
    cout << x-n << endl;
    return 0;
}


Measured memory_bytes: 3632
N = int(input())
x = ['']*N
u = ['']*N
ans = 0.0
for i in range(N):
    x[i], u[i] = input().split()
    if u[i] == 'JPY':
        ans += int(x[i])
    else:
        ans += float(x[i])*380000
print(ans)

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

int main(){
  string worm;
  int cost[60000];
  int count = 0;
  while(1) {
    if(count > 60000) break;
    count++;
    cin >> worm;
    if(worm[0] == '0') break;

    int ima[10];
    for(int i=0;i<worm.size();i++) {
      if(worm[i] == 'r') ima[i] = 0;
      else if(worm[i] =='b') ima[i] = 1;
      else ima[i] = 2;
    }

    int t = 1,m = worm.size();
    int deci = 0;
    // 3 to 10
    for(int i=0;i<m;i++) {
      deci += ima[m-1-i]*t;
      t *= 3;
    }

   
    for(int i=0;i<60000;i++) cost[i] = 1000000000;  
    cost[deci] = 0;

    queue <int> Q;
    Q.push(deci);

    int befo[2];
    int a;
    int ans = 1000000000;
    while(!Q.empty()) {
      a = Q.front();
      Q.pop();
      int b = a;
      //      cout << a << endl;
      for(int i =0;i<m;i++) {
	ima[m-1-i] = b%3;
	b/=3;
      }
      
      //      cout << "start";
      //for(int i=0;i<m;i++) cout << ima[i];
      //cout << endl;
    
      for(int j=0;j<m-1;j++) {
	if(ima[j] != ima[j+1]) break;
	if(j == m-2) ans = min(ans,cost[a]);
      }
      

      int flg[3] = {};
      for(int i=0;i<m-1;i++) {
	if(ima[i] != ima[i+1]) {
	  befo[0] = ima[i];
	  befo[1] = ima[i+1];
	  flg[ima[i]] = flg[ima[i+1]] = 1;
	  for(int j=0;j<3;j++) if(flg[j] == 0) ima[i] = ima[i+1] = j;
	  // for(int j=0;j<m;j++) cout << ima[j];
	  // cout << endl;
	  t = 1;
	  deci = 0;
	  // 3 to 10
	  for(int j=0;j<m;j++) {
	    deci += ima[m-1-j]*t;
	    t *= 3;
	  }

	  if(cost[deci]  > cost[a]+1 && ans > cost[a] +1 ) {
	    cost[deci] = cost[a]+1;
	    // cout << "deci ="<< deci << endl;
	    Q.push(deci);
	  }
	  ima[i] = befo[0];
	  ima[i+1] = befo[1];
	  flg[0] = flg[1] = flg[2] = 0;
	}
      }
    }
	



    if(ans == 1000000000) cout <<"NA" <<endl;
    else cout << ans << endl;


  }	
	return 0;
}

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

int main()
{
int n;cin>>n;
int a[n],b[n];
for(int i=0;i<n;i++)
	{cin>>a[i];b[i]=a[i];}
int nas[n];
sort(a,a+n);
int m1=a[n-1];
int m2=a[n-2];
for(int i=0;i<n;i++)
{
	if(b[i]==m1)
		nas[i]=m2;
	else nas[i]=m1;
}
for(int i=0;i<n;i++)
	cout<<nas[i]<<endl;
return 0;
}


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

int main() {
    int p,q,r;
    int a[3];
    cin >> p >> q >> r;
    a[0] = p;
    a[1] = q;
    a[2] = r;
    sort(a, a+3);
    cout << a[0] + a[1] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
int main() {
    // insert code here..
    int N, i;
    int *h, *r;
    cin >> N;
    h = new int[N];
    for(i=0; i<N; i++){
        cin >> h[i];
    }
    r = new int[N];
    for(i=0; i<N; i++){
        r[h[i]-1] = i+1;
    }
    for(i=0; i<N; i++){
        cout << r[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 1536
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int count = 0;
        for (char c : s.toCharArray()) {
            if (c == '1') count++;
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 22484
#include <iostream>

using namespace std;

long long h, w;
long long dy[] = {-1, 0, 1, 0};
long long dx[] = {0, -1, 0, 1};
char mp[405][405];
long long  color[405][405];
long long  count[405 * 405];
long long  cnt;

void dfs(long long y, long long x)
{
    if (mp[y][x] == '.') {
        count[cnt]++;
    }
    
    color[y][x] = cnt;

    for (long long i = 0; i < 4; i++) {
        long long ny = y + dy[i];
        long long nx = x + dx[i];

        if (ny >= 0 && ny < h &&
            nx >= 0 && nx < w &&
            mp[y][x] != mp[ny][nx] &&
            color[ny][nx] == 0) {
            dfs(ny, nx);
        }
    }

    return;
}

int main()
{
    long long ans = 0;

    cin >> h >> w;
    for (long long i = 0; i < h; i++) {
        for (long long j = 0; j < w; j++) {
            cin >> mp[i][j];
        }
    }

    for (long long i = 0; i < h; i++) {
        for (long long j = 0; j < w; j++) {
            if (color[i][j] == 0) {
                cnt++;
                dfs(i, j);
            }
        }
    }

    for (long long i = 0; i < h; i++) {
        for (long long j = 0; j < w; j++) {
            if (mp[i][j] == '#') {
                ans = ans + count[color[i][j]];
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 9216
#include<stdio.h>
int main(){
  
  int a,b,c,i,j;
  
  for(i=0;i<200;i++){
    if(scanf("%d %d",&a,&b)==EOF){
      break;
    }
    c=a+b;
    
    for(i=0;;i++){
      if(c<1){
	break;
      }
      c=c/10;
    }
    
    printf("%d\n",i);
  }
  
  return 0;
}

Measured memory_bytes: 600
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int N,T,S;
int A[3001];
int B[3001];

int dp[3001][3001];

int solve(int id,int time){
  if( id >= N ) return 0;
  if( time>=T ) return 0;
  if(dp[id][time]!=-1) return dp[id][time];
  int ret = max(solve(id,time+1),solve(id+1,time));
  if( !(time < S && S < time+B[id]) && time+B[id] <= T){
    ret = max(ret,solve(id+1,time+B[id])+A[id]);
  }
  return dp[id][time] = ret;
}

int main(){
  scanf("%d %d %d",&N,&T,&S);
  memset(dp,-1,sizeof(dp));
  for(int i=0;i<N;i++){
    scanf("%d %d",&A[i],&B[i]);
  }
  printf("%d\n",solve(0,0));
}

Measured memory_bytes: 36768
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    String[] s = new String[n];

    for (int i = 0; i < n; i++) {
      s[i] = sc.next();
    }

    Arrays.sort(s);

    for (int i = 0; i < n; i++) {
      System.out.print(s[i]);
    }

  }

}


Measured memory_bytes: 21588
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pi;
#define trace3(x, y, z) cerr << #x << ": " << x << ", " << #y < ": " << y << ", " << #z << ": " << z << endl;
#define all(v) v.begin(), v.end()

bool is_pal(string &s, int l, int r) {
	while(l < r) {
		if(s[l] != s[r]) {
			return 0;
		}
		l++;
		r--;
	}
	return 1;
}

int main() {
	double l;
	cin >> l;
	cout << fixed << setprecision(10) << l * l * l / 27 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1LL<<60;
const int inf = 1e5;
//typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
ll mo = 998244353;
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int main(){
  string s; ll k;
  cin >> s >> k;
  int d[s.size()];
  rep(i,0,s.size()){
    if((s[i]-'a')+k>=26 && s[i]!='a'){
      d[i] = 0;
      k -= 26 - (s[i]-'a');
    }else{
        d[i] = (s[i]-'a');
    }
  }
  if(k>0){
    d[s.size()-1] +=k;
    d[s.size()-1] %= 26;
  }
  char c[26];
  int i2=0;
  for(char i='a' ; i<='z' ; i++){
    c[i2] = i;
    i2++;
  }
  rep(i,0,s.size()){
    cout << c[d[i]];
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
#define debug(x) cerr << #x << ":" << x << endl

namespace atcoder {
	void judge_outer(bool judge_exp, string ok = "Yes", string ng = "No") {
		if (judge_exp) {
			cout << ok << endl;
		}
		else {
			cout << ng << endl;
		}
	}

	template<typename T>
	T ncr(T left, T right) {
		right = min(left - right, right);
		T ans = 1;
		for (T i = 1; i <= right; i++) {
			ans = ans * (left - right + i) / i;
		}
		return ans;
	}

	const int LIMIT = 1000000007;
	const int tenfive = 100000;


}

using namespace atcoder;


int main() {
	int ans = 0, m = 0;
	int stk,N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> stk;
		ans += stk;
		m = max(m, stk);
	}
	cout << ans - m / 2 << endl;
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func ceil(a, b int) int {
	var ans = a / b

	if a%b != 0 {
		ans++
	}

	return ans
}

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	fmt.Println(ceil(a+b, 2))
}


Measured memory_bytes: 512
A,B,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
info=[]
for i in range(m):
    x,y,c=map(int,input().split())
    info.append([x-1,y-1,c])
ans=min(a)+min(b)
for i in range(m):
    p=a[info[i][0]]+b[info[i][1]]-info[i][2]
    if p<ans:
        ans=p
print(ans)

Measured memory_bytes: 30764
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
            TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
         static long pow(long a , long b , long m){
             long res = 1;
             a%=m;
             while (b>0){
                 if ((b&1)==1)res*=a%m;
                 a = a*a%m;
                 b>>=1;
             }
             return res;
         }

         public void solve(int testNumber, InputReader in, PrintWriter out){
             String s = in.next();
             char c = s.charAt(0);
             c+=1;
             System.out.println(c);


         }

}

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt(){return  Integer.parseInt(next());}
        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}


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

int gcd(int a,int b){
  int r;
  /*
  int n=min(a,b);
  for(int d=n;d>0;d--){
    
    if(a%d==0 && b%d==0) 
      return d;
  }
  */
  if(a<b){
    swap(a,b);}
  while(b>0){
    r=a%b;
    a=b;
    b=r;
  }
  return a;
}

int main(){
  int a,b;

  cin >> a >> b;
  cout << gcd(a,b) << endl;

    return 0;
}

Measured memory_bytes: 1160
# こちらの方がやや高速
import math

N = int(input())

MOD = 10 ** 9 + 7

# 試し割り法(2以外の偶数は捨てる方法を追加)
def check_prime(n):
    flag = True

    # n:evenかつ2でないならば素数でない
    # n=1は素数でない,n=0も実装しやすいように入れておく
    if (n % 2 == 0 and n != 2) or n == 0 or n == 1:
        flag = False
        return(flag)

    # n:oddまたは2のときは考える
    else:
        # 2からrootnまでに約数は存在しうる
        for i in range(2, math.floor(math.sqrt(n))+1):
            if n % i == 0:
                flag = False
                break
        return(flag)

# N以下の素数を格納
prime = []
for i in range(N+1):
    if check_prime(i):
        prime.append(i)

M = len(prime)
cnt = [0]*M
for i in range(M):
    p = prime[i]
    while p <= N:
        cnt[i] += N // p
        p *= prime[i]

ans = 1
for i in range(M):
    ans *= cnt[i] + 1
    ans %= MOD
print(ans)

Measured memory_bytes: 3064
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n");
var TD=arr.shift().split(" ").map(Number);
var T=TD[0];
var D=TD[1];
var t=arr.shift().split(" ").map(Number);
var tA=t[0];
var tB=t[1];
var d=arr.shift().split(" ").map(Number);
var dA=d[0];
var dB=d[1];
var min=Infinity;
var i=0;
while(true){
   var vA=i*dA;
   if(vA>D)break;
   var j=0;
   while(true){
      var vB=j*dB;
      if(vA+vB>D)break;
      if(vA+vB!=0){
         var c=T-(tA * vA + tB * vB) / (vA + vB);
         min=Math.min(min,Math.abs(c));
      }
      j++;
   }
   i++;
}
console.log(min.toFixed(10));

Measured memory_bytes: 15564
//#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <utility>
#include <iomanip>

using namespace std;

#define ll long long

void solve()
{
    ll X, Y, Z;
    cin >> X >> Y >> Z;
    cout << Z << " " << X << " " << Y;

    return;
}

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


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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;
  
  vector<int> p(n), q(n);
  for (int i = 0; i < n; i++) cin >> p.at(i);
  for (int i = 0; i < n; i++) cin >> q.at(i);
  
  if (p > q) swap(p, q);
  
  int ans = 0;
  do {
    if (p == q) {
      break;
    }
    ans++;
  } while (next_permutation(p.begin(), p.end()));
  
  cout << ans << '\n';
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
	int W, H, x, y, r;
	std::cin >> W >> H >> x >> y >> r;

	if ((0 <= x - r && x + r <= W) && (0 <= y - r && y + r <= H))
	{
		std::cout << "Yes" << "\n";
	}
	else
	{
		std::cout << "No" << "\n";
	}
}

Measured memory_bytes: 3088
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


S = S()
num_w = S.count('W')
num_b = len(S) - num_w
left_w_pos = 0
ans = 0
for i, s in enumerate(S):
    if (s == 'W'):
        ans += (i-left_w_pos)
        left_w_pos += 1
print(ans)


Measured memory_bytes: 42700
//Nihal Mittal - nihal_47
//Strike First , Strike Hard , No Mercy !!

/**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀
⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀
⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀
⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀
⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀
⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀
⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀
⠀⠀⠀⣼⣿⣿⣿⣿⠀⡿⠭⠭⠭⠭⢿⠀⣿⢻⣿⣿⠃⠀⠀⠀
⠀⠀⠀⠙⠛⣿⢻⠹⣿⠐⠙⠛⠟⠉⢀⣴⡟⢿⣿⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡟⠀⠀⠻⣦⣤⣶⠾⠋⠀⠀⠁⡦⢄⢀⠀⠀⠀
⠀⠀⠀⠀⡠⠁⡇⠑⢄⠀⠀⠀⠀⠀⠀⠔⠀⠀⠁⠀⠀⠀⠉⠁
⠀⠔⠊⠁⠀⠀⣇⠀⠀⠀⠑⡤⠤⢎⠁⠀⠀⡘⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢢⠠⠀⡠⢆⠀⠀⡠⠙⢄⠀⡸⠀
**/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define in insert
#define se second
#define fi first
#define mod 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define all(v) (v).begin(),(v).end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define pii pair<ll,ll>
#define vi(x) vector<x>
#define maxn 100005
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace std;
using namespace __gnu_pbds;

signed main()
{
    fast;
  
    ll n,i,j;
    cin>>n;
    ll a[n+2];
    for(i=0;i<n;i++)
    {
    	ll x,y;
    	cin>>x>>y;
    	a[i] = (x == y);
    }
    for(i=2;i<n;i++)
    {
    	if(a[i]==a[i-1] and a[i]==a[i-2] and a[i] == 1)
    	{
    		cout<<"Yes";
    		return 0;
    	}
    }
    cout<<"No";
}

Measured memory_bytes: 3648