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

using namespace std;

int main()
{
  string q;
  cin>>q;
  int q_len = q.size();

  int J_length = 0;
  int O_length = 0;
  int I_length = 0;

  int check = 0;
  int ans = 0;
  for(int i = 0;i < q_len;++i){
    if(q.at(i) == 'J'){
      if(check != 1){
        J_length = 0;
        O_length = 0;
        I_length = 0;
        ++J_length;
        check = 1;
      }
      else if(check == 1){
        ++J_length;
      }
    }
    else if(q.at(i) == 'O'){
      if(check == 1){
        ++O_length;
        check = 2;
      }
      else if(check == 2){
        ++O_length;
      }
      else{
        J_length = 0;
        O_length = 0;
        I_length = 0;
        check = 0;
      }
    }
    else if(q.at(i) == 'I'){
      if(check == 2){
        ++I_length;
        check = 3;
      }
      else if(check == 3){
        ++I_length;
      }
      else{
        J_length = 0;
        O_length = 0;
        I_length = 0;
        check = 0;
      }
    }

    if(check == 3 && J_length >= O_length && O_length <= I_length){
      ans = max(ans,O_length);
    }
  }
  cout<<ans<<endl;
  
  return 0;
}


Measured memory_bytes: 4000
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
using ll = long long;
using ld = long double;
#define vpl vector<pair<long long,long long>>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
using pll = pair<long long,long long>;
#define cY cout<<"Yes"<<endl
#define cN cout<<"No"<<endl
const long long INF = 1LL << 60;
long long MOD = 1000000007;
const long double pi = 3.1415926535897932;
#define pb push_back
#define mp make_pair
#define mt make_tuple
using Grid = vector<vector<char>>;
#define vc vector<char>
//(mod m)でのaの逆元を計算する
//a/b(mod m)=a(mod m)*modinv(b,m)
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

//最大最小の入れ替え
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;
}

//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
//コンビネーション
ll nCr(ll n, ll r) {
    ll ans = 1;
    for (ll i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (ll i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}
//素因数分解
map< ll, ll > prime_factor(ll n) {
  map< ll, ll > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}
//UF
struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) { }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};
//切り上げの割り算は(a + b - 1) / bでできる

//ここから
int main(){
    ll N,M;
    cin>>N>>M;
    vector<pll> ab(M);
    rep(i,M){
        ll a,b;
        cin>>a>>b;
        a--; b--;
        ab[i].first=a;
        ab[i].second=b;
    }
    ll ans=0;
    rep(i,M){
        UnionFind uf(N);
        rep(j,M){
            if(j==i)continue;
            uf.merge(ab[j].first,ab[j].second);
        }
        rep2(j,1,N){
            if(uf.root(j)!=uf.root(0)){
                ans++;
                break;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int main() {
  int n;
  cin>>n;
  vin d(n);
  rep(i,0,n)cin>>d[i];
  sort(all(d));
  reverse(all(d));
  int ans=0;
  int r=inf;
  rep(i,0,n){
    if(r>d[i]){
     r=d[i];
      ans++;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3592
a,b,c,x,y=map(int,input().split())
ans=0
if a+b>=2*c:
    if x>=y:
        ans+=2*c*y
        x-=y
        y-=y
        if a<2*c:
            ans+=a*x
        else:
            ans+=2*c*x
    else:
        ans+=2*c*x
        y-=x
        x-=x
        #print(ans)
        if b<2*c:
            ans+=b*y
        else:
            #print("ok")
            ans+=2*c*y
else:
    ans+=(a*x+b*y)
print(ans)

Measured memory_bytes: 3064
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>
#include<math.h>

typedef int32_t i32;
typedef int64_t i64;

#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) > (0) ? (a) : -(a))
#define ALLOC(size,type) ((type*) calloc ((size), sizeof (type)))

typedef struct point {
  i64 x, y, z;
} point;

typedef struct ball {
  point p;
  i64 r;
  i64 l;
} ball;

i64 func (point s, point dir, point q) {
  return dir.x * (q.x - s.x) + dir.y * (q.y - s.y) + dir.z * (q.z - s.z);
}

i64 norm (point p) {
  return p.x * p.x + p.y * p.y + p.z * p.z;
}

i64 SQ (i64 v) {
  return v * v;
}

void run (void) {
  i32 n, q;
  scanf ("%" SCNi32 "%" SCNi32, &n, &q);
  ball *b = ALLOC (n, ball);
  for (i32 i = 0; i < n; ++i) {
    i32 x, y, z, r;
    i64 l;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32 "%" SCNi32 "%" SCNi64, &x, &y, &z, &r, &l);
    b[i] = (ball) {(point){x, y, z}, r, l};
  }
  while (q--) {
    point s, t;
    scanf ("%" SCNi64 "%" SCNi64 "%" SCNi64, &s.x, &s.y, &s.z);
    scanf ("%" SCNi64 "%" SCNi64 "%" SCNi64, &t.x, &t.y, &t.z);
    point dir = {t.x - s.x, t.y - s.y, t.z - s.z};
    i64 sum = 0;
    for (i32 i = 0; i < n; ++i) {
      ball a = b[i];
      if (func (s, dir, a.p) * func (t, dir, a.p) >= 0) continue;
      point c = {a.p.x - s.x, a.p.y - s.y, a.p.z - s.z};
      point cross = {dir.y * c.z - dir.z * c.y, dir.z * c.x - dir.x * c.z, dir.x * c.y - dir.y * c.x};
      if (norm (dir) * SQ(a.r) >= norm (cross)) {
        sum += a.l;
      }
    }
    printf ("%" PRIi64 "\n", sum);
  }
}

int main (void) {
  run();
  return 0;
}



Measured memory_bytes: 2060
#include<iostream>
#include<vector>
using namespace std;
#define int long long
#define V vector
#define vel V<int>
#define rep(i,n) for(int i=0;i<n;i++)
#define mkp make_pair
#define pin pair<int,int>
pin solve(V<pin>& ab, int ex) {
	if (!ex) { return mkp(1,0); }
	V<V<pin>> qab(2);
  int sz=ab.size();
  qab[0].reserve(sz);
  qab[1].reserve(sz);
	for (pin &x : ab) {
		qab[x.second & 1].push_back(mkp(x.first / 2,x.second / 2));
		if (x.first & 1) { qab[(x.second + 1) & 1].push_back(mkp(x.first / 2,(x.second + 1) / 2)); }
	}
  vel c(2);
	rep(i, 2) {
		for (pin &x : qab[1-i]) {
			int qc = (2 * x.first + x.second)%3;
          c[1-i]^=(qc+1);
		}
		if (!c[1 - i]) {
			pin ans = solve(qab[i], ex - 1);
			ans.first *= 2; ans.second *= 2; ans.second += i;
			return ans;
		}
	}
	for(pin &v:ab) { v.first++; }
	pin ans = solve(ab, ex); ans.first--;
	return ans;
}
signed main() {
	long long inf = 2e17;
	int n; scanf("%lld", &n);
	V<pin> ab(n);
	rep(i, n) {
		long long a, b; scanf("%lld", &a); scanf("%lld", &b);
		ab[i] = { a + inf,b + inf };
	}
	pin ret = solve(ab, 70);
	cout << ret.first - inf << " " << ret.second - inf << "\n";
}

Measured memory_bytes: 11136
#include<iostream>
#include<string>
using namespace std;
int main(){
    int i,j,c=0,k,a,w,h,n,x,y;
    cin >> w >> h >> n;
    int b[h][w];
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            b[i][j]=0;
        }
    }
    for(k=0; k<n; k++){
        cin>>x>>y>>a;
        if(a==1){
            for(i=0;i<h;i++){
                for(j=0;j<x;j++){
                    b[i][j]=1;
                }
            }
        }
        else if(a==2){
            for(i=0;i<h;i++){
                for(j=x;j<w;j++){
                    b[i][j]=1;
                }
            }
        }
        else if(a==3){
            for(i=0;i<w;i++){
                for(j=0;j<y;j++){
                    b[j][i]=1;
                }
            }
        }
        else if(a==4){
            for(i=0;i<w;i++){
                for(j=y;j<h;j++){
                    b[j][i]=1;
                }
            }
        }
    }

        for(i=0;i<h;i++){
            for(j=0;j<w;j++){
                if(b[i][j]==0){
                    c++;
                }
            }
        }

        cout<<c;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] d = new int[7];
        int dice=1, i=0, ans=0, q=0, surface=0, bottom=0, right=0;
        
        for(i=0;i<6;i++)d[i+1] = sc.nextInt();
        
        q = sc.nextInt();
        
        for(i=0;i<q;i++){
            surface = sc.nextInt();
            bottom = sc.nextInt();
            if(surface == d[1]){
                if(bottom == d[2])right = d[3];
                else if(bottom == d[3])right = d[5];
                else if(bottom == d[4])right = d[2];
                else right = d[4];
            
            }else if(surface == d[2]){
                if(bottom == d[1])right = d[4];
                else if(bottom == d[3])right = d[1];
                else if(bottom == d[4])right = d[6];
                else right = d[3];
               
            }else if(surface == d[3]){
                if(bottom == d[1])right = d[2];
                else if(bottom == d[2])right = d[6];
                else if(bottom == d[5])right = d[1];
                else right = d[5];
                
            }else if(surface == d[4]){
                if(bottom == d[1])right = d[5];
                else if(bottom == d[2])right = d[1];
                else if(bottom == d[5])right = d[6];
                else right = d[2];
                
            }else if(surface == d[5]){
                if(bottom == d[1])right = d[3];
                else if(bottom == d[3])right = d[6];
                else if(bottom == d[4])right = d[1];
                else right = d[4];
                
            }else if(surface == d[6]){
                if(bottom == d[2])right = d[4];
                else if(bottom == d[3])right = d[2];
                else if(bottom == d[4])right = d[5];
                else right = d[3];
                
            }
            System.out.println(right);
        }
    }
}


Measured memory_bytes: 26072
S = int(input())

if S < 3:
    print(0)
    exit()

if S < 6:
    print(1)
    exit()

x = [0] * (S + 1)
x[3] = x[4] = x[5] = 1
for i in range(6, S + 1):
    x[i] += 1
    for j in range(3, i - 3 + 1):
        x[i] += x[i - j]

print(x[S] % (10 ** 9 + 7))


Measured memory_bytes: 68568
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;

int main(){
	int a,b,m;
	cin>>a>>b>>m;
	vector<int>A(a),B(b);
	int MinA=1e9,MinB=1e9;
	for(int i=0;i<a;i++){
		cin>>A[i];
		MinA=min(A[i],MinA);
	}
	for(int i=0;i<b;i++){
		cin>>B[i];
		MinB=min(B[i],MinB);
	}
	int ans=MinA+MinB;
	vector<int>x(m),y(m),c(m);
	for(int i=0;i<m;i++)cin>>x[i]>>y[i]>>c[i];
	for(int i=0;i<m;i++){
		if((A[x[i]-1]+B[y[i]-1]-c[i])<ans)ans=A[x[i]-1]+B[y[i]-1]-c[i];
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 2176
using System.Linq;
using System.Numerics;
using static System.Console;
using static System.Math;
class Z { static void Main() => new K(); }
class K
{
	int F => int.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split();
	public K()
	{
		var N = F;
		var ps = new Complex[N];
		for (var i = 0; i < N; i++) { var I = G; ps[i] = new Complex(I[0], I[1]); }
		var M = 600000;
		var d = 2 * PI / M;
		var ans = new int[N];
		for (var i = 0; i < M; i++)
		{
			var p = Complex.FromPolarCoordinates(1e11, i * d);
			var k = -1;
			var r = double.PositiveInfinity;
			for (var j = 0; j < N; j++)
			{
				var tmp = (p - ps[j]).Magnitude;
				if (tmp < r) { r = tmp; k = j; }
			}
			ans[k]++;
		}
		for (var i = 0; i < N; i++) WriteLine(ans[i] / (decimal)M);
	}
}


Measured memory_bytes: 13396
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	if(a==1)a=14;
	if(b==1)b=14;
	if(a>b)printf("Alice");
	if(a<b)printf("Bob");
	if(a==b)printf("Draw");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
template <class T>
using Vec2 = vector<vector<T>>;
#define REP(i, m, n) for(ll i = (m); i < (n); ++i)
#define REPN(i, m, n) for(ll i = (m); i <= (n); ++i)
#define REPR(i, m, n) for(ll i = (m)-1; i >= (n); --i)
#define REPNR(i, m, n) for(ll i = (m); i >= (n); --i)
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define fs first
#define sc second
template <class T1, class T2>
bool chmax(T1 &a, const T2 b){if(a < b){a = b; return true;} return false;}
template <class T1, class T2>
bool chmin(T1 &a, const T2 b){if(a > b){a = b; return true;} return false;}
ll pow2(const int n){return (1LL << n);}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    for (const T &i : v) os << i << ' ';
    return os;
}
void co() { cout << endl; }
template <class Head, class... Tail>
void co(Head&& head, Tail&&... tail) {
    cout << head << ' ';
    co(forward<Tail>(tail)...);
}
void ce() { cerr << endl; }
template <class Head, class... Tail>
void ce(Head&& head, Tail&&... tail) {
    cerr << head << ' ';
    ce(forward<Tail>(tail)...);
}
void sonic(){ios::sync_with_stdio(false); cin.tie(0);}
void setp(const int n){cout << fixed << setprecision(n);}
constexpr int INF = 1000000001;
constexpr ll LINF = 1000000000000000001;
constexpr ll MOD = 1000000007;
constexpr ll MOD_N = 998244353;
constexpr ld EPS = 1e-11;
const double PI = acos(-1);

int main(void) {
    ll n, m;
    cin >> n >> m;
    scc_graph scc(n);
    while (m--) {
        ll a, b;
        cin >> a >> b;
        scc.add_edge(a, b);
    }

    auto v = scc.scc();
    co(v.size());
    for (auto &i : v) co(i.size(), i);

    return 0;
}


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

using namespace std;

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

  string S;
  cin >> S;

  for (size_t i = 0; i < S.size(); ++i) {
    char c = S[i];
    if (i % 2 == 0) {
      switch (c) {
        case 'R':
        case 'U':
        case 'D':
          break;
        default:
          cout << "No" << endl;
          return 0;
      }
    } else {
      switch (c) {
        case 'L':
        case 'U':
        case 'D':
          break;
        default:
          cout << "No" << endl;
          return 0;
      }
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string.h>

using namespace std;

int main(){
  int a, b, c, ch;
  cin >> a >> b >> c;
  if(a > b){
      ch = a;
      a = b;
      b = ch;
  }
  if(b > c){
    ch = b;
    b = c;
    c = ch;
  }
  if(a > b){
      ch = a;
      a = b;
      b = ch;
  }
  cout << abs(a - b) + abs(b - c) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>

using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = 123456;
vector<int> G[MAXN];
int ans1[MAXN], ans2[MAXN], deg[MAXN];
bool onL[MAXN];
vector<int> line;
int s, t, dis;

void dfs(int cur, int par, int lv) {
     if (lv >= dis) {
        dis = lv;
        if (!t) s = cur;
        else t = cur;
     }
     for (int i : G[cur])
         if (i != par) dfs(i, cur, lv + 1);
}

bool dfs2(int cur, int par, int tg) {
     if (cur == tg) {
        line.push_back(deg[cur] - 1);
        onL[cur] = 1;
        return true;
     }
     bool tmp = false;
     for (int i : G[cur]) {
         if (i != par && dfs2(i, cur, tg)) {
            line.push_back(deg[cur] - 1);
            tmp = true;
         }
     }
     onL[cur] = tmp;
     return tmp;
}

int dfs3(int cur, int par, int lv) {
    int cur_lv = lv;
    for (int i : G[cur]) {
        if (i != par && !onL[i]) {
           cur_lv = max(cur_lv, dfs3(i, cur, lv + 1));
        }
    }
    return cur_lv;
}

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n - 1; i++) {
        int x, y;
        scanf("%d %d", &x, &y);
        G[y].push_back(x);
        G[x].push_back(y);
        deg[x]++, deg[y]++;
    }
    dfs(1, 1, 0);
    t = 1, dis = 0;
    dfs(s, s, 0);
    dfs2(s, s, t);
    bool OK = true;
    for (int i = 1; i <= n; i++) {
        if (onL[i]) {
           int dep = dfs3(i, i, 0);
           if (dep > 1) OK = false;
        }
    }
    if (!OK) return !printf("-1\n");
    ans1[0] = ans2[0] = 1;
    ans2[n - 1] = ans1[n - 1] = n;
    int cur = n, idx = n - 2;
    for (int i = 1; i < (int)line.size() - 1; i++) {
        int cnt = line[i];
        ans1[idx--] = cur - cnt;
        for (int j = cur - 1; j > cur - cnt; j--) ans1[idx--] = j;
        cur -= cnt;
    }
    cur = n, idx = n - 2;
    for (int i = (int)line.size() - 2; i > 0; i--) {
        int cnt = line[i];
        ans2[idx--] = cur - cnt;
        for (int j = cur - 1; j > cur - cnt; j--) ans2[idx--] = j;
        cur -= cnt;
    }
    int md = 1;
    for (int i = 0; i < n; i++) {
        if (ans1[i] == ans2[i]) continue;
        else if (ans1[i] < ans2[i]) break;
        else {
             md = 2;
             break;
        }
    }
    if (md == 1) {
       for (int i = 0; i < n; i++) printf("%d ", ans1[i]);
    } else {
       for (int i = 0; i < n; i++) printf("%d ", ans2[i]);
    }
    puts("");
    return 0;
}
/*
http://mxwell.github.io/draw-graph/?q=graph{1--2;4--3;3--2;6--5;3--5;8--7;7--5;10--9;9--7;12--11;11--9;14--13;13--11;15--13}#
*/


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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;

const ll INF = 1e9+100;
const ll MOD = 1e9+7;
const bool debug = 0;

int h[6], w[6];

int main() {
	map<pii, int> m;
	
	REP(i, 6) {
		scanf("%d %d", h + i, w + i);
		if (h[i] < w[i]) swap(h[i], w[i]);
		m[pii(h[i], w[i])]++;
	}
	
	bool ok = true;
	int c = 0;
	
	vector<pii> v;
	for (map<pii, int>::iterator it = m.begin(); it != m.end(); ++it) {
		if (it->se & 1) ok = false;
		REP(i, it->se / 2) v.push_back(it->fi);
	}
	if (v.size() != 3) ok = false;
	
	if (ok) {
		ok = false;
		REP(t1, 2) REP(t2, 2) REP(t3, 2) {
			pii p1 = v[0]; if (t1) swap(p1.fi, p1.se);
			pii p2 = v[1]; if (t2) swap(p2.fi, p2.se);
			pii p3 = v[2]; if (t3) swap(p3.fi, p3.se);
			
			if (p1.fi == p2.fi && p3.fi == p1.se && p3.se == p2.se) ok = true;
			swap(p2, p3);
			if (p1.fi == p2.fi && p3.fi == p1.se && p3.se == p2.se) ok = true;
		}
	}
	
	puts(ok ? "yes" : "no");
	return 0;
}

Measured memory_bytes: 3160
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	
	if(a > b)
	{
		cout << a - 1 << endl;
	}
	else
	{
		cout << a << endl;
	}
	
	return 0;
}

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

using namespace std;

int main()
{
    std::string s;
    cin >> s;
    bool flag = false;
    for (int i = 0; i < s.length() -1; i++) {
        if (s[i] == s[i+1]) {
            flag = true;
        }
    }
    if (!flag) {
        cout << "Good" << endl;
    } else {
        cout << "Bad" << endl;
    }
 
    return 0;
}


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

const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
const int MOD=1000000007;

int main(){
	int n;cin>>n;
	for(int i=1;i<=9;i++){
		for(int j=1;j<=9;j++){
			if(i*j==n){
				puts("Yes");return 0;
			}
		}
	}
	puts("No");
}

Measured memory_bytes: 256
<?php
  
$S = trim(fgets(STDIN));
$N = strlen($S);
$left = substr($S, 0, ($N - 1) / 2);
$right = substr($S, (($N + 3) / 2) - 1, ($N - 1) / 2);
 
if (($left === $right) && ($left === strrev($left)) && ($right === strrev($right))) {
  echo 'Yes';
} else {
  echo 'No';
}

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

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)

#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define pii pair<int, int>
#define vi vector<int>

using namespace std;
template <class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& p)
{
    return o << "(" << p.first << "," << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& vc)
{
    o << "sz = " << vc.size() << endl
      << "[";
    for (const T& v : vc)
        o << v << ",";
    o << "]";
    return o;
}
using ll = long long;
constexpr ll MOD = 1000000007;

ll N;
constexpr ll MAX = 100000;
ll a[3 * MAX];
ll b[MAX + 1];
ll c[MAX + 1];

int main()
{
    cin >> N;
    ll sum1 = 0;
    ll sum2 = 0;
    rep(i, 3 * N)
    {
        cin >> a[i];
        if (i < N) {
            sum1 += a[i];
        } else if (i >= 2 * N) {
            sum2 += a[i];
        }
    }
    priority_queue<ll> q;
    rep(i, N)
    {
        q.push(a[i + 2 * N]);
    }
    b[N] = sum2;
    rep1(i, N)
    {
        const ll top = q.top();
        b[N - i] = b[N - i + 1];
        if (top > a[2 * N - i]) {
            b[N - i] = b[N - i + 1] - top + a[2 * N - i];
            q.pop();
            q.push(a[2 * N - i]);
        }
    }

    priority_queue<ll, vector<ll>, greater<ll>> q2;
    rep(i, N)
    {
        q2.push(a[i]);
    }
    c[0] = sum1;
    rep1(i, N)
    {
        const ll top = q2.top();
        c[i] = c[i - 1];
        if (top < a[N + i - 1]) {
            c[i] = c[i - 1] - top + a[N + i - 1];
            q2.pop();
            q2.push(a[N + i - 1]);
        }
    }

    ll score = numeric_limits<ll>::min();
    rep(i, N + 1)
    {  // removal from formar
        score = max(score, c[i] - b[i]);
    }

    cout << score << endl;
    return 0;
}


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

int N, W;
vector<int> values, weights;

const int MAX_W = 10010;
const int MAX_N = 110;
int memo[MAX_W][MAX_N];

int solve(int w_acc, int i)
{
  if (w_acc > W || i > N)
    return INT_MIN;
  if (w_acc == W || i == N)
    return 0;
  if (memo[w_acc][i] != -1)
    return memo[w_acc][i];

  return memo[w_acc][i] = max(
    solve(w_acc + weights[i], i) + values[i],
    solve(w_acc, i+1)
  );
}

int main()
{
  cin >> N >> W;
  values = vector<int>(N);
  weights = vector<int>(N);
  for (int i = 0; i < N; i++)
    cin >> values[i] >> weights[i];

  memset(memo, -1, sizeof(memo));
  cout << solve(0, 0) << endl;

  return EXIT_SUCCESS;
}




Measured memory_bytes: 7868
import java.util.*;

public class Main {
  public static void main(String[] args) {
    int i, number_n, number_a;
    Scanner sc = new Scanner(System.in);
    number_n = Integer.parseInt(sc.next());
    number_a = Integer.parseInt(sc.next());
    if(number_n < number_a) System.out.println(0);
    else System.out.println(10);
  }
}


Measured memory_bytes: 21716
#include<stdio.h>

int selectionSort(int A[], int N){
  int i, j, sw = 0, t, minj;

  for (i=0; i<N; i++){
    minj = i;
    for (j=i+1; j<N; j++){
      if (A[j] < A[minj]) minj = j;
    }
    if (minj != i){
      t = A[i];
      A[i] = A[minj];
      A[minj] = t;
      sw++;
    }
  }
  return sw;
}

int main(){
  int i, N, sw;
  int A[100];

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

  sw = selectionSort(A, N);

  for (i=0; i<N; i++){
    if (i > 0) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
  printf("%d\n", sw);

  return 0;
}



Measured memory_bytes: 2696
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(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;
   cin >> n;
   ll a[n];
   rep(i, n) cin >> a[i];

   bool flag = true;
   a[0]--;
   rep(i, n - 1) {
        if(a[i + 1] > a[i])
            a[i + 1]--;
        else if(a[i + 1] == a[i])
            continue;
        else {
            flag = false;
            break;
        }
   }
   if(flag)cout<< "Yes" << endl;
   else cout<< "No" << endl;
   return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>

#define MAX 2000001
#define VMAX 10000

int main(void)
{
  unsigned short *A, *B;
  
  int C[VMAX+1];
  int n, i, j;
  scanf("%d",&n);
  
  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);
  
  for(i=0;i<=VMAX;i++) C[i] = 0;
  
  for(i=0;i<n;i++) {
    scanf("%hu",&A[i+1]);
    C[A[i+1]]++;
  }
  
  for(i=1;i<=VMAX;i++) C[i] = C[i] + C[i-1];
  
  for(j=1;j<=n;j++) {
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
  
  for(i=1;i<=n;i++) {
    if(i>1) printf(" ");
    printf("%d",B[i]);
  }
  printf("\n");
  
  return 0;
}



Measured memory_bytes: 9648
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    A=list(map(int,input().split()))
    B=list(map(int,input().split()))
    C=list(map(int,input().split()))
    ans=sum(B)
    for i in range(n-1):
        if(A[i+1]-A[i]==1):
            ans+=C[A[i]-1]

    print(ans)
resolve()

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

int main()
{
  int N, W;
  cin >> N >> W;
  vector<int> v(N), w(N);
  for (int i = 0; i < N; i++)
  {
    cin >> v[i] >> w[i];
  }
  vector<vector<int>> dp(N + 1, vector<int>(W + 1, 0));
  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j <= W; j++)
    {
      dp[i + 1][j] = dp[i][j];
      if (j - w[i] >= 0)
      {
        dp[i + 1][j] = max(dp[i + 1][j], dp[i + 1][j - w[i]] + v[i]);
      }
    }
  }
  cout << dp[N][W] << endl;
}


Measured memory_bytes: 6796
class List
  def initialize
    @first = nil
    @last = nil
  end

  def [] index
    current_item = @first

    # ?????????????????????
    index.times {|item|
      return nil if current_item.next.nil?
      current_item = current_item.next
    }

    current_item
  end

  def insert val
    new_item = ListItem.new val
    link new_item, @first
    @first = new_item
    @last ||= new_item
  end

  def search target
    current_item = @first

    loop do
      return nil          if current_item.nil?
      return current_item if current_item.value == target
      current_item = current_item.next
    end
  end

  def delete target
    target_item = search target
    return false if target_item.nil?

    link target_item.prev, target_item.next

    # ??????????±????????????????
    @first = target_item.next if target_item.prev.nil?

    # ??????????±????????????????
    @last = target_item.prev if target_item.next.nil?

    return true
  end

  def delete_first
    return false if @first.nil?
    @first = @first.next
    link nil, @first
    @first = @last = nil if @first.nil?
    true
  end

  def delete_last

    return false if @last.nil?
    @last = @last.prev
    link @last, nil
    @first = @last = nil if @last.nil?
    true
  end

  def print delimiter = ' '
    print_items = []
    current_item = @first
    until current_item.nil?
      print_items << current_item.value
      current_item = current_item.next
    end
    puts print_items.join delimiter
  end

  private

  def link first, second
    first.next = second unless first.nil?
    second.prev = first unless second.nil?
  end

  class ListItem
    def initialize value
      @value = value
      @next = nil
      @prev = nil
    end
    attr_accessor :next, :prev, :value
  end
end

def main commands
  list = List.new

  commands.each do |raw_command|
    #list.print
    command, arg = raw_command.split ' '
    case command
    when 'insert'
      list.insert arg
    when 'delete'
      list.delete arg
    when 'deleteFirst'
      list.delete_first
    when 'deleteLast'
      list.delete_last
    else
      raise '??????'
    end
  end
  list.print
end


inputs = STDIN.read.split(/\n/)
inputs.shift

main(inputs)

Measured memory_bytes: 274428
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        String[] lines = getStdin();
        
        for (int i = 0; i < lines.length; i++){
            String str = lines[i];
            String[] str1 = str.split(" ");
            int a = Integer.parseInt(str1[0]);
            String op = str1[1];
            int b = Integer.parseInt(str1[2]);

                if (op.equals("+")){
                    System.out.println(a + b);
                } else if (op.equals("-")){
                    System.out.println(a - b);
                } else if (op.equals("*")){
                    System.out.println(a * b);
                } else if (op.equals("/")){
                    System.out.println(a / b);
                } else if (op.equals("?")){
                    return;
                }


        }

    }

  
  private static String[] getStdin() {
    Scanner scanner = new Scanner(System.in);
    ArrayList<String> lines = new ArrayList<>();
    while (scanner.hasNext()) {
      lines.add(scanner.nextLine());
    }
    return lines.toArray(new String[lines.size()]);
  }
  
}



Measured memory_bytes: 26152
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    
    int N, M;
    cin >> N >> M;
    
    int ans[51] = {};
    for(int i = 0;i < M; i ++){
        int a, b;    
        cin >> a >> b;
        ans[a]++;
        ans[b]++;
    }
    
    for(int i = 1; i <= N; i ++){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <set>

#define DEBUG 1

#define lli long long int
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

int main(){

	lli a,b,q;
	cin>>a>>b>>q;
	vector<vector<lli>> s = {vector<lli>(a),vector<lli>(b)};
	for(auto& e :s[0])cin>>e;
	for(auto& e :s[1])cin>>e;

	for(;q>0;q--){
		lli x;
		cin>>x;
		vector<vector<lli>::iterator> it = {lower_bound(begin(s[0]),end(s[0]),x),lower_bound(begin(s[1]),end(s[1]),x)};
		vector<vector<lli>> v(2);
		for(int i=0;i<2;i++){
			if(it[i] != begin(s[i])){
				v[i].push_back(*(it[i]-1));
			}
			if(it[i] != end(s[i])){
				v[i].push_back(*it[i]);
			}
		}
		lli r = 1e18;
		for(auto e0:v[0]){
			for(auto e1:v[1]){
				r = min(r,min(abs(e0-x),abs(e1-x)) + abs(e0-e1));
			}
		}
		cout<<r<<endl;
	}


	return 0;
}

Measured memory_bytes: 3328
MOD = pow(10,9) + 7
# print(MOD)
chars = ["A","C","G","T"]
dict = {
    "A":0,
    "C":1,
    "G":2,
    "T":3
}
invDict = ["A","C","G","T"]
illegalFours = []
for c in chars:
    illegalFours.append("AGC"+c)
    illegalFours.append(c+"AGC")
    illegalFours.append("ACG"+c)
    illegalFours.append(c+"ACG")
    illegalFours.append("GAC"+c)
    illegalFours.append(c+"GAC")
    illegalFours.append("AG"+c+"C")
    illegalFours.append("A"+c+"GC")
illegalFours = list(set(illegalFours))
# print(illegalFours,len(illegalFours))
def isLegal(value):
    f1,q = divmod(value,64)
    f2,q = divmod(q,16)
    f3,q = divmod(q,4)
    f4 = q
    # print(f1,f2,f3,f4)
    string = invDict[f1] + invDict[f2] + invDict[f3] + invDict[f4]
    return(string not in illegalFours)
valueIsLegal = [isLegal(i) for i in range(4**4)]
# print(sum(valueIsLegal))

def calcNextValue(value,x):
    return((value*4 + x)%256)
    
def solve(x):
    if x==3:
        return(61)
    dp = [[0 for _ in range(x+1)] for _ in range(256)]
    for value in range(256):
        if valueIsLegal[value]:
            dp[value][4] = 1
        else:
            dp[value][4] = 0
    for k in range(4,x):
        for v in range(256):
            for i in range(4):
                w = calcNextValue(v,i)
                if valueIsLegal[w]:
                    dp[w][k+1] += dp[v][k]
                    dp[w][k+1] %= MOD
    ans = 0
    for v in range(256):
        ans += dp[v][x]
        ans %= MOD
    return(ans)

N = int(input())
print(solve(N))

Measured memory_bytes: 3936
n, m = map(int, input().split())
L = []
for _ in range(m):
    a, b = map(int, input().split())
    L.append((a, b))
L = sorted(L, key=lambda x: x[1])
ans = 0
r = -float('inf')
for i in L:
    if i[0] >= r:
        ans += 1
        r = i[1]
print(ans)


Measured memory_bytes: 24652
(* O(n) (n = max {a, b}) *)
Scanf.scanf "%s %s" @@ fun a b ->
  let m = a ^ b |> int_of_string in
  let rec find i =
    if i * i = m then "Yes"
    else if i * i > m then "No"
    else find (i + 1) in
  find 1 |> print_endline

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

int main()
{int N;
 cin >> N;
 long int mod= 1e9+7;
long int  ans = 1;
 for(int i=2; i<=N; i++){
   ans *= (i);
   ans %= mod;
 }
 cout << ans << endl;}

Measured memory_bytes: 256
import sys

input = sys.stdin.readline


def main():
    S = input().rstrip()

    N = len(S)
    ans = float("inf")
    for i in range(0, N - 2):
        num = int(S[i:i + 3])
        if abs(753 - num) < ans:
            ans = abs(753 - num)

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007


int main() {

  int N;
  cin >> N;

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

  vector<int> ans(0);
  while(N > 0) {
    int num = 0;
    for(int i = 0;i < b.size();i++) {
      if(b.at(i) == i+1) num = i+1;
    }
    if(num == 0) {
      cout << -1 << endl;
      return 0;
    }
    ans.push_back(num);
    b.erase(b.begin()+num-1);
    N--;
  }

  for(int i = ans.size()-1;i >= 0;i--) {
    cout << ans.at(i) << endl;
  }

}



Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    Func cin2;
    void calc()
    {
        cin = new Scanner();
        cin2 = new Func();
        string s=cin.next();
        int n=s.Length;
        char a='a';
        bool[] x=new bool[26];
        for(int i=0;i<n;i++)
        {
          x[s[i]-a]=true;
        }
        for(int i=0;i<26;i++)
        {
          if(x[i]==false){Console.WriteLine((char)(a+i));return;}
        }
        Console.WriteLine("None");
        
    }
}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Answer
{
    public void Int2DArrayAns(int[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
    public void Char2DArrayAns(char[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
}

class Func
{
    public long GCDLong(long a, long b)
    {
        while(a!=0)
        {
          long t=a;
          a=b%a;
          b= t;
        }
      
        return b;        
    }
}


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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define int long long
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())
#define pqasc priority_queue<long long, vector<long long>, greater<long long>>

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ul = unsigned long;

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 GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { return a * b / GCD(a, b); }

const int dy[] = {0, 1, 0, -1, -1, 1, 1, -1};
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};

inline bool inside(int y, int x, int H, int W) {
    return (y >= 0 && x >= 0 && y < H && x < W);
}

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

// 素因数分解 O(√n)
map<int, int> prime_factor(int n)
{
  map<int, int> res;
  for (int i = 2; i * i <= n; i++)
  {
    while (n % i == 0)
    {
      ++res[i];
      n /= i;
    }
  }
  if (n != 1)
    res[n] = 1;
  return res;
}

long long rui(long long a, long long b){
  long long ans = 1;
  while (b > 0){
    if (b & 1)
      ans = ans * a % MOD;
    a = a * a % MOD;
    b /= 2;
  }
  return ans;
}

long long comb(long long a, long long b){
  long long ans = 1;
  for (long long i = a; i > a - b; i--){
    ans = ans * i % MOD;
  }
  for (long long i = 1; i <= b; i++){
    ans = (ans * rui(i, MOD - 2)) % MOD;
  }
  return ans;
}

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  int n,m; cin>>n>>m;
  
  auto primes=prime_factor(m);
  ll ans=1;
  for(auto p: primes){
    int cnt=p.second;
    ll tmp=comb(cnt+n-1, n-1);
    (ans*=tmp)%=MOD;
  }
  cout<<ans<<endl;
}


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


int main(){
	int n,m,l,s;
	cin>>n>>m;
	int numbers[n][m];
	int numbers2[m];
	for(int v=0;v<n;v++){
		for(int x=0;x<m;x++){
			cin>>l;
			numbers[v][x]=l;
		}
	}
	for(int y=0;y<m;y++){
		cin>>l;
		numbers2[y]=l;
	}

	for(int v2=0;v2<n;v2++){
		s=0;	
		for(int x2=0;x2<m;x2++){
			s+=numbers[v2][x2]*numbers2[x2];
		}
		cout<<s<<endl;
	}

}



Measured memory_bytes: 3108
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

typedef int Weight;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) { }
};

bool operator < (const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
    e.src != f.src ? e.src < f.src : e.dst < f.dst;
}

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

bool augment(const Graph& g, int u,
    vector<int>& matchTo, vector<bool>& visited) {
  if (u < 0) return true;
  FOR(e, g[u]) if (!visited[e->dst]) {
    visited[e->dst] = true;
    if (augment(g, matchTo[e->dst], matchTo, visited)) {
      matchTo[e->src] = e->dst;
      matchTo[e->dst] = e->src;
      return true;
    }
  }
  return false;
}
int bipartiteMatching(const Graph& g, int L) {
  const int n = g.size();
  vector<int> matchTo(n, -1);
  int match = 0;
  REP(u, L) {
    vector<bool> visited(n);
    if (augment(g, u, matchTo, visited)) ++match;
  }
  return match;
}

int minPathCover(const Graph &g) {
  int n = g.size();
  Graph g2(2*n);
  REP(i, n) {
    FOR(e, g[i]) {
      g2[e->src].push_back(Edge(e->src, e->dst+n, 1));
      g2[e->dst+n].push_back(Edge(e->dst+n, e->src, 1));
    }
  }
  return n-bipartiteMatching(g2, n);
}

int main() {
  int N;
  cin >> N;
  int X[N];
  REP(i, N) cin >> X[i];
  Graph g(N);
  REP(i, N) {
    REP(j, N) {
      if (i == j) continue;
      if (X[i] % X[j] == 0) g[i].push_back(Edge(i,j,1));
    }
  }
  int ans = minPathCover(g);
  bool table[N];
  memset(table,0,sizeof(table));
  int num = 0;
  REP(k, N) {
    vector<int> x;
    table[k] = 1;
    REP(i, N) {
      bool dame = 0;
      REP(j, N) {
        if (i == j) continue;
        if (table[j] && (X[i] % X[j] == 0 || X[j] % X[i] == 0)) dame = 1;
      }
      if (!dame) x.push_back(X[i]);
    }
    int n = x.size();
    Graph g(n);
    REP(i, n) {
      REP(j, n) {
        if (i == j) continue;
        if (x[i] % x[j] == 0) {
          g[i].push_back(Edge(i, j, 1));
        }
      }
    }
    // cout << k << " " << minPathCover(g) << " " << num << endl;
    if (ans == minPathCover(g)) {
      num++;
    } else {
      table[k] = 0;
    }
    if (num == ans) break;
  }
  bool f = 0;
  REP(i, N) {
    if (table[i]) {
      if (f) cout << " ";else f = 1;
      cout << i+1;
    }
  }
  cout << endl;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, K, ans = 1, L = 1, M;
  cin >> N >> K;
  M = K;
  while (1) {
    if (L <= N && N < M) {
      break;
    }
    L *= K;
    M *= K;
    ans++;
  }
  cout << ans << endl;
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/02/28  Problem: ABC 106 D / Link: http://abc106.contest.atcoder.jp/tasks/abc106_d  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */
template<typename type>
struct BIT { // 0-index
	int N;
	vector<type> data;
	BIT(int n) : N(n), data(n + 1, 0) {}
	void add(int i, type w) { // a[i] += w
		for (int x = i; x < N; x |= x + 1) {
			data[x] += w;
		}
	}
	type sum(int i) { // a[0] +...+ a[i-1] !!! [0,i)
		type ret = 0;
		for (int x = i - 1; x >= 0; x = (x&(x + 1)) - 1) {
			ret += data[x];
		}
		return ret;
	}
	type sum(int l, int r) { //a[l]+...+a[r-1] !!! [l,r)
		return sum(r) - sum(l);
	}
};


// 閉区間で入力を与える
vector<int>RangeInRangeCount(const vector<PII>& Range, const vector<PII>& Query, int Width) {
	Width++;
	int N = (int)Range.size();
	int Q = (int)Query.size();
	vector<vector<int>>ranges(Width);
	vector<vector<PII>>querys(Width);
	for (int i = 0; i < N; i++) {
		ranges[Range[i].second].push_back(Range[i].first);
	}
	for (int i = 0; i < Q; i++) {
		querys[Query[i].second].push_back(PII(Query[i].first, i));
	}

	BIT<int>bit(Width);
	vector<int>ans(Q);

	for (int R = 0; R < Width; R++) {
		for (int L : ranges[R]) {
			bit.add(L, 1);
		}
		for (PII L : querys[R]) {
			ans[L.second] = bit.sum(L.first, R + 1);
		}
	}

	return ans;
}

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

	int N, M, Q; cin >> N >> M >> Q;
	vector<PII> seg(M);
	for (int i = 0; i < M; ++i) {
		cin >> seg[i].first >> seg[i].second;
	}
	vector<PII> Qseg(Q);
	for (int i = 0; i < Q; ++i) {
		cin >>Qseg[i].first >> Qseg[i].second;
	}
	auto ans = RangeInRangeCount(seg, Qseg, N + 1);

	for (auto it : ans) {
		cout << it << endl;
	}



	return 0;
}


Measured memory_bytes: 5504
package main

import (
	"fmt"
)

func main() {
	var a, b, c, d int64
	fmt.Scan(&a, &b, &c, &d)
	arr := []int64{
		a * c,
		a * d,
		b * c,
		b * d,
	}
	ans := arr[0]
	for i := 1; i < len(arr); i++ {
		if ans < arr[i] {
			ans = arr[i]
		}
	}
	fmt.Println(ans)
}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl
#define PRINT(x) cout << x << endl
#define all(x) x.begin(),x.end()

int main() {
    int a,b;
    cin >> a >> b;

    int ans = a*b;
    if(a>9||b>9)ans = -1;
    cout << ans << endl;

}



Measured memory_bytes: 256