akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h> 
#define pb push_back
#define mp make_pair 
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define f(i,a,n) for(int i=a;i<n;i++)
using namespace std;
typedef vector<int> vi;
typedef map<int,int> mii;
typedef pair<int,int> pii; 
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

int main() {

    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif*/
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ; cout.tie(NULL) ;

   //int t; cin>>t; while(t--) 
	string s;
	cin>>s;
	if(s=="ARC") cout<<"ABC";
	else cout<<"ARC";
    return 0 ;  
}

Measured memory_bytes: 3580
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)
class Point {
public:
	long double x, y;
	Point(long double x = 0, long double y = 0) :x(x), y(y) {}
	Point operator + (Point p) { return Point(x + p.x, y + p.y); }
	Point operator - (Point p) { return Point(x - p.x, y - p.y); }
	Point operator * (double a) { return Point(x*a, y*a); }
	Point operator / (double a) { return Point(x / a, y / a); }
	long double abs() { return sqrt(norm()); }
	long double norm() { return x*x + y*y; }
	bool operator < (const Point &p) const { return x != p.x ? x < p.x : y < p.y; }
	bool operator > (const Point &p) const { return x != p.x ? x > p.x : y > p.y; }
	bool operator == (const Point &p) const { return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS; }
};
struct Segment {
	Point p1, p2;
};
long double norm(Point p) { return p.x*p.x + p.y*p.y; }
long double abs(Point p) { return sqrt(norm(p)); }
double dot(Point a, Point b) {
	return a.x*b.x + a.y*b.y;
}
Point projection(Segment a, Point b) {
	Point sa = a.p2 - a.p1;
	double hyp = dot(b - a.p1, sa); double r = hyp / norm(sa);
	return a.p1 + sa * r;
}
Point reflection(Segment a, Point b) {
	return b + ((projection(a, b) - b)*2.0);
}
int main() {
	Point P1, P2; Segment G; int q;
	cin >> P1.x >> P1.y >> P2.x >> P2.y; G.p1 = P1; G.p2 = P2;
	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> P1.x >> P1.y;
		P2 = reflection(G, P1);
		cout << fixed << setprecision(15) << P2.x << ' ' << fixed << setprecision(15) << P2.y << endl;
	}
	return 0;
}

Measured memory_bytes: 1304
#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 rrng(a) a.rbegin(),a.rend()
#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 eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<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 tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

int main() {
  int n;
  cin >> n;
  vl a(n);
  rep(i,n)cin >> a[i];
  map<ll,int> M;
  ll sum = 0;
  vl B;
  rep(i,n){
    B.push_back(a[i]-(i+1));
  }
  sort(rng(B));
  ll b = B[sz(B)/2];
  rep(i,n){
    sum+=abs(a[i]-(b+i+1));
  }
  cout<<sum<<endl;
  return 0;
}

Measured memory_bytes: 3956
#include<bits/stdc++.h>
#define N 200005
#define maxint 1000000001
#define LL long long 
using namespace std;
LL a[N],sum[N];
int n;
int main(){
    scanf ("%d",&n);
    for (int i = 1;i <= n;i++) 
    {
        scanf("%lld",&a[i]);
        sum[i] = sum[i-1] + a[i];
    }
    LL ans = sum[n];
    for (int i = 1,l = 1,r = 2;i < n - 1; i++)
    {
        while(l < i && abs(sum[i] - 2*sum[l]) > abs(sum[i] - 2*sum[l+1])) l++;
        while(r < n && abs(sum[n] + sum[i] - 2 * sum[r]) > abs(sum[n] + sum[i] - 2*sum[r+1])) r++;
        //cout<<l<<" "<<i<<" "<<r<<endl;
        LL pass[5];
        pass[1] = sum[n] - sum[r];
        pass[2] = sum[r] - sum[i];
        pass[3] = sum[i] - sum[l];
        pass[4] = sum[l];
        sort(pass+1,pass+5);
        if(ans > pass[4] - pass[1]){
            ans = pass[4] - pass[1];
            //cout<<pass[4]<<" "<<pass[1]<<endl;
        }
    }
    cout<<ans<<endl;
}

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

/*-------------------------------Template---------------------------------------*/

#define shameem              ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll                   long long int
#define gcd(a,b)              __gcd(a,b)
#define lcm(a,b)             (a*b)/gcd(a,b)
#define pi                    2*acos(0.0)
#define testi                int t; cin>>t; while(t--)
#define testl                ll t; cin>>t; while(t--)
#define vi                   vector<int>
#define vl                   vector<ll>
#define pb                   push_back
#define mk                   make_pair

/*-------------------------------Print---------------------------------------*/

#define YES                  cout<<"YES"<<endl
#define NO                   cout<<"NO"<<endl
#define yes                  cout<<"yes"<<endl
#define no                   cout<<"no"<<endl

using namespace std;

void solve()
{
    int n;
    cin>>n;
    int ans=0;
    for(int i=1; i<n; i++)
    {
        ans+=(n-1)/i;
    }
    cout<<ans<<endl;

}
int main()
{
    shameem

    //testi

    //testl



    solve();

    return 0;
}



Measured memory_bytes: 3644
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;

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

    return 0;
}


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

using namespace std;

string STR[38] =
  {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
   "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
   "ld", "mb", "mp", "nc", "nd", "ng", "nt", "nw", "ps", "qu", "cw", "ts"};

struct DATA{
  int n, cnt[38];
  DATA(){
    for(int i=0; i<N; ++i) cnt[i]=0;
  }
  void print(int& n){
    int k=0;
    for(int i=1; i<N; ++i){
      if(cnt[k]<cnt[i]) k=i;
    }
    cout << STR[n] << " " << STR[k] << " " << cnt[k] << endl;
  }
};

DATA data[N];

int two_char(const char& c1, const char& c2){
  for(int i=26; i<N; ++i){
    if(c1==STR[i][0] && c2==STR[i][1]) return i;
  }
  return -1;
}

int one_char(const char& c){
  for(int i=0; i<26; ++i){
    if(c==STR[i][0]) return i;
  }
  return -1;
}

void solve(string& s){
  vector<int> code;
  int i;
  for(i=0; i<s.size()-1; ++i){
    int k = two_char(s[i],s[i+1]);
    if(k!=-1){
      code.push_back(k); ++i; continue;
    }else{
      code.push_back(one_char(s[i]));
    }
  }
  if(i<s.size()) code.push_back(one_char(s[i]));

  for(i=0; i<code.size()-1; ++i){
    if(code[i]!=-1 && code[i]!=-1)
      ++data[code[i]].cnt[code[i+1]];
  }
}

int main(){
  int n;
  string s;
  cin >> n;
  for(int i=-1; i<n; ++i){
    getline(cin, s);
    if(i==-1) continue;
    solve(s);
  }
  for(int i=0; i<N; ++i) data[i].print(i);
  return 0;
}

Measured memory_bytes: 1240
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define MOD (1000000007)
#define INF (2e9)
#define INFL (2e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
using vint=vector<int>;
using vll=vector<ll>;
template<class T>using arr=vector<vector<T>>;
template<class T>int popcount(T &a){int c=0; rep(i, 8*(int)sizeof(a)){if((a>>i)&1) c++;} return c;}
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} pr(a[a.size()-1]);}
template<class T>void prarr(arr<T>& a){rep(i, a.size()) if(a[i].empty()) pr(""); else prvec(a[i]);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main()
{
    string s; cin >> s;
    int n = s.size();
    int p = 0;
    ll t = 0;
    int m = 0;
    vint ans;
    ans.push_back(p);
    int i = 0;
    while(i<n){
        p = 0;
        ll up = 0;
        vint v;
        while(i+up < n && s[i+up]=='<') {
            p++;
            up++;
        }
        i = i+up;

        ll down = 1;
        while(i+down < n && s[i+down]=='>'){
            p--;
            down++;
        }
        i += down;
        // cout << up << ":" << down << endl;

        if(up < down) swap(up, down);
        t += (up+1)*up/2 + (down-1)*down/2;
        
        // cout << t <<  " " << i << endl;
    }
    // prvec(ans);
    pr(t);
    return 0;}

Measured memory_bytes: 4284
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(register int i=st,i##end=ed;i<=i##end;++i)
#define DREP(i,st,ed) for(register int i=st,i##end=ed;i>=i##end;--i)
typedef long long ll;
template<typename T>inline bool chkmin(T &x,T y){return (y<x)?(x=y,1):0;}
template<typename T>inline bool chkmax(T &x,T y){return (y>x)?(x=y,1):0;}
inline int read(){
	int x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1)+(x<<3)+(c^'0');
	return x*f;
}
inline ll readll(){
	ll x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1ll)+(x<<3ll)+(c^'0');
	return x*f;
}
const int maxn=1e5+10;
int a[maxn],b[maxn];
int id1[maxn],id2[maxn],posx[maxn],posy[maxn];
ll sum1[maxn],sum2[maxn];
inline bool cmp1(const int A,const int B){
	return a[A]<a[B];
}
inline bool cmp2(const int A,const int B){
	return b[A]<b[B];
}
int main(){
	int n=read();
	REP(i,1,n) a[i]=read(),b[i]=read(),id1[i]=id2[i]=i;
	sort(id1+1,id1+n+1,cmp1);
	sort(id2+1,id2+n+1,cmp2);
	REP(i,1,n) sum1[i]=sum1[i-1]+a[id1[i]];
	REP(i,1,n) sum2[i]=sum2[i-1]+b[id2[i]];
	REP(i,1,n) posx[id1[i]]=i;
	REP(i,1,n) posy[id2[i]]=i;
	ll ans=min(sum1[n],sum2[n]);
	int num=0;
	REP(i,1,n-1){
		if(posy[id1[i]]<=n-i) ++num;
		if(posx[id2[n-i+1]]<=i-1) --num;
		if(num) chkmin(ans,sum1[i]+sum2[n-i]);
		else chkmin(ans,min(sum1[i]+sum2[n-i-1]+b[id2[n-i+1]],sum1[i-1]+sum2[n-i]+a[id1[i+1]]));
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
#define bug(x) cout << #x << " = " << x << endl
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define reset(x) memset(x,0,sizeof(x))
#define up(i,l,r) for(int i=l;i<=r;i++)
#define down(i,r,l) for(int i=r;i>=l;i--)
using namespace std;
typedef long long int ll;
ll n,a[305][305]={0},Ti=0;
bool flag=0;
int main(){
	ios_base::sync_with_stdio(0);
	cin>>n;
	up(i,1,n){
        up(j,1,n) cin>>a[i][j];
	}
	up(i,1,n) if(a[i][i]!=0) flag=1;
	up(i,1,n){
        up(j,i+1,n) if(a[i][j]!=a[j][i]) flag=1;
	}
	up(i,1,n){
        up(j,i+1,n){
            bool edge=1;
            up(k,1,n){
                if(k==i||k==j) continue;
                if(a[i][j]>(a[i][k]+a[k][j])){
                    flag=1;
                    break;
                }
                if(a[i][j]==(a[i][k]+a[k][j])) edge=0;
            }
            if(flag) break;
            if(edge) Ti+=a[i][j];
        }
        if(flag) break;
	}
	if(flag) Ti=-1;
	cout<<Ti<<endl;
	return 0;
}


Measured memory_bytes: 1024
//============================================================================
// Name        : procon.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <vector>
using namespace std;

int main() {
	int n,q,sum;
	vector<int> S,T;

	cin >> n;
	for(int i = 0; i < n; i++){
		int val;
		cin >> val;
		S.push_back(val);
	}

	cin >> q;
	for(int j = 0; j < q; j++){
		int val;
		cin >> val;
		T.push_back(val);
	}

	for(auto v1 : T){
		for(auto v2 :S){
			if(v1 == v2){
				sum++;
				break;
			}
		}
	}


	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 3156
#include<stdio.h>
int sum[10];
int main(){
int p,q,r;
scanf("%d%d%d",&p,&q,&r);
int sum1,sum2,sum3,sum4,sum5,sum6;
sum[1]=p+q;
sum[2]=q+r;
sum[3]=p+r;
sum[4]=p+q;
sum[5]=q+r;
sum[6]=p+r;
sum[0]=sum[1];
for(int i=2;i<=6;i++)
{
if(sum[i]<sum[0])
{
    sum[0]=sum[i];
}
}
printf("%d\n",sum[0]);
return 0;}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<ll> vl;
typedef queue<int> qi;
typedef queue<ll> ql;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define pq priority_queue
#define rep(i,n) for (int i=0;i<n;i++)
#define mp make_pair
#define pb push_back
#define pf push_front
#define F first
#define S second
#define INF 2000000009
string s; 
int main()
{
	ios::sync_with_stdio(false);
	cin>>s;
	for (int i=1;i<s.size();++i){
		if (s[i-1]=='A'&&s[i]=='C'){
			cout<<"Yes";return 0;
		}
	}
	cout<<"No";
}

Measured memory_bytes: 256
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("avx,avx2")
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

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

# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>

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

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
 
int rnd (int l, int r) {
	return uniform_int_distribution<int> (l, r)(gen);
}
 
int n, m, k;
int cnt[N];
string s;
int a[N];
vector < int > g[N];
int u[N];
int ans, res;
int cur;



int main () {
	SpeedForce;
	ll a;
    cin >> a >> s;
    ll b;
    for (auto &e : s) e -= '0';
    b = s[0] * 100 + s[2] * 10 + s[3];
    a *= b;
    a /= 100;

	cout << a << '\n';

	return Accepted;
}

// B...a

Measured memory_bytes: 17732
#include <stdio.h>

int main(){
	int i,j,n,a[1000],v;
	
	scanf("%d",&n);
	
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	for(i=0;i<n-1;i++) printf("%d ",a[i]);

	printf("%d\n",a[n-1]);
	
	for(i=1;i<=n-1;i++){
		v=a[i];
		j=i-1;
		while(j>=0 && a[j]>v){
			a[j+1]=a[j];
			j--;
		}
		a[j+1]=v;
		
		for(j=0;j<n-1;j++) printf("%d ",a[j]);

		printf("%d\n",a[n-1]);
	}
	
	return 0;
}


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

int main()
{
    int N;
    int a[110];
    int sum = 0;

    scanf("%d", &N);
    for (int i = 0; i < N; i++)
    {
        scanf("%d", &a[i]);
        sum += a[i];
    }

    int ave1 = sum / N;
    int ave2 = sum / N + 1;
    int ans1 = 0, ans2 = 0;
    for (int i = 0; i < N; i++)
    {
        ans1 += (a[i] - ave1) * (a[i] - ave1);
        ans2 += (a[i] - ave2) * (a[i] - ave2);
    }

    printf("%d\n", min(ans1, ans2));

    return 0;
}

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

signed main(void)
{
	int n, k;
	long long cnt1, cnt2, ans;

	cin >> n >> k;
	cnt1 = cnt2 = ans = 0;
	for(int i = 1; i <= n; i++)
	{
		if (i % k == 0)
			cnt1++;
		if (k % 2 == 0 && i % k == k / 2)
			cnt2++;
	}
	ans = cnt1 * cnt1 * cnt1 + cnt2 * cnt2 * cnt2;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
/*
*	User: Isanchez_Aguilar
*	Problem: AtCoder ABC134B - Golden Apple
*/
#include <bits/stdc++.h>

using namespace std;
using ii = pair<int, int>;

int main(void)
{
	int n, m;
	cin >> n >> m;

	vector<ii> s(n);
	vector<ii> t(m);

	for (auto& p : s)
		cin >> p.first >> p.second;

	for (auto& p : t)
		cin >> p.first >> p.second;

	vector<bool> used(m);

	for (int i = 0; i < n; ++i)
	{
		int d = INT_MAX;
		int idx = -1;
		auto& p1 = s[i];
		for (int j = 0; j < m; ++j)
		{
			auto& p2 = t[j];
			int currD = abs(s[i].first - t[j].first) + abs(s[i].second - t[j].second);

			if (currD < d and not used[j])
			{
				d = currD;
				idx = j;
			}
		}
	
		cout << idx + 1 << "\n";
	}

				

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> A(N + 1);
	for (int i = 0; i < N + 1; i++) {
		cin >> A.at(i);
	}
	vector<int> B(N);
	for (int i = 0; i < N; i++) {
		cin >> B.at(i);
	}

	long long int cnt = 0;
	for (int i = 0; i < N; i++) {
		if (A.at(i) <= B.at(i)) {
			cnt += A.at(i);
			B.at(i) -= A.at(i);
			A.at(i) = 0;
		}
		else {
			cnt += B.at(i);
			A.at(i) -= B.at(i);
			B.at(i) = 0;
		}

		if (A.at(i + 1) <= B.at(i)) {
			cnt += A.at(i + 1);
			B.at(i) -= A.at(i + 1);
			A.at(i + 1) = 0;
		}
		else {
			cnt += B.at(i);
			A.at(i + 1) -= B.at(i);
			B.at(i) = 0;
		}
	}

	cout << cnt << endl;

	return 0;
}


Measured memory_bytes: 1024
W, H, x, y = map(int, input().split())
ans_s = float((W*H)/2)
ans_d = 0
if ((W%2 == 0)&(x == W//2)) & ((H%2 == 0)&(y == H//2)):
  ans_d = 1
print("{} {}".format(ans_s, ans_d))

Measured memory_bytes: 3060
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};



int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int n;
    string s;
    cin>>n>>s;
    vector<vector<int>> place(26,vector<int>(0));
    rep(i,n) place[s[i]-'a'].emplace_back(i);
    vector<int> now(26,0);
    int ans=0;
    rep(i,n-1){
        int num=s[i]-'a';
        now[num] ++;
        if(now[num]==place[num].size()) continue;
        for(int j=now[num];j<place[num].size();j++){
            int x=place[num][j];
            if(i>=x) continue;
            if(i>0 && s[i-1]==s[x-1]) continue;
            int cnt=0;
            while(x+cnt<n){
                if(i+cnt==x) break;
                if(s[i+cnt]==s[x+cnt]) cnt ++;
                else break;
            }
            ans=max(ans,cnt);
        }
    }
    cout<<ans<<endl;
}/*
./problem.exe
*/

Measured memory_bytes: 384
#pragma region cp-helper
#include <bits/stdc++.h>
using namespace std;
#define AC ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ii pair<int, int>
#define lll pair<ll, ll>
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define vll vector<lll>
#define vvl vector<vl>
#define vii vector<ii>
#define all(a) a.begin(), a.end()
#define qsort(a) sort(all(a))
#define qsortd(a) sort(all(a), greater<>())
#define qsortf(a, f) sort(all(a), f)
#define pb(n) push_back(n)
#define eb(n) emplace_back(n)
#define pp(a, b) emplace_back(make_pair(a, b))
#define umap unordered_map
#define nl '\n'
#define fileio(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
#define qmod %mod
#define pls int
#define give main()
const int mod = 1000000007;
#pragma endregion

pls give {
    AC;
    int a, b;
    cin >> a >> b;
    if (a*500>=b) cout << "Yes";
    else cout << "No";
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	s := readString()
	t := readString()

	available := make([]bool, 26)
	for _, b := range []byte(s) {
		available[b-'a'] = true
	}
	for _, b := range []byte(t) {
		if !available[b-'a'] {
			fmt.Println(-1)
			return
		}
	}

	lut := make([][]int, 26)
	s2 := []byte(s + s)
	for b, _ := range available {
		if !available[b] {
			continue
		}
		lut[b] = make([]int, len(s))
		j := 0
		for i := len(s2) - 1; i >= 0; i-- {
			if int(s2[i]) == b+'a' {
				j = 0
			} else {
				j++
			}
			if i < len(s) {
				lut[b][i] = j
			}
		}
	}

	i := 0
	for _, b := range []byte(t) {
		i += lut[b-'a'][i%len(s)] + 1
	}
	fmt.Println(i)
}

const (
	ioBufferSize = 1 * 1024 * 1024 // 1 MB
)

var stdinScanner = func() *bufio.Scanner {
	result := bufio.NewScanner(os.Stdin)
	result.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	result.Split(bufio.ScanWords)
	return result
}()

func readString() string {
	stdinScanner.Scan()
	return stdinScanner.Text()
}


Measured memory_bytes: 22784
#include<bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  vector<vector<char>> data(a,vector<char>(b));
  for ( int i = 0 ; i < a ; i++ ) {
    for ( int j = 0 ; j < b ; j++ ) {
      cin >> data.at(i).at(j);
    }
  }
  
  vector<bool> row(a,false);
  vector<bool> lin(b,false);
  
  for ( int i = 0 ; i < a ; i++ ) {
    for ( int j = 0 ; j < b ; j++ ) {
     if ( data.at(i).at(j) == '#' ) {
       row.at(i) = true;
       lin.at(j) = true;
     }
    }
  }
  
  for ( int i = 0 ; i < a ; i++ ) {
    if ( row.at(i) ) {
      for ( int j = 0 ; j < b ; j++ ) {
        if (lin.at(j)) {
          cout << data.at(i).at(j);
        }
      }
      cout << endl;
    }
  }
}

Measured memory_bytes: 256
fn main(){
    let n: i32 = read();

    for x in 0..n+1 {
        if (x as f64 * 1.08) as i32 == n {
            println!("{}", x);
            return
        }
    }
    println!(":(");
}

use std::io::stdin;
use std::io::Read;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let cin = stdin();
    let cin = cin.lock();
    let token: String = cin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


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

int main()
{
    int N,X;
    int L;
    int sum = 0;
    int count = 1;
    cin >> N >> X;
    for(int i=0;i<N;i++){
        cin >> L;
        sum += L;
        if(sum <= X){
            count++;
        }
    }

    cout << count;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define SUM(n) ((n)+1)*(n)/2 //1〜nまでの総和を求める式
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) fixed<<setprecision(x+1) //小数点桁数を指定する
#define abs(x,y) max(x,y)-min(x,y)
#define all(v) v.begin(),v.end()
#define UPDigit(a,b) (a+b-1)/b //小数点切り上げ
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD = int(1e9)+7; 
using namespace std;
using pii = pair<lol, lol>;
typedef vector<int> vit;

//最大公約数
lol gcd(lol x, lol y){ return (y != 0 ? gcd(y, x % y) : x); }
//最小公倍数
lol lcm(lol x, lol y){ return ((x * y) / gcd(max(x, y), min(x, y))); }

signed main(void){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int a, b, k;
  cin >> a >> b >> k;
  for(int i = min(a, b);i >= 1;i --){
    if(a % i == 0 && b % i == 0){
      k --;
      if(!k){
	cout << i << '\n';
	return 0;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3548
s = input()
set_s = set(s)
if len(set_s) == 26:
    print("None")
    quit()
moji = [chr(i) for i in range(97,97+26)]
for i in range(len(moji)):
    if not(moji[i] in set_s):
        print(moji[i])
        quit()


Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define  all(x) (x).begin(),(x).end()
typedef long long ll;

void bublle_sort(vector<int> A){
    bool flag = true;
    int cnt = 0;
    while (flag){
        flag = false;
        for (int i = A.size()-1; i > 0; i--){
            if(A[i-1] > A[i]){
                swap(A[i-1], A[i]);
                flag = true;
                cnt++;
            }
        }
    }
    rep(i, A.size()){
        cout << A[i];
        if (i != A.size()-1) cout << " ";
    }
    cout << endl << cnt << endl;
}

int main(){
    int n;
    cin >> n;
    vector<int> A(n);
    rep(i, n) cin >> A[i];
    bublle_sort(A);
}


Measured memory_bytes: 3168
# ABC062A - Grouping
x, y = list(map(int, input().rstrip().split()))
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]

if x == y:
    print("Yes")
elif x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")

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

#define REP(i, start, count) for(int i=(start); i<(int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

typedef long long ll;
typedef unsigned long long ull;

int N, K;
vector<int> h;

int main(void) {
    cin >> N >> K;
    h.resize(N);
    for (int& t : h) {
        cin >> t;
    }
    vector<ll> dp(N + 1, 0);
    dp[0] = 0;
    dp[1] = abs(h[1] - h[0]);

    for(int i = 2; i < N; ++i) {
        ll lowest = INT64_MAX;
        for (int k = 1; k <= K; ++k) {
            if (i - k < 0) break;
            lowest = min(dp[i - k] + abs(h[i] - h[i - k]), lowest);
        }

        dp[i] = lowest;
    }

    cout << dp[N - 1] << endl;

    return 0;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const double PI=3.141592653589;
const int INF=1000000007;
const ll LMAX=1000000000000001;
ll gcd(ll a,ll b){if(a<b)swap(a,b);ll c=a%b;while(c!=0){a=b;b=c;c=a%b;}return b;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

int main(){
  string s; cin>>s;
  bool a=0;
  bool b=0;
  rep(i,s.size()){
    if(s[i]=='A')
    a=1;
    else if(s[i]=='B')
    b=1;
  }
  if(a&&b)
  puts("Yes");
  else
  puts("No");

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include <cstdint>
#include<unordered_map>
#include <boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define Endl endl
#define F first
#define S second

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;


int main() {
	int A, B, C, D, E, F;
	cin >> A >> B >> C >> D >> E >> F;
	double concentration = 0;
	int water = 0;
	int sugar = 0;
	rep(i, 101) {
		rep(j, 101) {
			rep(k, 101) {
				rep(m, 101) {
				
					int tmpwater = 100* A*i + 100 * B*j;
					int tmpsugar = C * k + D * m;
					double maxsugar = tmpwater * E / 100.00;
					if (tmpsugar + tmpwater <= F
						&&tmpsugar+tmpwater!=0
						&&tmpsugar<=maxsugar) {
						double tmp =
							100.00 * tmpsugar / (tmpsugar+tmpwater);
						if (concentration<tmp) {
							concentration = tmp;
							water = tmpwater;
							sugar = tmpsugar;
						}

					}
				}
			}
		}
	}
	if (water == 0) {
		water = 100*A;
	}
	cout << water+sugar << " " << sugar;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
    int h, w;
    cin >> h >> w;

    char s[h+2][w+2];
    for(int i=0;i<w+2;i++){
        s[0][i] = '.';
        s[h+1][i] = '.';
    }
    for(int i=1;i<h+1;i++){
        for(int j=1;j<w+1;j++)cin >> s[i][j];
        s[i][0] = '.';
        s[i][w+1] = '.';
    }

    for(int i=1;i<h+1;i++){
        for(int j=1;j<w+1;j++){
            if(s[i][j]=='#' && s[i-1][j]=='.' && s[i+1][j]=='.' && s[i][j-1]=='.' && s[i][j+1]=='.'){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

template <typename T>
vector<T> divisor(T val) {
  vector<T> res;
  for (T i = 1; i * i <= val; ++i) {
    if (val % i == 0) {
      res.emplace_back(i);
      if (i * i != val) res.emplace_back(val / i);
    }
  }
  sort(ALL(res));
  return res;
}

int main() {
  int x; cin >> x;
  for (int d : divisor(x)) {
    for (ll b = -1000; b <= 1000; ++b) {
      ll a = d + b;
      if (a * a * a * a * a - b * b * b * b * b == x) {
        cout << a << ' ' << b << '\n';
        return 0;
      }
    }
  }
  assert(false);
}


Measured memory_bytes: 3656
n = int(input())
a = list(map(int,input().split(" ")))
# print(a)

managelist = [0] * n
# print(managelist) 
# manage_d = {}

for i in range(n-1):
    managelist[a[i]-1] += 1
    # print(managelist)

for i in range(n):
    print(managelist[i])

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

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

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

    int dif[N];
    rep(i,N-1){
        dif[i] = a[i+1] - a[i];
    }
    dif[N-1] = K - a[N-1] + a[0];
    

    int sum = 0;
    rep(i,N) {
        sum += dif[i];
    }
    // cout << sum << endl;

    int min =  K; 
    rep(i,N){
        if(min > (sum - dif[i])) {
            min = sum - dif[i];
        }
    }


    cout << min << endl;


    
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int NIL = -1;
const int MAX = 200005;
const int MOD = 1000000007;
const double pi = 3.141592653589;
/* global variables */
int D = 60;
/* function */
/* main */
int main(){
    int n; ll k;
    cin >> n >> k;
    // Doublingでの解法
    // O(nlog(k))
    // to[l][i]: start i -> 2^l進んだ時の場所
    vector<vector<int>> to(D, vector<int>(MAX));
    for (int i = 0; i < n; i++) {
        cin >> to[0][i];
        to[0][i]--;
    }

    // i -> 2^{l + 1}進む
    // 2^l個次の要素」の2^l個次の要素は、2^(l+1)個次の要素
    // <=>   i  -> 1. 2^{l} 進む   -> 2. 2^{l}進む
    // 1. to[l][i]
    // 2. to[l][to[l][i]]
    // -> to[l + 1][i] = to[l][to[l][i]]
    for (int l = 0; l < D - 1; l++) {
        for (int i = 0; i < n; i++) {
            to[l + 1][i] = to[l][to[l][i]];
        }
    }

    int v = 0;
    for (int i = D - 1; i >= 0; --i) {
        ll b = 1LL << i;
        if (k & b) {
            //  二進展開して, k番目のビットが立っていたら,
            //  位置を2^iだけ次にずらす
            v = to[i][v];
        }
    }
    cout << v + 1 << '\n';
}


Measured memory_bytes: 51044
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect
import sys
import random
import time
inf = 10**9


def main():
    s = input()
    su = 0

    for i in range(2 ** (len(s) - 1)):
        a = []
        for j in range(len(s)):
            a.append(s[j])
            if (j < len(s)-1 and (i >> j) & 1):
                a.append("+")
        # print(''.join(a))
        su += eval(''.join(a))

    print(su)


if __name__ == '__main__':
    main()


Measured memory_bytes: 6308
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  ll x; cin >> x;
  ll a=100;
  int ans=0;
  while(a<x){
    a=ll(a*1.01);
    ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main() {
  ll n;
  cin >> n;
  string s;
  cin >> s;
  ll ans = 0;
  REP(i, 10) REP(j, 10) REP(k, 10) {
    vector<ll> a = {i, j, k};
    ll p = 0;
    REP(l, n) {
      if (s[l] - '0' == a[p]) {
        p++;
      }
      if (p == 3) {
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
class DisjointSet:
    def __init__(self, size):
        self.rank = [0 for i in range(size)]
        self.p = [0 for i in range(size)]
        for i in range(size):
            self.makeSet(i)
    
    def makeSet(self, x):
        self.p[x] = x
        self.rank[x] = 0

    def same(self, x, y):
        return self.findSet(x) == self.findSet(y)

    def unite(self, x, y):
        self.link(self.findSet(x), self.findSet(y))

    def link(self, x, y):
        if self.rank[x] > self.rank[y]:
            self.p[y] = x
        else:
            self.p[x] = y
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1
    
    def findSet(self, x):
        if x != self.p[x]:
            self.p[x] = self.findSet(self.p[x])
        return self.p[x]
        

if __name__ == '__main__':
    maxxy = 10**5
    N = int(input())
    ds = DisjointSet(maxxy*2+1)
    left = [0 for i in range(maxxy*2+1)]
    right = [0 for i in range(maxxy*2+1)]
    for i in range(N):
        x, y = map(int, input().split())
        ds.unite(x, maxxy+y)
    for i in range(maxxy+1):
        left[ds.findSet(i)] += 1
    for i in range(maxxy+1, maxxy*2+1):
        right[ds.findSet(i)] += 1
    ans = 0
    for i in range(maxxy*2+1):
        ans += left[i] * right[i]
    ans -= N
    print(ans)
    

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

using namespace std;

typedef long long int64;

int main()
{
  int N, A, B;
  cin >> N >> A >> B;
  vector< int64 > vs(N);
  map< int64, int > appear1, appear2;
  for(auto &s : vs) cin >> s, appear1[s]++;
  sort(vs.rbegin(), vs.rend());

  int64 sum = 0;
  int64 ret1 = 0, ret2 = 1;
  for(int i = 0; i < vs.size(); i++) {
    sum += vs[i];
    if(A <= i + 1 && i + 1 <= B) {
      if(sum * ret2 > ret1 * (i + 1)) {
        ret1 = sum;
        ret2 = i + 1;
      }
    }
  }

  cout << fixed << setprecision(10) << 1.0 * ret1 / ret2 << endl;

  int64 ret3 = 0;
  sum = 0;

  int64 dp[51][51] = {{}};
  for(int i = 0; i < 51; i++) dp[i][0] = dp[i][i] = 1;
  for(int i = 2; i < 51; i++) {
    for(int j = 1; j < i; j++) dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];
  }

  for(int i = 0; i < vs.size(); i++) {
    sum += vs[i];
    ++appear2[vs[i]];
    if(A <= i + 1 && i + 1 <= B) {
      if(sum * ret2 == ret1 * (i + 1)) {
        ret3 += dp[appear1[vs[i]]][appear2[vs[i]]];
      }
    }
  }
  cout << ret3 << endl;

}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <ostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#define INF 1000000000
#define rep(i,a,b) for (int i=(a);i<(b);i++)
#define rev(i,a,b) for (int i=(a)-1;i>=b;i--)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef queue<int> qi;
typedef vector<int> vi;
typedef vector<string> vs;
int dx[4] = { 0, 1, 0, -1 };
int dy[4] = { 1, 0, -1, 0 };

int s[10][10000];
int r,c;

int dfs(int i) {
	if(i == r) {
		int cnt, num=0;
		rep(k,0,c) {
			cnt = 0;
			rep(j,0,r) if(s[j][k] == 1) cnt++;
			if(cnt > r/2) num += cnt;
			else num += r-cnt;
		}
		return num;
	}

	int ans = -1;
	ans = max(ans, dfs(i+1));
	rep(j,0,c)
		if(s[i][j] == 0) s[i][j] = 1;
		else s[i][j] = 0;
	ans = max(ans, dfs(i+1));

	return ans;
}

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

	while(1) {
		cin >> r >> c;
		if(r == 0 && c == 0) break;
		rep(i,0,r)
			rep(j,0,c)
				cin >> s[i][j];
		cout << dfs(0) << endl;
	}

	return 0;
}

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

int mod = 1000000007;

int main()
{
    string S, T;
    cin >> S >> T;

    sort(S.begin(), S.end());
    sort(T.begin(), T.end());
    reverse(T.begin(), T.end());

    cout << (T > S ? "Yes" : "No");
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;
//using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; }
    void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; }

    void solve()
    {
        int N = cin.nextint;
        var A = cin.scanint;
        WriteLine(A.Sum() - N);
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

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

int main() {
  string S, T;
  cin >> S >> T;
  int a;
  a = S.size();
  int c = 0;
  
  for(int i = 0; i < a; i++){
    if(S.at(i) != T.at(i)){
      c++;
    }
  }
  cout << c << endl;
}

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

int main() {
    string a, b;
    cin >> a >> b;
    int x = stoi(a + b);
    REP(i, 1000) {
        if(i * i == x) {
            cout << "Yes" << endl;
            break;
        }
        if(i == 1000) cout << "No" << endl;
    }
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskG solver = new TaskG();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskG {
        private ArrayList<ArrayList<Integer>> g;
        private boolean[] used;
        private ArrayList<Integer> topSort;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            g = new ArrayList<>();
            for (int i = 0; i < n; i++)
                g.add(new ArrayList<>());
            for (int i = 0; i < m; i++) {
                int from = in.nextInt() - 1;
                int to = in.nextInt() - 1;
                g.get(from).add(to);
            }
            topSort = new ArrayList<>();
            used = new boolean[n];
            for (int i = 0; i < n; i++)
                if (!used[i])
                    dfs(i);
            int[] dp = new int[n];
            for (int i = 0; i < n; i++) {
                int from = topSort.get(i);
                for (int to : g.get(from))
                    dp[from] = Math.max(dp[from], dp[to] + 1);
            }
            int max = 0;
            for (int v : dp)
                max = Math.max(max, v);
            out.println(max);
        }

        private void dfs(int v) {
            used[v] = true;
            for (int to : g.get(v))
                if (!used[to])
                    dfs(to);
            topSort.add(v);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



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

typedef long long ll;

const int mod = M;

ll mod_pow(ll a,ll x){
  ll res=1;
  while(x){
    if(x%2) res=res*a%mod;
    a=a*a%mod;
    x/=2;
  }
  return res;
}

ll inv(ll x){
  return mod_pow( x, mod - 2 );
}

int X[M], invX[M];

void init(){
  
  int num = 1;
  
  for(int i=1;i<M;i++){
    num *= i;
    num %= mod;
    X[i] = num;
  }
  
  for(int i=0;i<M;i++) invX[i] = inv( X[i] );
  
}

int cal(int x, int d, int n){
  
  if( d == 0 ) return mod_pow( x, n );
  
  int R = ( x * inv( d ) + ( n - 1 ) ) % mod;
  int L = ( x * inv( d ) - 1 + mod ) % mod;
  
  //if( L + ( n - 1 ) >= mod ) return 0;
  
  int l = ( R - ( n - 1 ) - 1 );
  if( l <= 0 ) return 0;
    
  return ( ( X[R] * invX[L] ) % mod * mod_pow( d, n ) ) % mod;
}

signed main(){
  
  init();
  
  int q;
  cin >> q;
  
  while( q-- ){
    
    int x, d, n;
    cin >> x >> d >> n;
    
    cout << cal( x, d, n ) << endl;
    
  }
  
  return 0;
}


Measured memory_bytes: 16512
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s,t;
    cin>>s>>t;
    int ns=s.size();
    string subt=t.substr(0,ns);
    if(subt==s)
        cout<<"Yes\n";
    else
        cout<<"No\n";
    return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define cool ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) 
#define ll long long
#define MAX 1000001
#define mod 1000000007
#define pie 3.14159265358979323846
void solve()
{
	int a,b;
    cin>>a>>b;
    cout<<(a*b);
}
int main()
{ 
    cool;
    int t;
    //cin>>t;
    t=1;
    while(t--){
    	solve();
	}
    return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define EPS 1e-10
typedef long long ll;
using namespace std;
typedef pair<int, int> P;

double distanceAB(double xa, double ya, double xb, double yb);

/*
class Target
{
public:
	vector <string> draw(int n)
	{

	}
};
*/



int main()
{
	int n;
	double xa, ya, ra, xb, yb, rb;
	double dist, rsum;
	
	cin >> n;
	REP(n)
	{
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		dist = distanceAB(xa, ya, xb, yb);
		rsum = ra + rb;
		if (dist > rsum)
		{
			cout << 0 << endl;
		} else if (fabs(ra - rb) > dist) {
			//円が含まれている場合
			if (ra > rb)
			{
				cout << 2 << endl;
			} else {
				cout << -2 << endl;
			}
		} else {
			cout << 1 << endl;
		}
	}
	
	return 0;
}



double distanceAB(double xa, double ya, double xb, double yb)
{
	return sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
}

Measured memory_bytes: 1232