akhauriyash/Code-Regression huggingface dataset:
function Main(inputs) {
	const inputline = inputs.split("\n");
	let price = parseInt(inputline[0], 10);
  	while(price > 1000){
      price -= 1000;
    }
	let change = 1000 - price;
  
	console.log(change);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29584
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String n = sc.next();
            for (int i = 1; i < n.length(); i++) {
                if (n.charAt(i - 1) != n.charAt(i)) {
                    System.out.println("Yes");
                    return;
                }
            }
            System.out.println("No");
        }
    }
}


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

struct UF{
    vector<int>par,sz;
    int N;
    UF(int _N){
        N=_N;
        par=sz=vector<int>(N,1);
        for(int i=0;i<N;i++)par[i]=i;
    }
    int find(int x){
        return x==par[x]?x:par[x]=find(par[x]);
    }
    void unite(int x,int y){
        x=find(x);y=find(y);
        if(x==y)return;
        if(sz[x]<sz[y])swap(x,y);
        par[y]=x;
        sz[x]+=sz[y];
    }
    bool same(int x,int y){
        return find(x)==find(y);
    }
};

struct edge{
    int u,v,cost;
    edge(int a,int b,int c):u(a),v(b),cost(c){}
    edge(){}
};

bool operator<(const edge &a,const edge &b){
    return a.cost<b.cost;
}

int n,m;

void solve(){
    vector<edge>es;
    scanf("%d",&m);
    for(int i=0;i<m;i++){
        int a,b,c;
        scanf("%d,%d,%d",&a,&b,&c);
        es.push_back(edge(a,b,c/100-1));
    }
    sort(es.begin(),es.end());

    UF uf(n);
    int ans=0;

    for(int i=0;i<m;i++){
        edge &e=es[i];
        if(uf.same(e.u,e.v))continue;
        uf.unite(e.u,e.v);
        ans+=e.cost;
    }

    printf("%d\n",ans);
}

int main(){
    while(scanf("%d",&n),n)solve();
    return 0;
}

Measured memory_bytes: 1336
//Catchharsh
#include<bits/stdc++.h>
#define ll long long int 
#define ld long double
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define F first
#define S second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define see(x) cout<<#x<<" = "<<x<<endl
const ll MOD = 1e9+7;
const ll INF = 1011111111;
const ll LLINF = 1000111000111000111LL;
const ld EPS = 1e-10;
const ld PI = 3.14159265358979323;
using namespace std;
ll power (ll base,ll exponent)
{
    ll ans=1;
    //base%=MOD;
    //exponent%=(MOD-1);
    while(exponent!=0)
    {
      if(exponent&1) ans=(1LL*ans*base);
      base=(1LL*base*base);
      exponent>>=1;
    }
    return ans;
}

int32_t main()
{   
     IOS;
     
     ll n,m,i,j,k;
     string s;
     cin>>n>>m;
     ll ans=(n*(n-1))/2;
     ans+=(m*(m-1))/2;
     cout<<ans;
     
     cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';             
}

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

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}
template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll r, d, x;
    cin >> r >> d >> x;
    REP(i, 0, 10) {
        x = r * x - d;
        cout << x << endl;
    }
    return 0;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
using namespace std;
const int INF= 1e9+5;
typedef long long ll;

int main(){
  int n,k,x,y;
  cin>>n>>k>>x>>y;
  if(n<=k)cout<<n*x<<endl;
  else cout<<k*x+(n-k)*y<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
  int data=0;
  scanf("%d",&data);
  int u=data/100,d=data%100;
  if(1<=u&&u<=12){
    if(1<=d&&d<=12){
      printf("AMBIGUOUS");
    }else{
      printf("MMYY");
    }
  }else{
    if(1<=d&&d<=12){
      printf("YYMM");
    }else{
      printf("NA");
    }
  }
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#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; cin >> n;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        int a; cin >> a;
        if (a != i + 1) cnt++;
    }
    
    cout << ((cnt == 0 || cnt == 2) ? "YES" : "NO") << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream> 
#include <stdlib.h> 
#include <string.h> 
#include <string> 
#include <sstream>
#include <cstring> 
#include<cmath>
using namespace std;
int main() {
    int x, y, z = 1;
    cin >> x>>y;
    for (int i = 0; i < x; i++) {
        if (z * 2 >=z + y)
            z = z + y;
        else
            z = z * 2;
    }

    cout << z;
    return 0;
}

Measured memory_bytes: 3604
#include<iostream>
#include<map>
using namespace std;
string s;
map<char,int>M;
int id;
char f()
{
	char a,b;
	if(s[id]=='[')
	{
		id++;
		a=f();
	}
	else a=s[id++];
	id++;
	if(s[id]=='[')
	{
		id++;
		b=f();
	}
	else b=s[id++];
	id++;
	if(M[a]>M[b])
	{
		M[a]--;
		return a;
	}
	else
	{
		M[b]--;
		return b;
	}
}
main()
{
	cin>>s;
	char a;int v;
	while(cin>>a>>v)
	{
		M[a]=v;
	}
	id=1;
	f();
	for(pair<char,int>p:M)
	{
		if(p.second!=0)
		{
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
}



Measured memory_bytes: 3208
#include <iostream>
#include <algorithm>
#include <deque>
#define llint long long

using namespace std;

llint n;
llint a[100005], d[100005];

int main(void)
{
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> a[i];
	sort(a+1, a+n+1);
	for(int i = 1; i <= n-1; i++) d[i] = a[i+1]-a[i];
	n--;
	
	llint ans = 0;
	for(llint i = 1; i <= n; i++){
		ans += d[i] * min(i, n+1-i) * 2;
	}
	if(n%2) ans -= d[n/2+1];
	else ans -= min(d[n/2], d[n/2+1]);
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <string.h>


int main(void){
    char whe[10];
    scanf("%s",whe);

    if(strcmp(whe,"Sunny")==0)
    {printf("Cloudy");}
    else if(strcmp(whe,"Cloudy")==0)
    {printf("Rainy");}
    else
    {printf("Sunny");}


}

Measured memory_bytes: 128
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    Map<String, Integer> map_blue = new LinkedHashMap<>();
    Map<String, Integer> map_red = new LinkedHashMap<>();
    int no = 0;
    int onlyblue = 0;
    int both = 0;
    int ans = 0;

    int n = sc.nextInt();
    String blank = sc.nextLine();
    for(int i = 0 ; i < n; i++){
      String s = sc.nextLine();
      map_blue.put(s, map_blue.getOrDefault(s, 0) + 1);
    }

    int m = sc.nextInt();
    blank = sc.nextLine();
    for(int i = 0 ; i < m; i++){
      String s = sc.nextLine();
      map_red.put(s, map_red.getOrDefault(s, 0) + 1);
    }

    //青だけにあるキーで、かつ最大の値を求める処理がガバガバ
    for(String s : map_blue.keySet()){
      int cnt = 0;
      for(String ss : map_red.keySet()){
        if(! (s.equals(ss)) ){
          cnt++;
          if(cnt == map_red.size()){onlyblue = Math.max(onlyblue, map_blue.get(s));}
        }else{
          break;
        }
      }
    }

    for(String s : map_blue.keySet()){
      for(String ss : map_red.keySet()){
        if(s.equals(ss) && map_blue.get(s) > map_red.get(ss)){
            int d = map_blue.get(s) - map_red.get(ss);
            both = Math.max(d, both);
        }
      }
    }

    ans = Math.max(both, Math.max(no, onlyblue));
    System.out.println(ans);
  }
}

/*
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String blank = sc.nextLine();
String s = sc.nextLine();
System.out.println();
System.exit(0)
*/


Measured memory_bytes: 23124
#include <stdio.h>
int main(){
    int cards[4][13]={0};
    int n,number;
    char mark;
    int i,j;
    
    scanf("%d", &n);
    for(i=0;i<n;i++){
        scanf(" %c%d", &mark, &number);
        if(mark=='S'){
            cards[0][number-1] = 1;
        }else if(mark=='H'){
            cards[1][number-1] = 1;
        }else if(mark=='C'){
            cards[2][number-1] = 1;
        }else if(mark=='D'){
            cards[3][number-1] = 1;
        }
    }
    for(i=0;i<4;i++){
        for(j=0;j<13;j++){
            if(cards[i][j] == 0){
                if(i==0){
                    printf("S %d\n",j+1);
                }else if(i==1){
                    printf("H %d\n",j+1);
                }else if(i==2){
                    printf("C %d\n",j+1);
                }else if(i==3){
                    printf("D %d\n",j+1);
                }
            }
        }
    }    
    return 0;
}
    

Measured memory_bytes: 596
#include <climits>
#include <cstdio>
#include <iostream>

using namespace std;

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

    int minimum = INT_MAX;
    int maximum = INT_MIN;
    long long sum = 0;

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        minimum = min(x, minimum);
        maximum = max(x, maximum);
        sum += x;
    }

    printf("%d %d %lld\n", minimum, maximum, sum);

    return 0;
}


Measured memory_bytes: 3204
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(){
  int n;
  cin>>n;
  bool ans=false;
  for(int i=1;i<=9;i++){
    int a=n%i;
    int b=n/i;
    if(a==0&&b<=9&&b>=1){
      ans=true;
    }
  }
  if(ans){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  
      
      
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef  long long ll;
//double pi=3.1415926535898;
//double pi=acos(-1.0);
#define scarr(a,s,e) for(int i=s;i<=int(e);i++) scanf("%d ",&a[i]);
#define prarr(a,s,e) for(int i=s;i<=int(e);i++) printf("%d ",a[i]);
#define speed      ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
#define rng(i,a,b) for(int i=a;i>=int(b);i--)
#define rep(i,a,b) for(int i=a;i<=int(b);++i)
#define lop(i,n)   for(int i=0;i<int(n);i++)
#define ms(x,a)    memset(x,a,sizeof(x))
#define all(x)     (x).begin(),(x).end()
#define sz(x)      int(x.size())
#define pb         push_back
#define mkp        make_pair
#define sc(x)      scanf("%d",&x)
#define scl(x)     scanf("%lld",&x)
#define pr(x)      printf("%d ",x)
#define prl(x)     printf("%lld ",x)
#define prln(x)    printf("%d\n",x)
#define prlln(x)   printf("%lld\n",x)
#define r0         return 0;
#define CC         continue;
#define scd(x)     scanf("%lf",&x)
#define prd(x)     printf("%.10f\n",x)
#define bb(x)      cerr<< x <<endl;
#define pii        pair<int,int>
#define vi         vector<int>
#define fr         first
#define se         second
//#define max(a,b) a<b?b:a
//#define min(a,b) a<b?a:b
const ll M  = 1e9+7 ;
const ll inf = 1e18 ;
const int si = 1e5+9;
const int N = 1e5+5 ;
//////////////////////    Hi    ^_^  hack me if you can :P

int main()
{
    string s;
    cin >> s;
    int c =-1 , f =-1;
    lop(i,sz(s)){
    if(s[i]=='C')
        c=i;
    if(c!=-1)
        break;
    }
    for(int i=sz(s)-1;i>=0;i--){
    if(s[i]=='F')
        f=i;
    if(f!=-1)
        break;
    }
    if(c==-1||f==-1){
        puts("No");
        r0;
    }
    if(f>c){
        puts("Yes");
    }else{
        puts("No");
    }
    r0;
}

/*

ll pwmod(ll a, ll n, ll mod) {
    ll ret = 1;
    while (n) {
        if (n & 1) ret = ret * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return ret;
}
Wj0944296025*
*/
/*
freopen("output.txt","w",stdout);
freopen("input.txt","r",stdin);
for (int i=0;i<n;i++)            Hi    ^_^  hack me if you can :P
int mx[]= {0,0,1,-1, 1,1,-1,-1};
int my[]= {1,-1,0,0, 1,-1,1,-1};
bool inside (int i,int j) {return (i>=0 && i<n && j>=0 && j<m);}

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void gcd(LL n,LL m,LL &d,LL &xx,LL &yy){
    if(!m) {d=n; xx=1; yy=0;}
    else {gcd(m,n%m,d,yy,xx); yy-=xx*(n/m);}
}

int getm(int l,int r)
{
    if(l>r)
        return N;
    if(l==r)
        return 0;
    if(l==r-1)
        return s[l] != s[r];
    if(s[l]==s[r])
        return getm(l+1,r-1);
    else
        return 1+min(getm(l+1,r),getm(l,r-1));
}

int BIT[si], a[si], n;
void update(int x, int delta)
{
    for(; x <= N; x += x&-x)
        BIT[x] += delta;
}
int query(int x)
{
    int sum = 0;
    for(; x > 0; x -= x&-x)
        sum += BIT[x];
    return sum;
}

*/


Measured memory_bytes: 256
#include <string.h>
#include <stdlib.h>

#include <cstdio>
#include <string>
#include <iostream>
#include <cstdlib>
#include <tuple>
#include <typeinfo>
#include <algorithm>
#include <vector>
#include <iomanip>

using namespace std;

int main(void)
{
	int n,m;

	cin>>n>>m;

	tuple<int,int,int> data[m];

	for(int i=0;i<m;i++){
		int p,y;
		cin>>p>>y;

		data[i]=make_tuple(y,p,i);
	}

	sort(data,data+m);

	int cnt[n];
	pair<int,int> id[m];

	fill(cnt,cnt+n+1,0);

	for(int i=0;i<m;i++){
		int y,p,idx;
		tie(y,p,idx)=data[i];
		cnt[p]++;
		id[idx]=make_pair(p,cnt[p]);
	}

	for(int i=0;i<m;i++){
		cout<<setw(6)<<setfill('0')<<id[i].first;
		cout<<setw(6)<<setfill('0')<<id[i].second<<endl;
	}

	return 0;
}


Measured memory_bytes: 3840
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
count1 = 0
count2 = 0
for s in range(n):
	if a[s] > b[s]:
		count1 += a[s]
		count2 += b[s]
print(count1 - count2)

Measured memory_bytes: 3060
#include <stdio.h>

#define COUNT	10

int main(void) {
	char buffer[32] = {0};
	int data;
	int i, no1 = 0, no2 = 0, no3 = 0;
	for (i = 0; i < COUNT; i++) {
		fgets(buffer, sizeof(buffer)/sizeof(buffer[0]), stdin);
		if (1 == sscanf(buffer, "%d", &data)) {
			if (data > no1) {
				no3 = no2;
				no2 = no1;
				no1 = data;
			} else if (data > no2) {
				no3 = no2;
				no2 = data;
			} else if (data > no3) {
				no3 = data;
			}
		}
	}
	printf("%d\n", no1);
	printf("%d\n", no2);
	printf("%d\n", no3);
	return 0;
}

Measured memory_bytes: 612
package main

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

type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func main() {
	sc := NewScanner()
	N := sc.nextInt()
	L := sc.nextIntSlice(N)
	sort.Ints(L)
	count := 0
	for i := len(L) - 1; i > 0; i-- {
		for j := i - 1; j >= 0; j-- {
			lower := L[i] - L[j] + 1
			lowerIndex := binarySearch(L, lower)
			upperIndex := j - 1
			if lowerIndex <= upperIndex {
				count += upperIndex - lowerIndex + 1
			}
		}
	}
	fmt.Println(count)
}

func binarySearch(nums []int, key int) int {
	left := -1
	right := len(nums)
	for right-left > 1 {
		mid := left + (right-left)/2
		if nums[mid] >= key {
			right = mid
		} else {
			left = mid
		}
	}
	return right
}


Measured memory_bytes: 640
// This code writed by chtholly_micromaker(MicroMaker)
#include <bits/stdc++.h>
#define reg register
#define int long long
using namespace std;
const int MaxN=200050;
struct Peo
{
	int val;
	inline bool operator < (const Peo &nt) const
	{
		return val<nt.val;
	}
}a[MaxN];
struct Food
{
	int val;
	inline bool operator < (const Food &nt) const
	{
		return val>nt.val;
	}
}b[MaxN];
struct Node
{
	int u,v;
	int mul;
}A[MaxN];
template <class t> inline void rd(t &s)
{
	s=0;
	reg char c=getchar();
	while(!isdigit(c))
		c=getchar();
	while(isdigit(c))
		s=(s<<3)+(s<<1)+(c^48),c=getchar();
	return;
}
int n,k;
inline bool check(int x)
{
	reg int res=0;
	for(int i=1;i<=n;++i)
	{
		if(A[i].mul<=x)
			continue;
		res+=A[i].u-x/A[i].v;
	}
	return res<=k;
}
signed main(void)
{
	cin>>n>>k;
	for(int i=1;i<=n;++i)
		rd(a[i].val);
	for(int i=1;i<=n;++i)
		rd(b[i].val);
	sort(a+1,a+n+1);
	sort(b+1,b+n+1);
	for(int i=1;i<=n;++i)
		A[i].u=a[i].val,A[i].v=b[i].val,A[i].mul=a[i].val*b[i].val;
	reg int l=0,r=1e18,mid,ans=1e18;
	while(l<=r)
	{
		mid=(l+r)>>1;
		if(check(mid))
			ans=mid,r=mid-1;
		else
			l=mid+1;
	}
	printf("%lld\n",ans);
	return 0;
}



Measured memory_bytes: 8064
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
 
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//pair sort
bool compare_by_b(pair<LL, LL> a, pair<LL, LL> b) {
    if(a.second != b.second) return a.second < b.second;
    else return a.first < b.first;
}
std::uint32_t euclidean_gcd(std::uint32_t a, std::uint32_t b){return b != 0 ? euclidean_gcd(b, a % b) : a;}


void solve(std::string S){
    int ans=0;
    char prev=S[0];
    FOR(i,1, S.size()){
        if(S[i]!=prev){
            ans++;
            prev=S[i];
        }
    }
    cout<<ans<<endl;
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


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

using namespace std;

int main()
{ 
	set<int> anumber;
	set<int> bnumber;
	
	 int n;
	cin>>n;
	int a[n];
	for( int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	
	 int m;
	cin>>m;
	int b[m];
	for( int j=0;j<m;j++)
	{
		cin>>b[j];
	}
	
	int count=0;
	for(int k=0;k<n;k++)
	{	/*
		if(k>1)
		{
	
		for(int o=0;o<=k-1;o++)
		{	
			if(a[k]==a[o])break;
		 
			for(int l=0;l<=m;l++)
			{
				if(a[k]==b[l])
				{count++;break;}
			}
		}
		}
		else  */
		/*
		for(int o=0;o<=k-1;o++)
		{	
			if(a[k]==a[o])break;
		 
			for(int l=0;l<=m;l++)
			{
				if(a[k]==b[l])
				{count++;break;}
			}
		}
		
		if(a[k]==a[o])break;*/
		 int temp=anumber.size();
		 anumber.insert(a[k]);
		 if(temp==anumber.size())continue;
			for(int l=0;l<=m;l++)
			{
				if(a[k]==b[l])
				{count++;break;}
			}
		
	}
	cout<<count<<endl;




	return 0;
} 




Measured memory_bytes: 3100
x, y = [int(i) for i in input().split()]
_x = x
# ありうるパターンは
# 符号反転(あり,なし)
# ->インクリメント(負に合わせるのか正に合わせるのか)
# ->符号反転(一意に決定)
# つまり4パターンのみ

count = 10 ** 10
# 符号反転
_x = -x
# 最終反転なし
# インクリメント完全一致
if y >= _x:
    count = min(count, 1 + y - _x)
    # print("count1:{}".format(count))
# 最終反転あり
# インクリメント反転一致
if -y >= _x:
    count = min(count, 1 + (-y) - _x + 1)

# 符号非反転,インクリメント完全一致
_x = x
if y >= _x:
    count = min(count, y - _x)
    # print("count3:{}".format(count))
# インクリメント反転一致
if -y >= _x:
    count = min(count, (-y) - _x + 1)
    # print("count4:{}".format(count))
print(count)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define gcd(m,n) __gcd(m,n)
#define lcm(m,n) m*(n/gcd(m,n))
#define fast std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pi acos(-1.0)
#define endl '\n'
#define MOD 1000000007
#define ull unsigned long long
#define ll long long
#define ld long double
#define pb push_back
#define dbg(x) cout << #x << "  " << x << endl;
 
ll power(ll base, ll exp) 
{ll res=1;while(exp>0) {if(exp%2==1) res=(res*base);base=(base*base);exp/=2;}return res;}
ll mod(ll a, ll b) {return (a % b + b) % b;}
using namespace std;


int main()
{
	fast;
	ll n,m; cin>>n>>m;
	cout << (n)*(n-1) / 2 + (m) * (m-1) / 2 << endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=200111;
const int inf=1000000007;
const int MOD=1000000007;
const double PI = 3.1415926535897932384626433;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};


struct UnionFind {
	vector<int> par;
	UnionFind(int n) : par(n, -1) { }

	int root(int x) {
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

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

	bool merge(int x, int y) {
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y); // merge technique
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x) {
		return -par[root(x)];
	}
};

vvl comb(int n) {
	vvl v(n + 1,vl(n + 1, 0));
	for (int i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int j = 1; j < v.size(); j++) {
		for (int k = 1; k < j; k++) {
			v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
		}
	}
	return v;
}

void sosu(ll x,bool f[]){
	ll y=x;
	for(ll i=2;i<=sqrt(y);i++){
		if(x%i==0){
			x/=i;
			f[i]=true;
			i--;
		}
	}
}

ll __gcd(ll x,ll y){
	if(x<y)swap(x,y);
	while(1){
		ll tmp=x%y;
		x=y;
		y=tmp;
		if(y==0)break;
	}
	return x;
}

int keta(ll a){
	int ke=1;
	while(a/=10)ke++;
	return ke;
}

vector<long long> enum_divisors(long long N) {
	vector<long long> res;
	for (long long i = 1; i * i <= N; ++i) {
		if (N % i == 0) {
			res.push_back(i);
			// 重複しないならば i の相方である N/i も push
			if (N/i != i) res.push_back(N/i);
		}
	}
	// 小さい順に並び替える
	sort(res.begin(), res.end());
	return res;
}

ll zyou(ll x,ll n){
	ll y=1;
	rep(i,0,n){
		y*=x;
	}
	return y;
}


int n,m,up,c[13],a[13][13],ans=inf;

int main() {
	int n;
	cin>>n;
	if(n>=100)n%=100,n%=10;
	else if(n>=10)n%=10;
	if(n==2||n==4||n==5||n==7||n==9)print("hon");
	else if(n==3)print("bon");
	else print("pon");






}

Measured memory_bytes: 3596
#117
'''Theorem: an N-sided polygon satisfying the condition can be drawn 
if and only if the longest side is strictly shorter than the sum of the lengths of the other 
N−1 sides.'''

n = int(input())
sides = [int(_) for _ in input().split()]
sides.sort()
sidelen = 0
for i in range(n-1):
    sidelen += sides[i]
if sidelen > sides[-1]:
    print("Yes")
else:
    print("No")

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

long double p[1000001] = {};

int main() {

  /*
  for ( long long int i = 1000000; i >= 1; i-- ) {

    long long int q = i;
    long long int a = 0;
    while( q > 0 ) {
      a += q % 10;
      q /= 10;
    }
    p[i] = i;
    p[i] /= a;
    if ( i > 100000 ) continue;

    bool flag = true;

    for ( long long int j = i + 1; j <= 1000000; j++ ) {
      if ( p[i] <= p[j] ) continue;
      flag = false;
      break;
    }
    if ( flag ) cout << i << endl;

  }

  return 0;
  */

  long long int k;
  cin >> k;

  set< long long int > ans;

  for ( long long int i = 1; i < 10; i++ ) {
    ans.insert(i);
  }

  long long int cnt = 9;
  long long int q = 10;
  long long int st = 1;
  long long int en = 10;

  for ( long long int i = 0; i < 15; i++ ) {

    for ( long long int p = st; p < en; p++ ) {
      ans.insert( p * q + cnt );
    }

    cnt = cnt * 10 + 9;
    q *= 10;
    en += 10;

  }

  vector< long long int > aa;
  vector< long double > dd;

  set<long long int>::iterator itr = ans.begin();

  for ( long long int i = 0;; i++ ) {

    long long int pp = *itr;
    itr++;
    if ( itr == ans.end() ) break;

    aa.push_back( pp );

    long double d = pp;
    long long int ss = 0;
    while( pp > 0 ) {
      ss += pp % 10;
      pp /= 10;
    }
    d /= ss;
    dd.push_back( d );

  }

  for ( long long int i = 0; i < aa.size(); i++ ) {

    long long int q = aa[i];

    for ( long long int j = i + 1; j < aa.size(); j++ ) {

      if ( dd[i] <= dd[j] ) continue;
      aa[i] = 0;
      break;

    }

  }


  cnt = 0;

  for ( long long int i = 0; i < aa.size(); i++ ) {

    if ( aa[i] == 0 ) continue;
    cnt++;
    cout << aa[i] << endl;
    if ( cnt == k ) break;

  }

  return 0;

}


Measured memory_bytes: 384
def No():
    print("-1")
    exit()

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

# print(N+M)
    
S = []
C = []
Flag = True

for i in range(0,M):
    s,c = map(int, input().split(" "))
    for j in range(0, len(S)):
        if s == S[j] and c != C[j]:
            Flag = False
    S.append(s)
    C.append(c)

if Flag is False:
    No()
output = 0
flag = [False,False,False]
# print(S)
# print(C)
# if S.count(1) == 0:
#     print(S.count(1))
#     No()

for i in range(0,len(S)):
    
    if S[i] == 1 and flag[0]==False:
        if C[i] == 0 and N != 1:
            No()
        output += 100 * C[i]
        flag[0]=True
        
    if S[i] == 2 and flag[1]==False:
        output += 10 * C[i]
        flag[1]=True
        
    if S[i] == 3 and flag[2] == False:
        output += C[i]
        flag[2]=True
        
if (N == 3 or N == 2) and flag[0]==False:
    output += 100

output = int(output / (10 ** (3-N)))
# print(output)
if output < 10 ** (N-1) and output != 0:
    No()
print(output)

Measured memory_bytes: 3064
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (int64_t)(n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

#define chmax(a, b) (a) = max(a, b)
#define chmin(a, b) (a) = min(a, b)

int D;
vector<int> c(26);
vector<vector<int>> s;

int64_t calc_score(const vector<int>& t) {
  int64_t result = 0;
  vector<int> last(26, -1);
  rep(i, D) {
    const int j = t[i];
    result += s[i][j];
    last[j] = i;
    rep(k, 26) { result -= c[k] * (i - last[k]); }
  }
  return result;
}

int main() {
  cin >> D;

  rep(i, 26) { cin >> c[i]; }

  s.resize(D, vector<int>(26));
  rep(i, D) rep(j, 26) { cin >> s[i][j]; }

  int64_t score = numeric_limits<int64_t>::min();
  vector<int> sln(D);
  vector<int> last(26, -1);
  rep(i, D) {
    int next;
    int64_t point = numeric_limits<int64_t>::min();
    int64_t penalty = 0;
    rep(j, 26) { penalty += c[j] * (i - last[j]); }
    rep(j, 26) {
      int z = s[i][j] - penalty + c[j] * (i - last[j]);
      if (point < z) {
        point = z;
        next = j;
      }
    }

    last[next] = i;
    sln[i] = next;
    score += point;
  }

  mt19937 rng(111);
  uniform_int_distribution<int> select_day(0, D - 1);
  uniform_int_distribution<int> select_kind(0, 25);
  rep(iter, 100'000) {
    int j = select_day(rng);
    int old = sln[j];
    sln[j] = select_kind(rng);

    int64_t z = calc_score(sln);
    if (score > z) {
      sln[j] = old;
    } else {
      score = z;
    }
  }

  rep(i, D) { cout << sln[i] + 1 << "\n"; }
  cerr << "score = " << score << "\n";

  return 0;
}

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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////



ll N, A[20], B[20];
ll ab[20][3];
map<ll,ll> dp[1 << 19];

ll i, j,k;
int main(){
    scanf("%lld",&N);
    fornum(i,0,N){
        scanf("%lld", &A[i]);
    }
    fornum(i,0,N){
        scanf("%lld", &B[i]);
    }
    fornum(i,0,N){
        if(i%2==0){
            ab[i][0] = A[i];
            ab[i][1] = B[i];
        }else{
            ab[i][0] = B[i];
            ab[i][1] = A[i];
        }
    }
    dp[0][0] = 0;

    fornum(i,0,1<<N){
        ll a = __builtin_popcountll(i) % 2;
        vector<pll> vv;
        fornum(j,0,N){
            if((i&(1<<j))==0){
                vv.push_back({ab[j][a], j});
            }
        }
        
        ll b = vv.size();
        
        for(auto& it:dp[i]){
            ll c = it.first;
            ll d = it.second;
            fornum(k,0,b){
                if(vv[k].first<c){
                    continue;
                }
                ll e = i | (1 << vv[k].second);
                if(dp[e].find(vv[k].first)==dp[e].end()){
                    dp[e][vv[k].first] = d + k;
                }else{
                    dp[e][vv[k].first] = min(d + k, dp[e][vv[k].first]);
                }
            }
        }
    }
    ll ans = 1e9;
    for(auto& it:dp[(1<<N)-1]){
        ans = min(ans, it.second);
    }
    
    printf("%lld", ans == 1e9 ? -1 : ans);

    return 0;
}

Measured memory_bytes: 50688
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
const int mod = 1e9+7;

int main() {
    int n; cin >> n;
    vint a(n+1);
    rep(i,n+1) cin >> a[i];
    vll y(n+1);
    y[n] = a[n];
    for (int i = n-1; i >= 0; i--) {
        y[i] = y[i+1]+a[i];
    }
    ll ans = 1;
    ll now = 1;
    int id;
    rep(i,n+1) {
        now = (now-a[i])*2;
        if (now < 0) {cout << -1 << endl; return 0;}
        if (now >= y[i+1]) {id = i+1; break;}
        ans += now;
    }
    for (int i = id; i < n+1; i++) ans += y[i];
    cout << ans << endl;
}

Measured memory_bytes: 4564
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,a,b) for (int i=a; i<b; ++i)
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll N, W;
    cin >> N >> W;
    vector <ll> weights(N+1), values(N+1);
    for (int i=1; i<=N;++i) cin >> weights[i] >> values[i];
    vector < vector<ll> > dp(N+1, vector <ll> (W+1));
    for (int i=0; i<=W;++i) dp[0][i]=0;
    for (int i=1; i<=N;++i)
    {
        for (int j=1; j<=W;++j)
        {
            if (weights[i]>j) dp[i][j]=dp[i-1][j];
            else dp[i][j] = max(dp[i-1][j], dp[i-1][j-weights[i]] + values[i]);
        }
    }
    cout << dp[N][W] << "\n";
    return 0;
}


Measured memory_bytes: 80256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <iomanip> 

#include <atcoder/all>

using namespace std;
using namespace atcoder;

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

#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;(i) < ((int)(n));++(i))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

constexpr int INF = 1e9+7;
constexpr ll INFL = 9*1e18;

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

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

int inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T SUM(vector<T> vec){return accumulate(all(vec),(T)0);} // vectorの中身を全部足す
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T>inline void print(T&& x){cout<<setprecision(32)<<x<<endl;}


// TODO: write
int main() {
  int n;cin>>n;
  rep(i,n)cout<<("ACL");
  return 0;
}

Measured memory_bytes: 3512
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n; int k; cin >> n >> k;
    int ret = 0;
    for (int i = 0; i < n; ++i) { 
        int h = 0;
        cin >> h;
        if (k <= h) { ret++;}
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int n,m;
    cin >> n >> m;
    int sum = 1;
    int cnt = 0;
    while(sum < m){
        sum += n;
        sum--;
        cnt++;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
package main

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

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

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

const M = 1046527

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanLines)
	n := nextInt()
	S := make([]string, M)
	for i := 0; i < n; i++ {
		in := nextStr()
		l := strings.Split(in, " ")
		switch l[0] {
		case "insert":
			S = insert(S, l[1])
		case "find":
			if find(S, l[1]) {
				fmt.Println("yes")
			} else {
				fmt.Println("no")
			}
		}
	}

}

func getChar(s string) int {
	switch s {
	case "A":
		return 1
	case "C":
		return 2
	case "G":
		return 3
	case "T":
		return 4
	default:
		return 0
	}
}

func getKey(s string) int {
	sum := 0
	p := 1
	for i := 0; i < len(s); i++ {
		sum += p * getChar(string(s[i]))
		p *= 5
	}
	return sum
}

func h1(key int) int {
	return key % M
}

func h2(key int) int {
	return 1 + (key % (M - 1))
}

func find(S []string, s string) bool {
	key := getKey(s)
	for i := 0; ; i++ {
		h := (h1(key) + i*h2(key)) % M
		if S[h] == s {
			return true
		} else if len(S[h]) == 0 {
			return false
		}
	}
}

func insert(S []string, s string) []string {
	key := getKey(s)
	for i := 0; ; i++ {
		//ハッシュ値hに重複があれば、iをイテレート
		h := (h1(key) + i*h2(key)) % M
		if S[h] == s {
			return S
		} else if len(S[h]) == 0 {
			S[h] = s
			return S
		}
	}
}



Measured memory_bytes: 40188
#include <stdio.h>

typedef struct element_{
	int h, p, q;
} element;

void elem_copy(element* src, element* dst) {
	src->h = dst->h;
	src->p = dst->p;
	src->q = dst->q;
}

int main(void) {
	int n, m, a, i, j;
	int line[105];
	element elem[1001];
	element e;
	int t;
	
	while(scanf("%d %d %d\n", &n, &m, &a)==3) {
		if(n==0 && m==0 && a==0) break;
		
		for(i=0;i<=100;i++) line[i] = i;
		
		for(i=0;i<m;i++) {
			scanf("%d %d %d\n", &(elem[i].h), &(elem[i].p), &(elem[i].q));
		}
	
		for(i=0;i<m-1;i++) {
			for(j=i+1;j<m;j++) {
				if(elem[i].h < elem[j].h) {
					elem_copy(&e, &elem[i]);
					elem_copy(&elem[i], &elem[j]);
					elem_copy(&elem[j], &e);
				}
			}
		}
		
		for(i=0;i<m;i++) {
			t = line[elem[i].p];
			line[elem[i].p] = line[elem[i].q];
			line[elem[i].q] = t;
		}
		
		for(i=0;i<=n;i++) {
			if(line[i] == a) {
				printf("%d\n", i);
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 612
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<algorithm>
#include<list>
#include<cstring>
#include <numeric>

#define ll long long
#define int long long
#define ld long double
#define endl "\n"
#define debugv(v) cerr<<#v<<" : ";for (auto x:v) cerr<<x<<' ';cerr<<endl;
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define debugp(p) cerr<<#p<<'='<<(p.first)<<" "<<p.second<<endl;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define output(x)   cout << (x ? "YES" : "NO")<<endl;
const ll MOD = 1e9 + 7;
const int N = 1000000000000001;
const int demo = 10;
using namespace std;
const ll cfmod=998244353;
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
char button[4]={'L','R','U','D'};

// Ahhiya thi lakhvanu chalu thasse....


signed main() {
    FAST
    int q = 1;
    //cin>>q;
    while (q--) {
        int n,k;
        cin>>n>>k;
        vector<int> pos,neg;
        int arr[n];
        for(int i=0;i<n;i++){
            int x;
            cin>>x;
            arr[i]=x;
            if(x>0){
                pos.push_back(x);
            }
            else{
                neg.push_back(-x);
            }
        }
        if(n==k){
            int shrey=1;
            for(int i=0;i<k;i++){
                shrey=(((shrey*arr[i])%MOD)+MOD)%MOD;
            }
            cout<<(shrey+MOD)%MOD;
            return 0;
        }
        int ans=1;
        sort(pos.begin(),pos.end());
        sort(neg.begin(),neg.end());
        int pl=pos.size()-1,nl=neg.size()-1;
        if(k%2){
            if(pos.size()){
                ans=pos[pl--];
            }
            else{
                for(int i=0;i<k;i++){
                    ans=((ans*(-neg[i]))%MOD+MOD)%MOD;
                }
                cout<<(ans+MOD)%MOD;
                return 0;
            }
        }
        //debugv(pos)debugv(neg)
        for(int i=0;i<k/2;i++){
            int left=0,right=0;
            if(pl>=1){
                left=pos[pl]*pos[pl-1];
            }
            if(nl>=1){
                right=neg[nl]*neg[nl-1];
            }
            if(left>right){
                pl-=2;
                left%=MOD;
                ans=(ans*left)%MOD;
            }
            else{
                nl-=2;
                right%=MOD;
                ans=(ans*right)%MOD;
            }
        }
        cout<<ans%MOD;
    }
}

Measured memory_bytes: 6608
#include <stdio.h>
int main(void){
int a,b;
  scanf("%d %d",&a,&b);
  
  if((a==1||a==3||a==5||a==7||a==8||a==10||a==12)&&(b==1||b==3||b==5||b==7||b==8||b==10||b==12))
  {printf("Yes"); return 0;}
  if((a==4||a==6||a==9||a==11)&&(b==4||b==6||b==9||b==11))
    {printf("Yes");return 0;}
  if(a==2&&b==2)
  {printf("Yes");return 0;}
  printf("No");
  return 0;
}

Measured memory_bytes: 128
fun main(args: Array<String>) {
    val List = readLine()!!.split(" ").map(String::toInt)
    val A = List[0]
    val B = List[1]
    if(A >= 13) {
        println(B)
    } else if(A >= 6 && A <= 12) {
        println(B / 2)
    } else if (A <= 5) {
        println(0)
    }
}

Measured memory_bytes: 37576
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<cmath>
using namespace std;

#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)
#define absd(x) (x<0?-(x):x)
#define pow2(x) ((x)*(x))
#define rep(i,n) for(int i=0; i<n; ++i)
#define repr(i,n) for(int i=n-1; i>=0; --i)
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define replr(i,s,n) for(int i=n; i>=s; --i)
#define repf(i,s,n,j) for(int i=s; i<=n; i+=j)
#define repe(e,obj) for(auto e : obj)

#define SP << " " <<
#define COL << " : " <<
#define COM << ", " <<
#define ARR << " -> " <<
#define PNT(STR) cout << STR << endl
#define POS(X,Y) "(" << X << ", " << Y << ")"
#define DEB(A) " (" << #A << ") " << A
#define DEBREP(i,n,val) for(int i=0; i<n; ++i) cout << val << " "; cout << endl
#define ALL(V) (V).begin(), (V).end()
#define INF 1000000007
#define INFLL 10000000000000000007LL
#define EPS 1e-9

typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
//typedef pair<ll, ll> P;
typedef pair<P, int> PI;
typedef pair<int, P> IP;
typedef pair<P, P> PP;
typedef priority_queue<P, vector<P>, greater<P> > pvqueue;

ll gcd(ll m, ll n) {
  if(m < n) return gcd(n, m);
  ll r = m%n;
  return r ? gcd(n, r) : n;
}

int p, q, a, n;
// p/q = 1/a{0} + ... + 1/a{c-1} + x/y
// where P_{i=0..c-1}a{i} = s
int dfs(ll x, ll y, ll s, ll c, ll now) {
  int res = (x == 1 && now <= y && s * y <= a && c+1<=n);
  if(s * now > a || c >= n || x*now > y*(n-c)) return res;
  // use
  int nx = x*now-y, ny = y*now;
  if(nx != 0) {
    int g = gcd(nx, ny);
    nx /= g; ny /= g;
    int nxt = (ny+nx-1) / nx;
    nxt = maxd(nxt, now);
    res += dfs(nx, ny, s*now, c+1, nxt);
  }
  // next
  res += dfs(x, y, s, c, now+1);
  return res;
}

int main() {
  while(cin >> p >> q >> a >> n && p+q+a+n) {
    int g = gcd(p, q);
    cout << dfs(p/g, q/g, 1, 0, maxd(1, (p+q-1)/p)) << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
#define rep(i, a) for (int i = 0; i < (a); i++)
using namespace std;

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

	vector<int> e(n+1), w(n+1);

	e[0] = 0;
	w[0] = 0;

	int i;
	for(i = 0; i < n; i++){
		if(s[i] == 'E'){
			e[i+1] = e[i] + 1;
			w[i+1] = w[i];
		}else{
			w[i+1] = w[i] + 1;
			e[i+1] = e[i];
		}
	}

	int ans = 1000000;
	for(i = 0; i < n; i++){
		ans = min(ans, w[i] + e[n]-e[i+1]);
	}

	cout << ans << endl;
}
	


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

#define pb push_back
#define fi first
#define SZ(x) (int((x).size()))
#define se second
#define ll long long
#define pq priority_queue
#define MP make_pair
#define pii pair<int,int>
#define mod 998244353
#define debug(x) cerr<<#x<<"="<<x<<'\n'

char s[200];
int k;
ll f[200][2][10];
//0:< 1:=

int main(){
	cin>>s+1>>k;
	memset(f,0ll,sizeof(f));
	f[1][0][0]=1;
	f[1][0][1]=(ll)(s[1]-'1');
	f[1][1][1]=1;
	for (int i=1;i<strlen(s+1);i++) 
		for (int j=0;j<=k;j++) {
			//non-zero
			f[i+1][0][j+1]+=f[i][0][j]*9ll+f[i][1][j]*max(0ll,(ll)(s[i+1]-'1'));
			if (s[i+1]!='0') f[i+1][1][j+1]+=f[i][1][j];
			//zero
			f[i+1][0][j]+=f[i][0][j];
			if (s[i+1]!='0') f[i+1][0][j]+=f[i][1][j];
			else f[i+1][1][j]+=f[i][1][j];
//			printf("%d %d ",f[i+1][0][j+1],f[i+1][1][j+1]);
//			printf("f[%d][0][%d]=%d f[%d][1][%d]=%d\n",i,j,f[i][0][j],i,j,f[i][1][j]);
		}
	cout<<f[strlen(s+1)][0][k]+f[strlen(s+1)][1][k];
	return 0;
}

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

typedef long long int lli;
typedef pair<lli, lli> ii;
typedef vector<int> vi;

const int MOD = 998244353;
const int N = 3000;
lli dp[N][N];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	lli a, b, c, d;
	cin >> a >> b >> c >> d;
	for(lli i = 0; i < c; i++) for(lli j = 0; j < d; j++) {
		dp[i][j] = 0;
		if(i > 0) dp[i][j] += (j+1)*dp[i-1][j];
		if(j > 0) dp[i][j] += (i+1)*dp[i][j-1];
		if(i > 0 && j > 0) dp[i][j] -= i*j*dp[i-1][j-1];
		if(i == a-1 && j == b-1) dp[i][j]++;
		dp[i][j] %= MOD;
		dp[i][j] += MOD;
		dp[i][j] %= MOD;
	}

	cout << dp[c-1][d-1] << endl;

	return 0;
}

Measured memory_bytes: 73944
#include <bits/stdc++.h>
using namespace std;
const int dx[]={0,1,0,-1,1,-1,-1,1};
const int dy[]={-1,0,1,0,1,1,-1,-1};
const int INF = 1<<30;
const double EPS = 1e-8;
#define PB push_back
#define mk make_pair
#define fi first
#define se second
#define ll long long
#define reps(i,j,k) for(int i = (j); i < (k); i++)
#define rep(i,j) reps(i,0,j)
#define MOD 1000000007
typedef pair<int,int> Pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
string s;
int INDEX;
int expr(){
    INDEX++;
    if(isdigit(s[INDEX])){
        int num = s[INDEX] - '0';
        INDEX++;
        while(isdigit(s[INDEX])){
            num = num * 10 + s[INDEX] - '0';
            INDEX++;
        }
        INDEX++;
        return num/2+1;
    }
    vi p;
    while(s[INDEX] != ']'){
        p.PB(expr());
    }
    INDEX++;
    sort(p.begin(),p.end());
    int tmp = 0;
    rep(i,p.size()/2+1){
        tmp += p[i];
    }
    return tmp;
}
int main(){
    int N;
    cin >> N;
    while(N--){
        INDEX = 0;
        cin >> s;
        cout << expr() << "\n";
    }
    return 0;
}

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

count = [[0] * 10 for i in range(10)]

base = 1
for i in range(1, n + 1):
    if i >= base * 10:
        base *= 10
    count[i // base][i % 10] += 1

total = 0
base = 1
for i in range(1, n + 1):
    if i >= base * 10:
        base *= 10
    total += count[i % 10][i // base]

print(total)

Measured memory_bytes: 38768
import math
a,b,x = map(int,input().split())

x = x/a

if a*b/2>=x:
    S = (2*x)/(b*b)
    theta = math.atan(S)
    theta = math.degrees(theta)
    print(90-theta)
else:
    S = 2*(a*b-x)/(a*a)
    theta = math.atan(S)
    theta = math.degrees(theta)
    print(theta)

Measured memory_bytes: 3060
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=9e18;
typedef pair<int,int> P;
int n,a,b;
ll power(int a,int b){
	int sum=1;
	for (; b; b>>=1){
		if (b&1)	sum=1ll*sum*a%MOD;
		a=1ll*a*a%MOD;
	}
	return sum;
}
ll calc(int n,int x){
	ll sum=1;
	for (int i=n; i>=n-x+1; i--)	
		sum=sum*i%MOD;
	for (int i=1; i<=x; i++)
        //modの世界では、Xで割ることとX^(MOD-2)で掛けることが等価
		sum=sum*power(i,MOD-2)%MOD;
	return sum;
}
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  ll cnt1;
  cin >> n >> a >> b;
  cnt1=(power(2,n)-1+MOD)%MOD;
  cnt1=(cnt1-calc(n,a)-calc(n,b)+MOD)%MOD;
  cnt1=(cnt1+MOD)%MOD;
  cout << cnt1 << endl;
}

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


int main() {
  long long n;
  long long v[90];
  v[0] = 2;
  v[1] = 1;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    v[i] = v[i - 2] + v[i - 1];
  }
  cout << v[n];
  return 0;
}


Measured memory_bytes: 256