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

int main(){
  long long A,B,C;
  cin >> A >> B >> C;
  if(A%2==0 || B%2==0 || C%2==0){
    cout << 0 << endl;
  }
  else{
    cout << min({A*B,B*C,C*A}) << endl;
  }
} 

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

using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
#define INF 1e9

int main(){
    int n; cin >> n;
    vector<int> p(n);
    rep(i,n) {
        int a; cin >> a;
        a--;
        p[i] = a;
    }
    
    int ans = 0;
    int cnt = 0;
    rep(i,n){
        if(i == p[i]){
            cnt++;
        }
        else{
            if(cnt > 0){
                if(cnt == 1){
                    ans++;
                    
                }else{
                    ans += (cnt+1)/2;
                }
                cnt = 0;
            }
        }
    }
    if(cnt > 0){
        if(cnt == 1){
            ans++;
        }else{
            ans += (cnt+1)/2;
        }
    }
    
    cout << ans << endl;
    
    
    
    
}


Measured memory_bytes: 640
import java.io.*;
 
public class Main {
	public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args) throws IOException {
		new Main();
	}
	public Main() throws IOException {
		new aoj101().doIt();
	}
	class aoj101{
		void doIt() throws IOException {
	        String number = br.readLine();
	        int n = Integer.parseInt(number);
	         
	        for(int i=0; i<n; i++){
	             String str = br.readLine();
	             str = str.replaceAll("Hoshino","Hoshina");
	             System.out.println(str);
	        }
	    }
	}
}

Measured memory_bytes: 16964
n = int(input())
a = list(map(int, input().split()))

# a[0]^a[1]^a[2] == 0
# a[1]^a[2]^a[3] == 0
# すなわち a[0] == a[3] と出来れば良い

# 1)すべて0
# 2) ある値が2n/3, 0がn/3
# 3) 3つの値がそれぞれn/3ずつ
b = list(set(a))
kind = len(b)
if kind == 1 and a[0] == 0:
    print('Yes')
    exit()
elif kind == 2 and a.count(0) == n//3 and n % 3 == 0:
    print('Yes')
    exit()
elif kind == 3:
    if a.count(b[0]) == a.count(b[1]) == a.count(b[2]) == n/3 and b[0] ^ b[1] ^ b[2] == 0:
        print('Yes')
        exit()
print('No')


Measured memory_bytes: 14212
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <bitset>
#include <vector>
using namespace std;

#define LL long long

#define fi first
#define se second
#define lson l,mid,id<<1
#define rson mid+1,r,id<<1|1
#define ls id<<1
#define rs id<<1|1
#define MID(a,b) (((a)+(b))>>1)
#define maxx(a,b) ((a)<(b)?(b):(a))
#define minx(a,b) ((a)<(b)?(a):(b))
#define absx(a) ((a)<0?-(a):(a))
#define mk(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define itr iterator
#define lowbit(x) ((x)&-(x))

typedef unsigned LL ULL;
typedef unsigned uint;
typedef map<int,int> mii;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;

template< typename T > inline void read(T &x) {
    bool f; char ch; f=0; x=0; ch=getchar();
    while(ch<'0' || ch>'9') {if(ch=='-') f=1; ch=getchar();}
    while(ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
    if(f) x=-x;
}

template< typename T > inline void Max(T &a, T b) {if(a<b) a=b;}
template< typename T > inline void Min(T &a, T b) {if(b<a) a=b;}
template< typename T > inline T Abs(T a) {if(a<0) return -a; else return a;}

const double pi=(double) acos(-1.0);
const int MOD=(int) 1e9+7;
const int INF=(int) 0x3f3f3f3f;
const LL  LINF=(LL) INF<<32|INF;
const int SINF=(uint) ~0>>1;
const LL  SLINF=(ULL) (-1)>>1;
const double DINF=(double) 1e50;
const double eps=(double) 1e-8;
const int maxn=(int) 4e3+20;
const int maxm=(int) 1e5+20;
const int maxk=(int) 5e2+20;

inline int sig(double x) {return x<-eps?-1:x>eps;}

//--------------start------------------

int n;
int a[305][305],b[305][305];

void work()
{
    read(n);
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
            read(a[i][j]), b[i][j]=a[i][j];

    for(int k=0;k<n;k++)
        for(int i=0;i<n;i++)
            for(int j=0;j<n;j++)
                Min(a[i][j],a[i][k]+a[k][j]);

    bool flag=0;

    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
            flag |= a[i][j] != b[i][j] ;

    if(flag)
    {
        puts("-1");
        return ;
    }

    LL ans=0;

    for(int i=0;i<n;i++)
        for(int j=i+1;j<n;j++)
        {
            bool flag=1;
            for(int k=0;k<n;k++) if(k!=i && k!=j && a[i][j]==a[i][k]+a[k][j]) flag=0;

            if(flag) ans+=a[i][j];
        }

    cout <<ans <<endl;
}

//--------------end--------------------

int main()
{
#ifdef yukihana0416
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // yukihana0416
    work();
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

ll t[100001],a[100001];

int main() {

	int n;
	cin>>n;
	rep(i,n)cin>>t[i];
	rep(i,n)cin>>a[i];

	ll total=1;
	rep(i,n){
		int f=0;
		if(t[i]!=t[i-1]&&a[i]!=a[i+1]&&t[i]!=a[i])f=1;
		if(t[i]!=t[i-1]&&a[i]<t[i])f=1;
		if(a[i]!=a[i+1]&&t[i]<a[i])f=1;
		if(f==1){
			cout<<"0"<<endl;
			return 0;
		}
		if(t[i]==t[i-1]&&a[i]==a[i+1])total*=min(t[i],a[i]);
		total%=i197;
	}
	cout<<total<<endl;
	return 0;

}


Measured memory_bytes: 1792
#include<stdio.h>
#include<stdlib.h>
#define NIL -1

typedef struct node{

  int key;  
  struct node *p;
  struct node *r;
  struct node *l;
}Node; 

void insert(int);
void nodegene(Node *, int);
void print();
void in_p(Node *);
void pre_p(Node *);
void find(Node *,int ); 
Node *root = NULL;

int main(){

  char str[10];
  int i,n,m,l;
  Node *node;

  scanf("%d", &n);

  //scanf("%d", &l);
  //nodegene( root,l);

  for( i = 0; i < n; i++){

    scanf("%s", str);

    switch(str[0]){
    case 'i':
      scanf("%d",&m);
      insert(m);
      break;

    case 'p':
      print();
      break;

    case 'f':
      scanf("%d",&l);
      find( root, l);
      break;
    }
  }
return 0;
}

void nodegene(Node *n,int num){
  n -> key = num;
  n -> p = NULL;
  n -> r = NULL;  
  n -> l = NULL;
}


void insert(int n){
 
  Node *p = malloc(sizeof(Node));
  Node *search;

  nodegene( p, n);

  if(root == NULL){
    root = p;
    return;
  }

  search = root;

  while (1) {
    if (p -> key < search -> key) {
      if (search -> l == NULL) {
	search -> l = p;
	break;
      } 
      else {
	search = search -> l;
      }
    } 
    else {
      if (search -> r == NULL) {
	search -> r = p;
	break;
      } 
      else {
	search = search -> r;
      }
    }
  }
  search = p;
 
}


void in_p(Node *n){
  
  if(n != NULL){
    in_p(n -> l);
    printf(" %d", n -> key);
    in_p(n -> r);
  }
}

void pre_p(Node *n){
  
  if(n != NULL){  
    printf(" %d", n -> key);
    pre_p(n -> l);
    pre_p(n -> r);
  }
}

void print(){

  in_p( root);
  printf("\n");  
  pre_p( root);
  printf("\n");
}

void find(Node *node,int n){

  if(node == NULL){
    printf("no\n");
    return;
  }
  
  if(node -> key == n){
    printf("yes\n");
    return;
  }
  
    if(n < node -> key) find( node -> l, n);

    if(n > node -> key) find( node -> r, n);
}

Measured memory_bytes: 19364
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define STRINGLENGTH 1001

int main (void){

    char word[11],text[STRINGLENGTH];
    scanf("%s",word);
    int count =0 ;

    do
    {
    
    scanf("%s",text);
    // strcmp (a,b) a==bなら0を返す　a,bは文字列（アドレスを渡す）
    if(strcmp(text,"END_OF_TEXT") == 0)break; 
     
    for(int i = 0; text[i] != '\0'; i++)
    {
        text[i] = tolower(text[i]);
    }
    if(strcmp(word,text) == 0)count++;
    
    } while (1);
    printf("%d\n",count);
    return 0;
}





Measured memory_bytes: 2100
import java.util.Scanner;
import java.util.Arrays;

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

        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] p = new int[n];
        for(int i = 0; i<n; i++){
            p[i] = sc.nextInt();
        }

        Arrays.sort(p);

        int sum = 0;
        for(int i = 0; i<k; i++){    
            sum += p[i];
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 38908
#include <bits/stdc++.h>
using namespace std;
 
#define MAXN (int)(2*1e5 + 1)
#define MAXL 20
#define F first
#define endl "\n"
#define S second
#define MOD (int)(1e9 + 7)
#define MOD2 (lli) 998244353  
#define lli long long int
#define sz(a) int(a.size())
#define M_PI 3.1415
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dddx[] = {1, -1, 0, 0, 1, 1, -1, -1};
int dddy[] = {0, 0, 1, -1, 1, -1, 1, -1};

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

  int n;
  cin >> n;
  vector<int> A, B;
  for(int i=0;i<n+1;i++){
    int a;
    cin >> a;
    A.push_back(a);
  }
  for(int i=0;i<n;i++){
    int a;
    cin >> a;
    B.push_back(a);
  }

  lli ans = 0;
  for(int i=0;i<sz(B);i++){
    lli tot = A[i];
    if(tot >= B[i]){
      A[i] -= B[i];
      ans += B[i];
      B[i] = 0;
    } else {  
      ans += A[i];
      B[i] -= A[i];
      A[i] = 0;

      ans += (min(A[i+1], B[i]));
      A[i+1] -= (B[i]);
      A[i+1] = max(A[i+1], 0);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
int main(){
  while(1){
    string s;
    cin>>s;
    if(s=="-"){
      break;
    }
    int m;
    cin>>m;
    for(int i=0;i<m;i++){
      int h;
      cin>>h;
      s=s.substr(h)+s.substr(0,h);
    }
    cout<<s<<endl;
  }
}


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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

const int MOD = 1000000007;

typedef pair<int, int> P;

int main() {
    int N, Q;
    cin >> N >> Q;
    vector<ll> S(N), T(N), X(N), D(Q);
    rep(i, N) cin >> S[i] >> T[i] >> X[i];
    rep(i, Q) cin >> D[i];

    set<pair<pair<ll, ll>, ll>> events; // {{時間, 座標}, イベントフラグ}
    set<ll> running;
    rep(i, N) {
        events.insert(make_pair(make_pair(S[i] - X[i], X[i]), 1));
        events.insert(make_pair(make_pair(T[i] - X[i], X[i]), 0));
    }

    rep(i, Q) {
        if (!events.empty()) {
            while ((*events.begin()).first.first <= D[i]) {
                if ((*events.begin()).second == 1) {
                    running.insert((*events.begin()).first.second);
                } else {
                    running.erase(running.find((*events.begin()).first.second));
                }

                events.erase(events.begin());
                if (events.empty()) break;
            }
        }

        ll ans;
        if (running.empty()) ans = -1;
        else ans = *running.begin();
        cout << ans << endl;
    }
}

Measured memory_bytes: 33152
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;

using namespace std;

template <typename T> void output(T, int);
int gcd(int a, int b);

int main() {
    // source
    int k, s;
    cin >> k >> s;
    int ans = 0;
    rep(x, k + 1) {
        int num = s - x;
        rep(y, k + 1) {
            if (num - y >= 0 && num - y <= k) {
                // cout << x << " " << y << " " << num - y << endl;
                ans += 1;
            } else {
                continue;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}


Measured memory_bytes: 256
//file_name:ABC61_A.cpp
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // int scan
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // matrix scan
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // string scan
    /*
    string s;
    cin >> s;
    */


int main() {
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);

    if(a<=c&&c<=b)yn;
    return 0;
}



Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int H = Integer.parseInt(sc.next());
        int W = Integer.parseInt(sc.next());
        
        String[] s = new String[H];
        for(int i=0; i<H; i++){
            s[i] = sc.next();
        }
        
        for(int i=0; i<s[0].length()+2; i++){
            System.out.print("#");
        }
        System.out.println();
        
        for(int i=0; i<H; i++){
            System.out.println("#" + s[i] + "#");
        }
        
        for(int i=0; i<s[0].length()+2; i++){
            System.out.print("#");
        }
    }
}

Measured memory_bytes: 23508
#include <bits/stdc++.h>
using namespace std;
 
#define ff first
#define ss second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.exceptions(cin.failbit)
#define check(x) cout << #x << " : " << (x) << endl
#define all(v) v.begin(),v.end() 
//#define endl '\n'  
#define show(a) for(auto i:a) cout<<i<<" ";cout<<endl
typedef long long ll; 
typedef unsigned long long ull; 
typedef long double ld;
typedef pair< ll , ll > mypair;
typedef priority_queue <int> max_heap;
typedef priority_queue <mypair, vector<mypair>, greater<mypair> > min_heap;
const int mod=1000000007;
const int inf=1e9+100;
const int N=2e6+10;

int ask(int a,int b)
{
	cout<<"? ";
	for(int i=a;i<=b;i++) cout<<i<<" ";cout<<endl;
	string s;
	cin>>s;
	if(s[0]=='R') return 1;
	else return 0;	
}
std::vector<int> v;
int ans=0;

int ask(int a)
{
	cout<<"? ";
	cout<<a<<" ";
	for(int i:v) cout<<i<<" ";cout<<endl;
	string s;
	cin>>s;
	if(s[0]=='R') return 1;
	else return 0;	
}
int main()
{
	boost;
	int n;
	cin>>n;
	if(n==1)
	{
		string ans="! ";
		if(ask(1,1)) ans+='R';
		else ans+='B';
		if(ask(2,2)) ans+='R';
		else ans+='B';	
		cout<<ans<<endl;	
		return	0;
	}
	std::vector<int> a(2*n+1,-1);
	int start=ask(1,n);
	int lo=1;
	int hi=n+1;
	while((hi-lo)>1)
	{
		int i=(lo+hi)/2;
		int now=ask(i,i-1+n);
		if(now!=start) 
		{
			hi=i;

		}
		else lo=i;
	}
	{
			a[hi-1]=start;
			a[hi-1+n]=!start;
			for(int j=hi;j<(hi-1+n);j++) v.pb(j);
			ans=start;		
	}
	for(int i=1;i<v[0]-1;i++)
	{
		int now=ask(i);
		a[i]=now;
	}
	for(int i=v.back()+2;i<=2*n;i++)
	{
		int now=ask(i);
		a[i]=now;
	}
	start=v[0];
	int end=v.back();
	v.clear();
	bool flag1=0,flag2=0;
	for(int i=1;i<=2*n;i++) 
	{
		if(a[i]==1)
		{
			if(flag1==0)
			{
				flag1=1;
			}
			else
			{
				v.pb(i);
			}
		}
		else if(a[i]==0)
		{
			if(flag2==0)
			{
				flag2=1;
			}
			else
			{
				v.pb(i);
			}
		}
	}
	for(int i=start;i<=end;i++)
	{
		a[i]=ask(i);
	}	
	cout<<"! ";

	for(int i=1;i<=2*n;i++) if(a[i]) cout<<"R";else cout<<"B";
	cout<<endl;	


	return 0;
}

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

int main()
{
    int N;
    cin >> N;
    
    vector<int> a(N);
    REP(i, N) {
        cin >> a[i];
    }
    
    //昇順にソート
    sort(a.begin(), a.end());
  
    if (a[0] == a[N-1]) { //a_iが全て等しい場合
        if (a[0] <= N / 2 || a[0] + 1 == N) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else if (a[0] + 1 == a[N-1]) { //a_iが二種類で差が1の場合
        /*
          このとき全体の種類数はa[N-1](大きい方)となる
          小さい方は自分の色を除くと種類数が減り、大きい方は自分の色を除いても種類数が減らない
          つまり小さい方は他の帽子の色と被ってはいけない
          逆に大きい方は少なくとも1つ同じ色の帽子がなければいけない
         */
      
        //小さい方と大きい方がそれぞれいくつあるかを求める
        int smallCount = 0;
        int bigCount = 0;
        for (int i=1; i<N; i++) {
            if (a[i] != a[i-1]) {
                smallCount = i;
                bigCount = N - i;
            }
        }
        
        if (bigCount == 1) {
            cout << "No" << endl;
        } else if (smallCount < a[N-1] && smallCount + (bigCount / 2) >= a[N-1]) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 640
N,K = map(int,input().split())
V = list(map(int,input().split()))

if N < K:
    ans = sum(V)
    V = sorted(V)
    i = 0
    while len(V) > i:
        if V[i] >= 0:
            break
        ans += abs(V[i])
        i += 1
    print(ans)
    exit()


ans = 0
for a in range(K,-1,-1):
    for i in range(a+1):
        left = V[:a-i]
        if i != 0:
            right = V[-i:]
        else:
            right = []
        lr = sorted(left+right)
        tans = sum(lr)
        for j in range(min(len(lr),K-a)):
            if lr[j] < 0:
                tans += abs(lr[j])
        ans = max(ans , tans)
print(ans)


Measured memory_bytes: 40304
#include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <math.h>
 
using namespace std;
 
using LL = long long;
using VLL = std::vector<LL>;
using VVLL = std::vector<VLL>;
using VVVLL = std::vector<VVLL>;
using LD = long double;
using VLD = std::vector<LD>;
using VVLD = std::vector<VLD>;
using VVVLD = std::vector<VVLD>;
 
template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; }return false; }

//template<class T=LL> inline vector<T> cinv(LL N){ vector<T> v(N); REP(i, N)cin>>v[i]; return move(v);}
//template<class T=LL> inline vector<T> cinv(LL N){ vector<T> v(N); REP(i, N)cin>>v[i]; return move(v);}
#define REP(i,n) for(LL (i)=0;(i)<(n);(i)++)
#define ALL(v) v.begin(), v.end()
#define PRINTLN(v) {LL i=0; for(auto (a): v ){   cerr <<i << " : "<<  a << endl; i++;}}
#define PRINTSP(v) for(auto (a): v ) {cerr << a << " ";} cerr << endl
#define cmax(a,b) {if(a<b){a=b;}}
#define cmin(a,b) {if(a>b){a=b;}}
#define EACH(a,A) for(auto a: A)
//#define cmax(a,b) a = (a>b ? a:b)
//#define cmin(a,b) a = (a<b ? a:b) 
//cin,cout高速化のおまじない＋桁数指定
inline VLL cinvll(LL N){
  VLL A(N);
  REP(i,N){
    cin >> A[i];
  }
  return move(A);
}
struct Fast{
	Fast(){
		cin.tie(0);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(std::numeric_limits<double>::max_digits10);
	}
} fast;


void func(){
  LL N;
  cin >> N;

  for(LL i=1;i<=N;++i){
    LL n = (LL)((LD)i*1.08);
    if(n==N){
      cout << i;
      return ;
    }
  }
  cout << ":(";
  //LL N;
  //cin >> N;
  //auto A = cinvll(N);
  //PRINTSP(A);

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

Measured memory_bytes: 256
import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		String t = sc.next();
		int i=0, j=t.length()-1;
		boolean ok = true;
		while (i<j) ok&=(t.charAt(i++)==t.charAt(j--));
		System.out.println(ok ? "Yes" : "No");
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

}

Measured memory_bytes: 35352
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_C main
#include "bits/stdc++.h"
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions

#endif


int main_C() {
    cin.tie(0);
    ios::sync_with_stdio(false);
        
    ll H, W; cin >> H >> W;

    if (H%3==0 || W%3==0) {
        cout << 0 << endl;
        return 0;
    }

    ll ans1 = LINF;
    FOR(i,1,W) {
        ll s1 = H * i;
        ll s2 = (H / 2)*(W - i);
        ll s3 = ((H + 1) / 2)*(W - i);
        ll hi = max(s1, max(s2, s3));
        ll lo = min(s1, min(s2, s3));            
        ans1 = min(ans1, hi - lo);

        s2 = H * ((W - i) / 2);
        s3 = H * (((W - i) + 1) / 2);
        hi = max(s1, max(s2, s3));
        lo = min(s1, min(s2, s3));            
        ans1 = min(ans1, hi - lo);
    }
    ll ans2 = LINF;
    FOR(i,1,H) {
        ll s1 = W * i;
        ll s2 = (W / 2)*(H - i);
        ll s3 = ((W + 1) / 2)*(H - i);
        ll hi = max(s1, max(s2, s3));
        ll lo = min(s1, min(s2, s3));
        ans2 = min(ans2, hi - lo);

        s2 = W * ((H - i) / 2);
        s3 = W * (((H - i) + 1) / 2);
        hi = max(s1, max(s2, s3));
        lo = min(s1, min(s2, s3));
        ans2 = min(ans2, hi - lo);
    }

    ll ans = min(ans1, ans2);
    cout << ans << endl;

    return 0;
}

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

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

  int f=0;
  for(int i=0;i<n.size();i++){
    f += n.at(i)-'0';
  }
  int x=stoi(n);

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

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

#define oo 0x3f3f3f3f
#define mp make_pair
#define fi first
#define se second
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define FO(i,a,b) for (int i=(a);i<=(b);++i)
#define FD(i,a,b) for (int i=(a);i>=(b);--i)
#define FE(i,G,x) for(int i=(G).h[x];~i;i=(G).v[i].nxt)
typedef long long LL;
typedef pair<int, int> PII;

template <class T> inline bool chkmin(T& x, T y) { return x > y ? x = y, true : false; }
template <class T> inline bool chkmax(T& x, T y) { return x < y ? x = y, true : false; }

inline LL read(void) {
    LL x, f = 1; char ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (x = 0; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
    return x * f;
}

#define MO 1000000007
#define M 2000

int f[2 * M + 5][2 * M + 5], c[2 * M + 5][2 * M + 5];
LL fac[4 * M + 5], nfac[4 * M + 5];
int n, x, y, ans;

inline int C(int x, int y) { return fac[x] * nfac[y] % MO * nfac[x - y] % MO; }
inline LL ppow(LL a, LL b) {
    LL ret = 1;
    for (; b; b >>= 1) {
        if (b & 1) ret = ret * a % MO;
        a = a * a % MO;
    }
    return ret;
}

int main(void) {
    n = read();
    nfac[0] = fac[0] = 1;
    FO(i, 1, 8000) fac[i] = fac[i - 1] * i % MO;
    FO(i, 1, 8000) nfac[i] = ppow(fac[i], MO - 2);
    FO(i, 1, n) {
        x = read(); y = read();
        f[M - x][M - y]++; // f[-x][-y]++
        c[M + x][M + y]++;
        (ans += MO - C((x + y) * 2, y * 2)) %= MO;
    }
    FO(i, 0, 2 * M)FO(j, 0, 2 * M) {
        if (j && !i) (f[i][j] += f[i][j - 1]) %= MO;
        if (i && !j) (f[i][j] += f[i - 1][j]) %= MO;
        if (i && j) f[i][j] = ((LL)f[i][j] + f[i - 1][j] + f[i][j - 1]) % MO;
    }
    FO(i, 0, 2 * M)FO(j, 0, 2 * M) (ans += (LL)f[i][j] * c[i][j] % MO) %= MO;
    printf("%lld\n", ans * 500000004ll % MO);
    return 0;
}

Measured memory_bytes: 94976
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <set>
#include <stdio.h> 
using namespace std;
	typedef long long int lli;
	const int MaxN=200005;
	#define fst first
	#define snd second
	#define mp make_pair
	int mcd(int a,int b){	
		if(a==0)return b;
		return mcd(b%a,a);
	}		
	int vis[10];
	
int main(){
	lli N,K,i,j,s=0,p,q;
	cin>>N>>K;
	for(i=0;i<=N;i++)vis[i]=-1;
	for(i=0;i<K;i++){
		cin>>p>>q;
		if(vis[p]==-1){
			vis[p]=q;
		}
		else {
			if(vis[p]!=q){
				cout<<"-1";
				return 0;	
			}	
		}
	}	
	if(N==1&&vis[1]==-1){
		cout<<"0";
		return 0;
	}		
	if(N==1){
		cout<<vis[1];
		return 0;
	}
	if(vis[1]==0){
		cout<<"-1";
		return 0;
	}
	if(vis[1]==-1)vis[1]=1;
	for(i=1;i<=N;i++){
		if(vis[i]==-1)cout<<"0";
		else cout<<vis[i];
	}
}

Measured memory_bytes: 256
n = int(input())
a = [int(x) for x in input().split()]

aa = [0]
for i in range(n):
    aa.append(a[i]+aa[i])

dp = [[10**12 for i in range(n+1)] for i in range(n+1)]

for i in range(1, n+1):
    for l in range(n):
        if i == 1:
            dp[l][l+i] = 0
        else:
            if l + i < n+1:
                dp[l][l+i] = min(dp[l][l+k] + dp[l+k][l+i] +
                                 aa[l+i] - aa[l] for k in range(1, i))

print(dp[0][n])


Measured memory_bytes: 44892
# 23:22

S = input()
Q = int(input())

# 0: 順
# 1: 逆
head = 0
pre = ''
post = ''

for _ in range(0, Q):
    q = input()
    if len(q.split()) == 1:
        head = 1 if head == 0 else 0
    else:
        _, f, c = q.split()
        if f == '1':
            # 先頭
            if head == 0:
                pre = c + pre
            else:
                post = post + c
        else:
            # 末尾
            if head == 1:
                pre = c + pre
            else:
                post = post + c

S = pre + S + post
print(S[::-1] if head == 1 else S)


Measured memory_bytes: 4608
#include "bits/stdc++.h"
using namespace std;

int n;
double a;
double sum = 0;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a;
		sum += 1.0 / a;
	}
	cout<<1.0/sum;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;
  
  char s[H][W];
  for(int h=0; h<H; h++){
    for(int w=0; w<W; w++){
      cin >> s[h][w];
    }
  }
  
  for(int h=0; h<H; h++){
    for(int w=0; w<W; w++){
      int count = 0;
      if(s[h][w] == '.'){
        if(s[h][w-1]   == '#' && w-1 >=0)           count++;
        if(s[h+1][w-1] == '#' && h+1 <H && w-1 >=0) count++;
        if(s[h+1][w]   == '#' && h+1 <H)           count++;
        if(s[h+1][w+1] == '#' && h+1 <H && w+1 <W) count++;
        if(s[h][w+1]   == '#' && w+1 <W)           count++;
        if(s[h-1][w+1] == '#' && h-1 >=0 && w+1 <W) count++;
        if(s[h-1][w]   == '#' && h-1 >=0)           count++;
        if(s[h-1][w-1] == '#' && h-1 >=0 && w-1 >=0) count++;  
        cout << count;
      }else{
        cout << s[h][w];
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct Node{
  int key;
  int id,parent,left,right;
};


Node A[20000000];
int H;

void heap(int H){
  for(int i=1;i<=H;i++){
    if(i==1){
      A[i].left=A[2*i].key;
      A[i].right=A[2*i+1].key;
    }
    else {
      A[i].parent=A[i/2].key;
      A[i].left=A[2*i].key;
      A[i].right=A[2*i+1].key;
    }
  }
}
void maxheap(int i){
  int l=0,r=0;
  int lag;
  int tmp;
  l=2*i;
  r=2*i+1;
  if(l<=H && A[l].key>A[i].key){
    lag=l;
  }
  else {
    lag=i;
  }
  if(r<=H&&A[r].key>A[lag].key){
    lag=r;
  }
  if(lag!=i){
    tmp=A[i].key;
    A[i].key=A[lag].key;
    A[lag].key=tmp;
    maxheap(lag);
  }
  
}


int main(){
  cin>>H;
  for(int i=1;i<=H;i++){
    cin>>A[i].key;
    A[i].id=i;
  }
  heap(H);
  for(int i=H/2;i>=1;i--){
    maxheap(i);
  }
  for(int i=1;i<=H;i++){
    cout<<" "<<A[i].key;
  }
  cout<<endl;
  return 0;
}



Measured memory_bytes: 12784
#include"bits/stdc++.h"
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main(){
    int n, k; cin >> n >> k;
    vll a(n), ruiseki(n + 1, 0);
    ll ans = 0;
    
    rep(i, n) {
        cin >> a[i];
        a[i]--;
        ruiseki[i + 1] = (ruiseki[i] + a[i]) % k;
    }
    
    /*
    rep(i, n + 1) cout << ruiseki[i] << " ";
    cout << endl;
    //*/
    
    map<ll, ll> cnt;
    rep(i, min(k, n + 1)) cnt[ruiseki[i]]++;

    for(auto [k, v] : cnt){
        ans += v * (v - 1) / 2;
    }
    
    rep(i, n - k + 1){
        cnt[ruiseki[i]]--;
        ans += cnt[ruiseki[i + k]];
        cnt[ruiseki[i + k]]++;
        // cout << i << ": " << ruiseki[i] << " " << ruiseki[i+k] << ": " << v << ", " << ans << endl;
    }
    
    cout << ans << endl;
    return;
}

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

Measured memory_bytes: 18752
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n;
    cin>>n;
    string s;
    map<string,long long> mp;
    while(n--)
    {
        cin>>s;
        mp[s]++;
    }
    cout<<"AC x "<<mp["AC"]<<"\n"<<"WA x "<<mp["WA"]<<"\n"<<"TLE x "<<mp["TLE"]<<"\n"<<"RE x "<<mp["RE"]<<"\n";
    
    return 0;
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
//#include<windows.h>
//#include<conio.h>
using namespace std;
int main(){
	int n,b,a=1<<10,c;
	cin>>n>>b;
	for(int i=0;i<n;i++){
		cin>>c;
		a=min(a,c);
		b-=c;
	}
	cout<<n+b/a;
	return 0;
}


Measured memory_bytes: 256
// Tue May 26 19:06:02 IST 2020 
#include <bits/stdc++.h>        
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define forn(ii,a,b)        for(int ii = (int)a ; ii < (int)b  ; ii++ )
#define debug(x)           cerr << #x << " " << x << " -- \n"
#define I__O               ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define int64              long long    
#define MOD                998244353 
#define pb                 push_back
#define f1                 first 
#define s1                 second    
#define all(x)             (x).begin(),(x).end() 
#define precise(x)         cout << fixed << setprecision(12) << x << '\n'; 
#define tough_nut          numeric_limits<int64>::min()

const double pi = 3.141592653589793238;
using namespace  std ;       
using namespace __gnu_pbds;
 
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set ; 
const int N = 3e5+7; 
const int INF = INT_MAX;
struct comp{
    bool operator()(const pair<int,int> A,const pair<int,int>& B )const{
        if(A.first == B.first)
            return A.second < B.second ;
        return A.first > B.first;
    } 
};   
int tests(){ 
    int N;
    cin >> N;
    vector <int> arr(N+1);
    for (int i = 1 ; i <= N ; i++ )
        for(int j = i ; j <= N ; j +=i )
            arr[j] += 1;
    int64 ans = 0 ;
    for(int j = 1 ; j <= N ; j++ )
        ans += (int64)j*arr[j];
    cout << ans << '\n';
    return 0 ;
} 
int32_t main(){
    I__O ;     
    int cases = 1 ;  
    // cin >> cases ;  
    while(cases--) 
        tests(); 
     
    return 0 ; 
}
 // g++ -std=c++17 -O2 -Wall test.cpp  

Measured memory_bytes: 42268
//#pragma GCC optimize("trapv")
#include <iostream>
#include <vector>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <cassert>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
#include <functional>
//#define int long long
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()

using namespace std;

const int MOD = 1e9 + 7;
const int INF = 1e9 + 10;

void fast()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}



signed main()
{
	fast();
	string s, t;
	cin >> s >> t;
	int dif = INF;
	for (int i = t.size() - 1; i < s.size(); ++i)
	{
		int cur = 0;
		for (int j = 0; j < t.size(); ++j)
		{
			cur += s[i - j] != t[t.size() - 1 - j];
		}
		dif = min(dif, cur);
	}
	cout << dif << '\n';
	return 0;
}

Measured memory_bytes: 3636
package main

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

////////////////////////////////////////
///        templates                 ///
////////////////////////////////////////

var sc = bufio.NewScanner(os.Stdin)

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

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readBigLine() string {
        buf := make([]byte, 0, 1000000)
        for {
                l, p, e := rdr.ReadLine()
                if e != nil {
                        panic(e)
                }
                buf = append(buf, l...)
                if !p {
                        break
                }
        }
        return string(buf)
}

func strSprit(str string) []string {
        cols := strings.Split(str, " ")
        return cols
}

func parseInt(str string) int {
        n, _ := strconv.Atoi(str)
        return n
}

func intSprit(str string) []int {
        strs := strSprit(str)
        cols := make([]int, len(strs))
        for i, v := range strs {
                cols[i] = parseInt(v)
        }
        return cols
}

func bitCount(n uint) int {

        x := uint64(n)

        const m = 1<<64 - 1
        const m0 = 0x5555555555555555
        const m1 = 0x3333333333333333
        const m2 = 0x0f0f0f0f0f0f0f0f

        x = x>>1&(m0&m) + x&(m0&m)
        x = x>>2&(m1&m) + x&(m1&m)
        x = (x>>4 + x) & (m2 & m)
        x += x >> 8
        x += x >> 16
        x += x >> 32

        return int(x) & (1<<7 - 1)
}

func bitExist(n, i int) bool {
        return ((n >> uint(i)) & 1) == 1
}

////////////////////////////////////////
///        end templates             ///
////////////////////////////////////////
func chmax(dp [][]int, idx, dir, n int) {
        if dp[idx][dir] < n {
                dp[idx][dir] = n
        }
}

func main() {
        line := nextLine()
        N := parseInt(line)

        p := make([][]int, N)
        for i := 0; i < N; i++ {
                p[i] = intSprit(nextLine())
        }

        //INF := 1 << 30
        dp := make([][]int, N+1000)
        for i := 0; i < N+1000; i++ {
                dp[i] = make([]int, 3)
                /*
                        for j := 0; j < 3; j++ {
                                dp[i][j] = INF
                        }
                */
        }

        /*
                for i := 0; i < 3; i++ {
                        dp[0][i] = 0
                }
        */

        for i := 0; i < N; i++ {
                for j := 0; j < 3; j++ {
                        for k := 0; k < 3; k++ {
                                if j == k {
                                        continue
                                }
                                chmax(dp, i+1, k, dp[i][j]+p[i][k])
                        }
                }
        }

        ret := 0
        for i := 0; i < 3; i++ {
                if ret < dp[N][i] {
                        ret = dp[N][i]
                }
        }
        fmt.Println(ret)
}

Measured memory_bytes: 12544
#include<bits/stdc++.h>
using namespace std;
//BEGIN CUT HERE
template <typename T,typename E>
struct SegmentTree{
  using G = function<T(T,E)>;
  using H = function<E(E,E)>;
  int n;
  G g;
  H h;
  T ti;
  E ei;
  vector<T> dat;
  vector<E> laz;
  SegmentTree(){};
  SegmentTree(int n_,G g,H h,T ti,E ei):
    g(g),h(h),ti(ti),ei(ei){
    init(n_);
  }
  void init(int n_){
    n=1;
    while(n<n_) n*=2;
    dat.clear();
    dat.resize(n,ti);
    laz.clear();
    laz.resize(2*n-1,ei);
  }
  void build(int n_, vector<T> v){
    for(int i=0;i<n_;i++) dat[i]=v[i];
  }
  void eval(int k){
    if(k*2+1<2*n-1){
      laz[k*2+1]=h(laz[k*2+1],laz[k]);
      laz[k*2+2]=h(laz[k*2+2],laz[k]);
      laz[k]=ei;
    }
  }
  void update(int a,int b,E x,int k,int l,int r){
    eval(k);
    if(r<=a||b<=l) return;
    if(a<=l&&r<=b){
      laz[k]=h(laz[k],x);
      return;
    }
    update(a,b,x,k*2+1,l,(l+r)/2);
    update(a,b,x,k*2+2,(l+r)/2,r);
  }
  void update(int a,int b,E x){
    update(a,b,x,0,0,n);
  }
  void eval2(int k){
    if(k) eval2((k-1)/2);
    eval(k);
  }  
  T query(int k){
    T c=dat[k];
    k+=n-1;
    eval2(k);
    return g(c,laz[k]);
  }
};
//END CUT HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n,q;
  cin>>n>>q;
  SegmentTree<int,int> beet(n,
			    [&](int a,int b){ return b<0?a:b;},
			    [&](int a,int b){ return b<0?a:b;},
			    INT_MAX,-1);
  for(int i=0;i<q;i++){
    int c;
    cin>>c;
    if(c){
      int x;
      cin>>x;
      cout<<beet.query(x)<<endl;
    }else{
      int s,t,x;
      cin>>s>>t>>x;
      t++;
      beet.update(s,t,x);
    }
  }
  return 0;
}
/*
  verified on 2018/03/04
  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_D&lang=jp
*/



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

int main(){
  int N,K;
  cin >> N >> K;
  string s;
  cin >> s;
  if(s[K-1]=='A'){
    s.replace(K-1,1,"a");
  }
  if(s[K-1]=='B'){
    s.replace(K-1,1,"b");
  }
  if(s[K-1]=='C'){
    s.replace(K-1,1,"c");
  }
  cout << s <<endl;
}


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

int main()
{
	int m,d;
	cin>>m>>d;
	int ans=0;
	for(int i=1;i<=m;i++)
	for(int j=10;j<=d;j++)
	{
		if(j%10>=2&&j/10>=2&&(j%10)*(j/10)==i)ans++;
	}
	cout<<ans;
	return 0;
} 

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

int main(){
    int n, k; cin >> n >> k;
    vector<long long> V(n);
    for(int i = 0; i < n; i++){
        cin >> V[i];
    }
    long long ans = 0;
    for(int l = 0; l <= min(k, n); l++){
        for(int r = 0; l + r <= min(k, n); r++){
            vector<long long> v;
            long long tmp = 0;
            for(int i = 0; i < l; i++){
                v.push_back(V[i]); 
                tmp += V[i];
            }
            for(int i = 0; i < r; i++){
                v.push_back(V[n-1-i]); 
                tmp += V[n-1-i];
            }
            sort(v.begin(), v.end());
            for(int i = 0; i < min((int)v.size(), k - l - r); i++){
                if(v[i] < 0) tmp -= v[i];
            }
            ans = max(tmp, ans);
        }
    }
    cout << ans << endl;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<vll> vvll;

#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define no cout<<"No"<<endl
#define NO cout<<"NO"<<endl
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

ll mpow(ll m, ll p){
  ll power = m;
  ll res = 1;
  while(p>0){
    if(p&1)
      res = res*power%MOD;
    power = (power*power)%MOD;
    p /= 2;
  }

  return res;
}

ll mod_inv(ll m){
  return mpow(m, MOD-2);
}

struct COM{
  vll fact, fact_inv;
  COM(ll n): fact(n+1,1), fact_inv(n+1,1){
    for(ll i=1; i<=n; i++)
      fact[i] = fact[i-1]*i%MOD;

    fact_inv[n] = mod_inv(fact[n]);
    for(ll i=n; i>=1; i--)
      fact_inv[i-1] = fact_inv[i]*i%MOD;
  }

  ll calc(ll n, ll k){
    if(k<0 || n<k)
      return 0;
    ll res = fact[n]*fact_inv[n-k]%MOD*fact_inv[k]%MOD;
    return res;
  }
};

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

  ll h,w,a,b;
  cin>>h>>w>>a>>b;
  h--;
  w--;

  COM com(h+w+1);
  ll ans=0;
  for(ll i=b; i<=w; i++){
    ll up_rect=com.calc(h-a+i,i);
    ll bottom_rect=com.calc(a-1+w-i,w-i);
    ans=(ans+up_rect*bottom_rect%MOD)%MOD;
  }

  cout<<ans<<endl;

}



Measured memory_bytes: 3328
#include <iostream>

using namespace std;

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

	int cnt4 = 0, cnt2 = 0;
	for (int i = 0; i < N; i++) {
		int tmp;
		cin >> tmp;
		if (tmp % 4 == 0) cnt4++;
		else if (tmp % 2 == 0) cnt2++;
	}

	if (cnt2 == N || cnt4 >= N / 2 || cnt4*2 + cnt2 >= N) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
//Suplex
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
int T,a,b,c,d,k,BA;
long long resta,restb;

int main()
{
	scanf("%d",&T);
	while(T--){
		scanf("%d%d%d%d",&a,&b,&c,&d);
		int l=0,r=a+b+1;k=(max(a,b)-1)/(min(a,b)+1)+1;
		while(l<r){
			int mid=(l+r)>>1;
			resta=a-mid/(k+1)*k-mid % (k+1);
			restb=b-mid/(k+1);
			if(restb<=1ll*resta*k) l=mid+1;else r=mid;
		}
		resta=a-r/(k+1)*k-r % (k+1);
		restb=b-r/(k+1);BA=r+restb-resta*k+1;
		for(int i=c;i<=min(d,r);i++) putchar(i % (k+1) ? 'A' : 'B');
		for(int i=max(c,r+1);i<=d;i++) putchar((i-BA) % (k+1) ? 'B' : 'A');
		puts("");
	}
	return 0;
}

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

using namespace std;

int main(void){
    int N, T;
    cin >> N >> T;
    vector<int> t(N);
    for(auto& it : t) cin >> it;

    int ans = 0;
    for(int i=1;i<N;i++) {
        ans += min(T, t[i]-t[i-1]);
    }

    ans += T;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define MAXN 500010
int n, a[MAXN], b[MAXN], c[MAXN], pfx[MAXN], ans, mask;

inline int cmp(int x, int y){return (b[x] & mask) <( b[y] & mask);}

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
    for (int d = 0; d < 29; d++) {
        mask = (1 << d) - 1;
        for (int i = 1; i <= n; i++) c[i] = i;
        std::sort(c + 1, c + n + 1, cmp);
        int cnt = 0;
        memset(pfx, 0, sizeof(pfx));
        for (int i = 1; i <= n; i++) pfx[i] = pfx[i - 1] + ((b[c[i]] >> d) & 1);
        for (int i = 1; i <= n; i++) {
            int real = a[i] & mask;
            int l = 0, r = n, pos = n + 1;
            while (l <= r) {
                int mid = (l + r) >> 1;
                if ((b[c[mid]] & mask) + real > mask)
                    pos = mid, r = mid - 1;
                else
                    l = mid + 1;
            }
            int count = pfx[pos - 1] + (n - pos + 1) - pfx[n] + pfx[pos - 1];
            if((a[i] >> d) & 1)count = n - count;
            cnt += count;
        }
        if (cnt & 1) ans |= (1 << d);
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 6784
N = int(input())
a = list(map(int, input().split()))


def gcd(x, y):
    if x < y:
        x, y = y, x
    while y != 0:
        tmp = x % y
        x = y
        y = tmp
    return x


ans = 1
if N == 2:
    print(max(a))
    exit()

l = [1] * N
l[0] = a[0]
r = [1] * N
r[N-1] = a[N-1]
for i in range(1, N):
    l[i] = gcd(l[i-1], a[i])
    r[N-1-i] = gcd(r[N-i], a[N-1-i])
    
for i in range(N):
    if i == 0:
        n = r[1]
    elif i == N-1:
        n = l[N-2]
    else:
        n = gcd(l[i-1], r[i+1])
    ans = max(ans, n)
print(ans)

Measured memory_bytes: 20464
#include <iostream>

using namespace std;

int main(){
    int d;
    cin >> d;
    if(d == 25){
        cout << "Christmas" << endl;
    }
    else if(d == 24){
        cout << "Christmas Eve" << endl;
    }
    else if(d == 23){
        cout << "Christmas Eve Eve" << endl;
    }
    else if(d == 22){
        cout << "Christmas Eve Eve Eve" << endl;
    }
}

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

pos soln- 1  1  2  4  1  4  3
opt soln- 1  1   2    1   1

method - 
 min(|2-3|, |2-4|) + min(|3-4|, |3-6|) + min(|2-4|, |6-4|) + min(|2-1|, |2-5|) + min(|1-5|, |2-1|)
    ||
*/


#include<bits/stdc++.h>
#include<iostream>

using namespace std;

int main(void){
    int n, k;
    cin >> n >> k;
    int height[n];
    int arr[n];

    for(int i=0;i<n;++i){
        cin >> height[i];
        arr[i] = INT_MAX;
    }
    
    arr[0] = 0;
    for(int i = 0; i < n; ++i) {
        for(int j = i + 1; j< i + k + 1; ++j) {
            if(j < n) {
                arr[j] = min(arr[j],arr[i] + abs(height[i] - height[j]));
            }
        }
    }

    cout << arr[n-1];
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<queue>
#include<string.h>
#include<string>
#include<map>
#include<stdio.h> 
#include<math.h>
#include<algorithm>
using namespace std;
string str,str1;  int dx[4]={-1,1,4,-4}; 
map <string,int> mp;

int posi;
void bfs()
{
    queue <string> que;
    que.push("01234567");
     mp["01234567"]=0;
    while(que.size())
    {
    	string preq=que.front(); que.pop();
			for(int i=0;i<8;i++) if(preq[i]=='0') {
			posi=i; break;} 
		for(int i=0;i<4;i++)
		{
		    	int nposi=posi+dx[i];
				string q=preq;
				swap(q[posi],q[nposi]);
				if(mp.find(q)!=mp.end()||i==0&&nposi==3||i==1&&nposi==4||nposi>7||nposi<0) continue;
				que.push(q);
				mp[q]=mp[preq]+1;
		} 
	}
} 

int main()
{	
	bfs();
	while(getline(cin,str1)) 
	{
	   str.clear();
	   for(int i=0;i<str1.size();i++)
	   {
	       if(str1[i]!=' ')
	       str+=str1[i];
	   } 
	   printf("%d\n",mp[str]);
	}
	return 0;
}


Measured memory_bytes: 5580