akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
using namespace std;

int main() {
    int H,W,a[3000],b[3000];
    int j=0;
    
	while(cin>>H>>W){
	    if(H==0 && W ==0){
	        break;
	    }

	char result;
	a[j] = H;
	b[j] = W;
	
    for(int k=0;k<a[j];k++){
      string ret = "";
      for(int i=0;i<b[j];i++) 
      if((i+k)%2 ==0 ){
      ret += "#";
      }
      else{
          ret += ".";
      }
      cout << ret << endl;

    }
    cout<<endl;
    j++;
	}
	return 0;
}


Measured memory_bytes: 3156
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int cnt = 0, mi = 1e9+1;
  long long sum = 0;
  for (int i = 0, a; i < N && cin >> a; i++) {
    if (a < 0) cnt++;
    mi = min(mi, abs(a));
    sum += abs(a);
  }
  cout << ((cnt % 2) ? sum - mi * 2 : sum) << "\n";
}

Measured memory_bytes: 256
arr = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
dict = {i : idx for idx, i in enumerate(arr)}
arr = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
s = input()
print(7-dict[s])


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
using namespace std;
//
bool ok=true;
struct edge{int from;int to;int cost;};
struct bellman{
	//
	int v,e;
	vector<edge> G;
	vector<int> D;
	//
	bellman(int n,int m){
		v=n;e=m;
		D.resize(v);
		fill(D.begin(),D.end(),1e9+7);
	}
	//
	void add_edge(int from,int to,int cost){
		G.push_back((edge){from,to,cost});
	}
	//
	vector<int> dist(int s){
		D[s]=0;
		for(int u=0;u<v;u++){
		    bool f=false;
			for(int i=0;i<e;i++){
				edge &e=G[i];
				if(D[e.from]!=1e9+7&&D[e.to]>D[e.from]+e.cost){
					D[e.to]=D[e.from]+e.cost;
					f=true;
					if(u==v-1){
					    ok=false;
					    break;
					}
				}
			}
			if(!ok){
			    break;
			}
			if(!f){
				break;
			}
		}
		return D;
	}
};
//
int main(){
	int V,E,r;
	cin>>V>>E>>r;
	bellman be(V,E);
	for(int i=0;i<E;i++){
		int s,t,d;
		cin>>s>>t>>d;
		be.add_edge(s,t,d);
	}
	vector<int> ans=be.dist(r);
	if(!ok){
	    cout<<"NEGATIVE CYCLE"<<endl;
	    return 0;
	}
	for(int i=0;i<V;i++){
	    if(ans[i]==1e9+7){
	        cout<<"INF"<<endl;
	    }else{
	        cout<<ans[i]<<endl;
	    }
	}
	return 0;
}


Measured memory_bytes: 3200
#include <stdio.h>

int main(){
  int n,k;
  scanf("%d%d",&n,&k);
  long num;
  long answer;
  num = (long)n/k;
  answer = num * num * num;
  if(k % 2 == 0){
    num = (long)(n + k/2) / k;
    answer += num * num * num;
  }
  printf("%ld\n",answer);
  return 0;
}

Measured memory_bytes: 128
# -*- coding: utf-8 -*-

#お店にあるベルは 3 種類で、それぞれ a円、 b円、 c円です。
#この 3 つのうち、異なる 2 つのベルを選んで買うときの、値段の合計の最小値を求めて下さい。

x = input().split()
#x = [700, 600, 780]

y =[int(x[0]), int(x[1]), int(x[2])]

z = sorted(y)

ans = z[0] + z[1]

print(ans)


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

pub fn read_stdin() -> String {
    let mut s = String::new();
    ::std::io::stdin().read_to_string(&mut s).unwrap();
    s
}

pub trait Parse {
    fn to<T>(&mut self) -> T
    where
        T: std::str::FromStr;
}

impl<'a> Parse for std::str::SplitWhitespace<'a> {
    fn to<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let word = self.next().unwrap();
        word.parse().ok().unwrap()
    }
}

fn factorization(x: u32) -> Vec<u32> {
    let mut base = x;
    let mut div = 2;
    let mut v = Vec::new();
    v.push(1);
    if x == 1 {
        return v;
    }

    let last = (base as f64).sqrt() as u32;
    while last >= div {
        if base % div == 0 {
            base /= div;
            v.push(div);
            continue;
        }
        div += 1;
    }
    if base != 1 {
        v.push(base);
    }
    v
}

fn group_by_same(v: Vec<u32>) -> Vec<Vec<u32>> {
    let mut groups = Vec::new();
    let mut group = Vec::new();
    group.push(v[0]);
    for i in 1..v.len() {
        if v[i - 1] != v[i] {
            groups.push(group);
            group = Vec::new();
        }
        group.push(v[i]);
    }
    if !group.is_empty() {
        groups.push(group);
    }
    groups
}

fn count_factor(x: u32) -> u32 {
    group_by_same(factorization(x))
        .into_iter()
        .filter(|v| v[0] != 1)
        .map(|v| v.len() as u32 + 1)
        .fold(1, |st, x| st * x)
}

fn main() {
    let source = read_stdin();
    let mut iter = source.split_whitespace();
    let n = iter.to::<u32>() + 1;
    println!(
        "{}",
        (1..n)
            .filter(|&x| x % 2 == 1)
            .filter(|&x| count_factor(x) == 8)
            .count()
    );
}

Measured memory_bytes: 4352
#include<cmath>
#include<ctime>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<set>
#include <cstdio>
using namespace std;
const int N = 1001;
char a[N][N];
int n, m;
int d[N * N][2];
int step[N * N];
int b[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
int main(){
    int l = 0,  r = 0;
    scanf("%d %d", &n, &m);
    for (int i = 1;i <=  n ; i ++)
        for (int j = 1; j <= m  ; j ++) {
            scanf(" %c", &a[i][j]);
            if (a[i][j] == '#')
                d[++ r][0] = i, d[r][1] = j;
        }
    while (l != r)
    {
        l ++;
        for (int i = 0; i < 4; i ++){
            int x = d[l][0] + b[i][0];
            int y = d[l][1] + b[i][1];
            if (0 < x && x <= n && 0 < y && y <= m && a[x][y] == '.')
            {
                a[x][y] = '#';
                step[++r] = step[l] + 1;
                d[r][0] = x;
                d[r][1] = y;
            }
        }
    }
    printf("%d\n", step[r]);
    return 0;
}

Measured memory_bytes: 12928
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)

int x[2][100];

int main(){
	int n;
	scanf("%d", &n);
	f(o, 0, 2)f(i, 0, n)scanf("%d", x[o] + i);
	f(i, 1, n)x[0][i] += x[0][i - 1];
	for (int i = n - 2; i >= 0; --i)x[1][i] += x[1][i + 1];
	int an = 0;
	f(i, 0, n)an = max(an, x[0][i] + x[1][i]);
	printf("%d\n", an);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pf push_front
#define fr first
#define sc second
#define r_0 return 0
#define ld long double

using namespace std;

    const ll N = 1e7;
    const ll mod = 1e9 + 7;
    const ld eps = 1e-9;



void solve(){
    ll a;
    cin >> a;
    cout << a + a * a + a * a * a;
}

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

/**

**/


Measured memory_bytes: 3644
#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>

using namespace std;

#define REP(i,n) for(int i=0;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define REV(v) reverse(v.begin(),v.end())

typedef long long ll;
typedef tuple<int,int,bool> Tb;


int atcoder(){
    //入力
    ll n;
    cin >> n;
    ll ans;
    
    //処理
    for(ll i=1 ; i*i<=n ; ++i){
        if(n%i==0) ans = n/i;
    }
    //出力
    
    cout << floor(log10(ans)+1) << ENT;
    return 0;
}

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


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!$BDs=P;~$K%3%a%s%H%"%&%H(B!!
#ifdef DEBUG_
#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

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

    template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int mod = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);
const long double PI = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899;
int dx[] = {0,0,-1,1};
int dy[] = {-1,1,0,0};


signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);
    string S; cin >> S;
    int len = S.length();
    int ans = INF;
    REP(i,26){
        VI a(len);
        int pre = 0;
        for(int j = len-1; j >= 0; j--){
            if(S[j]-'a' == i){
                a[j] = 0;
                pre = 0;
            }else{
                a[j] = pre+1;
                pre++;
            }
        }
        int MAX = 0;
        REP(j,len){
            chmax(MAX,a[j]);
        }
        chmin(ans,MAX);
    }
    cout << ans << endl;

}

Measured memory_bytes: 256
// Problem : B - Product Max
// Contest : AtCoder - AtCoder Beginner Contest 178
// URL : https://atcoder.jp/contests/abc178/tasks/abc178_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define ff         first
#define ss         second
#define endl       '\n'
#define pb         push_back
#define int        long long
#define vi         vector<int>
#define mii        map<int, int>
#define pii        pair<int, int>
#define all(x)     (x).begin(), (x).end()
#define fill(a,b)  memset(a, b, sizeof(a))
#define setbits(x) __builtin_popcountll(x)
#define rep(i,x,y) for(int i=(int)x; i<y; i++)
#define px(a)      for(auto x: a) cout<<x<<" "; cout<<'\n';
#define pxy(a,n)   rep(i,0,n) {px(a[i])};
/*_________________________________________________________*/

const long long MOD=1e9+7,N=1e5+5;
int solve()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	int ans=max({a*c,a*d,b*c,b*d});
	return ans;
}
int32_t main()
{	
	std::ios::sync_with_stdio(false); 
	cin.tie(NULL);
	cout.tie(NULL);
	int t=1; 
	//cin>>t;
	while(t--) 
	//solve();
	cout<<solve()<<endl;
	//cout<<(solve()?"YES":"NO")<<endl;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define ll long long int
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define rep(i,a,n)   for(int i=a;i<n;i++)
#define pb           push_back
#define ff           first
#define ss           second
#define lcm(a, b)    ((a)*((b)/gcd(a,b)))
#define all(v)       v.begin(),v.end()
#define rall(v)      v.rbegin(),v.rend()
#define Pi           2*acos(0.0)
#define pii          pair<int,int>
#define pll          pair<ll,ll>
#define mem(a,b)     memset(a, b, sizeof(a))
#define fill_(a,b)   fill(a,a+n,b);
using namespace std;

ll expo(ll a,ll b,ll m = mod){
	a%=mod;
	ll res = 1;
	while(b){
		if(b&1)
			res = (res*a)%m;
		a = (a*a)%m;
		b>>=1;
	}
	return res;
}
ll gcd(ll a,ll b){
	while(b>0){
		ll r = a%b;
		a = b; b = r;
	}
	return a;
}

int main()
{
	 
   boost
   
	int t=1;
	//cin>>t;
	while(t--)
	{
	    int n;
              cin>>n;
              double p[n+1];
              rep(i,1,n+1){
                  cin>>p[i];
              }
              double dp[n+1][n+1];
              dp[1][0] = 1-p[1];
              dp[1][1] = p[1];
              for(int i=2;i<=n;i++)
                  dp[i][0] = dp[i-1][0]*(1-p[i]);
              for(int i=2;i<=n;i++){
                  for(int j=1;j<=n;j++){
                      dp[i][j] = dp[i-1][j]*(1-p[i])+dp[i-1][j-1]*p[i];
                  }
              }
              double res = 0;
              for(int i=(n/2)+1;i<=n;i++)
              res+=dp[n][i];
              cout<<setprecision(10)<<fixed<<res<<"\n";
	}
    return 0;
}


Measured memory_bytes: 73980
#!/usr/bin/env python3

#import
import math
#import numpy as np
#= int(input())
#= input()
a, b, x= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
#= [list(map(int, input().split())) for _ in range(N)]
#= [int(input()) for _ in range(N)]
#= {i:[] for i in range(N)}

d = a * a * b

# 半分より多い
if x * 2 > d:
    x = d - x
    xx = 2 * x / (a * a * a)
    theta = math.atan(xx)
    print(theta * 180 / math.pi)

else:
    xx = 2 * x / (a * b * b)
    theta = math.atan(xx)
    print(90 - theta * 180 / math.pi)



Measured memory_bytes: 9276
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <map>
using namespace std;
int n,mx[2],pos[2],cd[2],p[2][100050];
int main() {
	scanf("%d",&n);
	int i,x,m=100000,j;
	for(i=1;i<=n;i++) scanf("%d",&x),p[i&1][x]++;
	for(i=1;i<=m;i++) {
		for(j=0;j<2;j++) {
			if(p[j][i]>mx[j]) cd[j]=mx[j],mx[j]=p[j][i],pos[j]=i;
			else if(p[j][i]>cd[j]) cd[j]=p[j][i];
		}
	}
	if(pos[0]!=pos[1])printf("%d\n",n-mx[0]-mx[1]);
	else printf("%d\n",n-max(mx[0]+cd[1],mx[1]+cd[0]));
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
#define pb push_back 
#define lb lower_bound 
#define lowbit(x) (x)&(-x)   
#define forup(i,a,b) for(int i=(a);i<=(b);i++)  
#define fordown(i,a,b) for(int i=(a);i>=(b);i--)  
#define maxn 1000005
#define INF 107000000 
#define mod 997
#define fir first
#define sec second
#define pii  pair<int,int> 
using namespace std;  
typedef long long ll;  
typedef unsigned long long ull;  
    
template<class T> inline  void read(T& num){   num = 0; bool f = true;char ch = getchar();   while(ch < '0' || ch > '9') { if(ch == '-') f = false;ch = getchar();}   while(ch >= '0' && ch <= '9') {num = num * 10 + ch - '0';ch = getchar();}   num = f ? num: -num;  } 
int out[100]; 
template<class T> inline
void write(T x,char ch){  if (x==0) {putchar('0'); putchar(ch); return;}  if (x<0) {putchar('-'); x=-x;} int num=0; while (x){ out[num++]=(x%10); x=x/10;} fordown(i,num-1,0) putchar(out[i]+'0'); putchar(ch); } 
/*========================================================*/
int n;
int fa[maxn];
map< pii,int> M,A;
multiset<int> S[maxn];
queue<pii> Q;
pii makep(int x,int y)
{ if(x>y) swap(x,y);  return pii(x,y);}
int getfa(int x)
{if(fa[x]==x) return x; return fa[x]=getfa(fa[x]);}
int main()
{  cin>>n;
   forup(i,1,n) fa[i]=i;
   forup(i,1,2*n-2)
   {  int x,y; read(x);read(y);
      pii z=makep(x,y);
      S[x].insert(y);S[y].insert(x);
      if((++M[z]>1)&&(!A.count(z))) {A[z]=1;  Q.push(z);}
   }	
  forup(k,1,n-1)
  {  int x,y;
     while(1)
      {  if(Q.empty()) return puts("NO"),0;
         x=getfa(Q.front().fir); y=getfa(Q.front().sec);Q.pop();
         if(x!=y)  break;
      }
   if(S[x].size()>S[y].size())  swap(x,y);
   fa[x]=y;
   for(multiset<int>::iterator i=S[x].begin();i!=S[x].end();i++)
   { int v=getfa(*i);
     if(v==y) continue;
     S[y].insert(v);S[v].insert(y);
     if((++M[makep(y,v)])>1&&(!A.count(makep(y,v))))
       {Q.push(makep(y,v)); A[makep(y,v)]=1;}
     S[v].erase(x);
   }
   S[y].erase(x);
   S[x].clear();
  }	
 puts("YES");	
	return 0;
}

Measured memory_bytes: 85120
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

int main() {
	string s, ans; cin >> s;
    ans = "yes";
    int ssize = s.size();
    for (int i = 0; i < ssize; i++)
    {
        char si = s[i];
        for (int j = 0; j < ssize; j++)
        {
            char sj = s[j];
            if (i!=j && si == sj)
            {
                ans = "no";
                break;
            }
        }
        if (ans != "yes")
        {
            break;
        }
    }
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import copy
import itertools
def main():
    n = int(input())
    m = []
    for i in range(n):
        a = int(input())
        am = []
        for j in range(a):
            am.append(tuple(map(int,input().split())))
        m.append(copy.deepcopy(am))
    it = itertools.product([0,1],repeat=n)
    ans = 0
    for i in it:
        flag = True
        for x in range(len(i)):
            if i[x] == 1:
                if not all([k==i[j-1] for j,k in m[x]]):
                    flag = False
                    break
        if flag:
            ans = max([ans,sum(i)])
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 45916
using Atcoder;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            Console.WriteLine(input[0] - input[1] + 1);
        }
    }
}

Measured memory_bytes: 13268
n = int(input())
import collections
d = collections.deque([])
for _ in range(n):
    s = input().split()
    if s[0] == "deleteFirst":
        d.popleft()
    elif s[0] == "deleteLast":
        d.pop()
    elif s[0] == "insert":
        d.appendleft(s[1])
    else:
        try:
            d.remove(s[1])
        except:
            pass
print(" ".join(d))



Measured memory_bytes: 69868
package main

import "fmt"

func main() {
	var n, m int
	fmt.Scanf("%d %d", &n, &m)
	h := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&h[i])
	}
	var a, b int
	counter := make(map[int]struct{})
	for i := 0; i < m; i++ {
		fmt.Scanf("%d %d", &a, &b)
		if h[a-1] < h[b-1] {
			counter[a] = struct{}{}
		} else if h[a-1] > h[b-1] {
			counter[b] = struct{}{}
		} else if h[a-1] == h[b-1] {
			counter[a] = struct{}{}
			counter[b] = struct{}{}
		}
	}
	fmt.Println(n - len(counter))
}


Measured memory_bytes: 8676
#include<bits/stdc++.h>
#define fo(i,w,n) for(int i=(int) w;i<(int) n;i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define fi first
#define se second
#define mem(a,b) memset(a,b,sizeof(a))
#define cpy(a,b) memcpy(a,b,sizeof(a))
#define prq priority_queue
#define foreach(it,c) for(__typeof((c).begin()) it=c.begin();it!=c.end();it++)
using namespace std;
inline ll read(){
	ll x=0;
	int f=1;
	char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-')f=-f;
	for(;isdigit(c);c=getchar())x=x*10+(c-'0');
	return x*f;
}
int main(){
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	string s;
	cin>>s;
	int x=(s[0]-'0')*10+(s[1]-'0'),y=(s[2]-'0')*10+(s[3]-'0');
	if(x>12||x<1){
		if(y>12||y<1)cout<<"NA\n";
		else cout<<"YYMM\n";
	}else{
		if(y>12||y<1)cout<<"MMYY\n";
		else cout<<"AMBIGUOUS";
	}
	return 0;
}


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

int main(){
	int a, b, c;
	cin >> a >> b >> c;
	int count = 3;
	if (a == b || a == c || b == c)
	{
		count--;
	}
	if (a == b && b == c)
	{
		count--;
	}
	cout << count << endl;

}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] ans = new int[11][46];
		for(int i=0;i<(1<<10);i++) {
			int count = 0;
			int sum = 0;
			for(int j=0;j<10;j++) {
				if (((1<<j)&i) > 0) {
					sum += j;
					count++;
				}
			}
			ans[count][sum]++;
		}
		while(true) {
			int n = sc.nextInt();
			int s = sc.nextInt();
			if (n == 0) {
				break;
			}
			if (s > 45) {
				System.out.println(0);
			}else{
				System.out.println(ans[n][s]);
			}
		}
	}

}

Measured memory_bytes: 17376
using System;

namespace ABC026A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c;

            var word = Console.ReadLine().Split(' ');

            a = int.Parse(word[0]);
            b = int.Parse(word[1]);
            c = int.Parse(word[2]);


            if (a==b && a==c)
                Console.WriteLine("1");
            else if (a==b || b==c || c==a)
                Console.WriteLine("2");
            else
                Console.WriteLine("3");

            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 13140
s = input()

res = "Yes"
for i in range(len(s)):
    if s[i] != s[-(i+1)]:
        res = "No"
        break

if res == "Yes":
    mx = int((len(s)-1)/2)
    for i in range(mx):
        if s[i] != s[mx-i-1]:
            res = "No"
            break

if res == "Yes":
    mx = len(s)-1
    j = 0
    for i in range(int((len(s)+3)/2)-1, len(s)):
        if s[i] != s[(mx - j)]:
            res = "No"
            break
        j = j + 1

print(res)


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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
// #define mod (998244353ll)

const long long INF = 1LL << 60;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

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

  ll n = s.size();
  ll ans = 0;
  rep(i, n) {
    if (s[i] != t[i]) {
      ans++;
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3768
//author-abhijit dey
 //Welcome to my code. btw I hate coding 😉
#include <bits/stdc++.h>
using namespace std;
#define     ff first
#define     ss second
#define     pb push_back
#define     mp make_pair
#define     INF 1000000005
#define     MOD 1000000000
#define     ninf -1000000000
#define     all(c) c.begin(), c.end()
#define     tinput long long int t;cin>>t;
#define     mem(a,x) memset(a,x,sizeof a)
#define     for0(i,n) for(long long int i=0;i<n;i++)
#define     pi 3.141592653589793238462643383279502884
#define     fori(i,a,n) for(long long int i=a;i<n;i++)
#define     forxy(i,x,y) for(int i=x;i<=y;i++)
#define     rfor(i,n) for(long long int i=n-1;i>=0;i--)
#define     ainput for(int i=0; i<n; i++) cin>>a[i];
#define     fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

typedef     long long int ll;
typedef     vector<long long int>vll;
typedef     vector<vector<int> >vvll;
typedef     pair<long long int,long long int>pr;
typedef     vector<pair<long long int,long long int> >vp;

inline long long  min2(long long  a, long long  b)  {return (a)<(b)?(a):(b);}
inline long long  max2(long long  a, long long  b)  {return (a)>(b)?(a):(b);}
inline long long  max3(long long  a, long long  b, long long  c)    {return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long  min3(long long  a, long long  b, long long  c)    {return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c));}
using namespace std::chrono;
ll N,W;
ll w[101],v[101];
ll dp[101][100001];
ll minvalue(ll ind,ll V)
{
    ll left=INT_MAX,right=INT_MAX;
    if(V==0)return 0;

    if(V<0)return INT_MAX;

    if(ind==N+1)return INT_MAX;

    if(dp[ind][V]!=-1)return dp[ind][V];

    left=w[ind]+minvalue(ind+1,V-v[ind]);
    right=minvalue(ind+1,V);

    dp[ind][V]=min(left,right);
    return dp[ind][V];
}
void process()
{
    cin>>N>>W;
    for(ll i=1;i<=N;i++)cin>>w[i]>>v[i];
    memset(dp,-1,sizeof(dp));
    ll ans; 
    for(ll i=1;i<=100000;i++)
    {
        ll temp=minvalue(1,i);
        if(temp<=W)
            ans=i;
    }
    cout<<ans;
}
int main()
{
    fastio;
    //tinput;
    //while(t--)
        process();
}


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

#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;

void solve() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  a[0] = 0;
  rep(i, n) cin >> a[i + 1];
  dump(n, a);
  map<int, int> mp;
  function<int(int)> check = [&](int k) {
    dump(k);
    mp.clear();
    for (int i = 1; i <= n; i++) {
      if (i == 1) mp[a[i] - 1] = 0;
      if (a[i - 1] < a[i]) {
        // 何もしない
      } else {
        auto it = mp.lower_bound(a[i]);
        // auto it = mp.upper_bound(a[i] - 1);
        mp.erase(it, mp.end());
        int j = a[i] - 1;
        if (k == 1) {
          j = -1;
        } else {
          while (mp[j] + 1 >= k) {
            mp[j] = 0;
            j--;
          }
        }
        if (0 <= j) {
          mp[j] += 1;
        } else {
          dump("false", mp);
          return false;
        }
      }
      dump(mp);
    }
    return true;
  };
  int ans = 0;
  // index=0が条件を満たすこともあるので、leftの初期値は-1
  int left = 0;
  // index=a.size()-1が条件を満たさないこともあるので、rightの初期値はa.size()
  int right = n;
  while (right - left > 1) {
    int mid = left + (right - left) / 2;
    if (check(mid))
      right = mid; // 例えば(key<=a[mid])など
    else
      left = mid;
  }
  // leftは条件を満たさない最大の値、rightは条件を満たす最小の値になっている
  ans = right;
  dump(ans);
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  // freopen("temp.1", "r", stdin);
  solve();
  return 0;
}

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


typedef long long ll;
#define reg register
#define rep(i,a,b) for(int i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(int i=a,i##end=b;i>=i##end;--i)


char IO;
inline ll rd(){
	ll s=0,f=0;
	while(!isdigit(IO=getchar())) if(IO=='-') f=1;
	do s=(s<<1)+(s<<3)+(IO^'0');
	while(isdigit(IO=getchar()));
	return f?-s:s;
}


const int N=1e5+10;

int n,m;
vector <int> V[N];
priority_queue <int> Q;

int main(){
	n=rd(),m=rd();
	rep(i,1,n){
		int x=rd(),y=rd();
		V[x].push_back(y);
	}
	int ans=0;
	drep(i,m,1) {
		rep(j,0,V[i].size()-1) {
			if(m-i+1>(int)Q.size()) Q.push(-V[i][j]),ans+=V[i][j];
			else {
				if(V[i][j]>-Q.top()){
					ans-=-Q.top();Q.pop();
					Q.push(-V[i][j]);ans+=V[i][j];
				}
			}
		}
	}
	printf("%d\n",ans);
}




Measured memory_bytes: 6268
x, y, a, b, c = map(int, input().split())
list_A = list(map(int, input().split()))
list_B = list(map(int, input().split()))
list_C = list(map(int, input().split()))
list_A.sort(reverse=True)
list_B.sort(reverse=True)
list_C.sort(reverse=True)

list_N = list_A[:x] + list_B[:y] + list_C[:min(c, x + y)]
list_N.sort(reverse=True)
print(sum(list_N[:x+y]))

Measured memory_bytes: 29432
#include <bits/stdc++.h>
using namespace std;
int main(){
	int r,g,b,n,i,j,k,left,tr,tg,tb;
	long long ans=0;
	cin>>r>>g>>b>>n;
	for(i=n/r;i>=0;i--)
	{
		left=n-r*i;
		if(left==0)
		{
			ans++;
			continue;
		}
		for(j=left/g;j>=0;j--)
		{
			left=n-r*i-g*j;
			if(left%b==0)
			{
				ans++;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>
using namespace std;

int main(int argc, const char * argv[]) {
    
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int N, A, B;
    cin >> N >> A >> B;
    if ((A + B) % 2 == 0) cout << "Alice" << endl; else cout << "Borys" << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int n;
  scanf("%d",&n);
  for(int i = (int)((n - 1) /1.08);;i++){
    if((int)(i * 1.08)==n){
      printf("%d\n",i);
      break;
    }else if((int)(i * 1.08)>n){
      printf(":(\n");
      break;
    }
  }
}


Measured memory_bytes: 128
#include <stdio.h>
int main(void)
{
char b[1];
  char tui[1];
  scanf("%s", b);
  if(b[0]=='A')
    tui[0]='T';
  if(b[0]=='T')
    tui[0]='A';
  if(b[0]=='C')
    tui[0]='G';
  if(b[0]=='G')
    tui[0]='C';
  printf("%c",tui[0]);
  return 0;
}

Measured memory_bytes: 128
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    }
    public static void do_(Scanner inp) {
        int a = inp.nextInt();
        int b = inp.nextInt();
        a *= 3;
        System.out.println((a + b) / 2);
    }
}


Measured memory_bytes: 21716
// </> : towhid1zaman

#include "bits/stdc++.h"
using namespace std;
typedef unsigned long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair< int, int > pii;
typedef pair< pii, int > ppi;
#define fill(a,b) memset(a,b,sizeof(a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define _ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(a) int(a.size())
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int inf = 0x3f3f3f3f;// (int)3e18;
const int maxn = 2000100;



int main(){
        _
        ll x,y;
        cin >> x >> y;
        ll ans = 0;
        ll pre = x;
        for(ll i = x; i<=y;i*=2){
            ans++;
        }
        cout<<ans<<endl;


return 0;
}



Measured memory_bytes: 384
n = int(input(""))
mod = 1e9+7
maxn = 200000
x = []
f = []
sum = [0 for j in range(0,maxn+1)]
def add(a,b):
    s = (a+b)%mod
    return s
f.append(1)
x.append(-1)
for i in range(1,n+1):
    x.append(int(input()))
    if(x[i]==x[i-1]):
        f.append(f[i-1])
    else :
        f.append(add(f[i-1],sum[x[i]]))
        sum[x[i]]=f[i]
print(int(f[n]))

Measured memory_bytes: 19028
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll a,b,c,d;
	scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
	printf("%lld",max(a*b,c*d));
}

Measured memory_bytes: 128
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def rl(proc=None):
    if proc is not None:
        return proc(sys.stdin.readline())
    else:
        return sys.stdin.readline().rstrip()

def srl(proc=None):
    if proc is not None:
        return list(map(proc, rl().split()))
    else:
        return rl().split()

def main():
    N = rl(int)
    a = []
    for _ in range(N):
        s, t = srl()
        t = int(t)
        a.append((s, t))
    q = rl()
    ret = sum(x[1] for x in a)
    for s, t in a:
        ret -= t
        if s == q:
            break
    print(ret)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <stdio.h>

int main()
{
    int i, j, k, l;
    int n;
    int count = 0;
    
    while (scanf("%d", &n) != EOF) {
        count = 0;
	if (n <= 36) {
	  for (i = 0; i < 10; i++) {
	    if (i > n) break;
            for (j = 0; j < 10; j++) {
	      if (i + j > n) break;
	      for (k = 0; k < 10; k++) {
		if (i + j + k > n) break;
		for (l = 0; l < 10; l++) {
		  if (i+j+k+l == n) {
		    count++;
		    break;
		  }
		}
	      }
            }
	  }
	}
        printf("%d\n", count);
    }
    
    return 0;
}
                



Measured memory_bytes: 2028
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>

using namespace std;

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

int main(){
    string s;
    cin >> s;
    int n = s.size();
    for (int i = 0; i < (n - 1) / 2; i++){
        if(s[i] != s[(n-1)/2-1-i]){
            cout << "No" << endl;
            return 0;
        }
    }
    for (int i = (n + 3) / 2 - 1; i < n; i++){
        if (s[i] != s[n-1-i]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


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

int main() {
  string w; cin >> w;
  vector<bool> cnt('z' - 'a' + 1, true);
  for (auto e: w) {
    int idx = e - 'a';
    cnt.at(idx) = not cnt.at(idx);
  }
  bool ans = true;
  for (auto e: cnt) ans &= e;
  cout << (ans ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

int main() {
    ll n, k, s;
    cin >> n >> k >> s;
    vector<ll> ans(n, 1000000000);
    if (s == 1000000000) {
        rep(i, n) ans[i] = 999999999;
    }

    rep(i, k) ans[i] = s;
    rep(i, n) {
        cout << ans[i];
        if (i == n - 1)
            cout << "\n";
        else
            cout << " ";
    }
    return 0;
}

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

int main()
{
	string s;
	cin >> s;
	if (s[1] == 'S') {
		if (s[0] == 'R' || s[2] == 'R') cout << 1;
		else cout << 0;
	}
	else if (s[0] == 'R' && s[2] == 'R') cout << 3;
	else if (s[0] == 'R' || s[2] == 'R') cout << 2;
	else cout << 1;
	return 0;
}

Measured memory_bytes: 3168
#include<bits/stdc++.h>
using namespace std;
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  P   2*acos(0.0)
int main()
{
    ft
    double t,i,j,n,m,l,r;
    cin>>l;
    cout<<fixed<<setprecision(20)<<(2.0*P*l)<<"\n";
    return 0;
}


Measured memory_bytes: 3752
#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/algorithm/string/classification.hpp> // is_any_of
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/math/tools/minima.hpp>

const int MOD = 1e9+7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = (n); i >= 0; --i)

namespace adaptor = boost::adaptors;
using namespace std;
using boost::math::tools::brent_find_minima;
using boost::irange;
using boost::algorithm::join;
using boost::algorithm::split;
using boost::algorithm::replace_all;
using boost::multiprecision::cpp_int;
using ll = long long;
using P = pair<int, int>;

// TOP
void	Main()
{
	int n, k;
	cin >> n >> k;

	vector<int>	V(200010);
	bitset<200010> bs;
	rep(i, n)
	{
		int x;
		cin >> x;
		bs.set(x);
		V.at(x)++;
	}
	int bsn;
	bsn = bs.count();
	int sum;
	sum = 0;
	sort(V.rbegin(), V.rend());
	rep(i, k)
		sum += V.at(i);
	cout << accumulate(V.begin(), V.end(), 0) - sum << endl;
	// int j;
	// j = 0;
	// while (V.at(j) == 0)
	// 	j++;
	// for (int i = bsn; i > k; i--)
	// {
	// 	cnt += V.at(j);
	// 	j++;
	// }
	// cout << cnt << endl;
}
// END

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


Measured memory_bytes: 1024
// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF (1 << 29) * 2
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }

int main()
{
  char s[5], t[5];
  scanf("%2s%2s", s, t);
  int ss = atoi(s);
  int tt = atoi(t);
  // if (!((1 <= ss && ss <= 12) && (0 <= tt && tt <= 99)) || !((0 <= ss && ss <= 99) && (1 <= tt && tt <= 12)))
  if (!(1 <= ss && ss <= 12) && !(1 <= tt && tt <= 12))
  {
    puts("NA");
    return 0;
  }
  else
  {
    if (((1 <= ss && ss <= 12) && (1 <= tt && tt <= 12)))
    {
      puts("AMBIGUOUS");
      return 0;
    }
    else if (!(1 <= tt && tt <= 12))
    {
      puts("MMYY");
      return 0;
    }
    else
      puts("YYMM");
  }
  return 0;
}


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

string fun(string &s, string &t) {
    int n = s.size();
    int m = t.size();
    
    vector<vector<int> > dp(n+1, vector<int>(m+1, 0));
    
    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= m; j++){
            if(s[i-1] == t[j-1])
                dp[i][j] = dp[i-1][j-1] + 1;
            else
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
        }
    }
    
    string ans = "";

    int i = n, j = m;
    while(i > 0 and j > 0) {
        if(s[i-1] == t[j-1]){
            ans += s[i-1];
            i--;
            j--;
        } else if (dp[i-1][j] > dp[i][j-1])
            i--;
        else
            j--;
    }
    reverse(ans.begin(), ans.end());
    return ans;
}

int32_t main() {
    string s, t;
    cin >> s >> t;
    
    cout << fun(s, t);
    return 0;
}

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

const int IINF = 1e9 + 100;

struct edge{
    pair<int, int> to;
    int cost;
};

struct node{
    pair<int, int> v;
    int cost;

    bool operator<(const node & right) const {
        return cost > right.cost;
    }
};

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

    int n, m;
    cin >> n >> m;

    map<pair<int, int>, vector<edge> > g;
    for(int i = 0 ; i < m ; ++i){
        int a, b, c;
        cin >> a >> b >> c;
        --a;
        --b;
        g[{a, c}].push_back({{b, c}, 0});
        g[{b, c}].push_back({{a, c}, 0});
        g[{a, c}].push_back({{a, 0}, 0});
        g[{a, 0}].push_back({{a, c}, 1});
        g[{b, c}].push_back({{b, 0}, 0});
        g[{b, 0}].push_back({{b, c}, 1});
    }

    map<pair<int, int>, int> cost;
    for(auto x : g){
        cost[x.first] = IINF;
    }
    cost[{n - 1, 0}] = IINF;

    deque<node> deq;
    deq.push_back({{0, 0}, 0});
    while(!deq.empty()){
        node now = deq.front();
        deq.pop_front();
        if(cost[now.v] <= now.cost){
            continue;
        }
        cost[now.v] = now.cost;
        for(auto x : g[now.v]){
            if(cost[x.to] > now.cost + x.cost){
                if(x.cost == 0){
                    deq.push_front({x.to, now.cost});
                }else{
                    deq.push_back({x.to, now.cost + x.cost});
                }
            }
        }
    }

    if(cost[{n - 1, 0}] < IINF){
        cout << cost[{n - 1, 0}] << endl;
    }else{
        cout << -1 << endl;
    }

    return 0;
}

Measured memory_bytes: 92032
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	int n; cin >> n;
	if (n % 7 == 1) {
		cout << "fri" << endl;
	}
	if (n % 7 == 2) {
		cout << "sat" << endl;
	}
	if (n % 7 == 3) {
		cout << "sun" << endl;
	}
	if (n % 7 == 4) {
		cout << "mon" << endl;
	}
	if (n % 7 == 5) {
		cout << "tue" << endl;
	}
	if (n % 7 == 6) {
		cout << "wed" << endl;
	}
	if (n % 7 == 0) {
		cout << "thu" << endl;
	}
}


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

int main() {
	int n,m,c;
    cin>>n>>m>>c;
    int a[m]={0};
    int b[m]={0};
    for(int  i=0;i<m;i++)
         {
            cin>>b[i];
           }
     long long sum;
     int count=0;
    while(n--)
                   {
                       sum=0;
                       for(int j=0;j<m;j++)
                         {
                             cin>>a[j];
                         }
                            for(int j=0;j<m;j++)
                         {
                            sum=sum +a[j]*b[j];
                          }
                         if(sum+c>0)
                         count++;  
                   
                    }
           cout<<count<<endl;
}

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

int main() {
  
  int N, A;
  cin >> N >> A;
  if (N%500 <= A) {
    cout << "Yes" << endl;
  }
  
  if (N%500 > A) {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import zlib,base64
exec(zlib.decompress(base64.b85decode("c-oy(%Wi`(5WMphE>(q%O(Z9$L~-tXgM}&zCUFGDyh`}{E(F}F>Zu2Im+^RJY`JLb3U$MWZR<>R9nzJp+dlN#!C>s$$xa8K`B4VN_ludF)n%!&Uf1TE9gAZa9zA?xBVo8>J=B6-iBO+uiGwP&Seu?{V}~A-U1v)Tov<K05U&z)T`1}ny(4W<o0_Y_H<Ea{kTOof5&f~&h+H*;!V-58XFYtJB*YtUx>Tq+c?eDH!7|b8Y;8+bfCFH<K)IX}`AE+3DXUGd&7c5ZL6N~cn`w3jJ3N8x1C9ey5r1~NbUNd+$s&2X=u5=U_w#s;g~+8&<UM&2)iwmL!KvA$)+&=PQ84JUjF8`Md+^!M`pd+(Y3tM>^vU9m&mEsT9^ZHyYx}2eA9edE|9Q5R=kidOhpu_3%R`@e{&gGcO@I*bYzxl>=dy@+BCk;1Vz7jlN5~fd{l8Q")))

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

#define ll long long
#define pb push_back
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define fr freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define mp make_pair
#define F first
#define S second

using namespace std;

const int N = 5e5 + 2;
const int mod = 1e9 + 7;

int main ()
{
	speed;
	ll h;
	cin>>h;
	ll n;
	cin>>n;
	ll s=0;
	for (int i=0;i<n;i++){
		int x;
		cin>>x;
		s+=x;
	}
	if (s>=h){
		cout<<"Yes";
	}
	else cout<<"No";
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<assert.h>
#include<string>
#include<cstdlib>
#include<cctype>
#include<unordered_map>
#include<sstream>
#include<numeric>
#include<stack>
// #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 9e18;
constexpr int inf = 1e9;
const double INFD = 1e100;
const ll mod = 1000000007;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
};
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
};

// intやllをstringに変換
template<typename T> inline string toString(const T &a){
  ostringstream oss;
  oss << a;
  return oss.str();
};
// ----------------------------------------------------------------------------

int main(){
  int N;
  cin >> N;
  vector<int> p(N+1);
  for(int i=1; i<=N; i++){
    cin >> p[i];
  }
  int cnt = 0;
  for(int i=1; i<N; i++){
    if(p[i] == i){
      cnt++;
      swap(p[i],p[i+1]);
    }
  }
  if(p[N] == N){
    swap(p[N],p[N-1]);
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 640
#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();

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

void solve() {
    ll N;
    cin >> N;
    string ans;

    while (N > 0) {
        ll r = N % 26;
        if (r == 0) {
            r = 26;
            N -= 26;
        }
        ans += (char)('a' + r - 1);
        N /= 26;
    }

    reverse(ans.begin(), ans.end());

    cout << ans << "\n";
}

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

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

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,a,b;
  cin >> n >> a >> b;
  int p[n];
  int q1=0,q2=0,q3=0;
  for(int i=0; i<n; i++){
    cin >> p[i];
    if(p[i] <= a){
      q1++;
    }else{
      if(p[i] <= b){
        q2++;
      }else{
        q3++;
      }
    }
  }
  cout << min(q1,min(q2,q3)) << endl;
}

Measured memory_bytes: 256
import Data.List
import Data.Maybe
import Control.Monad
import Data.Array.Unboxed
import qualified Data.ByteString.Char8 as BS

main :: IO ()
main = do
  n <- readLn :: IO Int
  ds <- listArray (0,n-1) . sort . map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine :: IO (UArray Int Int)
  let a = ds!(n`div`2 - 1)
      b = ds!(n`div`2)
  print $ b - a
  


Measured memory_bytes: 19836
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define UINF 18446744073709551615
#define F first
#define S second
#define ll long long
using namespace std;
int main(){
	string s;
	cin>>s;
	if(s=="hi"||s=="hihi"||s=="hihihi"||s=="hihihihi"||s=="hihihihihi")
	{
		cout<<"Yes"<<endl;
	}
	else
	{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_063_B.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 i      PIC 9(2).
    01 j      PIC 9(2).
    01 S      PIC X(26).
    01 len    PIC 9(2).
    01 num    PIC 9(2) VALUE 26.
    01 alpha  PIC X(26) VALUE "abcdefghijklmnopqrstuvwxyz".
    01 flg1.
        03 flg11 OCCURS 26.
            05 flg PIC 9(1) VALUE ZERO.
    01 used   PIC 9(1) VALUE 0.
PROCEDURE                        DIVISION.
MAIN.
    ACCEPT S.

    COMPUTE len = FUNCTION STORED-CHAR-LENGTH(S).

    PERFORM VARYING i FROM 1 BY 1 UNTIL len < i
        PERFORM VARYING j FROM 1 BY 1 UNTIL num < j
            IF S(i:1) = alpha(j:1) THEN
                IF flg(j) = 1 THEN
                    MOVE 1 TO used
                    EXIT PERFORM
                END-IF
                MOVE 1 TO flg(j)
            END-IF
        END-PERFORM
        IF used = 1 THEN
            EXIT PERFORM
        END-IF
    END-PERFORM.

    IF used = 1 THEN
        DISPLAY "no"
    ELSE
        DISPLAY "yes"
    END-IF.

    STOP RUN.


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

int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  ll ans = (1LL << 63) - 1;
  for (int i = -100; i <= 100; i++) {
    ll sum = 0;
    for (int j = 0; j < n; j++) {
      sum += (a[j] - i) * (a[j] - i);
    }
    ans = min(ans, sum);
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3604