akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N,P,Q; cin>>N>>P>>Q;
  vector<vii> dp(N+1,vii(10*N+1,vi(10*N+1,INF)));
  dp[0][0][0]=0;
  rep(i,0,N){
    int A,B,C; cin>>A>>B>>C;
    REP(j,0,N*10){
      REP(k,0,N*10){
        if(dp[i][j][k]!=INF){
          dp[i+1][j][k]=min(dp[i][j][k],dp[i+1][j][k]);
          dp[i+1][j+A][k+B]=min(dp[i+1][j+A][k+B],dp[i][j][k]+C);
        }
      }
    }
  }
  int ans=INF;
  REP(i,1,min(10*N/P,10*N/Q)){
    if(dp[N][i*P][i*Q]!=INF) ans=min(ans,dp[N][i*P][i*Q]);
  }
  if(ans==INF) ans=-1;
  cout<<ans<<endl;
  }



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

const int N = 300 + 5;

int h, w, k, ans[N][N], tag[N];
string s[N];

void init() {
  cin >> h >> w >> k;
  for(int i = 0 ; i < h ; ++i) cin >> s[i];
}
void solve() {
  int cc = 1;
  for(int i = 0 ; i < h ; ++i) {
    int pre = -1;
    for(int j = 0 ; j < w ; ++j) {
      if(s[i][j] == '#') {
        if(pre == -1) pre = j;
        else cc++;
      }
      ans[i][j] = cc;
    }
    if(pre == -1) tag[i] = 1;
    else {
      for(int j = i - 1 ; j >= 0 ; --j) {
        if(tag[j]) memcpy(ans[j], ans[i], sizeof(ans[i])), tag[j] = 0;
        else break;
      }
      cc++;
    }
  }
  for(int i = 0 ; i < h ; ++i) if(tag[i]) {
    for(int j = i ; j < h ; ++j) memcpy(ans[j], ans[i - 1], sizeof(ans[i - 1]));
  }
  for(int i = 0 ; i < h ; ++i) {
    for(int j = 0 ; j < w ; ++j) {
      cout << ans[i][j] << " \n"[j == w - 1];
    }
  }
}

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  init();
  solve();
}


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

int main() {
	int a=0,b=0,y=0;
	cin >> a;
	cin >> b;
	if(a<0){
		exit(0);
	}
	if(b>23){
		exit(0);
	}
	
	y=a+b;
	if(y>24){
	y=y-24;
	}
	if(y==24){
	y=0;
	}
	cout << y;
	return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <bits/stdc++.h>
#include <vector>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define int         long long
#define ll          long long
#define ld	    long double
#define pb          push_back
#define pp	    pop_back()
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define mp          make_pair
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),a.rend()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define repj(j,a,b) for(ll j=a;j<b;j++)
#define lexistr(x,y)      lexicographical_compare(x.begin(),x.end(),y.begin(),y.end())
#define IOS	    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

typedef tree<ll,null_type,less<ll>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;

//CONSTANTS----------------------------------
#define PI 	    3.141592653589793238462643
const ll hell=1000000007;
const ll mod=1000000007;
//function-----------------------------------
ll GCD(ll a , ll b)
{
    if(b==0)
        return a;
    else
        return GCD(b,a%b);
}
ll LCM(ll a, ll b)
{
    return a*(b/GCD(a,b));
}
bool isPrime(ll n) {

    if (n <= 1) return false;
    if (n <= 3) return true;
    if (n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
    return true;
}
ll fact(ll n)
{
    ll f=1;
    for(ll i=2;i<=n;i++)
	f=f*i;
    return f;
}
ll power(ll a,ll b)
{
  if(b==0)return 1;
  if(b==1)return a;
  ll t=power(a,b/2);
  t%=hell;
  t*=t;
  t%=hell;
  if(b%2)return (t*a)%hell;
  else
     return t;
}
//CODE------------------------------------------
ll solve()
{
    ll n; string s,x=""; cin>>s; n=sz(s);
    for(ll i=0;i<n;i++)
    {
        if(s[i]=='B')
            if(!x.empty())
                x.pp;
        if(s[i]=='0')x+=s[i];
        if(s[i]=='1')x+=s[i];
    }
    cout<<x;
    return 0;
}
//MAIN------------------------------------------
signed main(){
    IOS
    #ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
    #endif
    int t=1;
    //cin>>t;
    while(t--) {
        solve();
        cout<<endl;
    }
    return 0;
}


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

using namespace std;

int main(){
    long long n;
    cin >> n;
    string result = "";
    int tmp = 0;
    while(n > 0){
        n -= 1;
        tmp = n % 26;
        result += char('a' + tmp);
        n = n / 26;
    }
    reverse(result.begin(), result.end());
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 3596
import sys


def main():
    input = sys.stdin.readline
    n, q = map(int, input().split())
    s = input()
    li = [map(int, input().split()) for i in range(q)]
    count = [0]*len(s)

    for i in range(1, len(s)):
        if s[i] == "C" and s[i-1] == "A":
            count[i] = count[i-1] + 1
        else:
            count[i] = count[i-1]
   
    for i, j in li:
        print(count[j-1] - count[i-1])


if __name__ == '__main__':
    main()


Measured memory_bytes: 79196
/*
*/

//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd

#define eps 1e-8
#define M_PI 3.141592653589793
#define bsize 512

#define ldouble long double
using namespace std;

#define bs 1000000007

const int N = 510031;

int n;
int ar[N];
map<int,int> cnt;
map<int,int>::iterator it;

int ans;

int main(){
//	freopen("apache.in","r",stdin);
//	freopen("apache.out","w",stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
//	cin.tie(0);

	cin>>n;
	for (int i=1;i<=n;i++){
		cin>>ar[i];
		cnt[ar[i]]++;
	}

	for (it=cnt.begin();it!=cnt.end();it++){
		int val=(*it).first;
		int am=(*it).second;
		int can=val;
		if (can>am)
			can=0;
		ans+=am-can;
	//cout<<am<<" "<<can<<endl;
	}
	cout<<ans<<endl;

	cin.get(); cin.get();
	return 0;
}


Measured memory_bytes: 5120
use std::io::Read;

fn main() {
    let mut buf = String::new();

    // 標準入力から全部bufに読み込む
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let s: String = iter.next().unwrap().parse().unwrap();

    let numbers: Vec<i32> = s.chars().map(|x| x.to_digit(10).unwrap() as i32).collect();
    let operands: Vec<i32> = numbers[1..].to_vec();
    let mut results: Vec<Vec<i32>> = Vec::new();

    for i in 0..8 {
        let mut row = numbers[1..].to_vec();
        for j in 0..i {
            if ((i >> j) & 1) == 1 {
                row[j] = -operands[j];
            }
        }
        results.push(row);
    }

    for result in results {
        if result.iter().fold(0, |acc, num| acc + num) + numbers[0] == 7 {
            let formula = result
                .iter()
                .map(|num| {
                    if *num < 0 {
                        num.to_string()
                    } else {
                        format!("{}{}", "+", num.to_string())
                    }
                })
                .collect::<Vec<String>>()
                .join("");
            println!("{}{}=7", numbers[0], formula);
            return;
        }
    }
}


Measured memory_bytes: 4352
#include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <deque>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;

const int MAX = 100001;
const int MOD = 1000000007;

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef pair< ll, int > pli;
typedef pair< int, ll > pil;

int ceil(int x, int y){
  return (x % y == 0) ? x / y : x / y + 1;
}

int gcd(int x, int y){
  return y ? gcd(y, x % y) : x;
}

int lcm(int x, int y){
  return x / gcd(x, y) * y;
}

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

  int a;
  string s;
  cin >> a;
  cin >> s;

  if(a >= 3200) cout << s << endl;
  else cout << "red" << endl;

  return 0;
}


Measured memory_bytes: 384
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]

s=input()
v=[]
for i in range(len(s)):
  if s[i]=="B":
    v.append(i)
a=0
n=0
for i in range(len(s)-len(v),len(s))[::-1]:
  n+=i-v[a]
  a+=1
print(n)

Measured memory_bytes: 53216
/*....
     
 "Be not afraid of GROWING slowly, be afraid only of STANDING Still"
                                                                     
....*/
#include<bits/stdc++.h>
#define Abhi_921 ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define ld long double
#define fi(i,j,n) for(int i=j;i<n;i++)
#define fd(i,j,n) for(int i=j;i>n;i--)
#define print(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define inp(a,n) for(int i=0;i<n;i++) cin>>a[i]
#define printe(v) for(auto &i:v){cout<<i<<' ';}cout<<endl;
#define deb(n1) cout<<n1<<endl;
#define pb push_back
#define eb emplace_back
#define vi vector<ll>
#define vll vector<pair<ll,ll>>
#define umap unordered_map<ll,ll>
using namespace std;
const long long mod=1e9+7;
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
Abhi_921;
int t;
t=1;
while(t--){
string s;
cin>>s;
int cnt=0,m=0;
int n=s.length();
vi v;
fi(i,0,n){
    if(s[i]=='R') cnt++;
    else v.pb(cnt),cnt=0;
}
v.pb(cnt);
cout<<*max_element(v.begin(),v.end())<<endl;
}
return 0;
}

Measured memory_bytes: 3660
// Binary Search
#include <stdio.h>

int binarySearch(int*, int, int);

int main(){
  int i, n, q, S[100000], T[50000], count=0;

  // 数列Tに含まれる整数の数と、その内容を入力
  scanf("%d", &n);
  for(i=0; i < n; i++){
    scanf("%d", &S[i]);
  }

  // 数列Sに含まれる整数の数と、その内容を入力
  scanf("%d", &q);
  for(i=0; i < q; i++){
    scanf("%d", &T[i]);
  }

  // 二分探索を実行
  for(i=0; i < q; i++){
    if(binarySearch(S, n, T[i]))count++;
  }

  // 結果の個数を表示
  printf("%d\n", count);

  return 0;
}

int binarySearch(int *A, int n, int key){
  int left=0, right=n, mid;
  while(left < right){
    mid = (left + right) / 2;
    if(key == A[mid]){ // 一致しているとき(見つかったとき)
      return 1;
    }
    else if(key < A[mid]){ // keyがA[mid]より小さいとき
      right = mid; // 探索範囲を前半半分にする
    }
    else{           // keyがA[mid]より大きいとき
      left = mid + 1; // 探索範囲を後半半分にする
    }
  }
  return 0;
}



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

int main(void){
    int s;
    cin >> s;
    int h, m;
    h = s / 3600;
    s %= 3600;
    m = s / 60;
    s %= 60;
    cout << h << ":" << m << ":" << s << endl;
    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()

const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const ll INF = 1<<30;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;

#define int long long
#define addm(X, Y) ((X) = ((X) + (Y) % mod) % mod)


int n;

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    int ans = 0;
    rep(i, n) {
        int l, r;
        cin >> l >> r;
        ans += (r + 1) - l;
    }
    cout << ans << endl;

}


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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

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

bool f(int a) {
	return a > 0 && a <= 12;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a, b;
	cin >> a;
	b = a % 100;
	a /= 100;
	if (f(a)&&f(b)) {
		cout << "AMBIGUOUS" << endl;
	}
	else if (f(a)) {
		cout << "MMYY" << endl;
	}
	else if (f(b)) {
		cout << "YYMM" << endl;

	}
	else {
		cout << "NA" << endl;
	}
}

Measured memory_bytes: 256
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
AB = [lr() for _ in range(N-1)] # 0-indexed
edges = [[] for _ in range(N+1)] # 1-indexed
for a, b in AB:
    edges[a].append(b)
    edges[b].append(a)

order = [] # 頂点１を根とした時、上からの頂点の順番
parent = [0] * (N+1) # 1-indexed
stack = [1]
while stack:
    x = stack.pop()
    order.append(x)
    for y in edges[x]:
        if parent[x] == y:
            continue
        parent[y] = x
        stack.append(y)

color = [-1] * (N+1) # 1-indexed 頂点iの親方向への辺の色
for o in order:
    ng = color[o]
    c = 1
    for z in edges[o]:
        if z == parent[o]:
            continue
        if c == ng:
            c += 1
        color[z] = c
        c += 1

answer = []
append = answer.append
for i in range(N-1):
    a, b = AB[i]
    if a == parent[b]:
        append(color[b])
    else:
        append(color[a])

print(max(answer))
print('\n'.join(map(str, answer)))
# 12

Measured memory_bytes: 44748
using System;
using static System.Console;
//using System.Linq;
using System.Collections.Generic;

namespace AC
{
   public class shiokara
   {
      static void Main(string[] args)
      {
          /*var n = ReadLine().Select(int.Parse).ToArray();
          int[] a = ReadLine().Split(' ').Select(int.Parse).ToArray();*/

          var n = int.Parse(ReadLine());
          string[] a = ReadLine().Split(' ');

          var hashset = new HashSet<string>();
          foreach(var berry in a)
          {
              if (hashset.Add(berry) == false)
              {
                  WriteLine("NO");
                  return;
                }     
            }
            WriteLine("YES");
      }
   }
}

Measured memory_bytes: 39760
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    int r, d, x, ans = 0;
    cin >> r >> d >> x;

    for (int i = 1;i <= 10; ++i) {
        ans = r * x - d;
        cout << ans << endl;
        x = ans;
    }
    return 0;
}


Measured memory_bytes: 256
N,M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(M)]



class UnionFind:
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0] * (n+1)
        self.root = [-1]*(n+1)
        self.cnt = 0

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def groupsize(self):
        self.cnt = 0
        for i,x in enumerate(self.par):
            if x == i:
                self.cnt += 1
        return self.cnt

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x==y:
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.root[x] += self.root[y]
            self.root[y] = self.root[x]
        else:
            self.par[y] = x
            self.root[x] += self.root[y]
            self.root[y] = self.root[x]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)
    
    def count(self, x):
        return -self.root[self.find(x)]

ans = [0] * M 
ans[M-1] = N*(N-1)//2
uf = UnionFind(N+1)

for i in reversed(range(1,M)):
    if not(uf.same_check(AB[i][0], AB[i][1])):
        ans[i-1] = ans[i] - (uf.count(AB[i][0]))*(uf.count(AB[i][1]))
    else:
        ans[i-1] = ans[i]
    uf.union(AB[i][0],AB[i][1])
    
for a in ans:
    print(a)
        
    
    
    
    

Measured memory_bytes: 38260
#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define LOCAL 1

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define dbg(...) cout<<#__VA_ARGS__ ": ["; for(auto e: __VA_ARGS__){cout<<e<<", ";} cout<<"]\n"
#define dbg1(...) cout<<#__VA_ARGS__ " "<< __VA_ARGS__ 
#else
#define dbg(...) 1;
#define dbg1(...) 1;
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
constexpr ll R=2669, INF=2e9+6969, mod = 1e9+7;

ll n,dp[R];

int main()
{
	scanf("%lld", &n);
	dp[0] = dp[1] = dp[2] = 0;
	dp[3] = dp[4] = dp[5] = 1;
	for(int i=4;i<=n;++i)
	{
		dp[i] = 1;
		for(int j=3;j<=i-3;++j) dp[i] = (dp[i] + dp[j]) % mod;
	}
	printf("%lld\n", dp[n]);
	return 0;
}


Measured memory_bytes: 3836
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define repi(i, a, b) for (int i = (a); i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ull << (b))

using namespace std;
using i32 = long long;
using u32 = unsigned long long;
using i64 = long long;
using u64 = unsigned long long;
using f64 = double;
using vi32 = vector<i32>;
using vu32 = vector<u32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf64 = vector<f64>;
using vstr = vector<string>;
using vvi32 = vector<vi32>;
using vvu32 = vector<vu32>;
using vvi64 = vector<vi64>;
using vvu64 = vector<vu64>;
using vvf64 = vector<vf64>;

template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }
template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  u64 a, b, c;
  cin >> a >> b >> c;
  if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0) {
    cout << 0 << endl;
    return 0;
  }
  if (a > b) swap(a, b);
  if (b > c) swap(b, c);
  if (a > b) swap(a, b);
  cout << a * b << endl;
  return 0;
}

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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int f(int s){
    if(s % 2 == 0) return s/2;
    else return s*3 + 1;
}

int main(void){
    int N; cin >> N;
    int H[N]; rep(i, N) cin >> H[i];
    //0(の連続)が途中に出るたびに水やり+1
    int ans = 0;
    while(true){
        bool cont = false;
        rep(i, N) if(H[i] > 0) cont = true;
        if(!cont) break;
        int idx = 0;
        int water = 1;
        int fin = N-1;
        while(H[idx] == 0) idx++;
        while(H[fin] == 0) fin--;
        for(; idx <= fin; idx++){
            if(H[idx] == 0){
                water++;
                while(H[idx] == 0){
                    idx++;
                }
                idx--;
            }
        }
        ans += water;
        rep(i, N) if(H[i] > 0) H[i]--;
        //rep(i, N) cout << H[i] << " "; cout << endl;
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  int N, M, k, a1, a2, b1, b2, c1, c2, d1, d2, e1, e2;
  cin >> N;
  cin >> M;
  if ( M % 2 == 1){
    cout << "No" << endl;
  }
  else {
    if ( M - 2 * N < 0){
      cout << "No" << endl;
    }
    else {
      if ( M - 4 * N > 0){
        cout << "No" << endl;
      }
      else {
        cout << "Yes" << endl;
      }
    }
  }
}

Measured memory_bytes: 3636
N = int(input())
S = input()

D = {}
for s in S :
    if s not in D :
        D[s] = 1
    else :
        D[s] += 1

ans = 1
for i in D.values() :
    ans *= (i+1)
ans -= 1
ans %= 10**9+7
print(ans)

Measured memory_bytes: 3188
import sys

INPUT = lambda: sys.stdin.readline().rstrip()

sys.setrecursionlimit(10 ** 9)


def main():
    S = INPUT()
    
    tmp = ""
    for s in S:
        tmp += str(1) if s in 'ACGT' else str(0)

    ans = 0
    for l in list(map(str, tmp.split("0"))):
        ans = len(l) if len(l) > ans else ans

    print(ans)


if __name__ == '__main__':
    main()

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

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int r, d, x;
  cin >> r >> d >> x;
  int before = x;
  for (int i = 1; i <= 10; i++) {
    cout << r*before - d << endl;
    before = r*before - d;
  }
}


Measured memory_bytes: 256
D,G = [int(s) for s in input().split()]
data = [[0 for i in range(3)] for j in range(D)]
s = []
for i in range(D):
    data[i][0] = (i+1)*100
    data[i][1],data[i][2] = [int(s) for s in input().split()]
data.reverse()

for i in range(1 << D):
    fl = False
    seq = 0
    sum = 0
    ##bitで1になるものを探索##
    for j in range(D):
        if ((i >> j) & 1) == 1:
            sum += data[j][0]*data[j][1] + data[j][2]
            seq += data[j][1]
    if sum < G:
        ##bitで0になるものを探索##
        for j in range(D):
            ##0になったらgreedyに解いていく##
            if ((i >> j) & 1) == 0:
                for k in range(data[j][1]):
                    if sum >= G:
                        fl = True
                        break
                    sum += data[j][0]
                    seq += 1
                if fl:break
    s.append(seq)
    
        
    
print(min(s))


Measured memory_bytes: 3064
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>

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


using namespace std;


int main() {
	
	char a, b;
	cin >> a >> b;
	if (a == b)cout << 'H' << endl;
	else cout << 'D' << endl;

	return 0;

}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc047/tasks/abc047_a
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<int> v(3);
    REP(i, 3) cin >> v[i];
    sort(ALL(v));
    if (v[0] + v[1] == v[2]) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }

    return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<string> w(n);
  rep(i, n) {
    cin >> w.at(i);
  }

  bool flag = true;
  rep(i, n) {
    rep(j, n) {
      if (i == j) continue;
      else
      {
        if (w.at(i) == w.at(j)) {
          flag = false;
        }
      }
    }
  }

  if (flag == true) {
    rep(i, n-1) {
      if (w.at(i).at(w.at(i).size()-1) != w.at(i+1).at(0)) {
        flag = false;
        break;
      } else {
        continue;
    }
  }
  }

  if (flag) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 2000000000
using namespace std;
typedef long long ll;
int read(){
    int f = 1, x = 0;
    char c = getchar();
    while(c < '0' || c > '9'){if(c == '-') f = -f; c = getchar();}
    while(c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar();
    return f * x; 
}
int n, m = 0, M = 998244353, inv = 499122177;
int cnt[1000005] = {0};
int prime[500005], mu[1000005], tot = 0;
bool vis[1000005] = {0};
int sum[1000005] = {0}, sub = 0;
void sieve(){
    mu[1] = 1;
    for (int i = 2; i <= m; ++i){
        if (!vis[i])
            prime[++tot] = i, mu[i] = -1;
        for (int j = 1; j <= tot; ++j){
            ll t = 1ll * i * prime[j]; 
            if (t > m) break;
            vis[t] = true;
            if (i % prime[j] == 0){
                mu[t] = 0;
                break;
            }else mu[t] = -mu[i];
        }
    }
}
void init(){
    n = read();
    for (int i = 0; i < n; ++i){
        int t = read();
        m = max(m, t), ++cnt[t];
        sub += t;
        if (sub >= M) sub -= M;
    }
    sieve();
    for (int i = 1; i <= m; ++i){
        for (int j = i; j <= m; j += i){
            sum[j] += i * mu[i];
            if (sum[j] < 0) sum[j] += M;
            else if (sum[j] >= M) sum[j] -= M;
        }
    }
}
void solve(){
    int ans = 0;
    for (int i = 1; i <= m; ++i){
        int cur = 0, lim = m / i;
        for (int j = 1; j <= lim; ++j){
            if (!cnt[i * j]) continue;
            cur += 1ll * cnt[i * j] * j % M;
            if (cur >= M) cur -= M;
        }
        cur = 1ll * cur * cur % M;
        cur = 1ll * cur * i % M;
        cur = 1ll * cur * sum[i] % M;
        ans += cur;
        if (ans >= M) ans -= M;
    }
    ans -= sub;
    if (ans < 0) ans += M;
    ans = 1ll * ans * inv % M;
    printf("%d\n", ans);
}
int main(){
    init();
    solve();
    return 0;
}

Measured memory_bytes: 14848
#include<bits/stdc++.h>
using namespace std;
struct edge 
{
	int v,nxt; 
}e[10010];
int n,t,u,v,s[5010],h[5010],g[5010],a[5010],f[5010][5010];
void add(int u,int v) 
{
	t++;
    e[t].v=v;
	e[t].nxt=h[u];
	h[u]=t;
}
inline void dfs(int u,int fa) 
{
    s[u]=f[u][1]=1;
    for(int i=h[u];i>0;i=e[i].nxt) 
	{
        int v=e[i].v;
		if(v==fa) continue;
        dfs(v,u);
        for(int j=1;j<=s[u]+s[v];j++) 
		{
			a[j]=0;
		}
        for(int j=1;j<=s[u];j++)
        {
            for(int k=0;k<=s[v];k++)
            {
                a[j+k]=(a[j+k]+1ll*f[u][j]*f[v][k])%1000000007;
            }
        }
        s[u]+=s[v];
        for(int j=1;j<=s[u];j++) f[u][j]=a[j];
    }
    for(int i=2;i<=s[u];i+=2)
    {
        f[u][0]=(f[u][0]-1ll*f[u][i]*g[i]%1000000007+1000000007)%1000000007;
    }
}
int main() 
{
   	cin>>n;
    for(int i=1;i<n;i++) 
	{
		scanf("%d%d",&u,&v);
        add(u,v);
		add(v,u);
    }
    g[0]=1;
    for(int i=2;i<=n;i+=2) 
	{
		g[i]=1ll*g[i-2]*(i-1)%1000000007;
	}
    dfs(1,0); 
    cout<<1000000007-f[1][0];
    return 0;
}

Measured memory_bytes: 58304
n = list(input())
n = int(n[-1])

if n == 2 or n == 4 or n== 5 or n == 7 or n==9:
    ans = 'hon'
elif n== 0 or n == 1 or n == 6 or n== 8:
    ans = 'pon'
else:
    ans = 'bon'

print(ans)

Measured memory_bytes: 9176
#pragma region RegionDefs
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include "boost/multi_array.hpp"
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,j,n) for(int i=(j),i##_len=(n);i<i##_len;++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define all(x) begin(x),end(x)
using namespace std;
const int INF = 1e9;
template<class T=int> using P  = pair<T, T>;
template<class T=int> using V  = vector<T>;
template<class T=int> using PQ = priority_queue<T>;
template<class T=int> using PQG = priority_queue<T, V<T>, greater<T>>;
typedef long long ll;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail)
{
    cin >> head;
    in(move(tail)...);
}
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)

//時間が厳しいとき使う
#define INI(...) int __VA_ARGS__; in(__VA_ARGS__)
#define INS(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
template<class T>bool chmax(T &a, const T &b) {if (a<b) {a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if (a>b) {a=b; return 1;} return 0;}
#define y0 y__0
#define y1 y__1
#define j0 j__0
#define j1 j__1
#pragma endregion RegionDefs

struct chars
{
    bool r = false;
    string f = "";
    chars* c = nullptr;
    string b = "";
    chars() {}
    chars(chars* c)
    {
        this->c = c;
    }
    string get(bool re)
    {
        if ((re && !r) || (!re && r))
        {
            reverse(all(b));
            return b + (c ? c->get(true) : "") + f;
        }
        else
        {
            reverse(all(f));
            return f + (c ? c->get(false) : "") + b;
        }
    }
};

chars n[200005];

void solve()
{
    string s; cin >> s;
    IN(q);
    n[0] = chars();
    n[0].b = s;
    rep(i, q)
    {
        IN(t);
        n[i+1] = chars(n+i);
        if (t == 1)
        {
            n[i+1].r = true;
        }
        else
        {
            IN(f); char k; cin >> k;
            if (f == 1) n[i+1].f += k;
            else
            {
                n[i+1].b += k;
            }
        }
    }
    cout << n[q].get(false) << endl;
}

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}

Measured memory_bytes: 37128
#include <bits/stdc++.h>
#include <cmath>
using namespace std; 
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define int long long int
#define rep(i,a,b) for(int i=a;i<b;i++)
#define reprev(i,a,b) for(int i=b-1;i>=a;i--)
#define all(c) c.begin(),c.end()
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mapp map<int,int>
#define pb push_back
#define mp  make_pair
#define mod 1000000007
#define mod2 998244353
#define tr(container, it) \
for(auto it = container.begin(); it != container.end(); it++)
 
bool comps(const pair<int,int> &a, const pair<int,int> &b) {return (a.second<b.second);} 
 
int power(int x, unsigned int y)
{ 
    int temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2); 
    if (y%2 == 0) 
        return temp*temp; 
    else
        return x*temp*temp; 
}
 
int binomialCoeff(int n, int k)
{  
    // Base Cases  
    if (k == 0 || k == n)  
        return 1;  
  
    // Recur  
    return binomialCoeff(n - 1, k - 1) +  
                binomialCoeff(n - 1, k);  
}
 
signed main(){
    IOS
    int n,m,sum=0;
    cin>>n>>m;
    sum=min(n%m,m-n%m);
    cout<<sum;
    return 0;
}

Measured memory_bytes: 256
N,T=map(int,input().split())
dict0 = {}
cost = 1001
for i in range(N) :
    ci,ti=map(int,input().split())
    dict0[ci]=ti
for c in dict0:
    t =dict0[c]
    if t <= T :
        if c <= cost :
            cost = c
if cost < 1001 : print(cost)
else : print("TLE")


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

int main(){
  int A,B;
  cin >> A >> B;
  if(B%A == 0){
    cout << A+B << endl;
  }else{
    cout << B-A << endl;
  }
  return 0;
}


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

using namespace std;

template <class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')
    cerr<<*sdbg++;
  cerr<<"="<<h<<","; 
  _dbg(sdbg+1, a...);
}

template<class T> ostream & operator<<(ostream & os, vector<T> V){
  os<<"[";
  for(auto vv: V) os << vv <<",";
  return os << "]";
}
template<class L, class R> ostream & operator <<(ostream & os, pair<L,R> P){
  return os <<"("<<P.first <<","<<P.second <<")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

long long ceil(long long a, long long k) {
    return (a + k - 1) / k;
}

int main() {
    long long h, w;
    scanf("%lld %lld", &h, &w);
    if (h == 1 || w == 1) {
        printf("1\n");
        return 0;
    }
    long long ans = ceil(w, 2) * ceil(h, 2) + (w / 2) * (h / 2);
    printf("%lld\n", ans);
    
    return 0;
}


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

int main() {
  int N, K;
  cin >> N >> K;
  int ans = 1;
  for (int i = 0; i < N; i++) {
    if (ans * 2 <= ans + K) {
      ans *= 2;
    } else {
      ans += K;
    }
  }
  cout << ans << endl;
}

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

int main()
{
  	int n,x;
  
 	cin >> n;
  
  	for(int i = 1;i <= n;i++){
      x = i;
      if(x % 3 == 0){
        cout << " " << i;
      }else{
        while(x){
          if(x % 10 == 3){
            cout << " " << i;
            break;
          }else{
        	x /= 10;
          }
        }
      }
    }
    cout << endl;
}


Measured memory_bytes: 3096
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1LL << 60;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)


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

	ll N, A, B;
	cin >> N >> A >> B;
	if (N < A + B - 1 || N > A*B) {
		puts(-1);
		return 0;
	}

	vector<int>temp(N);
	vector<int>ans;
	for (int i = 0; i < A; i++) {
		temp[i] = N - A + 1 + i;
		ans.pb(temp[i]);
	}
	for (int i = A; i < N; i++)temp[i] = N - i;


	int cur = N - A + 1;
	int idx = A;
	while (idx < N) {
		if (cur - (A - 1) > B) {
			for (int i = 0; i < A; i++)ans.pb(temp[idx+A-1-i]);
			cur -= A - 1;
			idx += A;
			continue;
		}
		for (int i = 0; i < cur - B; i++)ans.pb(temp[idx+cur-B-i]);
		ans.pb(temp[idx]);
		for (int i = idx + cur - B + 1; i < min(N,idx + A); i++)ans.pb(temp[i]);
		idx += A;
		break;
	}
	for (int i = idx; i < N; i++)ans.pb(temp[i]);
	for (int i = 0; i < N; i++)cout << ans[i] << " ";
	cout << endl;

	return 0;
}

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

public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split(" ");
			int ans = Integer.parseInt(chr[0]+chr[1]+chr[2]);
			System.out.println(ans%4==0?"YES":"NO");

		}
	}
}


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

using namespace std;

using ll = long long;
using ld = long double;
using D = double;
using uint = unsigned int;

#ifdef WIN32
    #define LLD "%I64d"
#else
    #define LLD "%lld"
#endif

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

const ll inf = 1e18;
const int maxn = 100005;

bool wasl[maxn], wasr[maxn];
ll cl[maxn], cr[maxn];
ll minx, maxx;
vector<pair<int, int>> grl[maxn], grr[maxn];
int n, m, k;
bool bad;

void gor(int cur, ll curc);
void gol(int cur, ll curc)
{
	if (wasl[cur])
	{
		if (cl[cur] != curc)
		{
			bad = true;
			return;
		}
		return;
	}
	wasl[cur] = true;
	cl[cur] = curc;
	minx = max(minx, -curc);
	for (auto t : grl[cur])
	{
		gor(t.fi, t.se - curc);
	}
}

void gor(int cur, ll curc)
{
	if (wasr[cur])
	{
		if (cr[cur] != curc)
		{
			bad = true;
			return;
		}
		return;
	}
	wasr[cur] = true;
	cr[cur] = curc;
	maxx = min(maxx, curc);
	for (auto t : grr[cur])
	{
		gol(t.fi, t.se - curc);
	}
}

int main()
{
	scanf("%d%d%d", &n, &m, &k);
	for (int i = 0; i < k; i++)
	{
		int x, y, sum;
		scanf("%d%d%d", &x, &y, &sum);
		x--, y--;
		grl[x].pb({y, sum});
		grr[y].pb({x, sum});
	}
	for (int i = 0; i < n; i++) if (!wasl[i])
	{
		minx = 0;
		maxx = inf;
		gol(i, 0);
		if (minx > maxx) bad = true;
	}
	if (!bad) printf("Yes\n");
	else printf("No\n");
    return 0;
}

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

int main() {
  int a , b ;
  cin >> a >> b ; 
  
  if(a >= b ){
    for(int i = 0 ; i < a ; i++){
      cout << b ;
    }
      cout << endl ; 
  }
  else {
        for(int i = 0 ; i < b ; i++){
      cout << a ;
    }
      cout << endl ; 
    
  }

  
  
  
  
}


Measured memory_bytes: 3516
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >> N;

    long long sum = 0;
    int max = -1000000;
    int min = 1000000;

    for(int i = 0; i < N; i++){
        int x;
        cin >> x;

        sum += x;

        if(max < x){
            max = x;
        }

        if(min > x){
            min = x;
        }

    }

    cout << min << " " << max << " " << sum << endl;
}


Measured memory_bytes: 3100
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;

int main(void) {
  int n;
  cin >> n;
  cout << (n + 1) / 2 << endl;

  return 0;
}

Measured memory_bytes: 3560
#include<iostream>
#include<stdio.h>

using namespace std;

int main(){
	int a[7],b[7],i;
	for(i=0;i<7;i++){
		std::cin>>a[i]>>b[i];
	}
	cout<< a[0]-b[0]<<endl;
	cout<< a[1]-b[1]<<endl;
	cout<< a[2]-b[2]<<endl;
	cout<< a[3]-b[3]<<endl;
	cout<< a[4]-b[4]<<endl;
	cout<< a[5]-b[5]<<endl;
	cout<< a[6]-b[6]<<endl;
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define pb push_back
#define int long long
#define mp make_pair
#define inf 1000000007
#define ll long long
using namespace std;
int field[1140][1140];
int yoko[1140];
int tate[1140];
void setfield(int h,int w,int a,int b,int yo,int ta){
	for(int i=0;i<h;i++){
		if(i<yo)yoko[i]=a;
		else yoko[i]=w-a;
	}
	for(int i=0;i<w;i++){
		if(i<ta)tate[i]=b;
		else tate[i]=h-b;
	}
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if( yoko[i] > 0 && tate[j]>0){
				field[i][j]=1;
				yoko[i]--;
				tate[j]--;
			}
		}
	}
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cout<<field[i][j];
		}
		cout<<endl;
	}
}
signed main(){
	int h,w,a,b;
	cin>>h>>w>>a>>b;
	for(int i=0;i<=h;i++){
		for(int j=0;j<=w;j++){
			int c1 = a*i+(w-a)*(h-i);
			int c2 = b*j+(h-b)*(w-j);
			if(c1 == c2){
				setfield(h,w,a,b,i,j);
				return 0;
			}
		}
	}
	cout<<"No"<<endl;
	return 0;
}

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

int main()
{
    string s;
    cin >> s;
    int a = (s[0] - '0')*10 + (s[1] - '0');
    int b = (s[2] - '0')*10 + (s[3] - '0');
    bool mmyy, yymm;
    mmyy = yymm = false;
    if(a >= 1 and a <= 12)
    {
        mmyy = true;
    }
    if(b >= 1 and b <= 12)
    {
        yymm = true;
    }
    if(yymm and mmyy)
    {
        cout<< "AMBIGUOUS";
    }
    else if(mmyy)
    {
        cout << "MMYY";
    }
    else if(yymm)
    {
        cout << "YYMM";
    }
    else
    {
        cout <<"NA";
    }
    
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define INT(str) stoi((str), 0)
#define INTB(str) stoi((str), 0, 2) // 2進数の文字列を int に
 
int main() {
  ll A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  cout << (abs(A - B) <= (V - W) * T ? "YES" : "NO") << endl;
}

Measured memory_bytes: 3632
*C, = map(int, open(0).read().split())

a1 = 0
a2 = C[3]-C[0]
a3 = C[6]-C[0]

b1 = C[0]
b2 = C[1]
b3 = C[2]

A = [a1, a2, a3]
B = [b1, b2, b3]


for i in range(3):
    for j in range(3):
        if C[i*3+j] != A[i]+B[j]:
            print('No')
            exit()

print('Yes')


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define lamsort(v,p) sort(v.begin(),v.end(),[](p a, p b){return a.num < b.num;});
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
const long long INF = 1LL<<60;
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; }
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお
int N;
//エラトステネスの篩
bool is_prime[ 10000 + 1 ];
vector<int> P;
void Eratosthenes( const int N )
{
    for( int i = 0; i <= N; i++ )
    {
        is_prime[ i ] = true;//初期化
    }    
    for( int i = 2; i <= N; i++ )
    {
        if( is_prime[ i ] )
        {
            for( int j = 2 * i; j <= N; j += i )
            {
                is_prime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> N;
    Eratosthenes(10000);
    vector<int> ans;
    for(int i = 0; i < 1000; i++) {
        if(P[i]%5==1) ans.push_back(P[i]);
    }
    rep(i,N) cout << ans[i] << endl;
    
    return 0;
}

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

int main( void ) {
    
    int a, b, c;
    cin >> a >> b >> c;
    
    for( int i = 0; i <= 1000000; i ++ ) {
        if( (a & 1) == 1 || (b & 1) == 1 || (c & 1) == 1 ) {
            cout << i;
            return 0;
        }
        
        int d = (b + c) >> 1, e = (c + a) >> 1, f = (a + b) >> 1;
        a = d; b = e; c = f;
    }
    
    cout << -1;
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>
#include <map>

using namespace std;
typedef long long ll;

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

int main() {

    ll N;
    cin >> N;
    ll sum = 0;
    ll mx = 0;
    rep(i,N){
        ll L;
        cin >> L;
        sum += L;
        if(L>mx) mx = L;
    }
    string out = "Yes";
    if(mx>=sum-mx) out = "No";
    cout << out << endl;
    return 0;
}


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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);  
	int n;
	cin >> n;
	int now[3] = {0, 0, 0};
	for(int i = 0; i < n; i++) {
		int next[3];
		cin >> next[0] >> next[1] >> next[2];
		int dist = 0;
		for(int j = 1; j < 3; j++) {
			dist += abs(now[j] - next[j]);
		}
		int tim = next[0] - now[0];
		if(tim % 2 != dist % 2 || dist > tim){
			cout << "No" << endl;
			return 0;
		}
		for(int j = 0; j < 3; j++) {
			now[j] = next[j];
		}
	}
	cout << "Yes" << endl;
	return 0;	
}


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

#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(v) reverse((v).begin(),(v).end())
#define ANS(ans) cout<<(ans)<<endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  for (int i = 0; i < (n); ++i)


int main() {
  int n;
  cin>>n;

  int ans;
  if(n%2==0){
    ans=n/2-1;
  }
  else{
    ans=ans=n/2;
  }

  ANS(ans);

}


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

int rev(int x){
    string s=to_string(x);
    reverse(s.begin(),s.end());
    return atoi(s.c_str());
}
 
int main() {
    string s;
    cin >>s;
    bool flag=1;
    int a=0,c=0,o=0;;
    
    if(s[0]!='A'){
        flag=0;
    }
    for(int i=2;i<s.size()-1;i++){
        if(s[i]=='C'){
            c++;
        //printf("%d\n",s[i]);
        }
    }
    if(c!=1){
        flag=0;
    }
    
    for(int i=0;i<s.size();i++){
        if(s[i]<=90 && s[i]>0){
            o++;
        }
    }
    if(o!=2){
        flag=0;
    }
    
    if(flag){
        cout << "AC" << endl;
    }else{
        cout << "WA" <<endl;
    }
}

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

//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;

void setfspattern_core(int floor,int number,int degree){
  if(floor==degree){
    fspattern.at(fspcnt) = fspattern_draft;
    fspcnt++;
  }else{
    rep(i,number){
      fspattern_draft.at(floor) = i;
      setfspattern_core(floor+1,number,degree);
    }
  }
}

void setfspattern(int number,int degree){
  int64_t array_num = 1;
  rep(i,degree){
    array_num *= number;
  }
  fspattern = vector<vector<int>>(array_num,vector<int>(degree));
  fspattern_draft = vector<int>(degree);
  setfspattern_core(0,number,degree);
}

//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);

/*void setmodfact(){
  for(int i=0;i<factnum;i++){
    if(i == 0){
      modfact.at(i) = 1;
    }else{
      modfact.at(i) = (modfact.at(i-1)*i)%univMod;
    }
  }
}

int64_t calcmodpower(int64_t a,int64_t n){
  int64_t res = 1;
  while(n != 0){
    if(n & 1){
      res = (res * a) % univMod;
    }
    a = (a*a) % univMod;
    n = n >> 1;
  }
  return res;
}

int64_t calcinverse(int64_t n){
	return calcmodpower(n,univMod-2);
}

void setmodinvfact(){
  for(int i=0;i<factnum;i++){
    if(i==0){
      modinvfact.at(i) = 1;
    }else{
      modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
    }
  }
}

int64_t calcmodcomb(int64_t n,int64_t r){
  return (((modfact.at(n)*modinvfact.at(r))%univMod)*modinvfact.at(n-r))%univMod;
}

int64_t calcmodpositive(int64_t n){
  return (n + ((abs(n)+univMod-1)/univMod)*univMod)%univMod;
}
  
    */


/*
int64_t calcGCD(int64_t a,int64_t b){
	int64_t p = a;
	int64_t q = b;
	int64_t c = a%b;
	while(c != 0){
		p = q;
		q = c;
		c = p%q;
	}
	return q;
}
*/

int main(){
  int64_t n,l;
  cin >> n >> l;
  vector<int64_t> a(n);
  rep(i,n){
    cin >> a[i];
  }
  bool okflag = false;
  int64_t okknot = -1;
  rep(i,n-1){
    if(a[i]+a[i+1] >= l){
      okflag = true;
      okknot = i;
      break;
    }
  }
  vector<int64_t> result;
  if(!okflag){
    cout << "Impossible" << endl;
  }else{
    cout << "Possible" << endl;
    result.push_back(okknot+1);
    int64_t c=1;
    while(okknot+c < n-1){
      result.push_back(okknot+c+1);
      c++;
    }
    c = -1;
    while(okknot+c >= 0){
      result.push_back(okknot+c+1);
      c--;
    }
    reverse(result.begin(),result.end());
    rep(i,n-1){
      cout << result[i] << endl;
    }
  }
  
}
    

Measured memory_bytes: 2548