akhauriyash/Code-Regression huggingface dataset:
// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
// #include<deque>
// #include<multiset>
// #include<bitset>
// #include<cstring>
// #include<bits/stdc++.h>
// }}}
using namespace std;
using ll = long long;

int n, k;
string s;

string tostr(vector<int> v) {
  string res(n, 'A');
  int c = 0;
  for(int i = 0; i < n; i++) {
    if(v[i]) c ^= 1;
    res[i] = 'A' + c;
  }
  return res;
}

string sol(vector<int> v, int k) { 
  vector<int> zero;
  for(int i = 0; i < n; i++) if(v[i] == 0) zero.push_back(i);

  reverse(begin(zero), end(zero));

  int x = -1, y = -1;
  int now = 0;
  while(k && zero.size()) {
    if(x == -1) {
      x = zero.back();
      // dump(x);
      y = -1;
      int use = x - now;
      if(k >= use) {
        k -= use;
        now = x;
      } else {
        now = now + k;
        k = 0;
        x = -1;
      }
    } else {
      y = zero.back();
      // dump(x, y);
      int use = (y - now - 1) * 2;
      if(k >= use) {
        k -= use;
        now = y - 1;
        v[now] = 0;
        if(k >= 1) {
          k--;
          v[now] ^= 1;
          v[now + 1] ^= 1;
        }
      } else {
        now = now + k / 2;
        v[now] = 0;
        assert(now + 1 < n);
        if(k % 2 == 1) {
          v[now] ^= 1;
          v[now + 1] ^= 1;
        }
        k = 0;
      }
      x = -1;
    }
    zero.pop_back();
  }
  // dump(v);
  vector<int> w(n, 1);
  for(int i = now; i < n; i++) w[i-now] = v[i];
  if(zero.size() == 0 && x != -1 && y == -1) {
    w[1 - k % 2] = 1;
    w[k % 2] = 0;
  }
  return tostr(w);
}

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> k;
  cin >> s;
  if(n == 1) {
    if(k % 2 == 1) s[0] = s[0] == 'A' ? 'B' : 'A';
    cout << s << endl;
    return 0;
  }

  vector<int> v(n);
  char last = 'A';
  int one = 0;
  for(int i = 0; i < n; i++) {
    v[i] = last != s[i];
    last = s[i];
    if(v[i] == 1) one++;
  }

  if(one % 2) {
    if(k && v[0] == 0) {
      k--, v[0] ^= 1, v[1] ^= 1;
    }
    if(k) {
      v.erase(v.begin());
      v.push_back(0);
      k--;
    }
  }

  cout << sol(v, k) << endl;
  return 0;
}


Measured memory_bytes: 4620
#include<cstdio>
#include<cstring>
#define Max 100010
using namespace std;
char S[Max],T[Max];
char s1[10]={"dream"};
char s2[10]={"dreamer"};
char s3[10]={"erase"};
char s4[10]={"eraser"};
char s5[15]={"dreamerase"};
char s6[15]={"dreameraser"};
bool check(int l,int r,int sign)
{
	if(sign==3)
	{
		bool flag=true;
		for(int i=l,j=0;i<=r;i++,j++)
		if(S[i] != s5[j])flag = false; 	
		return flag;		
	}
	else if(sign==4)
	{
		bool flag=true;
		for(int i=l,j=0;i<=r;i++,j++)
		if(S[i] != s6[j])flag = false; 	
		return flag;		
	}
	else if(sign==0)//5
	{
		bool flag1=true,flag2=true;
		for(int i=l,j=0;i<=r;i++,j++)
		if(S[i] != s1[j])flag1=false;
		
		for(int i=l,j=0;i<=r;i++,j++)
		if(S[i] != s3[j])flag2=false;

		return flag1||flag2;
	}
	else if(sign==1) //6
	{
		bool flag=true;
		for(int i=l,j=0;i<=r;i++,j++)
		if(S[i] != s4[j])flag = false; 	
		return flag;	
	}
	else //7
	{
		bool flag=true;
		for(int i=l,j=0;i<=r;i++,j++)
		if(S[i] != s2[j])flag=false;
		return flag;
	}

}

int main()
{
	while(~scanf("%s",S))
	{
		int n = 0;
		while(S[n++]!='\0');
		n--;
		if(n < 5)
		printf("NO\n");
		else 
		{
			int i=0;
			bool flag = true;
			while(i<n)
			{
				if(check(i,i+10,4))//7
				{
					i+=11;
					continue;
				}
				if(check(i,i+9,3))//10
				{
					i+=10;
					continue;
				}
				if(check(i,i+6,2))//7
				{
					i+=7;
					continue;
				}
				if(check(i,i+5,1))//6
				{
					i+=6;
					continue;
				}
				if(check(i,i+4,0))
				{
					i+=5;
					//printf("%s",s1);
					continue;
				}
				flag = false;
				printf("NO\n");
                break;
			}
			if(flag)
			printf("YES\n");
		}
	}
	return 0;;
}

Measured memory_bytes: 384
#include <stdio.h>
int main()
{
	int a,b;
	char c;
	while(1)
	{
		scanf("%d %c %d",&a,&c,&b);
		if(c=='?')
		break;
		else
		if(c=='+')
		printf("%d\n",a+b);
		else if(c=='-')
		printf("%d\n",a-b);
		else if(c=='*')
		printf("%d\n",a*b);
		else if(c=='/')
		printf("%d\n",a/b);		
	}
	return 0;
}


Measured memory_bytes: 2104
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Scanner;
public class Main {

    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        BigDecimal A = sc.nextBigDecimal();
        BigDecimal B = sc.nextBigDecimal();
        BigDecimal C = A.multiply(B);

 
        BigInteger D = C.toBigInteger();

        System.out.print(D);
    }
}


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

int main() {
  int n, d, ans = 0;

  cin >> n >> d;

  vector<vector<int>> x(n, vector<int>(d));

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

  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      double temp = 0;
      for (int k = 0; k < d; k++) {
        temp += pow(x[i][k] - x[j][k], 2);
        // cout << x[i][k] + x[j][k] << endl;
        // cout << x[i][k] << " " << x[j][k] << endl;
        // cout << temp << endl;
      }
      // cout << endl;
      // cout << temp << endl;
      temp = sqrt(temp);
      if (ceil(temp) == floor(temp)) ans++;
    }
  }

  cout << ans;

  return 0;
}

Measured memory_bytes: 256
import sys
import math
import collections
import bisect
import copy

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===


def main():
    n, m = ns()
    a = na()
    cum = [0] * (n + 1)
    cnt = dict()

    for i, ai in enumerate(a):
        tmp = (cum[i] + ai) % m
        cum[i + 1] = tmp
        if tmp not in cnt.keys():
            cnt[tmp] = [i]
        else:
            cnt[tmp].append(i)

    ans = 0
    for l, ci in enumerate(cum):
        if ci in cnt.keys():
            length = len(cnt[ci])
            tmp = bisect.bisect_right(cnt[ci], l - 1)
            ans += length - tmp

    print(ans)


if __name__ == '__main__':
    main()


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

using namespace std;

int main()
{
	int N, M;
	int count = 0;

	cin >> N >> M;

	count += N * (N-1) /2;
    count += M * (M-1) /2;

	cout << count;

	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		System.out.println(Integer.min(A, B) + Integer.min(C, D));
	}
}

Measured memory_bytes: 23124
while(1):
    h, w = map(int, input().split())
    if (h == 0 and w == 0):
        break

    for i in range(h):
        for j in range(w):
            ch = '#' if (i + j) % 2 == 0 else '.'
            print(ch, end="")
        print("")

    print("")



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

int main() {
  int A, B;
  cin >> A >> B;
    
  int count = 0;
  for(int i = A; i<=B; i++) {
    int S = i % 10; //1の位
    int T = i / 10000 % 10; //10000の位
    int U = i / 10 % 10; //10の位
    int V = i / 1000 % 10; //1000の位
    if(S == T && U == V) {
      count++;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 3604
// luogu-judger-enable-o2
#include <bits/stdc++.h>
int lenlong(long long i)
{
    int len=0;
    while(i!=0)
        len++,i/=10;
        return len;
}
using namespace std;
int main()
{
    long long a;
    cin>>a;
    for(int i=sqrt(a);i>=1;i--)
    if(a%i==0)
    {
    cout<<lenlong(a/i)<<endl;
    return 0;
    }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int mem[10000];
	int n = 1;
	int m = 1;
	int i;
	int count;
	int now;
	
	while (1){
		scanf("%d %d", &n, &m);
		if (n + m == 0){
			break;
		}
		
		for (i = 0; i < n; i++){
			mem[i] = 1;
		}
		now = n;
		count = 0;
		while (now > 1){
			for (i = 0; i < n; i++){
				if (mem[i] == 1){
					count++;
				}
				if (count == m){
					count = 0;
					mem[i] = 0;
					now--;
					if (now == 1){
						break;
					}
				}
			}
		}
		for (i = 0; i < n; i++){
			if (mem[i] == 1){
				break;
			}
		}
		printf("%d\n", i + 1);
		
	}
	
	return (0);
}

Measured memory_bytes: 612
//#pragma GCC optimize("Ofast")

#pragma GCC optimize("O3")
//#pragma GCC target("avx,avx2,fma")
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
#include<set>
#include<vector>
#include<sstream>
#include<queue>
#include <iomanip>
#include<unordered_set>
#include <stack>
#include <unordered_map>
#include <map>
constexpr auto INF = 9223372036854775807;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unsigned long int ul;
#define f(i,a,b) for(ll i=(ll)a;i<(ll)b;i+=1)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i-=1)
#define endl '\n'
#define N 1000000007 // prime modulo value 
#define M 998244353
#define all(x) x.begin(),x.end()
using namespace std;
// From Geeksforgeeks
inline ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
// Power function took from geeksforgeeks
ll power(ll x, ll y)
{
	ll res = 1;

	x = x%N;
	if (x == 0) return 0;
	while (y > 0)
	{
		if (y & 1)
			res = (res * x)%N;
		y = y >> 1;
		x = (x * x)%N;
	}
	return res;
}
double dist(ll x1,ll y1, ll x2,ll y2)
{
	double ans = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
	return ans;
}
int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll n;
	cin >> n;
	vector<ll> arr(n, 0);
	f(i, 0, n)
	{
		cin >> arr[i];
	}
	sort(all(arr));
	ll ans = 0;
	f(i, 0, n)
	{
		f(j, i + 1, n)
		{
			f(k, j + 1, n)
			{
				if (arr[k] < arr[i] + arr[j])
				{
					ans += 1;
				}

			}
		}
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 256
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
import datetime
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    S = sys.stdin.readline().rstrip()
    d = datetime.datetime.strptime(S,"%Y/%m/%d")
    k = "2019/04/30"
    if k >= S:
        print("Heisei")
    else:
        print("TBD")

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

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int[] A = new int[N];
    for(int i=0; i<N; i++) {
      A[i] = scan.nextInt();
    }
    scan.close();

    Arrays.sort(A);

    for(int i=0; i<N-1; i++) {
      if(A[i] == A[i+1]) {
        System.out.println("NO");
        return;
      }
    }
    System.out.println("YES");
  }
}

Measured memory_bytes: 81464
N=int(input())
ls=list(map(int,input().split()))
ls.sort()

#定数倍のやつに＋１する
M=max(ls)
A=[0]*(M+1)
for i in range(N):
  a=M//ls[i]
  for j in range(1,a+1):
    A[j*ls[i]]+=1
    
ans=0     
for i in range(len(ls)):
  if A[ls[i]]==1:
    ans+=1
print(ans)

Measured memory_bytes: 94136
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#include <ctime>
#include<bitset>

//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(ll i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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

using Graph = vector<vector<ll>>;

#define ketasitei setprecision(15) //15桁表示

const ll MOD = 1000000007;
const double PI = 3.1415926535897932;


int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	ll n;
	cin >> n;

	ll ans = 10;
	for (int i = 1; i < n; i++)
	{
		ans *= 10;
		ans %= MOD;
	}

	ll ans2 = 9;
	for (int i = 1; i < n; i++)
	{
		ans2 *= 9;
		ans2 %= MOD;
	}

	ans2 *= 2;
	ans2 %= MOD;
	ans -= ans2;
	ans %= MOD;
	ans += MOD;
	ans %= MOD;

	ans2 = 8;
	for (int i = 1; i < n; i++)
	{
		ans2 *= 8;
		ans2 %= MOD;
	}
	ans += ans2;
	ans %= MOD;

	cout << ans << endl;

	return 0;
}

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

int main(){
    int i, j, k;
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    for(i=0; i<N; i++) cin >> A[i];

    int ans = 1e9;
    for(i=0; i<=N-K; i++){
        int a = A[i], b = A[i+K-1], result;
        if(b <= 0){
            result = abs(a);
        }else if(a >= 0){
            result = abs(b);
        }else{
            result = abs(a) + abs(b) + min(abs(a), abs(b));
        }
        ans = min(ans, result);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <numeric>
#include <queue>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <map>
#include <functional>
#include <limits>
#include <set>
#include <stack>
#include <cctype>
#define rep(i,a,b) for((i)=a;i<(int)(b);i++)

#define AAA (1000000007) 


using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pairII;
typedef vector<int> vecI;

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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
ll powD(ll a, ll b) {
	ll ans = 1;
	a %= AAA;
	for (int i = 0; i < b; i++)
	{
		ans *= a;
		ans %= AAA;
	}
	return ans;
}



int main() {
	int i, j, k;
	int N, M, K;
	
	cin >> N;
	vecI C(N);
	string S;
	cin >> S;
	rep(i, 0, N) {
		C[i] = (S[i] == 'R' ? 1 : 0);
	}

	int W = 0, R = 0;
	rep(i, 0, N) {
		R += C[i];
	}
	W = N - R;
	int left = 0, right = 0;
	rep(i, 0, R) {
		left += (C[i] == 0);
	}
	rep(i, R, N) {
		right += C[i];
	}
	cout << min(left, right);


	return 0;
}


Measured memory_bytes: 4440
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .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")
}

fn main() {
  let b = read::<String>();
  let mut ans = 0;

  let mut count = 0;
  for i in b.chars() {
    if i == 'A' || i == 'C' || i == 'G' || i == 'T' {
      count += 1;
    } else {
      count = 0;
    }

    if count > ans {
      ans = count;
    }
  }

  println!("{}", ans);
}



Measured memory_bytes: 4352
/*
  AUTHOR:SOURABH
  CREATED:22:03:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<pll , null_type, less< pll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

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

    //freopen("in.txt","r",stdin);
    //freopen(2 "out.txt","w",stdout);

    ll t,l;
    t=1;
    //cin>>t;
    W(t--)
    {
        cin>>l;
        ld a=(1.0*l)/3;
        cout<<fixed<<setprecision(12)<<a*a*a;
    }
    return 0;
}










































Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MOD=998244353;
int n,K;
char s[333];
int f[333][333][333],tx[333][333],ty[333][333];
int cnt[333];
int main()
{
	ios_base::sync_with_stdio(false);
	cin>>(s+1)>>K;
	n=strlen(s+1);if(K>n)K=n;
	int cur=0;
	for(int i=1;i<=n;i++)
	{
		if(s[i]=='0')cur++;
		else cnt[cur]++;
	}
	n=cur;
	f[n+1][0][0]=1;
	for(int i=n;i>=0;i--)
	{
		for(int j=1;j<=K;j++)
		{
			for(int k=1;k<=K;k++)
			{
				tx[j][k]=(tx[j-1][k-1]+f[i+1][j-1][k-1])%MOD;
			}
		}
		for(int j=K;j>=0;j--)
		{
			for(int k=0;k<=K;k++)
			{
				ty[j][k]=(ty[j+1][k]+f[i+1][j][k])%MOD;
			}
		}
		for(int j=0;j<=K;j++)
		{
			for(int k=j;k<=K;k++)
			{
				f[i][j][k]=(0ll+tx[j][k]-((j>=cnt[i])?tx[j-cnt[i]][k-cnt[i]]:0)+ty[j][k]+MOD)%MOD;
//				cerr<<i<<' '<<j<<' '<<k<<' '<<f[i][j][k]<<endl;
//				cerr<<tx[j][k]<<' '<<ty[j][k]<<endl;
			}
		}
	}
	long long ans=0;
	for(int i=0;i<=K;i++)
	{
		ans+=f[0][0][i];
	}
	cout<<ans%MOD<<endl;
	return 0;
}

Measured memory_bytes: 63864
#include <iostream>                                             
#include <vector>                                               
#include <algorithm>                                            
using namespace std;                                            
                                                                
int main(void) {                                                
  int x;                                                        
  vector<int> v;                                                
  for (int i=0; i<3; i++) {                                     
    cin >> x;                                                   
    v.push_back(x);                                             
  }                                                             
  sort(v.begin(),v.end());                                      
  for (int i=0; i<v.size(); i++) {                              
    cout << (i==0?"":" ") << v[i];                              
  }                                                             
  cout << endl;                                                 
  return 0;                                                     
}                                                               
                                                                
                                 

Measured memory_bytes: 3148
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>

using namespace std;

bool exists( pair<int, int> p, vector<pair<int, int>> &vs, vector<pair<int, int>> &ms ){
  for ( auto v : vs ) {
	if ( find( ms.begin(), ms.end(), make_pair( p.first + v.first, p.second + v.second ) ) == ms.end() ) {
	  return false;
	}
  }
  return true;

}

int main() {

  while ( true ) {
	int n;
	cin >> n;
	if ( n == 0 ) break;
	
	vector<pair<int, int>> vs( n );
	for ( int i = 0; i < n; i++ ) {
	  int x, y;
	  cin >> x >> y;
	  vs[ i ] = make_pair( y, x );
	}
	auto center = vs[ n - 1 ];
	for ( int i = 0; i < n; i++ ) {
	  vs[ i ].second -= vs[ n - 1 ].second;
	  vs[ i ].first -= vs[ n - 1 ].first;
	}

	int m;
	cin >> m;
	vector<pair<int, int>> ps( m );
	for ( int i = 0; i < m; i++ ) {
	  int x, y;
	  cin >> x >> y;
	  ps[ i ] = make_pair( y, x );
	}

	for ( auto p : ps ) {
	  if ( exists( p, vs, ps ) ) {
		cout << p.second - center.second << " " << p.first - center.first << endl;
	  }
	}
  }  
}

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

using namespace std;

#define rep(i, n) REP(i, 0, (n))
#define REP(i, a, n) for(typeof(n) i=(a); i<(n); i++)

pair<int,pair<int,int> > dat[1000];

int main(){
    int n, m, a;
    while(scanf("%d%d%d",&n,&m,&a), n+m+a){
        rep(i, m) {
            int h, p, q; scanf("%d%d%d", &h, &p, &q);
            dat[i] = make_pair(-h, make_pair(p, q));
        }
        sort(dat, dat + m);
        rep(i, m) {
            if(a == dat[i].second.first){
                a = dat[i].second.second;
            } else if(a == dat[i].second.second){
                a = dat[i].second.first;
            }
        }
        printf("%d\n", a);
    }
}


Measured memory_bytes: 3160
N,M = map(int,input().split())
AB = []
for _ in range(N):
    AB.append([int(i) for i in input().split()])
AB_sort = sorted(AB,key=lambda x : x[0])
money = 0
for ab in AB_sort:
    if M >= ab[1]:
        money += ab[0] * ab[1]
        M -= ab[1]
    else:
        money += M * ab[0]
        break
print(money)


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

typedef long long ll;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define ANS(n) cout << (n) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(a);i>=(b);i--)

#define ALL(obj) (obj).begin(),(obj).end()

#define pii pair<int,int>

#define pb(a) push_back(a)
#define mp make_pair

int main()
{
	int d,n;
	cin >> d >> n;
	if(n == 100)n++;
	cout << n;
	FOR(i,0,d)cout << "00";
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
N,M = map(int,input().split())
L = [0]*M
R = [0]*M

for i in range(M):
    L[i],R[i] = map(int,input().split())
    
L.sort()
R.sort()

l= L[len(L)-1]
r = R[0]

cnt =0 

for i in range(l,r+1):
    cnt+=1

print(cnt)    

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

int a, b;


int main(){
  cin >> a >> b;
  int mn = min(a, b);
  int mx = max(a, b);
  rep(i, mx){
   char res = '0' + mn;
   cout << res;
  }
  
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
using namespace std;
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
Def inf = sizeof(Def) == sizeof(long long) ?  2e18:1e9+10;
int dx[]={0,-1,0,1};
int dy[]={1,0,-1,0};
int d[1050][1050],dp[1010][1010];
int main(){
	int sosu[1100000]={1,1,0};//1 is not sosu
	for(int i=2;i*i<1100000;i++)if(sosu[i]==0)
	for(int j=i*2;j<1100000;j+=i)sosu[j]=1;
	
	int x=500,y=500,to=0,go=1,num=2;
	d[x][y]=1;
	while(1){
		rep(i,2){
			rep(j,go){
				x+=dx[to];y+=dy[to];
				if(x<0||y<0||x>1049||y>1049)goto end;
				d[x][y]=num++;
			}
			to++;
			if(to==4)to=0;
		}
		go++;
	}
	end:;
	
//	loop(x,490,510){loop(y,490,510)cout<<" "<<d[x][y];cout<<endl;}
		
	int n,m;
	while(cin>>m>>n,n){
		rep(i,1010)rep(j,1010)dp[i][j]=-inf;
		rep(i,1010)rep(j,1010)if(d[i][j]==n)dp[i][j]=0;//!sosu[d[i][j]];
		rep(i,1009)loop(j,1,1009){
			int e=!sosu[d[i][j]];
			if(d[i][j]>m)e=0;
//			cout<<"! "<<i<<" "<<j<<endl;
			dp[i+1][j]=max(dp[i+1][j],dp[i][j]+e);
			dp[i+1][j-1]=max(dp[i+1][j-1],dp[i][j]+e);
			dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]+e);
		}
		int ma=-1,a;
		rep(i,1010)rep(j,1010)if(d[i][j]<=m&&sosu[d[i][j]]==0){
			dp[i][j]++;
			if(dp[i][j]>ma){
				ma=dp[i][j];
				a=d[i][j];
			}else if(dp[i][j]==ma)a=max(a,d[i][j]);
		}
		if(ma==-1)ma=a=0;
		cout<<ma<<" "<<a<<endl;
		
	}
	
}









Measured memory_bytes: 15476
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    double W, H, x, y;
    cin >> W >> H >> x >> y;

    if(x == W/2 && y == H/2){
        cout << H * W / 2 << " ";
        cout << 1 << endl;
    }else{
        cout << H * W / 2 << " ";
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int M = scan.nextInt();
			int []s = new int[M];
			int []c = new int[M];
			ArrayList<ArrayList<Integer>> po  = new ArrayList<ArrayList<Integer>>();
			Map<Integer,Integer>map = new TreeMap<Integer,Integer>();
			
			for(int i = 0;i<N;i++) {
				ArrayList<Integer> list = new ArrayList<Integer>();
				po.add(list);
			}
			boolean owari = false;
			
			for(int i = 0;i<M;i++) {
				s[i] = scan.nextInt();
				c[i] = scan.nextInt();
				
				if(map.containsKey(s[i])&&!map.containsValue(c[i])||N>=2&&s[i]==1&&c[i]==0) {
					owari=true;
				}else {
					map.put(s[i], c[i]);
				}
				
			}
			
		
			
			if(owari) {
				System.out.println(-1);
				return;
			}
			
			
			StringBuffer sb  = new StringBuffer();
			
			for(int i = 0;i<N;i++) sb.append(0);
			
			int ans = 0;
			
			for(Integer key:map.keySet()) {
				
				
				//ans+=map.get(key)*(int)Math.pow(10, N-key);
				sb.replace(key-1, key, String.valueOf(map.get(key)));
			}
			
			
			int count = 0;
			for(int i = 0;i<N;i++){
				if(!sb.toString().substring(i,i+1).equals("0"))count++;
				
				if(count==0&&sb.toString().substring(i,i+1).equals("0")) {
					
				}
			}
			
			if(N>=2&&sb.toString().substring(0,1).equals("0")){
				sb.replace(0, 1, "1");
				System.out.println(sb.toString());
			}else {
				System.out.println(sb.toString());
			}
			
			
		
			
			
			
		}
		
		
	}
	
	
	
		

}


Measured memory_bytes: 23636
#include <iostream>
#include <set>

int main(int argc, char *argv[]) {
  int q;
  std::cin >> q;
  std::set<long> s;
  for (int i = 0; i < q; ++i) {
    int c, x;
    std::cin >> c >> x;
    switch (c) {
    case 0:
      s.insert(x);
      std::cout << s.size() << std::endl;
      break;
    case 1:
      std::cout << s.count(x) << std::endl;
      break;
    case 2:
      s.erase(x);
      break;
    }
  }
}



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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair

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

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

int main() {
    i64 N; cin >> N;
    using P = pair<char, char>;
    i64 BA = 0;
    i64 BX = 0;
    i64 XA = 0;
    i64 cnt = 0;
    REP(i, N) {
        string s; cin >> s;
        REP(j, s.length() - 1) {
            if (s[j] == 'A' && s[j + 1] == 'B') cnt++;
        }
        if (s[0] == 'B' && s[s.length() - 1] == 'A') BA++;
        else if (s[0] == 'B') BX++;
        else if (s[s.length() - 1] == 'A') XA++;
    }

    if (BA > 1) cnt += BA - 1, BA = 1;
    if (BA > 0 && (BX > 0 || XA > 0)) cnt++, BA--;
    cnt += min(BX, XA);

    cout << cnt << endl;

    return 0;
}

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

int main() {
  int n,x;
  cin >> n >> x;
  vector<int> l(n+1,0);
  rep(i,1,n+1) {
    cin >> l[i];
    l[i] += l[i-1];
  }
  int ans = 0;
  rep(i,0,n+1) {
    if (l[i] > x) {
      ans = i;
      break;
    }
  }
  if (ans == 0) ans = n+1;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3564
#include <bits/stdc++.h>
        #include<iostream>
        #include<cstdio>
        #include<vector>
        #include<queue>
        #include<map>
        #include<cstring>
        #include<string>
        #include <math.h>
        #include<algorithm>
    //    #include <boost/multiprecision/cpp_int.hpp>
        #include<functional>
      #define int long long
        #define inf  1000000007
        #define pa pair<int,int>
#define ll long long
        #define pal pair<ll,ll>
        #define ppa pair<int,pa>
        #define  mp make_pair
        #define EPS (1e-10)
        #define equals(a,b) (fabs((a)-(b))<EPS)

        using namespace std;

        class Point{
        	public:
        	double x,y;
        	Point(double x=0,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);}
        	double absv() {return sqrt(norm());}
        	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 fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
        	}
        };
        typedef Point Vector;

        struct Segment{
        Point p1,p2;
        };

    double hen(Vector a){
    if(fabs(a.x)<EPS && a.y>0) return acos(0);
    else if(fabs(a.x)<EPS && a.y<0) return 3*acos(0);
    else if(fabs(a.y)<EPS && a.x<0) return 2*acos(0);
    else if(fabs(a.y)<EPS && a.x>0) return 0.0;
    else if(a.y>0) return acos(a.x/a.absv());
    else return 2*acos(0)+acos(-a.x/a.absv());

    }

        double dot(Vector a,Vector b){
        	return a.x*b.x+a.y*b.y;
        }
        double cross(Vector a,Vector b){
        	return a.x*b.y-a.y*b.x;
        }
        int dx[4] = {1, 0, -1, 0};
        int dy[4] = {0, 1, 0, -1};
        //----------------kokomade temple------------


signed main(){
int a,b,h;
	cin>>a>>b>>h;
	
	cout<<(a+b)*h/2<<endl;
	return 0;
        }
        
//printf("%.10f\n",ans);


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

int main() {
  int a, b;
  cin >> a >> b;
  if (a >= 13)
    cout << b << endl;
  else if (a <= 12 && a >= 6)
    cout << b / 2 << endl;
  else
    cout << 0 << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int F[100];

fibonacci(int n){
  if(n == 0 || n == 1){
    return F[n] = 1;
  }
  if(F[n] != -1){
    return F[n];
  }
  return F[n] = fibonacci(n-2)+fibonacci(n-1);
}

int main(){
  int i,n;

  for(i=0; i<100; i++){
    F[i] = -1;
  }

  scanf("%d",&n);

  printf("%d\n",fibonacci(n));

  return 0;
}

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

using namespace std;

#define pb push_back
#define eb emplace_back
#define ll long long
#define pii pair < int, int >
#define fr first
#define sc second
#define mk make_pair
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define ok puts("ok");
#define whatis(x) cerr << #x << " = " << x << endl;
#define pause system("pause");
#define random rand() ^ (rand() << 5)

const int N = (int)1e5 + 7;
const int inf = (int)1e9 + 7;

main() {
	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	int ans = inf;
	ans = min(ans, a * x + b * y);
	int cost = min(x, y) * 2 * c;
	int mn = min(x, y);
	x -= mn;
	y -= mn;
	ans = min(ans, cost + a * x + b * y);
	x += mn;
	y += mn;
	cost = max(x, y) * 2 * c;
	ans = min(ans, cost);
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define REP(i,n) for(int i=(0);i<(n);i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

template<class T> inline void read(T &x){
	int f=0;x=0;char ch=getchar();
	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');
	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';
	if(f)x=-x;
}

int h,w,a,b;

int main(){
	read(h),read(w),read(a),read(b);
	rep(i,1,h){
		rep(j,1,w)
			if((j<=a)^(i<=b))putchar('1');
			else putchar('0');
		puts("");
	}

	return 0;
}


Measured memory_bytes: 1280
import java.util.*

fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map(String::toInt)
    val array = readLine()!!.split(' ').map(String::toLong)
    // 値が大きいものが優先度が高い
    val pq = PriorityQueue<Long>(n, Comparator { o1, o2 -> o2.compareTo(o1) })
    array.forEach { pq.add(it) }
    repeat(m) {
        val num = pq.poll() / 2
        pq.add(num)
    }
    println(pq.sum())
}


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

int main(int argc, char *argv[]){

  int n;
  scanf("%d\n", &n);
  //printf("n=%d\n", n);

  int len = 4096;
  char delimiter[] = " ";

  char a1_str[len];
  fgets(a1_str, len, stdin);
  a1_str[strlen(a1_str) - 1] = '\0';
  char *a1_ary = strtok(a1_str, delimiter);
  int a1[n];
  for(int i=0; i<n; i++){
    a1[i] = atoi(a1_ary);
    //printf("%d\n", a1[i]);
    a1_ary = strtok(NULL, delimiter);
  }

  char a2_str[len];
  fgets(a2_str, len, stdin);
  a2_str[strlen(a2_str) - 1] = '\0';
  char *a2_ary = strtok(a2_str, delimiter);
  int a2[n];
  for(int i=0; i<n; i++){
    a2[i] = atoi(a2_ary);
    //printf("%d\n", a2[i]);
    a2_ary = strtok(NULL, delimiter);
  }

  int sum_max = 0;
  for(int k=0; k<n; k++){
    int sum = 0;
    for(int i=0; i<n; i++){
      if(i<=k) sum += a1[i];
      if(i>=k) sum += a2[i];
    }
    if(sum > sum_max) sum_max = sum;
  }
  printf("%d\n", sum_max);

  return 0;
}


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

int main () {
  string objStr;
  int len, count = 0;
  cin >> len;
  cin >> objStr;
  for (int i = 0; i <= len - 3; i++) {
    if (objStr.substr(i, 3) == "ABC") {
      ++count;
      i = i + 2;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

signed main(){
	int n,m;
	while(1){
		cin>>n>>m;
		if(n+m==0) break;
		vi h(n),w(m);
		rep(i,0,n) cin>>h[i];
		rep(i,0,m) cin>>w[i];
		vi a,b;
		rep(i,0,n){
			int tmp=0;
			rep(j,i,n){
				tmp+=h[j];
				a.push_back(tmp);
			}
		}
		rep(i,0,m){
			int tmp=0;
			rep(j,i,m){
				tmp+=w[j];
				b.push_back(tmp);
			}
		}
		int ans=0;
		sort(all(b));
		sort(all(a));
		rep(i,0,a.size()){
			ans+=upper_bound(all(b),a[i])-lower_bound(all(b),a[i]);
		}
		o(ans);
	}
}

Measured memory_bytes: 37036
#include <iostream>

using namespace std;

int main() {
    int m, f, r;
    cin >> m >> f >> r;
    while(m != -1 || f != -1 || r != -1) {
        if(m == -1 || f == -1) {
            cout << "F" << endl;
        }else if(m + f >= 80){
            cout << "A" << endl;
        }else if(m + f >= 65){
            cout << "B" << endl;
        }else if(m + f >= 50 || r >= 50){
            cout << "C" << endl;
        }else if(m + f >= 30) {
            cout << "D" << endl;
        }else {
            cout << "F" << endl;
        }
        cin >> m >> f >> r;
    }
}


Measured memory_bytes: 3076
using System;
using System.Collections.Generic;
using System.Linq;

namespace AOJ0571
{
    class Program
    {
        static void Main()
        {
            Console.WriteLine(
                (Console.ReadLine() ?? "")
                    .Compress()
                    .GroupMoving(3)
                    .Where(s => s[0].Value == 'J' && s[1].Value == 'O' && s[2].Value == 'I')
                    .Where(s => s[0].Length >= s[1].Length && s[2].Length >= s[1].Length)
                    .Select(s => s[1].Length)
                    .DefaultIfEmpty()
                    .Max());
        }
    }

    class Run<T>
    {
        public T Value { get; set; }
        public int Length { get; set; }
    }

    static class EnumerableExtensions
    {
        public static IEnumerable<Run<T>> Compress<T>(this IEnumerable<T> source)
        {
            var value = default(T);
            var length = 0;

            foreach (var item in source)
            {
                if (Equals(item, value))
                {
                    length++;
                }
                else
                {
                    if (length != 0) yield return new Run<T> {Value = value, Length = length};
                    value = item;
                    length = 1;
                }
            }

            if(length != 0) yield return new Run<T> { Value = value, Length = length };
        }

        public static IEnumerable<T[]> GroupMoving<T>(this IEnumerable<T> source, int count)
        {
            var history = new List<T>();
            foreach (var item in source)
            {
                history.Add(item);
                if (history.Count < count) continue;
                if (history.Count > count)
                {
                    history.RemoveAt(0);
                }

                yield return history.ToArray();
            }
        } 
    }
}

Measured memory_bytes: 14784
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define erep(i,n) for(int i = 0;i<=n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
#define erep1(i,n) for(int i = 1;i<=n;i++)
typedef long long ll;
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstring vector<string>
#define vdouble vector<double>
#define vll vector<ll>:
#define vbool vector<bool>
#define INF 1101010101010101010
#define MOD 1000000007
#define int long long
using P = pair<int,int>;

signed main(){
  int n;
  cin >> n;
  vint A(n);
  rep(i,n) cin >> A[i];
  sort(A.begin(),A.end());
  int fans = 0,sans = 0;
  if(n % 2 == 0){
      rep(i,n/2-1){
        fans += A[n-1-i]*2;
        fans -= A[i]*2;
      }
      fans += A[n/2];
      fans -= A[n/2-1];
      cout << fans << endl;
  }
  else{
    rep(i,n/2-1){
        fans += A[n-1-i]*2;
        fans -= A[i]*2;
    }
    sans = fans;
    fans -= A[n/2-1];
    fans -= A[n/2];
    fans += A[n/2+1]*2;
    sans -= A[n/2-1]*2;
    sans += A[n/2];
    sans += A[n/2+1];
    cout << max(fans,sans) << endl;
  }
}

Measured memory_bytes: 1152
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = []
for i in range(N):
  b.append(int(input()))

for i in range(N):
  for j in range(3):
    for k in range(3):
      if b[i] == A[j][k]:
        A[j][k] = 0

ans = "No"

if A[0][0]==0 and A[0][1]==0 and A[0][2]==0:
  ans = "Yes"
if A[1][0]==0 and A[1][1]==0 and A[1][2]==0:
  ans = "Yes"
if A[2][0]==0 and A[2][1]==0 and A[2][2]==0:
  ans = "Yes"
if A[0][0]==0 and A[1][0]==0 and A[2][0]==0:
  ans = "Yes"
if A[0][1]==0 and A[1][1]==0 and A[2][1]==0:
  ans = "Yes"
if A[0][2]==0 and A[1][2]==0 and A[2][2]==0:
  ans = "Yes"
if A[0][0]==0 and A[1][1]==0 and A[2][2]==0:
  ans = "Yes"
if A[0][2]==0 and A[1][1]==0 and A[2][0]==0:
  ans = "Yes"

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <sstream>
#include <string>
using namespace std;

int main(){
  long long a[5];
  long long n, min_per, ans, sa;
  min_per = pow(10, 16);
  cin >> n;
  for(int i=0; i<5; i++){
    cin >> a[i];
    min_per = min(min_per, a[i]);
  }
  sa = n % min_per;
  if(sa == 0) ans = (n / min_per) + 4;
  else ans = (n / min_per) + 5;
  cout << ans << endl;
  return 0;
}


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

int main(){
    int n,a=0,b=0,c=0,cou=0;
    cin>>n>>a>>b>>c;
    for(int i=0;i<n-1;i++){
        if((a<=b&&b<=c)||(c<=b&&b<=a)){
            cou++;
        }
        a=b;
        b=c;
        if(n-3-i!=0){
            cin>>c;

        }else{
            cout<<cou<<endl;
            return 0;
        }
    }

}

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

#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define ANS(ans) cout << (ans) << endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

// repetition
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) for (long long i = 0; i < (n); ++i)

int main() {
  int k;
  string s;
  cin >> k >> s;
  int len = s.size();
  string ans;
  if (len <= k) {
    ans = s;
  }else{
    ans = s.substr(0, k);
    ans = ans + "...";
  }

  ANS(ans);
  return 0;
}


Measured memory_bytes: 3628
//code by smigwump
//https://codeforces.com/blog/entry/62393
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define REP(i,a,b) for(int i = a; i <= b; i++)

typedef long long ll;

using namespace std;

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);
    int x,y;
    cin>>x>>y;
    if(y%2==0) {
    	int a = y/2-x;
    	int b = 2*x-y/2;
    	if(a>=0 && b>=0) {
    		cout<<"Yes\n";
    	}
    	else {
    		cout<<"No\n";
    	}
    }
    else {
    	cout<<"No\n";
    }
	return 0;
}

Measured memory_bytes: 3648
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cstdlib>
#include <iomanip>
#define rep(i,x) for(ll i=0;i<x;i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
using ld = long double;
using ll = long long;
const ll INF = 10010010010;
typedef pair<ll, ll> P;
using graph = vector<vector<ll>>;
const ll mod = 1000000007;
ll gcd(ll a, ll b) {//a>b
    if (a < b)swap(a, b);
    if (a % b == 0) return b;
    else return gcd(b, a % b);
}/*フィボナッチテンプレ
ll memo[50];
ll fibo(ll n) {
    if (memo[n] != 0)return memo[n];
    if (n <= 1)return memo[n] = n;
    else return memo[n] = fibo(n - 1) + fibo(n - 2);
}
*/
bool isp(ll n) {
    bool res = true;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            res = false;
            break;
        }
    }
    return res;
}
ll ctoi(char c) {
    if (c == '0')return 0;
    else if (c == '1')return 1;
    else if (c == '2')return 2;
    else if (c == '3')return 3;
    else if (c == '4')return 4;
    else if (c == '5')return 5;
    else if (c == '6')return 6;
    else if (c == '7')return 7;
    else if (c == '8')return 8;
    else if (c == '9')return 9;
    else return -1;
}

int main() {
    ll N;
    cin >> N;
    bool ans = true;
    vector<ll> time(N + 1);
    vector<vector<ll>> field(N + 1, vector<ll>(2));
    time[0] = 0; field[0][0] = 0; field[0][1] = 0;
    rep(i, N)cin >> time[i + 1] >> field[i + 1][0] >> field[i + 1][1];
    rep(i, N) {
        ll t = time[i + 1] - time[i];
        ll sa = abs(field[i + 1][0] - field[i][0]) + abs(field[i + 1][1] - field[i][1]);
        if (sa > t)ans = false;
        else if ((t - sa) % 2 == 1)ans = false;
    }
    if (ans)cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 6528
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <algorithm>
#include <utility>
#include <cstring>
#include <cmath>
using namespace std;


int main() {
    int n;
    cin>>n;
    int prev=0;
    int ans=0;
    for(int i=0;i<n;++i){
        int h;
        cin>>h;
        if(prev<=h)ans++;
        prev=max(prev,h);
    }
    cout<<ans<<endl;
    return 0;
}


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

int main() {
  int a, b;
  double c;
  cin >> a >> b;
  c = a*b/3.305785;
  printf("%.4lf", c);
  for(int i = 0; i<1000; i++) cout << "...........978..........";
  return 0;
}

Measured memory_bytes: 1204
cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
}
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    cards[s][int(r) - 1] = 1
  
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print(s, r + 1)

Measured memory_bytes: 6724