akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 using namespace  std;
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
const double pi=3.1415926535897932384626433832;
const long long mod=1e9+7;
//long long primeset[5000000]={};
typedef complex<double> cd;
typedef long long ll;
typedef double ld;
//#define For(i,0,n) for(long long i = 0 ; i<n ;i++) 
cd fast_exp(cd a, long long b)
{
	if (b == 0)
		return 1;
	
	cd res = fast_exp(a, b / 2);
		
	res = res * res;
	
	if (b % 2 == 1)
		res = res * a;
	
	return res;
}

long long fastexpon(long long a,long long b,long long mod)
{
	if(b==0)
		return 1;
	
	long long res=fastexpon(a,b/2,mod);
	
	res=(res*res)%mod;
	if(b%2==1)
		res= (res * a)%mod;

	return res;
}


//template ends here





ld n;
ld dp[301][301][301];



ld expected_val(int x1, int x2, int x3)
{
	if(x1==0 && x2==0 && x3==0)
		return 0;
	if(dp[x1][x2][x3]!=-1)
		return dp[x1][x2][x3];
	else
	{
		ld s1=0,s2=0,s3=0;
		if (x1!=0)
		s1=1 + expected_val(x1-1,x2,x3);
		if(x2!=0)
		s2=1+expected_val(x1+1,x2-1,x3);
		if(x3!=0)
		s3=1+expected_val(x1,x2+1,x3-1);

		ld p0,p1,p2,p3;
		p0=(n-x1-x2-x3)/n;
		p1=x1/n;
		p2=x2/n;
		p3=x3/n;
		//cout<<" p0 ="<< p0<<"   p1= "<<p1<<"  p2= "<<p2<<"  p3=  "<<p3<<'\n';
		dp[x1][x2][x3] = (p0*(1)+ p1*s1+ p2*s2+ p3*s3)/(1-p0);
		return dp[x1][x2][x3];


	}
}






int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	for(int i=0 ;i<301 ;i++)
		for(int j=0 ;j<301 ;j++)
			for(int k=0; k<301 ;k++)
				dp[i][j][k]=-1;


	cin>>n;
	int c[3]={};
	int inp;
	for(ld i=0 ; i<n ;i++)
	{
		cin>>inp;
		c[inp-1]++;
	}
	cout<<fixed;
	cout<<setprecision(12);
	cout<<expected_val(c[0],c[1],c[2])<<'\n';		
	//cout<<expected_val(0,0,0);
	

	//cout<<'\n'<<"time elapsed: "<<clock()*1000.0 / CLOCKS_PER_SEC<<" ms"<<'\n';
	return 0;
}

Measured memory_bytes: 213376
#include <bits/stdc++.h> 
using namespace std;
int a,b,c[101];
bool check(int d)
{
	for (int i=0;i<b;i++)
		if (d==c[i])
			return false;
	return true;
}
int main()
{
	cin>>a>>b;
	for (int i=0;i<b;i++)
		cin>>c[i];
	for (int i=0;;i++)
	{
		if (check(a-i))
		{
			cout<<a-i;
			return 0;
		}
		if (check(a+i))
		{
			cout<<a+i;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 3624
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*pi*/double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll i,fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=0,i=0;while(n/10>0){i++;d++;}return d;}
llfor;ll ans=0;////////////////////////////////////////////////////////////
int main(){
 ll a,b;
 sc(a);sc(b);
 ll ans;
 if(a>=2&&b>=2){
  pr((a-2)*(b-2));return 0;
 }
 if(a==1&&b==1){
  puts("1");return 0;
  }
 if(a==1){
  pr(b-2);return 0;
 }
 if(b==1){
  pr(a-2);return 0;
 }
 
 return 0;}



Measured memory_bytes: 3608
#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<math.h>
#include<tuple>
#include<string.h>
#include <numeric> 
#include<unordered_map>
using namespace std; 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define pp(...) "\033[94m [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "]\033[0m"
#define pp1(...) "\033[1;47;35m" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "]\033[0m"
#define dg(x) debug() << pp1(x)
#define dg1(x) debug() << pp(x)
#define dg2(x,y) debug() << pp(x) pp(y)
#define dg3(x,y,z) debug() << pp(x) pp(y) pp(z)
#define dg4(w,x,y,z) debug() << pp(w) pp(x) pp(y) pp(z)
#define int long long
#define all(x) x.begin() , x.end()
#define clr(x) memset(x , 0 , sizeof x);
#define sz(x) (int)x.size()
template<typename T> void db(T x ){ debug() <<">>> " <<  x; }
template<typename T> void db(T x , T y){ debug() <<">>> " <<  x <<" , "<< y; }
template<typename T> void db(T x , T y , T z){ debug() <<">>> "<< x <<" , "<< y <<" , "<< z; }
template<typename T> void db(T x , T y , T z , T a){ debug() <<">>> "<< x <<" , " << y <<" , "<< z <<" , "<< a; }
const int xx = 2e5;
const int Mod = 1e9 + 7;
const int inf = 1e18;
const int Maxn = 20010;

signed main(){
  ios::sync_with_stdio(false);cin.tie(0);
  
  int n;
  cin >> n;
  vector<pair<int,int>> a(n);
  for(int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  map<pair<int,int>,int>Cnt;

  for(int i = 0; i < n; i++) {
    for(int j = i + 1; j < n; j++) {
      int x = a[i].first - a[j].first , y = a[i].second - a[j].second;
      Cnt[{x,y}]++;
      Cnt[{-x,-y}]++;
    }
  }
  int Mx = 0;
  for(auto i : Cnt){
    Mx = max(Mx , i.second);
  }
  cout << n - Mx << '\n';
}


Measured memory_bytes: 3180
#include <bits/stdc++.h>
using namespace std;
int a,b,c,x,ans;
int main() {
	scanf("%d%d%d%d",&a,&b,&c,&x);
	for(int i=0;i<=a;i++)
	for(int j=0;j<=b;j++)
	for(int k=0;k<=c;k++)
	if(500*i+100*j+50*k==x)
	ans++;
	printf("%d",ans);
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;

int A[100005], ans;
int main(){
	int N; scanf("%d", &N);
	for (int i = 1; i <= N; i++) {
		scanf("%d", A + i);
	}
	for (int i = 1; i < N; i++) {
		if (A[i] == i && A[i + 1] == i + 1){
			swap(A[i], A[i + 1]);
			ans++;
		}
	}
	for (int i = 1; i <= N; i++) {
		if (A[i] == i)
			ans++;
	}
	printf("%d", ans);

}


Measured memory_bytes: 512
#include <iostream>

using namespace std;

int main() {
    int n, m;
    int a[100], points[100];
    int b[100][100];
    cin >> n >> m;
    for (int i = 0; i < m; ++i) {
        cin >> a[i];
    }
    for (int i = 0; i < m; ++i) {
        for (int j = 0; j < n; ++j) {
            cin >> b[i][j];
        }
    }
    for (int i = 0; i < n; ++i) {
        points[i] = 0;
    }
    for (int i = 0; i < m; ++i) {
        for (int j = 0; j < n; ++j) {
            if (b[i][j] == a[i]) {
                ++points[j];
            } else {
                ++points[a[i] - 1];
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        cout << points[i] << endl;
    }
    return 0;
}

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

int main(){
   short a[2];
   char s[2];
   for(char i = 0;i < 2;i++){

      cin >> a[i];

      if(a[i] == 2) s[i] = '2';
      else if(a[i] == 4 || a[i] == 6 || a[i] == 9 || a[i] == 11) s[i] = '1';
      else s[i] = '0';
   }

   if(s[0] == s[1])   cout << "Yes";
   else                  cout << "No";

   return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,n,m) for(int i=n;i<m;i++)
#define elif else if
#define INF 1000000007
using namespace std;
int gcd(int a,int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int n,aa[220000],cnt=0,a,b,k,ab[220000];
pair<int,int> p[220000];
string s,t,u;
char c;
signed main(){
    cin>>n>>k;
    rep(i,n){
        cin>>aa[i];
        ab[i]=ab[i-1]+aa[i];
    }
    rep(i,n-k+1){
        cnt=max(cnt,ab[k-1+i]-ab[i-1]);
    }
    if((cnt+k)%2==1){
        cout<<(cnt+k)/2<<".500000";
    }else{
        cout<<(cnt+k)/2<<".000000";
    }
}

Measured memory_bytes: 4864
if __name__=='__main__':
    S = int(input())
    N = int(1e9)
    y2 = S//N + 1
    y3 = N - S%N
    if S >= 1e18:
        print("{} {} {} {} {} {}".format(0,0,0,N,N,0))
    else:
        print("{} {} {} {} {} {}".format(0,0,1,y2,N,y3))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define int long long
#define f(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define mod 1000000007
#define P pair<int,int>
using namespace std;
int a[26];
map<char,bool> m;
signed main(){
	string s;
	cin>>s;
	f(i,s.size()){
		a[s[i]-'a']=1;
		m[s[i]]=true;
	}
	s+='a'-1;
	for(int i=s.size()-1;i>=0;i--){
		for(char j=s[i]+1;j<='z';j++){
			if(m[j]==false){
				cout<<s.substr(0,i)+j<<endl;
				return 0;
			}
		}
		m[s[i]]=false;
	}
	puts("-1");
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <string>

#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define sum(n) accumulate((n).begin(), (n).end(), 0)
using namespace std;


int main(){
	int x1, x2, y1, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	if (x1 < x2) {
		if (y1 < y2) {
			cout << x2 - abs(max(y1, y2) - min(y1, y2)) << " " << y2 + abs(max(x1, x2) - min(x1, x2)) << " " << x1 - abs(max(y1, y2) - min(y1, y2)) << " " << y1 + abs(max(x1, x2) - min(x1, x2)) << endl;

		}
		else {
			cout << x2 + abs(max(y1, y2) - min(y1, y2)) << " " << y2 + abs(max(x1, x2) - min(x1, x2)) << " " << x1 + abs(max(y1, y2) - min(y1, y2)) << " " << y1 + abs(max(x1, x2) - min(x1, x2)) << endl;

		}
	}
	else {
		if (y1 < y2) {
			cout << x2 - abs(max(y1, y2) - min(y1, y2)) << " " << y2 - abs(max(x1, x2) - min(x1, x2)) << " " << x1 - abs(max(y1, y2) - min(y1, y2)) << " " << y1 - abs(max(x1, x2) - min(x1, x2)) << endl;

		}
		else {
			cout << x2 + abs(max(y1, y2) - min(y1, y2)) << " " << y2 - abs(max(x1, x2) - min(x1, x2)) << " " << x1 + abs(max(y1, y2) - min(y1, y2)) << " " << y1 - abs(max(x1, x2) - min(x1, x2)) << endl;

		}
	}
	
	return 0;
}

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

using namespace std;
typedef long long int ll;

const ll p = 31;
const ll N = 1e9 +1;


int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
 
  string s,t;
  cin>>s>>t;
  ll ct = 0;
  for(int i =0;i<3;i++){
  	if(s[i] == t[i]){
  		ct++;
  	}
  }
  cout<<ct;

}

Measured memory_bytes: 256
#include <stdio.h>
#include <vector>
#include <queue>
using namespace std;
struct side{
    int n;
    int m;
    int l;
};
side sides[100000];
void mergesort(int l,int r){
    if(l==r)return;
    side temp;
    if(l==r-1){
        if(sides[l].l>sides[r].l){
            temp=sides[l];
            sides[l]=sides[r];
            sides[r]=temp;
        }
        return;
    }
    int mid=(l+r)/2,now=0;
    side b[r-l+1];
    mergesort(l,mid-1);
    mergesort(mid,r);
    for(int i=0;i<=r-l;i++){
        if(sides[i+l-now].l<sides[mid+now].l){
            b[i]=sides[i+l-now];
            if(i+l-now==mid-1){
                for(i++;i<=r-l;i++){
                    b[i]=sides[mid+now];
                    now++;
                }
            }
        }
        else{
            b[i]=sides[mid+now];
            now++;
            if(mid+now>r){
                for(i++;i<=r-l;i++)
                    b[i]=sides[i+l-now];
            }
        }
    }
    for(int i=0;i<=r-l;i++)
        sides[i+l]=b[i];
}
int main(){
    int n,a,ans=0,c=1,now=0;
    bool tree[10000];
    scanf("%d",&n);
    tree[0]=true;
    for(int i=1;i<n;i++){
        tree[i]=false;
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            scanf("%d",&sides[now].l);
            sides[now].n=i;
            sides[now].m=j;
            if(sides[now].l==-1)now--;
            now++;
        }
    }
    mergesort(0,now-1);
    while(c<n){
        a=0;
        while(tree[sides[a].n]==tree[sides[a].m])a++;
        ans+=sides[a].l;
        tree[sides[a].n]=tree[sides[a].m]=true;
        c++;
    }
    printf("%d\n",ans);
}

Measured memory_bytes: 2836
#include<bits/stdc++.h>
#define llong long long
#define pii pair<int,int>
#define riterator reverse_iterator
using namespace std;

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

const int N = 40;
char a[N+3][N+3];
llong f[N+3][N+3][N+3],g[N+3][N+3][N+3];
int n;

int main()
{
	scanf("%d",&n); n<<=1;
	for(int i=1; i<=n; i++) scanf("%s",a[i]+1);
	if(n==2) {printf("%c\n",a[1][2]); return 0;}
	for(int i=1; i<=n; i++) f[i][i][i] = 1ll;
	for(int i=2; i<=n; i++)
	{
		for(int j=i+1; j<=n; j++) {if(a[i][j]=='1') g[i][i][j] = 1ll;}
	}
	for(int len=3; len<=n; len+=2) for(int l=2; l+len-1<=n; l++)
	{
		int r = l+len-1;
		for(int d1=l; d1<=r; d1+=2) for(int d2=r; d2>d1; d2-=2)
		{
			llong tmp = 0ll;
			for(int u2=r; u2>=d2; u2--)
			{
				tmp += g[l][d1][u2]*f[d2][r][u2];
			}
			for(int mid=d1+1; mid<d2; mid++)
			{
				f[l][r][mid] += f[d1+1][d2-1][mid]*tmp;
			}
		}
		for(int u2=r+1; u2<=n; u2++) for(int u1=l+1; u1<r; u1++) if(a[u1][u2]=='1')
		{
			g[l][r][u2] += f[l][r][u1];
		}
	}
	llong ans = 0ll;
	for(int mid=3; mid<=n-1; mid++) if(a[1][mid]=='1')
	{
		ans += f[2][n][mid];
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <string.h>
#include <sstream>
#include <ctime>

using namespace std;

#define eps 1e-12
#define pi 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define bgn begin
#define ll long long
#define ld long double
#define ull unsigned long long
#define ii pair<ll,ll>






#define typ ll


const int N=310;
int prnt[N];
typ d[N];
bool vst[N];
vector<pair<int,int>>adj[N];
priority_queue<pair<typ,int>,vector<pair<typ,int>>,greater<pair<typ,int>>>q;
pair<typ,int>p;

void dijkstra(int s,int n)
{
	for(int i=1;i<=n;i++)
	{
		d[i]=-1;
		vst[i]=false;
	}
	d[s]=0;
	p.first=d[s];
	p.second=s;
	q.push(p);
	while(!q.empty())
	{
		p=q.top();
		int u=p.second;
		q.pop();
		if(vst[u])continue;
		vst[u]=true;
		for(int i=0,v,w;i<adj[u].size();i++)
		{
			v=adj[u][i].first;
			w=adj[u][i].second;
			if(d[v]==-1 || d[u]+w<d[v])
			{
				prnt[v]=u;
				d[v]=d[u]+w;
				p.first=d[v];
				p.second=v;
				q.push(p);
			}
		}
	}
}









ll n,u,v,w;
ll res;
vector<pair<int,pair<int,int>>>e;









void solve()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=i;j++)cin>>w;
		for(int j=i+1;j<=n;j++)
		{
			cin>>w;
			e.pb(mp(w,mp(i,j)));
		}
	}
	sort(e.begin(),e.end());
	res=0;
	for(int i=0;i<e.size();i++)
	{
		w=e[i].first;
		u=e[i].second.first;
		v=e[i].second.second;
		dijkstra(u,n);
		if(d[v]==-1||d[v]>w)
		{
			adj[u].pb(mp(v,w));
			adj[v].pb(mp(u,w));
			res+=w;
		}
		else if(d[v]<w)
		{
			cout<<"-1\n";
			return;
		}
	}
	cout<<res<<"\n";
}

int main()
{
	std::ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef localProject
	freopen("in.txt","r",stdin);
#endif
	solve();
	return 0;
}

Measured memory_bytes: 1148
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <set>
using namespace std;

int main() {
  // input
    long n,m;cin >> n >> m;
    long ans;
    ans = 0;
  

  // compute 
    ans = (1900 * m + 100 * (n - m)) ;
    for(int i = 0;i < m; i++) {
      ans *= 2;
    }

  // output  
    cout << ans << endl;
}

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

int main(){
    int H, W, K;
    cin >> H >> W >> K;
    int sx, sy, gx, gy;
    cin >> sx >> sy >> gx >> gy;
    sx--; sy--; gx--; gy--;
    vector<vector<bool>> avail(H);
    for(int i=0; i<H; i++){
        string s;
        cin >> s;
        avail[i].resize(W);
        for(int j=0; j<W; j++) avail[i][j] = (s[j] == '.');
    }

    int dx[] = {-1, 1, 0, 0};
    int dy[] = {0, 0, -1, 1};
    auto inside = [&](int i, int j){ return i>=0 && i<H && j>=0 && j<W && avail[i][j]; };

    vector<vector<int>> dist(H, vector<int>(W, 1e9));
    queue<pair<int, int>> que;
    que.emplace(sx, sy);
    dist[sx][sy] = 0;

    while(que.size()){
        auto [i, j] = que.front(); que.pop();
        for(int k=0; k<4; k++) for(int d=1; d<=K; d++){
            int x = i+d*dx[k], y = j+d*dy[k];
            if(!inside(x, y) || dist[x][y] <= dist[i][j]) break;
            if(dist[x][y] == 1e9){
                dist[x][y] = dist[i][j] + 1;
                que.emplace(x, y);
            }
        }
    }

    int ans = dist[gx][gy];
    if(ans == 1e9) ans = -1;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 11132
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BrickBreak
{
	class Program
	{
		static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			string[] strBricks = Console.ReadLine().Split(' ');
			int brick = 0;
			int nextBrick = 1;
			int countBreak = 0;


			for (int i = 0; i < n; i++)
			{
				brick = int.Parse(strBricks[i]);
				if (brick == nextBrick)
				{
					nextBrick++;
					
				}
				else
				{
					countBreak++;
				}
			}
			if (nextBrick == 1)
			{
				Console.Write(-1);
			}
			else
			{
				Console.Write(countBreak);
			}
			
			Console.ReadKey(true);
		}
	}
}


Measured memory_bytes: 32348
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var N = Sarray()[0];
            var Ai = Sarray();
            var dct = new Dictionary<long, long>();
            foreach (var a in Ai)
            {
                if (!dct.ContainsKey(a)) dct[a] = 0;
                ++dct[a];
            }
            var l1 = 0L;
            var l2 = 0L;
            foreach (var d in dct.OrderByDescending(d => d.Key)) 
            {
                if (2 <= d.Value)
                {
                    if (l1 == 0) l1 = d.Key;
                    else l2 = d.Key;

                }
                if (4 <= d.Value)
                    l2 = d.Key;
                if (l1 != 0 && l2 != 0)
                {
                    WriteLine(l1 * l2);
                    return;
                }
            }
            WriteLine(0);
        }

        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

Measured memory_bytes: 43568
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int main() {
    int N, M;
    scanf("%d %d", &N, &M);
    int* AC = (int*)malloc((N+1) * sizeof(int));
    int* WA = (int*)malloc((N+1) * sizeof(int));
    int i;
    for(i=0; i<N+1; i++) {
        AC[i] = 0;
        WA[i] = 0;
    }
    int mondai;
    char result[3];
    int seito = 0;
    int pena = 0;
    for(i=0; i<M; i++) {
        scanf("%d", &mondai);
        scanf("%s", result);
        if((strcmp(result, "WA") == 0) && (AC[mondai] == 0)) {
            WA[mondai] ++;

        }
        if((strcmp(result, "AC") == 0) && (AC[mondai] == 0)) {
            AC[mondai] = 1;
            pena += WA[mondai];
            seito++;
        }
    }
    printf("%d %d\n", seito, pena);
    free(AC);
    free(WA);
    return 0;
}

Measured memory_bytes: 896
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt(), w = sc.nextInt();
		char[][] s = new char[h][w];
		int[] dx = new int[] {0,1,0,-1};
		int[] dy = new int[] {1,0,-1,0};
		for (int i = 0; i < h; i++) s[i] = sc.next().toCharArray();
		boolean alone = false;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if(s[i][j] == '#') {
					boolean flag = false;
					for (int k = 0; k < 4; k++) {
						if(i+dx[k]<h&&i+dx[k]>=0&&j+dy[k]<w&&j+dy[k]>=0) {
							flag = flag||(s[i+dx[k]][j+dy[k]]=='#');
						}
					}
					if(!flag) {
						alone = true;
						break;
					}
				}
			}
		}
		if(!alone)System.out.println("Yes");
		else System.out.println("No");
		sc.close();
	}
}

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

int main() {
  
  int S;
  cin >> S;
  
  vector<int64_t> R(2001);
  
  for (int i = 0; i < 3; i++) {
    R.at(i) = 0;
  }
  
  for (int i = 3; i < 6; i++) {
    R.at(i) = 1;
  }
  
  for (int i = 6; i < 2001; i++) {
    R.at(i) = (R.at(i-5) + R.at(i-4) + 2*R.at(i-3))%1000000007;
  }
    
  
  cout << R.at(S) << endl;

return 0;
}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
    int A,B; cin>>A>>B;

    for(int i=0;;i++){
        if(1+(A-1)*i>=B){
            cout<<i<<endl;
            break;
        }
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int S,W;
    scanf("%d %d",&S,&W);
    if(S>=1&&S<=100&W>=1&&W<=100)
    {
        if(S<=W)
        {
            printf("unsafe");
        }
        else
        {
            printf("safe");
        }
    }
}


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

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  int L = a+b;
  int R = c+d;
  if (L > R){
    cout << "Left" << endl;
  	}
  else if (L < R){
  cout << "Right" << endl;
  }
	else{
  cout << "Balanced" << endl;
	}
}


Measured memory_bytes: 256
import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;
import std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	long n = read.to!long;
	long m = read.to!long;
	
	bool[long] f1;
	bool[long] f2;
	
	foreach(i; 0 .. m){
		long a = read.to!long;
		long b = read.to!long;
		
		if(a == 1) f1[b] = 1;
		if(b == 1) f1[a] = 1;
		if(a == n) f2[b] = 1;
		if(b == n) f2[a] = 1;
		}
	
	string answer = "IMPOSSIBLE";
	foreach(i; 1 .. m + 1){
		if((i in f1) && (i in f2)) answer = "POSSIBLE";
		}
	
	answer.writeln;
	}

Measured memory_bytes: 15100
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define popcnt(x) __builtin_popcount(x)
#define inf 0x3f3f3f3f
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rand() (rand() << 15 | rand())
using namespace std;
using namespace __gnu_pbds;

template<typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long  ll;
#define EPS 1e-9
#define PI acos(-1.0)
const int MOD = 1e9 + 7;



int main() {

   ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
   int x , y;
   cin >> x >> y;
   cout << 6 - x - y << "\n";
}

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

double getDis(int d,vector<int> p1,vector<int> p2){
	double dis2 = 0;
	for (int k = 0; k < d; k++) {
		int t = abs(p1.at(k) - p2.at(k));
		dis2 += t*t;
	}
	double dis = sqrt(dis2);
	int t = floor(dis);
	return dis - t;
}

int main() {
	int n, dem;
	int ans = 0;
	cin >> n >> dem;
	vector<vector<int>> points(n, vector<int>(dem));
	vector<vector<bool>> cl(n, vector <bool> (n,false));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < dem; j++) {
			cin >> points.at(i).at(j);
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (i != j && !cl.at(i).at(j) && !cl.at(j).at(i)) {
				//cout << getDis(dem, points.at(i), points.at(j)) << endl;
				cl.at(i).at(j) = true;
				cl.at(j).at(i) = true;
				if (getDis(dem, points.at(i), points.at(j)) == 0) {
					ans++;
				}
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
const int maxn = 3e5 + 10;
using namespace std;

ll arr[maxn];

int main() {
	ios::sync_with_stdio(0);
	ll sum = 0, xr = 0, ans = 0, j = 1;
	int n; cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> arr[i];
		while(sum + arr[i] != (xr ^ arr[i])) { 
			sum -= arr[j]; xr ^= arr[j];
			ans += i - j; j++;  
		}
		sum += arr[i]; xr ^= arr[i];
	}
	while(j <= n) { ans += n + 1 - j; j++; }
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>

using namespace std;

int main() {
    int M, K;

    cin >> M >> K;

    if (M == 0) {
        if (K == 0)
            cout << "0 0" << endl;
        else
            cout << -1 << endl;
        return 0;
    }
    if (M == 1) {
        if (K == 0)
            cout << "0 0 1 1" << endl;
        else
            cout << -1 << endl;
        return 0;
    }

    if (K > (1 << M) - 1) {
        cout << -1 << endl;
        return 0;
    }

    for (int i = 0; i < (1 << M); i++) {
        if (i != K) cout << i << " ";
    }
    cout << K << " ";
    for (int i = (1 << M) - 1; i >= 0; i--) {
        if (i != K) cout << i << " ";
    }
    cout << K << endl;
}


Measured memory_bytes: 1792
coin_500 = int(input()) + 1
coin_100 = int(input()) + 1
coin_50 = int(input()) + 1
total = int(input())

cnt = 0

for i in range(coin_500):
    for j in range(coin_100):
        for k in range(coin_50):
            if 500 * i + 100 * j + 50 * k == total:
                cnt +=1
                
print(cnt)

Measured memory_bytes: 9212
/*
	Powered by C++11.
	Author : Alex_Wei.
*/

#include <bits/stdc++.h>
using namespace std;

//#pragma GCC optimize(3)
//#define int long long

#define ll long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb emplace_back
#define all(x) x.begin(),x.end()
#define sor(x) sort(all(x))
#define rev(x) reverse(all(x))
#define mem(x,v) memset(x,v,sizeof(x))

// Templates start.

namespace IO{
	char buf[1<<21],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;
	#ifdef __WIN32
		#define gc getchar()
	#else
		#define gc (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
	#endif
	#define pc(x) (*O++=x)
	#define flush() fwrite(obuf,O-obuf,1,stdout)

	inline int read(){
		int x=0,sign=0; char s=gc;
		while(!isdigit(s))sign|=s=='-',s=gc;
		while(isdigit(s))x=(x<<1)+(x<<3)+(s-'0'),s=gc;
		return sign?-x:x;
	}
	void print(int x) {if(x>9)print(x/10); pc(x%10+'0');}
}

namespace math{
	const int mod=998244353;
	const int maxn=1e6+5;

	ll ksm(ll a,ll b){ll s=1,m=a; while(b){if(b&1)s=s*m%mod; m=m*m%mod,b>>=1;} return s;}
	ll inv(ll x){return ksm(x,mod-2);}

	ll fc[maxn],ifc[maxn];
	void init_m(int n){
		fc[0]=1; for(int i=1;i<=n;i++)fc[i]=fc[i-1]*i%mod;
		ifc[n]=inv(fc[n]); for(int i=n-1;i>=0;i--)ifc[i]=ifc[i+1]*(i+1)%mod;
	}
	ll C(ll n,ll m){return fc[n]*ifc[m]%mod*ifc[n-m]%mod;}
}

// Templates end. Please give me more points.

using namespace IO;
//using namespace math;

int k,n,a[1005];

int main(){
	cin>>n>>k;
	for(int i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+n+1);
	int ans=0;
	for(int i=1;i<=k;i++)ans+=a[i];
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef pair<l_l,ll> lll;
const ll dx[4]={1,-1,0,0};
const ll dy[4]={0,0,1,-1};
#define pb push_back
#define sz(x) (int)(x).size()
#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)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
//グリッド：（典型）dp,dfs,bfs,最短経路,その他
const int mod = 1000000007;
struct mint {
ll x;
mint(ll x=0):x((x%mod+mod)%mod){}
mint operator-() const { return mint(-x);}
mint& operator+=(const mint a) {
if ((x += a.x) >= mod) x -= mod;
return *this;
}
mint& operator-=(const mint a) {
if ((x += mod-a.x) >= mod) x -= mod;
return *this;
}
mint& operator*=(const mint a) {
(x *= a.x) %= mod;
return *this;
}
mint operator+(const mint a) const {
mint res(*this);
return res+=a;
}
mint operator-(const mint a) const {
mint res(*this);
return res-=a;
}
mint operator*(const mint a) const {
mint res(*this);
return res*=a;
}
mint pow(ll t) const {
if (!t) return 1;
mint a = pow(t>>1);
a *= a;
if (t&1) a *= *this;
return a;
}
mint inv() const {
return pow(mod-2);
}
mint& operator/=(const mint a) {
return (*this) *= a.inv();
}
mint operator/(const mint a) const {
mint res(*this);
return res/=a;
}
};
ll n;
mint dp[1<<23];
ll a[23][23];
ll bitcnt[1<<23];
int main(){
    cin>>n;
    rep(i,n){
        rep(j,n){
            cin>>a[i][j];
        }
    }
    dp[0]=1;
    for(int s=1;s<(1<<n);s++){
        bitcnt[s]=bitcnt[s/2]+s%2;
        rep(l,n){
            if((s>>l)%2==0)continue;
            dp[s]+=dp[s-(1<<l)]*a[bitcnt[s]-1][l];
        }
    }
    cout<<dp[(1<<n)-1].x<<endl;
    return 0;
}

Measured memory_bytes: 85504
#include <bits/stdc++.h>
 
#define infi            5e9
#define infl            5e18
#define MX              100005
#define pi              2*acos(0.0)
#define ll              long long int
#define rr              read()
#define ff              first
#define ss              second
#define pb              push_back
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define ms(a,b)         memset(a, b, sizeof(a))
#define loop(i,n)       for(register int i=0;i<n;i++)
#define pool(i,n)       for(register int i=n-1;i>=0;i--)
#define loop1(i,n)      for(register int i=1;i<=n;i++)
#define pool1(i,n)      for(register int i=n;i>0;i--)
 
using namespace std;
 
inline ll read(){char c=getchar();ll num,sign=1;for(;c<'0'||c>'9';c=getchar())if(c=='-')sign=-1;for(num=0;c>='0'&&c<='9';){c-='0';num=num*10+c;c=getchar();}return num*sign;}
// inline ll pw(ll b, ll p){ll ans=1;while(p>0){if(p&1)ans*=b;p>>=1;b*=b;}return ans;}
inline bool isPrime(ll n){if(n==1)return false;if(n==2)return true;if(!(n%2))return false;for(ll i=3;i<=sqrt(n);i+=2)if(!(n%i))return false;return true;}
// inline ll gcd(ll a, ll b){if(a==0)return b;return gcd(b%a,a);}
 
// //*************************************  Bitmask Opereations  **********************************//
// int Set(int N,int pos){return N=N | (1<<pos);}
// int reset(int N,int pos){return N= N & ~(1<<pos);}
// bool check(int N,int pos){return (bool)(N & (1<<pos));}
// //********************************************************************************************//


int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    //#ifdef rid.dle
      //freopen("in.txt", "r", stdin);
    //#endif

    ll k=rr,m=rr;

    ll ans=0;
    loop(i,k+1){
      ll dif=m-i;
      if(dif>=0 && dif<=k)ans+=dif+1;
      else if(dif>k && dif<=2*k)ans+=(2*k)-dif+1;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
 
int main(){
  int n,i,j,cost,x,y,z,G[101][101],p[101],d[101];
 
  scanf("%d", &n);
 
  for(i = 0; i < n; i++){
    p[i] = 0;

    if(i == 0){
      d[i] = 0;
    }
    else d[i] = 150000;

    for(j = 0; j < n; j++){
      G[i][j] = -1;
    }
  }
 
  for(i = 0; i < n; i++){
    scanf("%d %d", &x, &y);
    for(j = 0; j < y; j++){
      scanf("%d", &z);
      scanf("%d", &G[x][z]);
    }
  }
 
  while(cost != 150000){
    cost = 150000;
    for(i = 0; i < n; i++){
      if(p[i] != 1 && d[i] < cost){
        cost = d[i];
        x = i;
      }
    }
 
    for(i = 0; i < n; i++){
      if(G[x][i] != -1 && p[i] != 1 && d[x] + G[x][i] < d[i])
        d[i] = d[x] + G[x][i];
    }
    p[x] = 1;
  }
 
  for(i = 0; i < n; i++){
    printf("%d %d\n", i, d[i]);
    }

  return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>

using namespace std;

typedef long long ll;

int main(){
    ll n, k;
    cin >> n >> k;
    ll mod = n%k;
    cout << min(mod, k - mod);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;


int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin >> s >> s;
    cout << "A" << s[0] << "C\n";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ctype.h>
# define pb push_back
#define fst first
#define sec second
#define For(i,a,b) for(int i=a;i<b;i++)
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
#define fo(i,n) for(ll i=0;i<n;i++)
#define endl "\n"
#define rev(i,n) for(ll i=n-1;i>=0;i--)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define boolsize 1000001
#define pi pair<ll,ll>
#define vi vector<ll>
#define vii vector<pi>
using namespace std;
template<typename T>
void showvector(vector <T> v)
{
    for(T x:v)
        cout<<x<<" ";
    cout<<endl;

}
template<typename T>
void showvector1(vector <T> v)
{
    ll n=v.size();
    fo1(i,n-1)
        cout<<v[i]<<endl;

}
template<typename T>
void showset(set <T> s)
{
    for(T x: s)
        cout<<x<<" ";
    cout<<endl;
}
template<class T>
void showvectorpair(vector<T> v)
{
    for(auto it=v.begin();it!=v.end();it++)
        cout<<it->first<<" "<<it->second<<endl;
    cout<<endl;
}
template<typename T,typename P>
void showmap(map <T,P> m)
{
    for(auto it=m.begin();it!=m.end();it++)
        cout<<it->first<<" "<<it->second<<endl;
    cout<<endl;
}
template<typename T>
bool comp(T a,T b)
{
    return (a>b);
}
template<class T>
bool comppair(T a,T b)
{
    if(a.first==b.first)
        return(a.second>b.second);
    return (a.first>b.first);
}
bool sameparity(ll a,ll b)
{
    return (a%2==b%2);
}
bool difparity(ll a,ll b)
{
    return !(a%2==b%2);
}
bool isprime(ll x)
{   if(x<=1)
     return false;
    for(ll i=2;i<=sqrt(x);i++)
    {
        if(x%i==0)
            return false;
    }
    return true;
}
bool iseven(ll x)
{
    return !(x%2);
}
bool isodd(ll x)
{
    return (x%2);
}
/// check for test case before submitting
void vfun()
{
    ll n,k;
    cin>>n;
    vector <ll> v(n);
    fo(i,n)
    cin>>v[i];

}
ll C(ll n,ll r)
{
    if(n<r)
        return 0;
    r=min(r,n-r);
    ll res=1;
    fo(i,r)
    {
        res*=(n-i);
    }
    fo(i,r)
    {
        res/=(i+1);
    }
    return res;
}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("inputh.txt", "r", stdin);
    freopen("outputh.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0); ///cant use scanf, printf
    cin.tie(0);cout.tie(0); /// no longer auto flush cout before each cin, remove for interactive
    //cout << fixed << setprecision(11); /// no scientific output
    ll test=1;
    //cin>>test;
    while(test--)
    {
            ll n;
            cin>>n;
            vi v(n);
            fo(i,n)
                cin>>v[i];
            ll cnt=0,ind=1;
            fo(i,n)
            {
                if(v[i]==ind)
                {
                    ind++;
                }
                else
                    cnt++;
            }
            if(ind==1)
                cnt=-1;
            cout<<cnt;

//         if(vfun())
//            cout<<"YES\n";
//         else
//            cout<<"NO\n";
    }
}
///before sub
/// check for value of zero and single input in array
///loop vars,1LL in mult, equal, one, bounds, int v ll, endl, finish taking inputs
/// check whether test cases are given or not





Measured memory_bytes: 4784
a1 = list(map(int, input().split(' ')))
a2 = list(map(int, input().split(' ')))
a3 = list(map(int, input().split(' ')))
A = a1+a2+a3
n = int(input())
for q in range(n):
    b = int(input())
    i = 0
    while i < 9:
        if A[i] == b:
            A[i] = 0
        i += 1

ans = 0
counterlist = [(0,1,2),(3,4,5),(6,7,8),(0,3,6),(1,4,7),(2,5,8),(0,4,8),(2,4,6)]
for p in counterlist:
    if A[p[0]]+A[p[1]]+A[p[2]] == 0:
        ans += 1
if ans == 0:
    print('No')
else:
    print('Yes')

Measured memory_bytes: 3064
#include <iostream>
#include <math.h>
#include <vector>
#include <stack>
#include <cstdio>
#include <string>
#include <bitset>
#include <list>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <functional>

using namespace std;
//debug

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

#define pb push_back

typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;



#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()



int main() {
	int a,b;
	cin >> a>>b;
	if(a+b==15){
		cout<<'+';
	}
	else if(a*b==15){
		cout<<'*';
	
	}
	else{
		cout << 'x' << endl;
	}

	return 0;
}



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

int main() {
    // std::ifstream in("D:/CLion 2016.3.2/untitled/in.txt");
    int n;
    std::cin >> n;
    std::vector<int> cands(n);
    for (int i = 0; i < n; ++i) {
        std::cin >> cands[i];
    }
    int m;
    std::cin >> m;
    std::vector<int> req(m);
    for (int i = 0; i < m; ++i) {
        std::cin >> req[i];
    }
    if (m > n) {
        std::cout << "NO\n";
        return 0;
    }

    std::sort(cands.begin(), cands.end());
    std::sort(req.begin(), req.end());
    int pos1 = 0;
    int cnt = 0;
    while(cnt < m && pos1 != cands.size()) {
        if (cands[pos1] == req[cnt]) {
            ++pos1;
            ++cnt;
        } else if (cands[pos1] < req[cnt]) {
            ++pos1;
        } else {
            std::cout << "NO\n";
            return 0;
        }
    }
    if (cnt == m) {
        std::cout << "YES\n";
    } else {
        std::cout << "NO\n";
    }
}


Measured memory_bytes: 1792
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int M = scan.nextInt();
        int[] d = new int[N];
        for (int i = 0; i < M; i++) {
            d[scan.nextInt()-1] += 1;
            d[scan.nextInt()-1] += 1;
        }
        boolean ans = true;
        for (int i = 0; i < N; i++) {
            if (d[i] % 2 == 1) {
                ans = false;
                break;
            }
        }
        System.out.println(ans ? "YES" : "NO");
    }
}


Measured memory_bytes: 65280
#include<iostream>
#include<cmath>
#include<string>

#define ll long long
#define MAX 10000001

using namespace std;

int main()
{
	int n;
	cin>>n;
	ll div[MAX];
	
	
	for(int i=0;i<MAX;i++)
		div[i] = 0;
	
	
	for(int i=2;i<MAX;i++)
	{
		for(int j=i;j<MAX;j=j+i)
		{
			if(j%i==0)
			{
				div[j]++;
			}
		}
	}
	
	div[0] = -1;
	div[1] = 1;
	
	ll ans = 0;
	while(n>1)
	{
      	
		ans = ans + (n*(div[n]+1));
      	n--;
	}
	cout<<ans+1;
	
 	return 0;
}

Measured memory_bytes: 81732
// Original: https://github.com/tanakh/competitive-rs
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

mod util {
    #[allow(dead_code)]
    pub fn chmin<T>(x: &mut T, y: T) -> bool
    where
        T: PartialOrd + Copy,
    {
        *x > y && {
            *x = y;
            true
        }
    }

    #[allow(dead_code)]
    pub fn chmax<T>(x: &mut T, y: T) -> bool
    where
        T: PartialOrd + Copy,
    {
        *x < y && {
            *x = y;
            true
        }
    }

    /// 整数除算切り上げ
    #[allow(dead_code)]
    pub fn roundup(a: i64, b: i64) -> i64 {
        (a + b - 1) / b
    }

    #[allow(dead_code)]
    pub fn ctoi(c: char) -> i64 {
        c as i64 - 48
    }
}

#[allow(unused_imports)]
use util::*;

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, VecDeque};

fn main() {
    input! {
        n:usize,s:chars,t:chars
    }

    let mut ans = vec![];
    for (a, b) in s.iter().zip(t.iter()) {
        ans.push(*a);
        ans.push(*b);
    }

    // let ans = ans.iter().collect::<String>();
    // println!("{}", ans);
    for c in ans.iter() {
        print!("{}", c);
    }
    println!("");
}


Measured memory_bytes: 4352
using System;

namespace TapDance
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] step = Console.ReadLine().ToCharArray();
            string answer = "Yes";
            for (int i = 0; i < step.Length; i++)
            {
                if (i % 2 == 0)
                {
                    if (step[i].Equals('L'))
                    {
                        answer = "No";
                    }
                }
                else
                {
                    if (step[i].Equals('R'))
                    {
                        answer = "No";
                    }
                }
            }

            Console.WriteLine(answer);
        }
    }
}


Measured memory_bytes: 11092
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <deque>
using ll = long long;

using namespace std;

int main() {
    ll N,K;
    cin >> N >> K;
    deque<ll> baseDeq;
    for(ll i = 0; i < N; i++){
        ll tmp;
        cin >> tmp;
        baseDeq.push_back(tmp);
    }
    ll maxVal = 0;
    //捨てる数の決定
    for(int trashAmount = 0; trashAmount < K; trashAmount++){
        int pickCount = K - trashAmount;
        //左右から取り出す数の決定
        for(int ri = 0; ri <= pickCount; ri++){
            ll tmpVal = 0;
            deque<ll> deq = baseDeq;
            vector<ll> inHand = vector<ll>(0);
            //取り出す動作
            for(int i = 0; i < ri; i++){
                if(deq.empty()){
                    break;
                }
                ll tmp = deq.front();deq.pop_front();
                inHand.push_back(tmp);
            }
            for(int i = ri; i < pickCount; i++){
                if(deq.empty()){
                    break;
                }
                ll tmp = deq.back();deq.pop_back();
                inHand.push_back(tmp);
            }
            for(int i = 0; i < inHand.size(); i++){
                //cout << inHand[i]  <<", ";
            }
            //cout << endl;
            //捨てる動作
            sort(inHand.begin(),inHand.end(),greater<ll>());
            for(int i = 0; i < trashAmount; i++){
                if(inHand[inHand.size() - 1] >= 0){
                    break;
                }
                inHand.pop_back();
            }
            //入手した合計を計算
            for(int i = 0; i < inHand.size(); i++){
                tmpVal += inHand[i];
            }
            maxVal = max(maxVal,tmpVal);
        }
    }
    cout << maxVal << endl;
}


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

int main()
{
    ll N;
    cin >> N;
    ll mi = LLONG_MAX;
    for(int i = 0;i < 5;i++){
        ll A;
        cin >> A;
        mi = min(mi, A);
    }
    cout << 4 + (N + mi - 1) / mi << endl;
    return 0;
}


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

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;


#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};


int main()
{
    ll n,m;
    cin>>n>>m;
    vector<ll> a(n);
    for (ll i = 0; i < n; i++)
    {
        cin>>a[i];
        a[i]/=2;
    }
    ll gcd=a[0];
    for (ll i = 0; i < n; i++)
    {
        gcd=__gcd(gcd,a[i]);
    }
    bool odd=true;
    for (ll i = 0; i < n; i++)
    {
        if((a[i]/gcd)%2==0)
        {
            odd=false;
        }
    }
    if(odd)
    {
        ll lcm=1;
        for (ll i = 0; i < n; i++)
        {
            lcm=lcm*(a[i]/__gcd(lcm, a[i]));
        }
        cout<<(m/lcm)/2+(m/lcm)%2<<endl;
    }
    else
    {
        cout<<0<<endl;
    }
        
    return 0;
}

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

typedef long long ll;

int main(){
    int n;
    bool b = false;
    cin>>n;
    for(int i=0; i<3;i++){
        if(n%10==7) b = true;
        n /= 10;
    }
    if(b) cout<<"Yes"<<endl;
    else cout <<"No"<<endl;
}



Measured memory_bytes: 3512