akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
using ll =long long;
using db = double;

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

#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(v) SORT(v);(v).erase(unique((v).begin(),(v).end()),(v).end())
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;

ll ans;
//ここから書き始める
int main()
{
	cout << setprecision(10);
	int a,b,c,d;
	cin >> a >> b>> c>> d;
	cout << min(a,b) + min(c,d)<<endl;	

}


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

using namespace std;

int n, x;
int arr[200100];

int main() {
    int i;
    scanf("%d%d",&n,&x);
    if (x>1&&x<2*n-1) {
        printf("Yes\n");
        arr[n-1] = x;
        int p = 1;
        for (i=n;i<2*n-1;i++) {
            if (p==x) p++;
            arr[i] = p++;
        }
        p = 2*n-1;
        for (i=n-2;i>=0;i--) {
            if (p==x) p--;
            arr[i] = p--;
        }
        for (i=0;i<2*n-1;i++) printf("%d\n",arr[i]);
    }
    else printf("No\n");
    return 0;
}


Measured memory_bytes: 2304
import sys
from collections import defaultdict
alphabets = defaultdict(int)
lines = sys.stdin.readlines()
for line in lines:
    for ch in line.rstrip():
        if ch.isalpha():
            ch = ch.lower()
            alphabets[ch] += 1

for i in range(26):
    ch = chr(ord('a')+i)
    print(f'{ch} : {alphabets[ch]}')


Measured memory_bytes: 5972
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)

int main() {
    ll N, M, C;
    cin >> N >> M >> C;

    ll B[M];
    REP(i, M) cin >> B[i];

    ll ans = 0;
    REP(i, N) {
        ll sum = C;
        REP(j, M) {
            ll tmp;
            cin >> tmp;
            sum += tmp*B[j];
        }

        if(sum > 0) ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3576
#include "bits/stdc++.h"
#include <math.h>
#include <time.h>
using namespace std;
const long long mod = 1000000007;
#define dump(x)                             \
    if (dbg) {                              \
        cout << #x << " = " << (x) << endl; \
    }
bool dbg = false;
long long gcd(long long a, long long b){
   if (a % b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a % b));
   }
}
long long lcm(long long a, long long b){
   return (a / gcd(a, b))* b;
}
//---------------------------------------------------------------------------------------------------
/*ここからいじる*/
//---------------------------------------------------------------------------------------------------

void solve(){
}
int main(){
    string s;
    cin >> s;
    int n = s.size();
    int ans = 10000;
    for(int i = 0; i < n - 2; i++){
        int num = (s.at(i) - '0') * 100 + (s.at(i + 1) - '0') * 10 + (s.at(i + 2) - '0');
        int tmp = abs(753 - num);
        ans = min(ans, tmp);
    }
    cout << ans << endl;
    solve();
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdint>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

int main(void)
{
    int64_t N;

    std::cin >> N;

    int64_t ans = N % 1000;

    if (ans != 0) {
        ans = 1000 - ans;
    }

    std::cout << ans << std::endl;

    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1e9 + 7

template < typename T >
void printVector (const vector < T > & vec) {
	for (const T x : vec) {
		cout << x << " ";
	}
	cout << endl;
}

const int INF = 1e9 + 5;

int main() {
	int N, k;
	scanf ("%d %d", &N, &k);
	vector < int > h (N);
	for (int & x : h) {
		scanf ("%d", &x);
	}
	vector < int > dp (N, INF);
	dp[0] = 0;
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j <= i + k; j++) {
			if (j < N){
				dp[j] = min (dp[j], dp[i] + abs (h[i] - h[j]));
			}
		}
	}
	// printVector (h);
	// printVector (dp);
	printf ("%d\n", dp[N - 1]);
	return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#pragma comment(linker, "/STACK:400000000")

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(it=X.begin();it!=X.end();it++)
#define iss istringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sst stringstream
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int p,s,table[111][11],sumV[111],sumH[111];

int main(){
	int newline=0;
	while(cin>>p && p){
		cin>>s;
		if(newline)cout<<endl;
		newline=1;
		fill(sumV,sumV+s+1,0);
		fill(sumH,sumH+p,0);
		int var=0,varV[111]={},varH[111]={};
		rep(i,p){
			rep(j,s){
				char c[9];
				cin>>c;
				if(c[0]=='?'){
					table[i][j]=INF+(var++);
					varV[j]++;
					varH[i]++;
				}
				else{
					table[i][j]=atoi(c);
					sumV[j]-=table[i][j];
					sumH[i]-=table[i][j];
				}
			}
			int x;cin>>x;
			sumH[i]+=x;
		}
		rep(i,s+1){
			int x;cin>>x;
			sumV[i]+=x;
		}
		int ans[1011]={},no=0,found=0;
		while(1){
			int flag=0;
			rep(i,p)if(varH[i]==1){
				flag=1;
				found++;
				varH[i]--;
				rep(j,s)if(table[i][j]>=INF){
					ans[table[i][j]-INF]=sumH[i];
					table[i][j]=0;
					sumV[j]-=sumH[i];
					varV[j]--;
					break;
				}
			}
			rep(j,s)if(varV[j]==1){
				flag=1;
				found++;
				varV[j]--;
				rep(i,p)if(table[i][j]>=INF){
					ans[table[i][j]-INF]=sumV[j];
					table[i][j]=0;
					sumH[i]-=sumV[j];
					varH[i]--;
					break;
				}
			}
			if(found==var)break;
			if(!flag){
				no=1;
				break;
			}
		}
		if(no)cout<<"NO\n";
		else{
			rep(i,var)cout<<ans[i]<<endl;
		}
	}
}

Measured memory_bytes: 0
import java.io.*;
import java.math.*;
import java.util.*;
public class Main{ //USE LONGS TO AVOID OVERFLOW THEN CAST
 
	public static void main(String[] args) { 
		FastScanner input = new FastScanner();
		PrintWriter w = new PrintWriter(System.out);
		int N = input.nextInt();
		int Z = 0;
		TreeSet<Long> set = new TreeSet<Long>();
		long[] a = new long[N];
		long cnt = 0;
		String ans = "No";
		for (int i = 0; i < N; i++) {
			a[i] = input.nextLong();
			if (a[i]==0) Z++;
			set.add(a[i]);
		}
		if (Z==N) ans="Yes";
		else if (N%3==0) {
			if (Z==N/3) {
				if (set.size()==2) ans="Yes"; //0 and some other constant
			}else if (Z==0) {
				if (set.size()==3) {
					boolean good = true;
					Arrays.sort(a);
					for (int i = 0; i < N; i++) {
						cnt++;
						if ((i<N-1&&a[i]!=a[i+1])||i==N-1) {
							if (cnt!=N/3) {
								good=false;
								break;
							} 
							cnt=0;
						}
					}
					if (good) {
						long A = set.pollLast();
						long B = set.pollLast();
						long C = set.pollLast();
						if ((A^B)!=C) good=false;
					}
					if (good) ans="Yes";
				}
			}
		}
		
		w.println(ans);
		w.flush();
	}
	public static long GCD(long a, long b) {
		if (a==0||b==0) return Math.max(a,b);
		return GCD(Math.min(a, b),Math.max(a, b)%Math.min(a, b));
	}
	public static long FastExp(long base, long exp, long mod) {
		long ans=1;
		while (exp>0) {
			if (exp%2==1) ans*=base;
			exp/=2;
			base*=base;
			base%=mod;
			ans%=mod;
		}
		return ans;
	}
	public static long ModInv(long num,long mod) {return FastExp(num,mod-2,mod);}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
}

Measured memory_bytes: 51208
var lines = [];

var readline = require('readline')
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});


rl.on('line', (x) => {
    lines.push(x)
});

rl.on('close', () => {
    var r = Number(lines[0].split(" ")[0])
    var D = Number(lines[0].split(" ")[1])
    var x = Number(lines[0].split(" ")[2])

    for (var i = 1; i <= 10; i++) {
        var x = r * x - D
        console.log(x);
    }
});

Measured memory_bytes: 7884
#include <iostream>
#include <map>
using namespace std;
map <int,int> mp;
int a[121621];
int main(int argc, char** argv) {
	int n,ans=0;
	cin >> n;
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
		mp[a[i]]++;
	}
	for(int i=0;i<n;i++)
	{
		if(mp[a[i]]>=a[i])
			ans+=mp[a[i]]-a[i];
		else
			ans+=mp[a[i]];
		mp[a[i]]=a[i];
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 5120
#include <iostream>
#include<string>
#include<cmath>
#include<ciso646>
#include<cstring>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<utility>
#include<map>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
using ll = long long;
ll Max = 10 + 1e12;
int N = 5 + 1e5;


int main()
{
	int h, a;
	int cnt = 0;
	cin>> h >> a;
	while (h > 0) {
		h -= a;
		cnt++ ;
	}
	cout << cnt;
}

Measured memory_bytes: 3608
# coding: utf-8
# Your code here!
N,a,b=map(int,input().split())
M=N/2
while True:
    #print(a,b)
    #Aliceのターン
    if a+1<b:
        a+=1
    elif a+1==b:
        a-=1
        
    if a<=0:
        print('Borys')
        break
    #Bobのターン
    if a+1<b:
        b-=1
    elif a+1==b:
        b+=1
        
    if b>N:
        print('Alice')
        break

Measured memory_bytes: 38384
import collections
def f(heights,roads):
	adj = collections.defaultdict(list)
	count = 0
	for u,v in roads:
		adj[u].append(v)
		adj[v].append(u)
	for i,h in enumerate(heights):
		u = i + 1
		if h > max([heights[v-1] for v in adj[u]] or [-1]): count +=1
	return count

n,m = map(int, raw_input().split(' '))
print f(map(int,raw_input().split(' ')), [map(int, raw_input().split(' ')) for _ in range(m)] )


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

//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (a); i > (n); --i)
#define arep(i, x) for (auto &&i : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
//降順はgreater<T>()
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
// gcd lcmはそのままok
#define gcd(a, b) __gcd(a, b)
#define bits(n) (1LL << (n))
#define pcnt(x) __builtin_popcountll(x)
//配列内等要素削除
#define unique(x) (x).erase(unique((x).begin(), (x).end()), (x).end())
#define Fixed(n) fixed << setprecision(n)
//総和
#define sowa(n) ((n) * ((n) + 1)) / 2
#define pb(x, a) (x).push_back(a)
#define fb(x, a) (x).push_front(a)
#define eb(x, a) (x).emplace_back(a)
#define F first
#define S second
#define cauto const auto &
using P = pair<int, int>;
using Graph = vector<vector<P>>;
template <class T>  //昇順
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T>  //降順
using max_heap = priority_queue<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class A>
using uset = unordered_set<A>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {  //多次元初期化
  std::fill((T *)array, (T *)(array + N), val);
}
template <class T>
bool chmax(T &a, const T &b) {  //最大値更新 返り値はbool
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {  //最小値更新 返り値はbool
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9 + 7;
constexpr int mod2 = 998244353;
//} END

signed main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  string s;
  cin>>s;
  int k,a=0;
  cin>>k;

  rep(i,0,s.size()){
    if(s[i] != 'a' && s[i] + k > 'z'){
      a = 'z' - s[i] + 1;
      s[i] = 'a';
      k -= a;
    }
  }

  s[s.size()-1] += (k % 26);

  cout<<s<<'\n';
  return 0;
}

Measured memory_bytes: 592
#include<bits/stdc++.h>
using namespace std;
pair<int,int> p[100005];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++) {
		p[i].second=i;
		scanf("%d", &p[i].first);
	}
	sort(p+1, p+n+1);
	for(int i=1;i<=n;i++) printf("%d ", p[i].second);
}


Measured memory_bytes: 1536
// https://atcoder.jp/contests/abc126/tasks/abc126_a

package main

import "fmt"
import "bufio"
import "os"
import "strconv"
import "unicode"

var _sw = bufio.NewScanner(os.Stdin)

func main() {
	_ = nextInt()
	K := nextInt()
	s := nextString()
	b := []byte(s)

	b[K-1] = byte(unicode.ToLower(rune(b[K-1])))
	fmt.Println(string(b))
}

func init() {
	_sw.Split(bufio.ScanWords)
}

func nextInt() int {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	i, e := strconv.Atoi(_sw.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextString() string {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	return _sw.Text()
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x > y {
		return y
	}
	return x
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int X;
  cin>>X;
  int sw=0;
  int A,B;
  
  for(int i=1;i<pow(10,5);i++){
    //while(sw==0){
      if(X%i==0){
        //A=B+i;
        for(int j=-500;j<500;j++){
          B=j;
          A=B+i;
          if(pow(A,5)-pow(B,5)==X){
            cout<<A<<" "<<B<<endl;
            sw=1;
            break;
          }
        }
      }
    //}
  }
  
  //cout<<A<<" "<<B<<endl;
  
}



  

Measured memory_bytes: 4140
#include <algorithm>
#include <bitset>
#include <cfloat>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define ll long long
#define eps LDBL_EPSILON
#define mod 1000000007
#define int long long
#define double long double
#define INF LLONG_MAX/10
#define P pair<int,int>
#define prique priority_queue
using namespace std;
int n, k, a[100010], b[100010];
signed main() {
	cin >> n >> k;
	rep(i, n)cin >> a[i] >> b[i];
	int ans = 0;
	rep(i, 35) {
		int memo;
		memo = ((k >> i) << i) + (((ll)1 << (i-1)) - 1);
		if (memo > k)continue;
		int cnt = 0;
		rep(j, n) {
			if ((a[j] | memo) == memo)cnt += b[j];
		}
		ans = max(ans, cnt);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
// 0 0 1 2
int main() {
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    for(int i = 0; i < D-B; i++) {
        cout << 'U';
    }
    for(int i = 0; i < C-A; i++) {
        cout << 'R';
    }
    for(int i = 0; i < D-B; i++) {
        cout << 'D';
    }
    for(int i = 0; i < C-A+1; i++) {
        cout << 'L';
    }
    for(int i = 0; i < D-B+1; i++) {
        cout << 'U';
    }
    for(int i = 0; i < C-A+1; i++) {
        cout << 'R';
    }
    cout << 'D';
    cout << 'R';
    for(int i = 0; i < D-B+1; i++) {
        cout << 'D';
    }
    for(int i = 0; i < C-A+1; i++) {
        cout << 'L';
    }
    cout << 'U';
    cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MX=2e5+9;
char s1[MX],s2[MX];
int main()
{
    //freopen("input.txt","r",stdin);
    scanf("%s %s",s1,s2);
    int len=strlen(s1),ans=0;
    for( int i=0 ; i<len ; i++ )
        if( s1[i]!=s2[i] )
            ans++;
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 4196
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String input = sc.nextLine();
		String[] inputArray = input.split(" ");

		if(inputArray.length == 2){
			int width = Integer.parseInt(inputArray[0]);
			int height = Integer.parseInt(inputArray[1]);
			
			int menseki = width * height;
			int syuu = width * 2 + height * 2;
			System.out.println(menseki + " " + syuu);
		}else{
			System.out.println("2???????????¶??°?????\?????????????????????");
		}
	}
}

Measured memory_bytes: 26040
SHIFT_COUNT = int(input())
word = input()
result = ""

for s in word:
    if ord('a') <= ord(s) <= ord('z'):
        result = result + \
            chr(abs(((ord(s) + SHIFT_COUNT - ord('a')) % 26)) + ord('a'))
    else:
        result = result + \
            chr(abs(((ord(s) + SHIFT_COUNT - ord('A')) % 26)) + ord('A'))

print(result)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
template<typename T> auto compare = [](T x, T y) -> bool{return (x < y);};
const int MOD = 1000000007;

ll pow(ll x){
    return x * x * x * x * x;
}

signed main(){
    ll X;
    cin >> X;
    for(ll A = -200; A <= 200; A++){
        for(ll B = -200; B <= 200; B++){
            if(pow(A) - pow(B) == X){
                cout << A << " " << B << endl;
                return 0;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007 // 10^9+7
#define INF 99999999999 //10^12-1
#define dev 998244353 //tenka1
#define P pair<int,int>
#define F first
#define S second
int n,k;
signed main(){
    cin>>n>>k;
    if(k==1)cout<<0<<endl;
    else cout<<n-k<<endl;
    return 0;
}



Measured memory_bytes: 764
#include <stdio.h>

int main(void)
{
	int x, y;

	while (1) {
		scanf("%d %d", &x, &y);

		if (x == 0 && y == 0) break;

		if (x < y) {
			printf("%d %d\n", x, y);
		} else {
			printf("%d %d\n", y, x);
		}
	}

	return 0;
}

Measured memory_bytes: 596
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
	public static void main(String[] arges) {

		List<String> k = new ArrayList<String>();
		try {
			BufferedReader stdReader = new BufferedReader(
					new InputStreamReader(System.in));
			String line;
			while ((line = stdReader.readLine()) != null) {
				k.add(line);
							}
		} catch (Exception e) {
			e.getStackTrace();
			System.exit(0);
		}

		String[] alfalfa = new String[] { "a", "b", "c", "d", "e", "f", "g",
				"h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
				"t", "u", "v", "w", "x", "y", "z" };
		int[] arfa = new int[26];
		for (String string : k) {
			for (int i = 0; i < string.length(); i++) {
				String one = string.substring(i, i + 1);

				if (one.equals("a") || one.equals("A")) {
					arfa[0]++;
				} else if (one.equals("b") || one.equals("B")) {
					arfa[1]++;
				} else if (one.equals("c") || one.equals("C")) {
					arfa[2]++;
				} else if (one.equals("d") || one.equals("D")) {
					arfa[3]++;
				} else if (one.equals("e") || one.equals("E")) {
					arfa[4]++;
				} else if (one.equals("f") || one.equals("F")) {
					arfa[5]++;
				} else if (one.equals("g") || one.equals("G")) {
					arfa[6]++;
				} else if (one.equals("h") || one.equals("H")) {
					arfa[7]++;
				} else if (one.equals("i") || one.equals("I")) {
					arfa[8]++;
				} else if (one.equals("j") || one.equals("J")) {
					arfa[9]++;
				} else if (one.equals("k") || one.equals("K")) {
					arfa[10]++;
				} else if (one.equals("l") || one.equals("L")) {
					arfa[11]++;
				} else if (one.equals("m") || one.equals("M")) {
					arfa[12]++;
				} else if (one.equals("n") || one.equals("N")) {
					arfa[13]++;
				} else if (one.equals("o") || one.equals("O")) {
					arfa[14]++;
				} else if (one.equals("p") || one.equals("P")) {
					arfa[15]++;
				} else if (one.equals("q") || one.equals("Q")) {
					arfa[16]++;
				} else if (one.equals("r") || one.equals("R")) {
					arfa[17]++;
				} else if (one.equals("s") || one.equals("S")) {
					arfa[18]++;
				} else if (one.equals("t") || one.equals("T")) {
					arfa[19]++;
				} else if (one.equals("u") || one.equals("U")) {
					arfa[20]++;
				} else if (one.equals("v") || one.equals("V")) {
					arfa[21]++;
				} else if (one.equals("w") || one.equals("W")) {
					arfa[22]++;
				} else if (one.equals("x") || one.equals("X")) {
					arfa[23]++;
				} else if (one.equals("y") || one.equals("Y")) {
					arfa[24]++;
				} else if (one.equals("z") || one.equals("Z")) {
					arfa[25]++;
				}
			}
			

		}for (int i = 0; i < arfa.length; i++) {
				if (i == 25) {
					System.out.print(alfalfa[i] + " : " + arfa[i]);
					System.out.println("");
				} else {
					System.out.println(alfalfa[i] + " : " + arfa[i]);
				}
			}
	}
}

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

ll gcd(ll x, ll y) {
  if(x > y)
    return gcd(y, x);
  else if(x == 0)
    return y;
  else
    return gcd(y % x, x);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  ll K;
  cin >> N >> K;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];
  sort(all(A));
  ll GCD = A[0];
  rep(i, N) GCD = gcd(A[i], GCD);
  if(K > *A.rbegin()) {
    cout << "IMPOSSIBLE" << "\n";
  } else if(GCD == 1) {
    cout << "POSSIBLE" << "\n";
  } else {
    cout << (K % GCD == 0 ? "POSSIBLE" : "IMPOSSIBLE") << "\n";
  }
  return 0;
}


Measured memory_bytes: 3992
#include"bits/stdc++.h"
#include<unordered_set>
#include<unordered_map>
#include<random>
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

int N;
int c[200000];
vector<int> e[200000];

ll ans[200000] ={};
int used[200000] ={};

ll calc(ll n){
    return n*(n-1)/2 + n;
}

int dfs(int n, int p){
    int usedMemo = used[c[n]];
    int siz = 1;
    rep(i, e[n].size()){
        if(e[n][i] == p) continue;
        used[c[n]] = 0;
        int tmp = dfs(e[n][i], n);
        siz += tmp;
        ans[c[n]] += calc(tmp-used[c[n]]);
    }
    usedMemo += siz;
    used[c[n]] = usedMemo;
    return siz;
}

signed main(){
    cin >> N;
    rep(i, N){
        cin >> c[i];
        c[i]--;
    }
    rep(i, N-1){
        int a, b;
        cin >> a >> b;
        a--; b--;
        e[a].pb(b);
        e[b].pb(a);
    }
    dfs(0, -1);

    rep(i, N){
        cout << calc(N) - (ans[i] + calc(N-used[i])) << endl;
    }
}

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

int main() {
    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    bool bl = true;
    for(int b : a){
        if(b%2 == 0){
            if(b%3 != 0 && b%5 != 0){
                bl = false;
                break;
            }
        }
    }
    if(bl) cout << "APPROVED" << endl;
    else cout << "DENIED" << endl;
}


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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

int main(void){
  int x,a,b; cin >> x >> a >> b;
  if(abs(x-a)<abs(x-b)) cout << "A" << endl;
  else cout << "B" << endl;
  
  return 0;
}


Measured memory_bytes: 3588
//大文字->小文字 tolower(),逆はtoupper()
//int a = stoi(c); 文字列をintへ
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// Nの桁数
ll dig(ll N) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= 10;
	}
	return dig;
}
// x,yの最大公約数
ll gcd(ll x, ll y) {
	ll r;
	while (x%y) {
		r = x % y;
		x = y;
		y = r;
	}
	return y;
}

int main() {
	ll N; cin >> N;
	ll x = N;

	ll s = 0;
	while (N) {
		s += N % 10;
		N /= 10;
	}

	if (x%s == 0) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

using namespace std;

int main() {
  int n;

  cin >> n;
  int cont = 0;

  if(n % 10 == 0) cout << 10 << endl;
  else {
    while(n > 0) {
      cont += n % 10;
      n /= 10;
    }
    cout << cont << endl;
  }

  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  char s[31]={0};
  int i,n;
  for(i=0;i<28;i++){
    scanf("%d",&n);
    s[n]=1;
  }
  for(i=1;i<=30;i++)if(s[i]==0)printf("%d\n",i);
  return 0;
}

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

/*------------------------------------------------------------------*/

#define ll long long int
#define mp make_pair
#define pb push_back
#define MOD 1000000007

bool isvowel(char c)
{
    if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')
        return true;
        return false;
}
ll isprime(ll n)
{
    ll ans=1;
    for(ll i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
            ans = i;
    }
    return ans;
}
ll power(ll a,ll b,ll m)
{
    if(b==0)
        return 1;
    if(b==1)
        return a%m;
    ll temp=power(a,b/2,m);
    if(b%2==0)
        return ((temp%m)*(temp%m))%m;
    else
        return ((((temp%m)*(temp%m))%m)*a%m)%m;
}

/*-----------------------------------------------------------------------------*/

ll c(ll n, ll k)
{
    ll C[n + 1][k + 1];
    ll i, j;

    for (i = 0; i <= n; i++)
    {
        for (j = 0; j <= min(i, k); j++)
        {

            if (j == 0 || j == i)
                C[i][j] = 1;

            else
                C[i][j] = (C[i - 1][j - 1]%MOD +
                          C[i - 1][j])%MOD;
        }
    }
    return C[n][k]%MOD;
}
ll modInverse(ll a, ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {

        ll q = a / m;
        ll t = m;
        m = a % m, a = t;
        t = y;


        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;

    return x;
}
ll func(ll n)
{
    ll ans=0;
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            if(i/10==0)
                ans+=1+func(i)*func(n/i);
            else
                ans+=func(i)*func(n/i);
        }
    }
    return ans;
}
ll dp[2001][2001];
ll check(vector<pair<ll,ll> >v,ll l,ll r,ll i)
{ 
   //cout<<l<<" "<<r<<endl;
   if(l>r)
    return 0; 
   if(dp[l][r]!=-1)
    return dp[l][r]; 
   ll ans=0;
   ll p1=v[i].first;
   ll p2=v[i].second;
   ans=max(p1*(p2-l)+check(v,l+1,r,i+1),p1*(r-p2)+check(v,l,r-1,i+1));
   return dp[l][r]=ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);

    //freopen("1.txt","rt",stdin);
    //freopen("output.txt","wwt",stdout);

    ll t;
    t=1;
    //cin>>t;
    //ll t1=0;
    while(t--)
    {
      ll x,y,a,b,c;
      cin>>x>>y>>a>>b>>c;
      ll p[a],q[b],r[c];
      for(ll i=0;i<a;i++)
       cin>>p[i];
      for(ll i=0;i<b;i++)
       cin>>q[i];
      for(ll i=0;i<c;i++)
       cin>>r[i];
      sort(p,p+a,greater<ll>());
      sort(q,q+b,greater<ll>());
      sort(r,r+c,greater<ll>());
      
      vector<ll>v;
      for(ll i=0;i<x;i++)
       v.pb(p[i]);
      for(ll i=0;i<y;i++)
       v.pb(q[i]);
      for(ll i=0;i<c;i++)
       v.pb(r[i]);
      sort(v.begin(),v.end(),greater<ll>());
      ll sum=0;
      for(ll i=0;i<x+y;i++)
       sum+=v[i];
      cout<<sum;     
    }
}


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

using pii = pair<int, int>;

enum {
    No,
    Near,
    Yes
};

int query(int n) {
    cout << n << endl;
    string r; cin >> r;
    if(r == "Yes") return Yes;
    else if(r == "No") return No;
    return Near;
}

int main() {
    int n, k; cin >> n >> k;

    vector<pii> es;
    function<void(int, int)> create = [&] (int i, int w) {
        if(i >= n || w <= 1) return;
        for(int j = i + 1; j < min(i + w, n); ++j) {
            es.emplace_back(i + 1, j + 1);
        }
        int tw = w / 2;
        int ii = i + 1;
        while(tw >= 2) {
            create(ii, tw);
            ii += tw;
            tw = (tw + 1) / 2;
        }
    };
    create(0, n);
    cout << es.size() << endl;
    for(auto const& p : es) {
        cout << p.first << " " << p.second << endl;
    }

    while(k--) {
        function<int(int, int)> solve = [&] (int i, int w) {
            auto r = query(i + 1);
            if(r == Yes) return Yes;
            if(r == No) return No;
            int ii = i + 1, tw = w / 2;
            while(tw >= 1) {
                r = solve(ii, tw);
                if(r == Yes) return Yes;
                ii += tw;
                tw = (tw + 1) / 2;
            }
            assert(false);
        };
        solve(0, n);
    }
}


Measured memory_bytes: 3312
N = int(input())
A_list = [int(i) for i in input().split()]
h_list = []
A_before = 0
for A in A_list:
    h = 0
    if A < A_before:
        h = A_before - A
    else:
        h = 0
    h_list.append(h)
    A_before = A + h
print(sum(h_list))

Measured memory_bytes: 32216
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <bitset>
#include <numeric>
#include <unordered_set>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <numeric>
#include <cstdlib>
#include <random>
#include <bits/stdc++.h>


using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll mod=1000000007ll;
const ll inf=1000000000000000ll;



int main(){
  ll N;
  cin>>N;
  if(N%2==0)cout<<N<<endl;
  else cout<<N*2<<endl;
  return 0;
}


Measured memory_bytes: 256
import math
n,d = map(int,input().split())
li = []
ans = 0
for i in range(n):
    li.append(list(map(int,input().split())))
for i in range(n):
    for j in range(n):
        if i != j:
            a = 0
            b = 0
            for k in range(d):
                a += (li[i][k]-li[j][k])**2
            b = math.sqrt(a)
            if b == int(b):
                ans += 1
print(ans//2)

Measured memory_bytes: 9164
mod=998244353
n,m,k=map(int,input().split(' '))
F=[1 for i in range(n+1)]
for i in range(1,n+1):
    F[i]=F[i-1]*i%mod
I=[1 for i in range(n+1)]
for i in range(2,n+1):
    I[i]=(mod-int(mod/i))*I[mod%i]%mod
for i in range(2,n+1):
    I[i]=I[i]*I[i-1]%mod
def binom(n,k):
    return F[n]*I[k]%mod*I[n-k]%mod
pw=[1 for i in range(n+1)]
for i in range(1,n+1):
    pw[i]=pw[i-1]*(m-1)%mod
ans=0
for i in range(k+1):
    sz=n-i
    ans+=binom(n-1,i)*m%mod*pw[sz-1]%mod
    ans%=mod
print(ans)

Measured memory_bytes: 99916
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define REP(i,n) for(int i=0;i<n;++i)
#define REP1(i,n) for(int i=1;i<=n;++i)
#define SZ(i) int(i.size())
#define eb emplace_back
#define ALL(i) i.begin(),i.end()
#define X first
#define Y second
#ifdef tmd
#define IOS()
#define debug(...) fprintf(stderr,"#%d: %s = ",__LINE__,#__VA_ARGS__),_do(__VA_ARGS__);
template<typename T> void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T &&x, S &&...y){cerr<<x<<", ";_do(y...);}
template<typename It> ostream& _printRng(ostream &os,It bg,It ed)
{
    os<<"{";
    for(It it=bg;it!=ed;it++) {
        os<<(it==bg?"":",")<<*it;
    }
    os<<"}";
    return os;
}
template<typename T> ostream &operator << (ostream &os,vector<T> &v){return _printRng(os,v.begin(), v.end());}
template<typename T> ostream &operator << (ostream &os,array<T,2> &v){return _printRng(os,v.begin(), v.end());}
template<typename T> void pary(T bg, T ed){_printRng(cerr,bg,ed);cerr<<endl;}
#else
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define debug(...)
#define pary(...)
#endif

const int MAXN = 702;
const ll MOD = 1000000007;

int n, m;
bool edge[MAXN][MAXN];

vector<array<int, 2> > comp;

bool vis[MAXN], cl[MAXN];
void dfs (int nd, array<int,2> &cnt, bool c) {
    debug(nd, c);
    vis[nd] = true;
    cl[nd] = c;
    cnt[c]++;

    REP1 (i, n) {
        if (edge[nd][i]) {
            if (vis[i]) {
                if (cl[nd] == cl[i]) {
                    debug(i, nd);
                    cout << -1 << endl;
                    exit(0);
                }
            } else {
                    dfs(i, cnt, !c);
            }
        }
    }
}

bool dp[MAXN];
/*********************GoodLuck***********************/
int main () {
    IOS();

    cin >> n >> m;

    REP1 (i, n) {
        REP1 (j, n) {
            if (i != j) {
                edge[i][j] = true;
            }
        }
    }
    REP (i, m) {
        int u, v;
        cin >> u >> v;
        edge[u][v] = false;
        edge[v][u] = false;
    }

    REP1 (i, n) {
        if (!vis[i]) {
            debug(i);
            array<int,2> cur = {0, 0};
            dfs(i, cur, 0);

            comp.eb(cur);
        }
    }

    debug(comp);
    dp[0] = true;
    for (auto ar : comp) {
        for (int i=MAXN-1;i>=0;i--) {
            dp[i] = (i>=ar[0]?dp[i-ar[0]]:0) | (i>=ar[1]?dp[i-ar[1]]:0);
        }
    }

    auto cob = [](int x) {
        return x * (x-1) / 2;
    };

    int ans = MOD;
    REP (i, n+1) {
        if (dp[i]) {
            assert(dp[n-i]);
            ans = min(ans, cob(i) + cob(n-i));
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 768
import bisect
from itertools import accumulate

n = int(input())
a = sorted(map(int,input().split()))
b = sorted(map(int,input().split()))
c = sorted(map(int,input().split()))

ans = 0
b_sect = [0]
for i in range(n)[::-1]:
    b_sect.append(n-bisect.bisect_right(c,b[i]))
acc = list(accumulate(b_sect))[::-1]

for i in a:
    t = bisect.bisect_right(b,i)
    ans += acc[t]
print(ans)

Measured memory_bytes: 25460
package main

import (
        "fmt"
)

func solution(k int, s string) string {
        l := len(s)
        if l <= k {
                return s
        }

        return s[:k] + "..."
}

func main() {
        var k int
        var s string
        fmt.Scan(&k, &s)
        fmt.Println(solution(k, s))
}

Measured memory_bytes: 1756
#include <iostream>
#include <stdio.h>

using namespace std;

typedef long long ll;

int main() {
  ll a, b, x;
  cin >> a >> b >> x;

  ll b_num = b / x;
  ll a_num = (a - 1) >= 0 ? (a - 1) / x : -1;
  printf("%lld\n", b_num - a_num);
}

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

const int N = 105;
const int W = 1e5 + 5;

long int w[N],v[N];
long int dp[W][N];
long int n,weight;

long int solve(int capacity, int index){
	if(index == -1 || capacity == 0) return 0;
    
	if(dp[capacity][index] != -1) return dp[capacity][index];

    if(capacity < w[index]) return dp[capacity][index] = solve(capacity,index-1);
     
	long int res1 = solve(capacity,index-1);

	long int res2 =	v[index] + solve(capacity-w[index],index-1);
    
    //cout<<res1<<" "<<res2<<" "<<index<<endl;

	return dp[capacity][index] = max(res1,res2);
}

int main() {

   memset(dp,-1,sizeof(dp));

   cin>>n>>weight;

   for(int i=0;i<n;i++) cin>>w[i]>>v[i];

   cout<<solve(weight,n-1);
   	
 return 0;   
}

Measured memory_bytes: 85640
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        solve2440();
    }

    public static void solve2440() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        HashSet<String> set = new HashSet<>();
        for (int i = 0; i < N; i++) {
            set.add(sc.next());
        }
        int M = sc.nextInt();
        boolean state = false;
        for (int j = 0; j < M; j++) {
            String user = sc.next();
            if (set.contains(user)) {
                state = !state;
                System.out.println(state ? "Opened by " + user : "Closed by " + user);
            } else {
                System.out.println("Unknown " + user);
            }
        }
    }
}


Measured memory_bytes: 28488
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <string>
#include <bitset>
#include <tuple>
#include <cmath>
#include <map>

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

using namespace std;

using ll = long long;
using ull = unsigned long long;

using Pll  = pair<ll, ll>;
using Pull = pair<ull, ull>;

#define eb emplace_back
#define pb push_back
#define mp make_pair
#define mt make_tuple

#define F first
#define S second

#define rep( i, n ) for ( int i = 0; i < (int)( n ); ++i )
#define reps( i, n ) for ( int i = 1; i <= (int)( n ); ++i )
#define rrep( i, n ) for ( int i = (int)( ( n ) - 1 ); i >= 0; --i )
#define rreps( i, n ) for ( int i = (int)( ( n ) ); i > 0; --i )
#define arep( i, v ) for ( auto &&i : ( v ) )

template<typename T> T gcd( const T a, const T b ) { return ( b ? gcd( b, a % b ) : a ); }

#define ALL( c ) ( c ).begin(), ( c ).end()
#define RALL( c ) ( c ).rbegin(), ( c ).rend()
#define UNIQUE( c ) ( c ).erase( unique( ( c ).begin(), ( c ).end() ), ( c ).end() )

constexpr ll MOD = 1000000007LL;

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

template<typename T = ll> class UnionFind {
public:
	UnionFind( T n ) { rep( i, n ) { par.resize( n ); siz.resize( n ); par[i] = i; siz[i] = 1; } }
	T find( T x ) { if ( x == par[x] ) return ( x ); else return( par[x] = find( par[x] ) ); }
	void unite( T x, T y ) { T xx = find( x ); T yy = find( y ); if ( xx == yy ) return;
		if ( siz[xx] <= siz[yy] ) swap( xx, yy ); par[yy] = xx; siz[xx] += siz[yy]; }
private:
	vector<T> par, siz;
};

template<typename T = ll> T power( T a, T b, T m = MOD ) {
	T res = 1;
	while ( b > 0 ) { if ( b & 1 ) res = res * a % m;
		a = a * a % m; b >>= 1; }
	return ( res );
}

/*
constexpr ll MAX = 500010;
ll fact[MAX];
ll inv[MAX];
ll inv_fact[MAX];

template<typename T> void initComb( T n, T m = MOD )
{
	fact[0] = fact[1] = inv_fact[0] = inv_fact[1] = 1;
	inv[1] = 1;
	for ( int i = 2; i < n; i++ ) {
		fact[i] = ( fact[i - 1] * i ) % m;
		inv[i] = m - inv[m % i] * ( m / i ) % m;
		inv_fact[i] = inv_fact[i - 1] * inv[i] % m;
	}
}

template<typename T> T comb( T n, T r, T m = MOD )
{
	if ( n < r ) return ( 0 );
	if ( n < 0 || r < 0 ) return ( 0 );
	return ( fact[n] * ( inv_fact[r] * inv_fact[n - r] % m ) % m );
}
*/

void replace( string &s, string t, string r ) {
	string::size_type p = 0;
	while ( ( p = s.find( t, p ) ) != string::npos ) {
		s.replace( p, t.length(), r );
		p += r.length();
	}
}


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

	int p = 700;
	rep( i, s.size() )
	{
		if ( s[i] == 'o' )
		{
			p += 100;
		}
	}

	cout << p << endl;

	return ( 0 );
}


Measured memory_bytes: 504
/*by freesteed*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fill(x,c) memset(x,c,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=100000000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head
const int SIZE = 1e6+10;
ll a[SIZE];
int main() {
	//ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll n;
	cin>>n;
	ll N = log(n)/log(2);
	cout<<powmod(2,N+1)-1;
  	return 0;
}


Measured memory_bytes: 640
N = int(input())

for h in range(1, 3501):
    for n in range(h, 3501):
        if 4 * n * h - N * h - N * n == 0:
            continue
        w = (N * h * n) / (4 * n * h - N * h - N * n)
        if w == int(w) and 0 < w:
            print(h, n, int(w))
            exit()

Measured memory_bytes: 40812
import java.util.Scanner;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		double l, w, h, n, r, lw, wh, hl,minside;

		for(;;){
			l = sc.nextInt();
			w = sc.nextInt();
			h = sc.nextInt();
			if((l == 0) && (w == 0) && (h == 0)) break;
			n = sc.nextDouble();

			lw = Math.sqrt(Math.pow(l, 2) + Math.pow(w, 2));
			wh = Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2));
			minside = Math.min(lw, wh);
			hl = Math.sqrt(Math.pow(h, 2) + Math.pow(h, l));
			minside = Math.min(minside, hl);

			for(int i = 0; i < n; i++){
				r = sc.nextDouble();
				if(minside < r * 2) System.out.println("OK");
				else System.out.println("NA");
			}
		}
	}
}

Measured memory_bytes: 12000
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template<class T>//ex) auto dp = make_vec(4,4,4,INF);
vector<T> make_vec(size_t s, T val) { return vector<T>(s, val); }
template<class... Size>
auto make_vec(size_t s, Size... tail) {
	return vector<decltype(make_vec(tail...))>(s, make_vec(tail...));
}

int main() {

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

	Int H, W;
	cin >> H >> W;

	vector<vector<Int>> A(H+1, vector<Int>(W+1));
	vector<vector<Int>> B(H+1, vector<Int>(W+1));
	for (Int i = 0; i < H; i++) {
		for (Int j = 0; j < W; j++) {
			cin >> A[i][j];
		}
	}
	for (Int i = 0; i < H; i++) {
		for (Int j = 0; j < W; j++) {
			cin >> B[i][j];
		}
	}

	auto dp = make_vec(H+1, W+1, 13000, 0);
	dp[0][0][abs(A[0][0]-B[0][0])] = 1;

	
	for (Int i = 0; i < H; i++) {
		for (Int j = 0; j < W; j++) {
			for (Int k = 0; k < 12900; k++) {
				if (dp[i][j][k]) {
					dp[i + 1][j][k + abs(A[i + 1][j] - B[i + 1][j])] = 1;
					dp[i + 1][j][abs(k - abs(A[i + 1][j] - B[i + 1][j]))] = 1;//kが負になる場合は正に切り返す

					dp[i][j + 1][k + abs(A[i][j + 1] - B[i][j + 1])] = 1;
					dp[i][j + 1][abs(k - abs(A[i][j + 1] - B[i][j + 1]))] = 1;//kが負になる場合は正に切り返す

				}
			}
		}
	}

	Int ans;
	for (Int k = 0; k < 13000; k++) {
		if (dp[H-1][W-1][k]) {
			cout << k << "\n";
			return 0;
		}
	}

}


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

using namespace std;


int main(){
    int num_query;
    int command,val;
    char key[20];
    char L[20],R[20];
    scanf("%d",&num_query);
    multimap<string,int> map_array;

    for(int i = 0;i < num_query;i++){
        scanf("%d %s",&command,key);
        if(command == 0){
            scanf("%d",&val);
            map_array.insert(make_pair(key,val));
        }else if(command == 1){
            if(map_array.count(key) > 0){
                auto rg = map_array.equal_range(key);
                for(auto it = rg.first;it != rg.second;it++){
                    printf("%d\n",it->second);
                }
            }
        }else if(command == 2){
            if(map_array.find(key) != map_array.end()) map_array.erase(key);
        }else if(command == 3){
            scanf("%s",R);
            map<string,int>::iterator itr = map_array.lower_bound(key);
            while(itr != map_array.upper_bound(R)){
                printf("%s %d\n",itr->first.c_str(),itr->second);
                itr++;
            }
        }
    }

    return 0;   
}



Measured memory_bytes: 24964
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#define fi first
#define se second
#define pb push_back
#define loop(i, a, b) for (int i=a; i<(b); i++)
typedef long long ll;
typedef pair<int,int> pi;
const int INF = 1e9;
const int MOD = 1000000007;

vector<vector<char>> maze;
vector<pi> good;
vector<pi> bad;
int n,m;

void test_case() {
	string a,b;
	cin>>a>>b;
	int ans = 0;
	loop(i,0,a.length())
		ans += a[i]==b[i] ? 0 : 1;
	cout<<ans<<endl;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int t = 1;
	// cin >> t;
	for (int i = 1; i <= t; i++) {
		test_case();
	}
	return 0;
}

Measured memory_bytes: 3772
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

namespace Atcoder.Abc
{
    //https://atcoder.jp/contests/abc176/tasks/abc176_b
    public class Abc176_B
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            string s = Console.ReadLine();

            //var loop = s.Length - 1;
            //var sum = 0;

            //for (int i = 0; i <= loop; i++)
            //{
            //    sum += int.Parse(s.Substring(i, 1));
            //}

            //WriteLine(sum % 9 == 0 ? "Yes" : "No");

            long[] a = s.Select(x => long.Parse(x.ToString())).ToArray();
            WriteLine(a.Sum() % 9 == 0 ? "Yes" : "No");

            Console.Out.Flush();
        }
    }
}


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

using namespace std;
#define int long long int
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define vi vector <int>
#define sz(s) (int)s.size()
#define pii pair<int,int>
#define piii pair< int,pair<int,int> >
#define tiii tuple <int,int,int>
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define rall(v) v.rbegin(),v.rend()
#define endl '\n'
#define matrix vector <vector <int> >
#define boost ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define NAYAN freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define N 100006
#define mod 1000000007
#define mod2 998244353
#define inf 1e17

bool dp[N],vis[N];

int a[101];
int n,k;






int solve(int id)
{
    if(id==0)
        return 0;
    

    if(vis[id]!=false)
        return dp[id];

    vis[id]=true;

    for(int i=0;i<n;i++)
    {
        if(id>=a[i] && solve(id-a[i])==false)
        {
            dp[id]=true;
        }
    }

    
   
    return dp[id];
}

int32_t main()  
{
    boost
    // #ifndef ONLINE_JUDGE 
    // NAYAN
    // #endif
    
    

    cin >> n >> k;
    memset(dp,false,sizeof dp);
    memset(vis,false,sizeof vis);

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

    int tmp=solve(k);

    if(tmp==0)
    {
        cout << "Second\n";
    }
    else
    {
        cout << "First\n";
    }
    //cout << tmp << endl;

   



   


}

Measured memory_bytes: 3584
import numpy as np
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
d = np.zeros((n,m))
for i in range(n):
    a = list(map(int,input().split()))
    for j in range(len(a)):
        d[i][j] = a[j]
cnt = 0
for i in range(n):
    ans = 0
    for j in range(m):
        ans += d[i][j]*b[j]
    ans += c
    if ans>0:
        cnt+=1
print(cnt)

Measured memory_bytes: 12504