akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string a;cin>>a;
    int x=0,y=0;
    for(int i=0;i<3;i++){
    if(a[i]=='A') x++;
    else y++;
    }
    if(x==0||y==0) cout<<"No\n";
     else cout<<"Yes\n";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <cmath>
#include <utility>
#include <bitset>
#include <queue>
#include <stack>
#include <limits>
#include <list>

using namespace std;
using ll = long long;
const ll INF = numeric_limits<ll>::max();
const int MOD = 1000000007;

void chmin(ll &a, ll b)
{
    if (a > b)
    {
        a = b;
    }
}
void chmax(ll &a, ll b)
{
    if (a < b)
    {
        a = b;
    }
}

int main()
{
    ll N;
    cin >> N;
    vector<ll> as = vector<ll>(N);
    vector<ll> bs = vector<ll>(N);
    vector<ll> cs = vector<ll>(N);
    for (int i = 0; i < N; i++)
    {
        ll a, b, c;
        cin >> a >> b >> c;
        as[i] = a;
        bs[i] = b;
        cs[i] = c;
    }

    vector<vector<ll>> dp = vector<vector<ll>>(N, vector<ll>(3, -INF));
    dp[0][0] = as[0];
    dp[0][1] = bs[0];
    dp[0][2] = cs[0];

    for (int i = 1; i < N; i++)
    {
        dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + as[i];
        dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + bs[i];
        dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + cs[i];
    }
    ll maxV = dp[N - 1][0];
    chmax(maxV, dp[N - 1][1]);
    chmax(maxV, dp[N - 1][2]);
    cout << maxV << endl;
}

Measured memory_bytes: 8064
using System;
using System.Linq;

public class Program
{
    static void Main()
    {
        var xyxy = Console.ReadLine().Split().Select(z => int.Parse(z)).ToArray();
        var x = xyxy[2] - xyxy[0];
        var y = xyxy[3] - xyxy[1];
        Console.WriteLine($"{xyxy[2] - y} {xyxy[3] + x} {xyxy[0] - y} {xyxy[1] + x}");
    }
}


Measured memory_bytes: 13396
#include <iostream>

int main(void){

	int time;
	std::cin >> time;

	int h,m,s;
	
	h = time/3600;
	time = time%3600;
	
	m = time/60;
	time = time%60;
	s = time;

	std::cout << h << ':' << m << ':' << s << std::endl;

}

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

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

#define INF 100000000

int main() {
  int N, L;
  cin >> N >> L;
  vector<string> q;
  rep(i,N){
    string a;
    cin >> a;
    q.push_back(a);
  }
  sort(q.begin(), q.end());
  rep(i,N){
    cout << q.at(i);
  }
  cout << endl;
  return 0;
}

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

int main(){
    long double a,b,c;
    cin >> a >> b >> c;
    long double eps = 1.0E-14;

if(sqrt(a) + sqrt(b) + eps < sqrt(c)){
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define        ll     long long int
using namespace std;
int main()
{
   ll a[4];
   cin>>a[0]>>a[1]>>a[2]>>a[3];
   vector<ll>b;
    b.push_back(a[0]*a[2]);
    b.push_back(a[0]*a[3]);
    b.push_back(a[1]*a[2]);
    b.push_back(a[1]*a[3]);
   sort(b.begin(),b.end());
   cout<<b[3]<<endl;
    return 0;
}


Measured memory_bytes: 3616
#include <stdio.h>

int main(void){
  int s=0,n,m;
  
  scanf("%d",&n);
  m=n;
  while(n!=0){
    s += n%10;
    n /= 10;
  }
  
  if( m%s == 0) printf("Yes\n");
  else          printf("No\n");
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
#define sz(v) (int)v.size()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
const char EOL = '\n';
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}
 
void solve() {
    string s, t;
    cin >> s >> t;
    vector<vector<int>> dp(sz(s) + 1, vector<int>(sz(t) + 1, 0));
    REP(i, sz(s)) REP(j, sz(t)) {
        if (s[i] == t[j]) chmax(dp[i + 1][j + 1], dp[i][j] + 1);
        dp[i + 1][j + 1] = max({dp[i + 1][j + 1], dp[i + 1][j], dp[i][j + 1]});
    }

    string ans;
    int x = sz(s);
    int y = sz(t);
    while (x > 0 && y > 0) {
        if (dp[x][y] == dp[x - 1][y]) {
            x--;
        } else if (dp[x][y] == dp[x][y - 1]) {
            y--;
        } else {
            ans = s[x - 1] + ans;
            x--; y--;
        }
    }
    cout << ans << EOL;   
}


Measured memory_bytes: 35584
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for(inti=a;i<=b;i++)

#define MOD 1000000009
typedef long long int ll;
typedef vector<int>vi;
typedef pair<int,int>pi;




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

int n = s.size();
for(int index = 0 ;index < n;index++)
    if(s[index]!=s[n-index-1])
{
    cout<<"No"<<endl;
    return 0;
}
cout<<"Yes"<<endl;
 return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                    \
  ifstream in("abc157/abc157_b.txt"); \
  cin.rdbuf(in.rdbuf());
#else
#define INPUT_FILE
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
const int INF = 100100100;
const int MOD = 1e9 + 7;

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  vector<vector<int>> c(3, vector<int>(3, 0));
  rep(i, 3) rep(j, 3) { cin >> c[i][j]; }

  int N;
  cin >> N;

  vector<int> b(N);
  vector<vector<int>> bingo(3, vector<int>(3, 0));
  rep(i, N) {
    cin >> b[i];
    rep(j, 3) rep(k, 3) {
      if (bingo[j][k] == 0) {
        bingo[j][k] = (c[j][k] == b[i]);
        // printf("%d %d %d: %d %d %d\n", j, k, c[j][k], b[i], c[j][k] == b[i],
        //        bingo[j][k]);
      }
    }
  }

  bool ans = false;
  ans = ans | (bingo[0][0] && bingo[0][1] && bingo[0][2]);
  ans = ans | (bingo[1][0] && bingo[1][1] && bingo[1][2]);
  ans = ans | (bingo[2][0] && bingo[2][1] && bingo[2][2]);

  ans = ans | (bingo[0][0] && bingo[1][0] && bingo[2][0]);
  ans = ans | (bingo[0][1] && bingo[1][1] && bingo[2][1]);
  ans = ans | (bingo[0][2] && bingo[1][2] && bingo[2][2]);

  ans = ans | (bingo[0][0] && bingo[1][1] && bingo[2][2]);
  ans = ans | (bingo[0][2] && bingo[1][1] && bingo[2][0]);

  cout << (ans ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#028_A
from fractions import gcd

N,M=map(int,input().split())
S=input()
T=input()
flg=True

g=gcd(N,M)
n,m=N//g,M//g

for k in range(0,g):
    if S[k*n]!=T[k*m]:
        flg=False

print(N*M//g if flg else -1)

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

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef pair<ll, int> PILL;
typedef pair<ll, ll> PLL;

const int MAX_N = 1e5+5;
const int M = 1e6;
const ll INF = (ll)(1e18);
const int inf = 1e9;
const ll MOD = 1000000007LL;

void solve() {

}

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

    int n;
    cin >> n;
    bool ok = true;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        if (x%2 == 0 && x%3 != 0 && x%5 != 0) {
            ok = false;
        }
    }

    if (ok) cout << "APPROVED\n";
    else cout << "DENIED\n";








    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define REPvec(itr, mp) for(auto itr = mp.begin();itr != mp.end(); itr ++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007//1e9+7
using namespace std;
typedef long long ll;
typedef vector<int >    vecint;
typedef vector<vector<int> >  vec2int;
typedef vector<ll >     vecll;
typedef vector<string > vecstr;
typedef vector<bool > vecbool;
typedef vector<bool > vecbool;
////////////////////////////////////////////////
int main()
{
  string s; cin >> s;
  int n = s.size();
  cout << string(n,'x') << endl;
}

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
using namespace std;
using ll=long long;
using ld=long double;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};

template <typename T>
bool chmax(T &a, const T& b) {
    if (a < b) {
      a = b;
        return true;
    }
    return false;
}

template <typename T>
bool chmin(T &a, const T& b) {
    if (a > b) {
      a = b;
      return true;
    }
    return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll N,K;
    cin >> N >> K;
    vl A(N);
    vector<set<ll>> st(200000);
    rep(i,200000){
        st[i].insert(INF);
    }
    rep(i,N){
        cin >> A[i];
        A[i]--;
        st[A[i]].insert(i);
    }
    ll now=0;
    ll loop_count=1;
    while(now!=N){
        auto itr=st[A[now]].upper_bound(now);
        if(*itr==INF){
            loop_count++;
            itr=st[A[now]].upper_bound(-1);
        }
        now=*itr+1;
    }
    K%=loop_count;
    now=0;
    loop_count=0;
    ll j;
    while(loop_count<K){
        auto itr=st[A[now]].upper_bound(now);
        if(*itr==INF){
            loop_count++;
            if(loop_count==K){
                j=now;break;
            }
            itr=st[A[now]].upper_bound(-1);
        }
        now=*itr+1;
    }
    cerr << j << endl;
    vl t;
    ll i=j;
    while(i<N){
        if(*st[A[i]].upper_bound(i)==INF){
            t.pb(A[i]);
            i++;
        }
        else{
            ll k=*st[A[i]].upper_bound(i);
            i=k+1;
        }
    }
    rep(i,t.size()){
        cout << t[i]+1 << (i==t.size()-1?'\n':' ');
    }
}
/*
overflow checked?
corner case checked?
boundary checked?
not TLE in worst case checked?
*/

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

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

int main() {

	int N;
	cin >> N;

	cout << N*N << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
  int a,b,i,j;
  while(1)
       {
  scanf("%d%d",&a,&b);
  if(a==0&&b==0){break;}
 
  for(i=1;i<=a;i++)
    {
      for(j=1;j<=b;j++)
    {
      if(j%2==1)
        {
          if(i%2==1)printf("#");
          else printf(".");
        }
      else
        {
              if(i%2==1)printf(".");
          else printf("#");
        }
    }
      printf("\n");
    }
  printf("\n");
     
       }
  return 0;
}


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


struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};


int main() {
  int N,M;
  cin >> N >> M;
  //vector<int> l(N);
  
  int ans = N;
  
  UnionFind tree(N);
  
  int X,Y,Z;
  for (int i=0; i<M; i++) {
    cin >> X >> Y >> Z;
    if(!tree.same(X-1,Y-1)) {
      ans--;
      tree.unite(X-1,Y-1);
    }
  }
  
  cout << ans << endl;
  
  return 0;
    
}

Measured memory_bytes: 768
N = int(input())
A = map(int, input().split())

A = sorted(A)
A = A[::-1]
sumkoko = A.pop(0)
sumkoko += sum(A[0:(N-2)//2]) * 2
if ((N-2)%2) == 1:
    sumkoko += A[(N-2)//2]

print(sumkoko)


Measured memory_bytes: 104824
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy
import bisect


def dfs(s, prev, pre):
  val[s] += Ope[s] + prev
  for i in G[s]:
    if(i == pre):
      continue
    dfs(i, val[s], s)

def bfs(sx, sy, n):
  que = deque([[sy,sx]])
  while que:
    y,x = que.popleft()
    for i,j in D:
      if(x+i<0 or y+j<0 or x+i>W-1 or y+j>H-1):
        continue
      dist = G[y+j][x+i]
      if(G[y+j][x+i] != "X"):
        if(type(G[y+j][x+i]) is str):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        elif(dist>G[y][x]+1):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        

#X = str(input()).split()
#a = [int(x) for x in input().split()]
#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]

A, B = map(int, input().split())
ans = -1

for i in range(10000):
  if(int(math.floor(i*0.08)) == A and int(math.floor(i*0.1)) == B):
    ans = i
    break

print(ans)


Measured memory_bytes: 39788
n = gets.to_i

ret = 0
(1..n).each do |a|
  b = n - a
  break if a > b

  sum = a.to_s.split('').map(&:to_i).inject(:+)
  sum += (n - a).to_s.split('').map(&:to_i).inject(:+)
  ret = sum if sum < ret || ret < 1
end
puts ret


Measured memory_bytes: 2044
#include <stdio.h>

int main(void)
{
	int book;
	int sum;
	int i;
	
	while (1){
		scanf("%d", &sum);
		
		if (sum == 0){
			break;
		}
		
		for (i = 0; i < 9; i++){
			scanf("%d", &book);
			sum -= book;
		}
		
		printf("%d\n", sum);
	}
	
	return (0);
}

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

using namespace std;
using L = vector<long long>;
using A = vector<vector<long long>>;
#define sorted(vector) sort(vector.begin(),vector.end())
#define vmin(vector) *min_element(vector.begin(),vector.end())
#define vmax(vector) *max_element(vector.begin(),vector.end())
#define vsum(vector) accumulate(vector.begin(),vector.end(),0)
#define append(a) push_back(a)
#define int(a) stoi(a)
#define str(a) to_string(a)
#define bisect_left(vector,a) (lower_bound(vector.begin(),vector.end(),a)-vector.begin())
#define bisect_right(vector,a) (upper_bound(vector.begin(),vector.end(),a)-vector.begin())
#define defA(a,b,c) A(a,L(b,c));
//    A a = defA(n,2,0);

bool is_prime(long long n){
    if (n==1) return false;
    long long i=2;
    while (i*i<=n){
        if (n%i==0) return false;
        i++;
    }
    return true;
}

vector<long long> divisor_enumetarion(long long n){
    vector<long long> divisors;
    for(long long i=1 ; i*i<=n ; i++){
        if(n%i == 0){
            divisors.push_back(i);
            if(i != n/i){
                divisors.push_back(n/i);
            }
        }
    }
    return divisors;
}


int main(void) {
    long long a,b;
    long long ans=0;
    cin>>a>>b;
//    cout<<__gcd(a,b)<<endl;
    L c = divisor_enumetarion(__gcd(a,b));
    set<long long> s(c.begin(), c.end());
    for(auto y : s) {
        ans+=is_prime(y);
    }
    cout<<ans+1<<endl;
}

Measured memory_bytes: 640
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>

#define vvi vector<vector<int>>
#define vi vector<int>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

const int INF = 10e7;

int main() {
  int n;
  cin >> n;
  int b[n];
  b[0] = 1;
  int in[n];
  for (int i = 0; i < n; i++) {
    cin >> in[i];
  }
  int count = 0;
  for (int i = 0;; count++) {
    if (in[i] == INF) {
      break;
    }
    if (i == 1) {
      cout << count << endl;
      return 0;
    }
    int p = i;
    i = in[p] - 1;
    in[p] = INF;
  }
  cout << -1 << endl;

  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll, vl/*, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); ++i)
#define rep2(i, n) for(ll i = 1; i <= ll(n); ++i)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); ++i)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); ++i)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

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

  string S;
  cin >> S;
  S[3]++;
  cout << S << newl;
  return 0;
}

Measured memory_bytes: 256
m,d=map(int,input().split())
ans=0
for i in range(22,d+1):
    s=list(str(i))
    d1=int(s[0])
    d2=int(s[1])
    if d1<2 or d2 <2:
        continue

    for j in range(1,m+1):
        if d1*d2==j:
            ans+=1
            # print(j,i)

print(ans)

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

struct Node {
  int key;
  Node *parent, *left, *right;
};

Node *root, *NIL;

void insert(int k) {
  Node *y = NIL;  // zの親を指す
  Node *x = root; // rootからzの親をたどるためのポインタ
  Node *z;

  z = new Node;
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while (x != NIL) {
    y = x;
    if (z->key < x-> key) {
      x = x->left;
    } else {
      x = x->right;
    }
  }

  z->parent = y;
  if(y == NIL) root = z;
  else if(z->key < y->key) y->left = z;
  else y->right = z;
}

void inorder(Node *u) {
  if (u == NIL) return;
  inorder(u->left);
  cout << " " << u->key;
  inorder(u->right);
}

void preorder(Node *u) {
  if (u == NIL) return;
  cout << " " << u->key;
  preorder(u->left);
  preorder(u->right);
}

bool find(int k) {
  Node *x = root;

  while (x != NIL && x->key != k) {
    if(x->key > k) {
      x = x->left;
    } else {
      x = x-> right;
    }
  }

  return x != NIL;
}

int main() {
  int n;cin>>n;
  Node T[n];

  rep(i, n) {
    string cmd; cin>> cmd;
    if (cmd == "insert") {
      int key; cin >> key;
      insert(key);
    } else if (cmd == "print") {
      inorder(root);
      cout << endl;
      preorder(root);
      cout << endl;
    } else {
      int key; cin >> key;
      if(find(key)) cout << "yes" << endl;
      else cout << "no" << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 21936
# include <bits/stdc++.h>
using namespace std;
namespace Base{
	# define mr make_pair
	typedef long long ll;
	typedef double db;
	const int inf = 0x3f3f3f3f, INF = 0x7fffffff;
	const ll  infll = 0x3f3f3f3f3f3f3f3fll, INFll = 0x7fffffffffffffffll;
	template<typename T> void read(T &x){
    	x = 0; int fh = 1; double num = 1.0; char ch = getchar();
		while (!isdigit(ch)){ if (ch == '-') fh = -1; ch = getchar(); }
		while (isdigit(ch)){ x = x * 10 + ch - '0'; ch = getchar(); }
	    if (ch == '.'){
	    	ch = getchar();
	    	while (isdigit(ch)){num /= 10; x = x + num * (ch - '0'); ch = getchar();}
		}
		x = x * fh;
	}
	template<typename T> void chmax(T &x, T y){x = x < y ? y : x;}
	template<typename T> void chmin(T &x, T y){x = x > y ? y : x;}
}
using namespace Base;

struct point{
	int x, y;
}p[4010];
int n, flag[2], tmp;
ll g[110];
int main(){
	read(n);
	for (int i = 1; i <= n; i++){
		read(p[i].x); read(p[i].y);
		flag[((p[i].x + p[i].y) % 2 + 2) % 2] = true;
	}
	if (flag[0] + flag[1] > 1){
		printf("-1\n");
		return 0;
	}
	if (flag[0] == 1) tmp = 40; else tmp = 39;
	printf("%d\n", tmp);
	g[1] = 1;
	for (int i = 2; i <= tmp; i++) g[i] = g[i - 1] * 2;
	g[40] = 1;
	for (int i = 1; i <= 39 / 2; i++) swap(g[i], g[39 - i + 1]);
	for (int i = 1; i <= tmp; i++)
		printf("%lld%c", g[i], (i == tmp) ? '\n' : ' ');
	for (int i = 1; i <= n; i++){
		ll nowx = 0, nowy = 0;
		for (int j = 1; j <= tmp; j++){
			ll dx = nowx - p[i].x, dy = nowy - p[i].y;
			if (abs(dx) >= abs(dy)){
				if (nowx < p[i].x) {printf("R"); nowx += g[j];}
					else {printf("L"); nowx -= g[j];}
			}
			else {
				if (nowy < p[i].y) {printf("U"); nowy += g[j];}
					else {printf("D"); nowy -= g[j];}
			}
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 256
n = int(input())
A = list(map(int,input().split()))

flag = True
for i in range(n):
    if A[i]%2 == 0:
        if (A[i]%3 != 0) and (A[i]%5) != 0:
            flag = False

if flag:
    print("APPROVED")
else:
    print("DENIED")


Measured memory_bytes: 3060
#include<stdio.h>
#define MAX 100000
  
int A[MAX], n;
  
int partition(int p, int r) {
  int x, i, j, t;
  x = A[r];
  i = p - 1;
  for ( j = p; j < r ; j++ ) {
    if (A[j] <= x) {
      i++;
      t = A[i] ; A[i] = A[j]; A[j] = t;
    }
  }
  t = A[i + 1] ; A[i + 1] = A[r]; A[r] = t;
  return i + 1;
}
  
int main() {
  int i, q;
  scanf("%d", &n);
  for ( i = 0; i < n; i++ ) scanf("%d", &A[i]);
  q = partition(0, n-1);
  for ( i = 0; i < n; i++) {
    if ( i ) printf(" ");
    if ( i == q ) printf("[");
    printf("%d", A[i]);
    if ( i == q ) printf("]");
  }
  printf("\n");
  return 0;
}
 

Measured memory_bytes: 2144
#include "bits/stdc++.h"
using namespace std;
char str[100002]={'\0'};
vector<int> a,f;
int main()
{
    int n,q;
    int l,r;
    int i,ans;
    scanf("%d %d",&n,&q);
    scanf("%s",str);
    f.resize(n);
    a.resize(n);
    f[0]=0;
    a[0]=0;
    if(str[0]=='A'&&str[1]=='C')
    {
        f[0]=1;
        a[0]=1;
    } 
    for(i=1;i<n-1;i++)
    {
        f[i]=f[i-1];
        a[i]=0;
        if(str[i]=='A'&&str[i+1]=='C')
        {
            f[i]++;
            a[i]=1;
        }
    }
    f[n-1]=f[n-2];
    a[n-1]=0;
    for(i=0;i<q;i++)
    {
        scanf("%d %d",&l,&r);
        l--;
        r--;
        if(!a[l]&&!a[r])
        {
            printf("%d\n",f[r]-f[l]);
        }
        else
        {
            ans=f[r]-f[l];
            if(a[l])
            {
                ans++;
            }
            if(a[r])
            {
                ans--;
            } 
            printf("%d\n",ans);
        }
    }
    return 0;
}

Measured memory_bytes: 1664
n = int(input())
for _ in range(n):
    l = list(map(int, input().split()))
    l.sort()
    a = l[0]
    b = l[1]
    c = l[2]
    if a ** 2 + b ** 2 == c ** 2:
        print("YES")
    else:
        print("NO")




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

using namespace std;

#define int long long
#define fr(i, n) for(int i=0;i<n;i++)
#define frr(i, n) for(int i=n;i>=0;i--)
#define fra(i, a, n) for(int i=a;i<n;i++)
#define frra(i, a, n) for(int i=a;i>=n;i--)
#define f(i, a) for(auto &i:a)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define ff first
#define ss second
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef map<int, int> mii;
typedef set<int> si;
typedef unordered_map<int, int> uii;
typedef unordered_set<int> usi;

const int mod = 1e9 + 7;
const int MAXN = 2e5 + 5;
const int inf = 1e9 + 10;
const double eps = 1e-9;
const double pi = 3.14159265358979323;

int power(int x, int y) {
    int res = 1;
    while (y) {
        if (y & 1)res = (res * x) % mod;
        x = (x * x) % mod;
        y >>= 1;
    }
    return res;
}

void solve() {
    //CODE BEGIN
    string s, t;
    cin >> s >> t;
    int n = s.length(), m = t.length();
    vvi dp(n + 1, vi(m + 1));
    vvi from(n + 1, vi(m + 1));
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= m; ++j) {
            if (i == 0 || j == 0)dp[i][j] = 0;
            else if (s[i - 1] == t[j - 1])dp[i][j] = dp[i - 1][j - 1] + 1;
            else dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
        }
    }
    string ans;
    int i = n, j = m;
    while (true) {
        if (i == 0 || j == 0)break;
        if (s[i - 1] == t[j - 1]) {
            ans = s[i - 1] + ans;
            i--;
            j--;
        } else if (dp[i][j] == dp[i - 1][j])i--;
        else j--;
    }
    cout << ans << endl;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int test = 1;
//    cin >> test;
    for (int i = 0; i < test; ++i) {
//        cout << "Case #" << i + 1 << ": ";
        solve();
    }
    return 0;
}


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

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

    if (s.at(0) == s.at(1) && s.at(1)== s.at(2)){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 3608
process.stdin.resume();
process.stdin.setEncoding("utf8");

const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

const lines = [];
reader.on("line", (line) => {
  lines.push(line);
});

reader.on("close", () => {
    lines.forEach((e,i)=> e!="0" && console.log(`Case ${i+1}: ${e}`))
});



Measured memory_bytes: 23396
#include <iostream>
using namespace std;
#define N 1000

int main()
{
	int x;
	int stack[N];
	int n = 0;
	
	while (cin >> x) {
		if (x != 0) {
			stack[n] = x;
			n++;
		} else {
			cout << stack[n - 1] << "\n";
			n--;
		}
	}
	return 0;
}

Measured memory_bytes: 1160
A,B=map(int,input().split())
S = input()
digits = list(map(str,list(range(0,10))))
if S[A] != "-":
        print("No")
        exit()
for i in range(A+B+1):
    if i != A:
        if S[i] not in digits:
            print("No")
            exit()
print("Yes")

Measured memory_bytes: 3060
N = int(input())

A = list(map(int,input().split()))

Ans = 0

but = 0

while (True):
	for i in range(N):
		if A[i] % 2 == 1:
			but = 1
		else:
			A[i] /= 2
	if but == 1:
		break
		
	Ans += 1
	
print(Ans)
	
	
	
	 
	

Measured memory_bytes: 2940
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
constexpr bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
constexpr bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

void Pr(bool f){
  cout << (f ? "Yes" : "No") << "\n";
  exit(0);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll x;
  cin >> x;
  repr(i, -1000, 1001){
    repr(j, -1000, 1001){
      if(i*i*i*i*i-j*j*j*j*j==x){
        print(i, j);
        return 0;
      }
    }
  }
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i=x;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define UNIQ(a) unique(all(a))
#define UNIQNUM(a) UNIQ(a)-a.begin()
#define UNIQIT(a) a.erase(UNIQ(a), a.end());
#define VOUT(v,i) cout<<#v<<": ";for(int i=0;i<(int)v.size();i++){cout<<v[i]<<" ";}cout<<"\n";
#define vout(v) VOUT(v,z);
#define vmin(v) *min_element(all(v))
#define vmax(v) *max_element(all(v))
#define vsum(v) accumulate(all(v), 0LL)
#define MOUT(m,r,c) rep(i,r){rep(j,c){cout<<m[i][j]<<" ";}cout<<endl;}
#define mout(m) MOUT(m,m.size(),m[0].size())
#define debg(a) cout<<#a<<": "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define digit(a) to_string(a).length();
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef vector<ll> V;
// const long long MOD=1000000007;
const long long INF = 1e18;
#define EPS (1e-7)
#define PI (acos(-1))
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) { a = b; return true; }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) { a = b; return true; }
    return false;
}


void solve(long long N){
    cout << (N+2-1)/2 << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


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

int main(){
    int w,h,x,y,r;
    cin>>w>>h>>x>>y>>r;
    if (x>=r&&y>=r&&x<=w-r&&y<=h-r){
      cout<<"Yes"<<endl;
    }else{
      cout << "No" << endl;
    }
}


Measured memory_bytes: 3080
#include <bits/stdc++.h>
#define rep(i,n) for (ll i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
int main(){
    int A,B,C,D; cin >> A >> B >> C >> D;
    int ans1=A*B;
    int ans2=C*D;
    
    if (ans1>=ans2) cout << ans1 << endl;
    else cout << ans2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

	cin >> N >> R;

	if (N >= 10) {
		cout << R << endl;
	} else {
		cout << 100 * (10 - N) + R << endl;
	}

	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] d = new int[n];
        for(int i = 0; i < n; i++) {
            d[i] = sc.nextInt();
        }
        Arrays.sort(d);
        int low = d[n/2-1];
        int high = d[n/2];
        System.out.println(high - low);
    }
}


Measured memory_bytes: 50640
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cctype>
#include <string>
#include <map>
#include <set>
#include <math.h>
#include <cmath>
#define ll long long

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

int main(){
  int N, a;
  cin >> N;
  int ans = 0;
  vector<int> vec(N);

  for (int i = 0; i < N; i++){
    cin >> a;
    vec.at(i) = a;
  }

  bool flag = false;
  int check = 1;
  for (int i = 0; i < N; i++) {
    if(vec.at(i) == check){
      flag = true;
      ans++;
      check++;
    }
  }

  if(flag == true){
    ans = N - ans;
    cout << ans << endl;
  } else {
    cout << -1 << endl;
  }

  return 0;
}

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

int	main()
{
	int		n;
	string	color;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> color;
		if (color == "Y")
		{
			cout << "Four" << endl;
			return (0);
		}
	}
	cout << "Three" << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007; // 998244353
using ll = long long;
using namespace std;

int main(){
	int n; cin >> n;
	map<string, int> m;
	for( int i = 0; i < n; ++i ){
		string s; cin >> s;
		++m[s];
	}
	int cnt = 0;
	for( auto p : m ){
		cnt = max(cnt, p.second);
	}
	vector<string> a;	
	for( auto p : m ){
		if( cnt == p.second ){
			a.push_back(p.first);
		}
	}
	sort( a.begin(), a.end() );
	for( auto s : a ){
		cout << s << endl;
	}
}

Measured memory_bytes: 26868
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
typedef long long ll;
typedef pair<int, int> P;
typedef pair<pair<int, int>, int> PP;
typedef bitset<61> Bitset;
const ll INFL = 1LL << 60;
//const int MOD = 1000000007;
const int MOD = 998244353;
const int INF = INT_MAX;
const int MAX = 300000;
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
ll LCM(ll a, ll b) { return (a * b) / GCD(a, b); }
//------------------------------------------------------------------------------------------------------------------------------

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;cin>>n;
    vector<int>a(n);
    int sum = 0;
    for(int i = 0; i < n; i++) {
        cin>>a[i];
        sum ^= a[i];
    }
    for(int i = 0; i < n; i++) {
        int ans = sum^a[i];
        cout<<ans<<endl;
    }
}


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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> x(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    x[i] = a[i];
  }
  sort(x.begin(), x.end());
  int c = 0;
  for (int i = 0; i < n; i++) {
    if (x[i] != a[i]) {
      c++;
    }
  }
  cout << (c <= 2 ? "YES" : "NO");
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
    char s[3];
    scanf("%s",&s);
    if(s[0]=='A'&&s[1]=='B'&&s[2]=='C'){
        printf("ARC\n");
    }else if(s[0]=='A'&&s[1]=='R'&&s[2]=='C'){
        printf("ABC\n");
    }
    return 0;
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define PB push_back()
#define MP(x,y) make_pair(x,y)
#define F first
#define S second
using namespace std;

typedef double DB;
typedef long double LDB;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<int,DB> pid;
typedef pair<DB,int> pdi;
typedef pair<DB,DB> pdd;

template<typename T>
inline bool getmin(T& a,const T& b) {return b < a? (a=b,true):false;}
template<typename T>
inline bool getmax(T& a,const T& b) {return b > a? (a=b,true):false;}
template<typename T>
inline bool inrange(const T& x,const T& L,const T& R) {return L<=x && x<=R;}

const int maxn=1000+5;
char s[maxn];
inline int idx(char c)
{
    if(c=='S') return 0;
    else if(c=='N') return 1;
    else if(c=='E') return 2;
    else if(c=='W') return 3;
    else assert(0);
}
int main()
{
    scanf("%s",s);
    int show[4]={0,0,0,0};
    int n=strlen(s);
    for(int i=0;i<n;i++) show[idx(s[i])]=1;
    printf("%s\n",((show[0]^show[1]) || (show[2]^show[3]))?"No":"Yes");
}


Measured memory_bytes: 256
import java.util.HashMap;
import java.util.Scanner;

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

		int s = sc.nextInt();

		HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
		map.put(s, s);

		int ans = 2;
		while (true) {
			if (s % 2 == 0)
				s = s / 2;
			else
				s = 3 * s + 1;
			if (map.containsKey(s)) {
				break;
			}
			map.put(s, s);
			ans++;
		}

		System.out.println(ans);
	}

}


Measured memory_bytes: 21844
l = [int(raw_input()) for _ in range(3)]
x = int(raw_input())
ct = 0
for i in range(l[0]+1):
  for j in range(l[1]+1):
    for k in range(l[2]+1):
      if i * 500 + j * 100 + k * 50 == x:
        ct += 1
print ct


Measured memory_bytes: 2692
// Problem : A - Falling Asleep
// Contest : Dwango Programming Contest 6th
// URL : https://atcoder.jp/contests/dwacon6th-prelims/tasks/dwacon6th_prelims_a
// Memory Limit : 1024.000000 MB 
// Time Limit : 2525.000000 milisec 
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

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

#define iter(i, a, b) for(int i=(a); i<(b); i++)
#define rep(i, a) iter(i, 0, a)
#define rep1(i, a) iter(i, 1, (a)+1)
#define log(a) cerr<<"\033[32m[DEBUG] "<<#a<<'='<<(a)<<" @ line "<<__LINE__<<"\033[0m"<<endl
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using ll=long long;
using pii=pair<int, int>;
//#define int ll
const int MOD = 1000000007;

vector<pair<string, int>> ps;

signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	int n; cin >> n;
	rep(i, n) {
		string a; int b; cin >> a >> b;
		ps.pb({a, b});
	}
	string t; cin >> t;
	int ans = -1; 
	for(auto& e:ps) {
		if(ans != -1) ans += e.se;
		if(e.fi == t) ans = 0;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#define N 100000

int partition(int*,int,int);

int main(){
  int num,n[N],i,center;

  scanf("%d",&num);

  for(i=0; i<num; i++) scanf("%d",&n[i]);
  
  center = partition(n,0,num-1);
    
    for(i=0; i<num-1; i++){
      if(i==center) printf("[%d]",n[i]);
      else printf("%d",n[i]);
      printf(" ");
    }

    printf("%d\n",n[i]);
  
  return 0;
}

int partition(int *A,int p,int r){
  int x,tmp,i,j;
  x = A[r];
  i = p-1;
  for(j=p; j<r; j++){
    if(A[j]<=x){
      i++;
      tmp=A[i];
      A[i]=A[j];
      A[j]=tmp;
    }
  }
  tmp=A[i+1];
  A[i+1]=A[r];
  A[r]=tmp;
  return i+1;
}

Measured memory_bytes: 992
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[]) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		String[] c = line.split("");
		
		String sum = "";
		
		for(int i = 0; i < c.length ;i ++){
			if(c[i].equals("B") && !sum.equals("")){
				sum = sum.substring(0, sum.length() -1);
			}else if(!c[i].equals("B")){
				sum = sum + c[i];
			}
		}
		
		System.out.println(sum);
	}
}


Measured memory_bytes: 7892
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        
        for(;;){
            int H = scan.nextInt();
            int W = scan.nextInt();
            if(H != 0 && W != 0){
                for(int i = 1; i <= H; i++){
                    System.out.print("#");
                    for(int j = 1; j < W; j++){
                        System.out.print("#");
                    }    
                    System.out.println();
                }
                System.out.println();
            }else{
                break;
            } 
        }   
    }
}

Measured memory_bytes: 35024
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) (a).begin(),(a).end()
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
bool test = 0;
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
#define MAX (int)1e6 + 5

bool possible[MAX];
int cnt[MAX];

int main() {
	ull i, j, k, l;
	int a[3];
	rep(i, 3) cin >> a[i];
	sort(a, a + 3);
	if (a[0] == 5 && a[1] == 5 && a[2] == 7) {
		puts("YES");
	}
	else puts("NO");

	return 0;
}

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

using namespace std;

int main()
{
    int a,b,c,d,e,f;
    cin>>a>>b>>c;
     d=a+b;
     e=b+c;
     f=c+a;
     if(d>e && d>f)
     {
       if(e>f)
        {
           cout<<f;
        }
        else
        {
            cout<<e;
        }
     }
     else if(e>f && e>d )
     {
         if(f>d)
     {
         cout<<d;
     }
     else
     {
         cout<<f;
     }
     }
     else if(f>d && f>e)
     {
            if(d>e)
     {
         cout<<e;
     }
     else
     {
         cout<<d;
     }
     }
     else if(d==e && e==f)
     {
         cout<<d;
     }

    return 0;
}


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

int main(){
    int p, q, r;
    cin >> p >> q >> r;
    if(p+q<=q+r&&p+q<=r+p){
        cout << p+q;
    }
    else if(q+r<=p+q&&q+r<=r+p){
        cout << q+r;
    }
    else if(r+p<=p+q&&r+p<=q+r){
        cout << r+p;
    }
    cout << endl;
    return 0;
}

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

//#pragma GCC optimize("O3")
//#pragma GCC target("sse4")

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ITER(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a))

#define SZ(a) (int)((a).size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = (LL)INF * INF;

string s;
int n, a, b, c, d;

void no()
{
	cout << "No";
	exit(0);
}

bool rock(int i)
{
	return i < 0 || i >= n || s[i] == '#' || i == a || i == b;
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	cin >> n >> a >> b >> c >> d >> s;
	a--;
	b--;
	c--;
	d--;
	while(b < d)
	{
		if(rock(b + 1))
		{
			if(rock(b + 2))
				no();
			else
				b += 2;
		}
		else
		{
			if(!rock(b - 1) && !rock(b + 1))
				break;
			b++;
		}
	}
	while(a < c)
	{
		if(rock(a + 1))
		{
			if(rock(a + 2))
				no();
			else
				a += 2;
		}
		else
		{
			a++;
		}
	}
	while(b < d)
	{
		if(rock(b + 1))
		{
			if(rock(b + 2))
				no();
			else
				b += 2;
		}
		else
		{
			b++;
		}
	}
	cout << "Yes";
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[])
{
  int min_n = 1, max_n = 100000;
  vector<bool> is_prime(max_n +1, true);
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i < is_prime.size(); i++) {
    if (!is_prime[i]) {
      continue;
    }

    for (int j = i; j < is_prime.size(); j += i) {
      is_prime[j] = false;
    }

    is_prime[i] = true;
  }

  vector<int> cnts(max_n + 1, 0);
  for (int i = 1; i < cnts.size(); ++i) {
    if (is_prime[i] && is_prime[(i + 1)/2]) {
      cnts[i] = cnts[i - 1] + 1;
    } else {
      cnts[i] = cnts[i - 1];
    }
  }

  int q;
  cin >> q;

  vector<int> ans;
  for (int i = 0; i < q; ++i) {
    int l, r;
    cin >> l >> r;
    ans.push_back(cnts[r] - cnts[l - 1]);
  }

  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << '\n';
  }
  return 0;
}

Measured memory_bytes: 4284
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rrep(i,n) for(int (i) = (n) - 1; (i) >= 0; --(i)) //Reversi rep
#define nfor(i,a,b) for(int (i) = (a); (i) < (b); ++(i)) //Natural for
#define rfor(i,a,b) for(int (i) = (b); (i) >= (a); --(i)) //Reversi for
#define mod (1000000007)
#define YES cout << "YES" << endl;
#define Yes cout << "Yes" << endl;
#define NO cout << "NO" << endl;
#define No cout << "No" << endl;

int main()
{
    string s;
    cin >> s;
    if (s.find('a') != -1 && s.find('b') != -1 && s.find('c') != -1) {
        Yes;
    }else{
        No;
    }
    return 0;
}

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

using namespace std;

// Repetitions
#define FOR(i,a,n) for(ll i = ((ll) a); i < ((ll) n); ++i)
#define FORR(i, s, g) for(ll i = ((ll)s - 1); i >= ((ll) g); --i)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) FORR(i, n, 0)

// Container Utils
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define SORTALL(v) sort(ALL(v))
#define SZ(a) int((a).size())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())

// For Debug
#define DMP(x)  cerr << #x << " = " << (x) << endl
#define DBG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

// Aliases
#define PB push_back
#define MP make_pair
typedef long long ll;
typedef string str;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

// I/O Asynchronizing
struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
}aaaaaaa;

int main() {
    str s;
    cin >> s;
    s[5] = ' ';
    s[13] = ' ';
    cout << s << endl;

    return 0;
}


Measured memory_bytes: 256