akhauriyash/Code-Regression huggingface dataset:
#include<iostream>

using namespace std;

int main() {
	int N;
	cin >> N;
	bool flag = false;
	for (int i = 1; i < 10; i++) {
		if (N%i == 0) {
			for (int j = 1; j < 10; j++) {
				if (i*j == N) {
					flag = true;
					break;
				}
			}
			if (flag)break;
		}
	}
	if (flag)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

int main()
{
    int n,k,q,i,j;
    cin>>n>>k>>q;
    int a[q];
    for(i=0;i<q;i++)cin>>a[i];
    int memb[n];
    for(i=0;i<n;i++)memb[i]=k-q;
    
    for(i=0;i<q;i++)
    {
        memb[a[i]-1] += 1; 
    }

    for(i=0;i<n;i++)
    {
        if(memb[i]<=0)
        {
            cout<<"No"<<endl;
        }
        else
        {
            cout<<"Yes"<<endl;
        }
    }
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define f first
#define s second
using namespace std;

int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, k; vector<ll> vec; vec.pb(-1); cin >> n >> k;
    for(int i = 0; i < n; i++){
        ll t; cin >> t; vec.pb(t);
    }
    ll res = 1e15;
    for(int i = 1; i <= n-k+1; i++){
        ll l = vec[i], r = vec[i+k-1];
        if(l <= 0 && r >= 0){
            res  = min(res, (ll)min(abs(l), abs(r))*2 + (ll)max(abs(l), abs(r)) );
        }
        else if(l <= 0 && r <= 0){
            res = min(res, (ll)max(abs(l), abs(r)));
        }
        else{
            res = min(res , (ll)max(abs(l),abs(r)));
        }
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 4256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def main():
    s = S()
    c = collections.Counter(s)

    return c['+'] - c['-']



print(main())


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

using namespace std;
int main()
{
  int a,b,c;
  cin >> a >> b >> c;
  
  int res = b*c;
  if(a <= res)
    	cout << "Yes\n";
 else
   	cout << "No\n";
  return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n;
  cin>>n;
  vector<int> v(n), c(n);
  rep(i,n) cin>>v[i];
  rep(i,n) cin>>c[i];
  int ans = 0;
  rep(i,n) ans += max(v[i]-c[i], 0);
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <map>
#include <limits>
using namespace std;
typedef long long ll;

float inf = std::numeric_limits<float>::infinity();
ll mod = 1e9+7;

/* 二次元配列の宣言
  vector<vector<int>> tb;
  tb.resize(H);
  for (size_t i = 0; i < H; i++) {
    tb[i].resize(W);
  }
*/
/*
  A.resize(N);
  for (int i = 0; i < N; i++) {scanf("%d",&A[i]);}
*/

int max(int &a,int &b){if(a>b){return a;}else{return b;}}
int min(int &a,int &b){if(a>b){return b;}else{return a;}}

int ar_max(vector<int> &v){
  int max_val = v[0];
  for (size_t i = 1; i < v.size(); i++) {
    if (v[i]>max_val){max_val=v[i];}
  }
  return max_val;
}

int ar_min(vector<int> &v){
  int min_val = v[0];
  for (size_t i = 1; i < v.size(); i++) {
    if (v[i]<min_val){min_val=v[i];}
  }
  return min_val;
}


int main(void) {
  int A,B,C,D;
  cin >> A >> B >> C >> D; 
  cout << max(A*B,C*D) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1 LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main() {
    int K;cin >> K;
    vector<pll> pos(K);
    rep(i,K)cin >> pos[i].F >> pos[i].S;

    vector<int> per(8);
    rep(i,8)per[i] = i;
    do{
        vector<bool> tate(8);
        vector<bool> naname(15);
        vector<bool> gyaku(15);
        vector<vector<char>> ans(8,vector<char>(8,'.'));
        bool ok = true;
        rep(i,8){
            if(tate[per[i]]){
                ok = false;
                break;
            }
            tate[per[i]] = true;
            if(naname[i + per[i]]){
                ok = false;
                break;
            }
            naname[i + per[i]] = true;
            if(gyaku[i + (7 - per[i])]){
                ok = false;
                break;
            }
            gyaku[i + (7 - per[i])] = true;
            ans[i][per[i]] = 'Q';
        }

        rep(i,K){
            if(ans[pos[i].F][pos[i].S] != 'Q'){
                ok = false;
                break;
            }
        }

        if(ok){
            rep(i,8){
                rep(j,8){
                    cout << ans[i][j];
                }
                cout << endl;
            }
            break;
        }
    }while(next_permutation(all(per)));



}


Measured memory_bytes: 3116
#include <stdio.h>
#define MAX 100000

int A[MAX],n;

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

int main(){
  int i,q;

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

  q=partition(0,n-1);

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


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

int main(){
	int a[4],sum,i,j,k;
	char ch[2];
	string tmp,ans;

	ch[0]='+';
	ch[1]='-';
	cin>>tmp;
	for(int p=0;p<4;p++)
		a[p]=tmp[p]-'0';

	for(i=0;i!=2;i++){
		for(j=0;j!=2;j++){
			for(k=0;k!=2;k++){
				sum=a[0];
				if(i==0)sum+=a[1];
				else if(i==1)sum-=a[1];
				if(j==0)sum+=a[2];
				else if(j==1)sum-=a[2];
				if(k==0)sum+=a[3];
				else if(k==1)sum-=a[3];
				if(sum==7)break;
			}
			if(sum==7)break;
		}
		if(sum==7)break;
	}
	cout<<a[0]<<ch[i]<<a[1]<<ch[j]<<a[2]<<ch[k]<<a[3]<<"="<<sum;
}

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    S=ST()
    before = ""
    before_index = 0
    N=len(S)
    i=0
    ans=0
    while i < N:
        if before != S[before_index:i+1]:
            # print(S[before_index:i+1], before)
            ans+=1
            before=S[before_index:i+1]
            before_index=i+1
        i+=1
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 41328
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int 
#define pb push_back
#define mp make_pair
#define P pair
#define M 998244353
#define fr(i,n) for(int i=0;i<n;i++)
#define M2 1000000007
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define CASES  ll t;cin>>t;while(t--)
#define Take_n ll n; cin>>n;
using namespace std;

int main() 
{
	//your code
	int n,i,j;
	cin>>n;
	double dp[n+1][n+1],p[n+1],ans=0.0;
	for(i=1;i<=n;i++)
	cin>>p[i];
	memset(dp,0,sizeof(dp));
	dp[0][0]=1.0;
	for(i=1;i<=n;i++)
	{
		for(j=0;j<=i;j++)
		{
			if(j==0)
			dp[i][j]=dp[i-1][j]*(1-p[i]);
			else
			dp[i][j]=dp[i-1][j]*(1-p[i])+dp[i-1][j-1]*p[i];
		}
	}
	j=(n+1)/2;
	for(i=j;i<=n;i++)
	ans+=dp[n][i];
	cout<<setprecision(15)<<ans;
	return 0;
}

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

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

    if(b=="A") cout<<"T"<<endl;
    if(b=="C") cout<<"G"<<endl;
    if(b=="G") cout<<"C"<<endl;
    if(b=="T") cout<<"A"<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
#define INF (long long)(1LL << 60)

bool chmin(long long& a, long long b) {
    if( a > b ) {
        a = b;
        return true;
    }
    return false;
}

bool chmax(long long& a, long long b) {
    if( a < b ) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    // INPUT
    int N = 0;
    cin >> N;
    vector<long long> height(N);
    for(int i = 0; i < N; i++) {
        cin >> height[i];
    }
    vector<long long> cost(N, INF);
    cost[0] = 0;
    chmin(cost[1], abs(height[1] - height[0]));

    // SOURCE
    for( int i = 2; i < N; i++ ) {
        chmin(cost[i], cost[i-1] + abs(height[i]-height[i-1]));
        chmin(cost[i], cost[i-2] + abs(height[i]-height[i-2]));
    }

    // OUTPUT
    cout << cost[N-1] << endl;

    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
using namespace std;
   
int main() {
int H, W;
string s;
while (cin >> H >> W && H!=0 && W != 0) {
for(int j = 0; j < W; j++) {
s = s + "#";
}
for(int i = 0; i < H; i++) {
cout << s << endl;
}
cout << endl;
s = "";
} 
}


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

int main() {
	long long int H,ans=0;
	cin >> H;
	int k=0;
	long long int V[50]={1};
	while(H>1){
		H = H/2;
		k++;
		V[k] = V[k-1]*2;
	}
	for(int i=0;i<=k;i++){
		ans = ans+V[i];
	}

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


Measured memory_bytes: 256
import numpy as np
n=int(input())
a = [int(i) for i in input().split()]
ala = sum(a)
tmp = 0
ans = np.array([9999999999]*n)

for i in range(n-1):
 tmp += a[i]
 ala = ala - a[i]
 ans[i] = abs(tmp-ala)
print (min(ans))


Measured memory_bytes: 32968
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long x, y;
  cin >> x >> y;
  if(x%y == 0){
    cout << -1 << endl;
    return 0;
  }
  long long ans = x;
  while(ans%y == 0){
    ans += x;
  }
  cout << ans << 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;

int main() {
	string s; cin >> s;
	stack<char>st;
	for (char c : s) {
		if (c == 'S')st.push(c);
		else {
			if (st.size() && st.top() == 'S')st.pop();
			else st.push(c);
		}
	}
	printf("%d\n", st.size());
}

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

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define ll long long
#define pii pair<int, int>
#define is insert
#define er erase

using namespace std;

int solve();

#define TASK ""

int main()
{
    #ifdef DEBUG
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #else
        //freopen(TASK".in", "r", stdin);
        //freopen(TASK".out", "w", stdout);
    #endif // DEBUG
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    solve();
    return 0;
}

int n;

multiset<ll> s;

int ans = 0;

int solve()
{
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        ll x;
        cin >> x;
        s.is(x);
    }
    while (!s.empty())
    {
        ll v = *s.rbegin();
        s.er(s.find(v));
        for (ll i = 31; i >= 0; --i)
        {
            ll val = (1ll << i) - v;
            if (s.find(val) != s.end())
            {
                //cerr << v << ' ' << val << endl;
                ans++;
                s.er(s.find(val));
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 10236
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var N = Sarray()[0];
            var S = ReadLine();
            var cnt = 0L;
            for (var i = 1; i < N; ++i)
            {
                var p = S.Substring(0, i).Distinct();
                var a = S.Substring(i).Distinct();
                var num = 0;
                foreach (var c in p)
                    if (a.Contains(c)) ++num;
                cnt = Max(cnt, num);
            }
            WriteLine(cnt);
        }


        static long Mod = 998244353;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

Measured memory_bytes: 29812
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;}
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll N;
        cin >> N;
        vll A(N);
        vll AA(N);
        rep(i, 0, N) cin >> A[i];

        rep(i, 1, N+1) AA[i-1] = A[i-1] - i;
        sort(all(AA));
        ll b;
        if (odd(len(AA))) {
                b = AA[N/2];
        } else {
                b = (AA[N/2-1] + AA[N/2]) / 2;
        }

        ll ans = 0;
        rep(i, 1, N+1) {
                ans += abs(A[i-1] - (b + i));
        }
        cout << ans << endl;
}


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

int cake = 4, doughnut = 7;

bool can_buy(int price, int doughnut_num) {  
  if (doughnut_num < 0)
    return false;  
  else if (price % cake == 0)
    return true;
  else
    return can_buy(price + doughnut, doughnut_num - 1);
}

int main(int argc, char** argv){
  int n;  
  
  while(cin >> n) {
    if (can_buy(n % doughnut, n / doughnut))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        String N = sc.next();
				char[] Nparts = new char[N.length()];
				for(int i=0;i<N.length();i++){
						Nparts[i]= N.charAt(i);
				}

				int sum=0;

				for(int i=0;i<N.length();i++){
						sum+=Character.getNumericValue(Nparts[i]);
				}

				int Nint = Integer.parseInt(N);

				if(Nint%sum==0){
						System.out.println("Yes");
				}else{
						System.out.println("No");
				}
    }
}

Measured memory_bytes: 23764
# AOJ 0505: Questionnaire
# Python3 2018.6.29 bal4u

while True:
	n, m = map(int, input().split())
	if n == 0: break
	s = [0]*m
	for i in range(n):
		a = list(map(int, input().split()))
		s = [s[i]+a[i] for i in range(m)]
	ans = []
	for i in range(m): ans.append((s[i], i+1))
	ans.sort(key=lambda x:(-x[0],x[1]))
	print(*[ans[i][1] for i in range(m)])


Measured memory_bytes: 5632
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>

using namespace std;

#define INF 1e+9
#define mp make_pair
#define pb push_back
#define fi first
#define fs first
#define se second
#define i64 long long
#define li long long
#define lint long long
#define pii pair<int, int>
#define vi vector<int>

#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define fore(i, b, e) for (int i = (int)b; i <= (int)e; i++)

const int maxn = 1005;
const i64 inf = 1e18;
int x_sign, y_sign, z_sign;

struct Trio {
    i64 x, y, z;
    i64 eval() {
        if (x == -inf)
            return -inf;
        return x * x_sign + y * y_sign + z * z_sign;
    }
    i64 abs() {
        return llabs(x) + llabs(y) + llabs(z);
    }
};
Trio dp[maxn][maxn];

inline void upd(Trio& t, const Trio& fr, i64 deltax, i64 deltay, i64 deltaz) {
    Trio tmp = fr;
    tmp.x += deltax;
    tmp.y += deltay;
    tmp.z += deltaz;
    if (tmp.eval() > t.eval())
        t = tmp;
}

int main() {
#ifdef LOCAL
    freopen("inp", "r", stdin);
    //freopen("outp", "w", stdout);
#else
    // freopen(TASKNAME ".in", "r", stdin);
    // freopen(TASKNAME ".out", "w", stdout);
#endif
    int n, m;
    scanf("%d%d", &n, &m);
    vector<i64> x(n), y(n), z(n);
    forn(i, n)
        cin >> x[i] >> y[i] >> z[i];
    i64 ans = 0;
    for (x_sign = -1; x_sign <= 1; x_sign += 2) {
        for (y_sign = -1; y_sign <= 1; y_sign += 2) {
            for (z_sign = -1; z_sign <= 1; z_sign += 2) {
                fore(i, 0, n)
                    fore(j, 0, i)
                        dp[i][j] = {-inf, -inf, -inf};
                dp[0][0] = {0, 0, 0};
                forn(i, n)
                    fore(j, 0, i) {
                        if (dp[i][j].x == -inf)
                            continue;
                        upd(dp[i + 1][j + 1], dp[i][j], x[i], y[i], z[i]);
                        upd(dp[i + 1][j], dp[i][j], 0, 0, 0);
                    }
                i64 nnew = dp[n][m].abs();
                ans = max(ans, nnew);
            }
        }
    }
    cout << ans;

}



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

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

using namespace std;

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

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector<pii> edge(3);

	rep(i, 3){
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		edge[i].first = a;
		edge[i].second = b;
	}

	vector<int> v(4);
	rep(i, 4) v[i] = i;

	do{
		bool used[3] = {};

		// 1つの経路のループ
		bool aok;
		rep(i, 3){
			aok = false;
			int a = v[i];
			int b = v[i+1];
			bool ok = false;
			rep(j, 3){
				if(!used[j]){
					if((a == edge[j].first && b == edge[j].second) || (b == edge[j].first && a == edge[j].second)){
						used[j] = true;
						ok = true;
						break;
					}
				}
			}
			if(!ok) break;
			aok = true;
		}
		if(aok){
			cout << "YES" << endl;
			return 0;
		}else{
			continue;
		}
	}while(next_permutation(v.begin(), v.end()));

	cout << "NO" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define INF 1000000000
using namespace std;
int main(void){
    int n;
    cin>>n;
    int res=n;
    for(int i=0;i<=n;i++){
        int cc=0;
        int t=i;
        while(t>0)cc+=t%6,t/=6;
        t=n-i;
        while(t>0)cc+=t%9,t/=9;
        if(res>cc){
            res=cc;
        }
    }
    cout<<res<<endl;
}

Measured memory_bytes: 256
#include <cstdio>
int x[105], y[105], h[105];
bool vis[105][105];
inline int abs(int x) {
	return x >= 0 ? x : -x;
}
inline int max(int a, int b) {
	return a > b ? a : b;	
}
int main() {
	int n, S;
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) scanf("%d%d%d", x + i, y + i, h + i), S = h[i] ? i : S, vis[x[i]][y[i]] = true;
	for(int cx = 0; cx <= 100; ++cx) {
		for(int cy = 0; cy <= 100; ++cy) {
			if(true) {
				int H = h[S] + abs(cx - x[S]) + abs(cy - y[S]);
				bool valid = true;
				for(int i = 1; i <= n; ++i) {
					if(max(H - abs(cx - x[i]) - abs(cy - y[i]), 0) != h[i]) valid = false;
				}
				if(valid) return printf("%d %d %d", cx, cy, H), 0;
			}
		}
	}
}

Measured memory_bytes: 128
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

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

void solve() {
  int n;
  ll ret = 1;
  cin >> n;
  while(n--) {
    ll t;
    cin >> t;
    ll g = __gcd(ret, t);
    t /= g;
    ret *= t;
  }
  cout << ret << "\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
  solve();
}


Measured memory_bytes: 384
n, l = map(int, input().split())
apple_ls = []
result = 0
for i in range(n):
    apple_ls.append(l + i)
if apple_ls[0] > 0:
    for i in apple_ls:
        result = result + i
    result = result - apple_ls[0]
    print(result)
elif apple_ls[n-1] < 0:
    for i in apple_ls:
        result = result + i
    result = result - apple_ls[n-1]
    print(result)
else:
    for i in apple_ls:
        result = result + i
    print(result)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define rep(i,a,b) for(uint32 i = (a); i < (b); ++i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define ALL(x) (x).begin(),(x).end()
#define C(x) std::cout << #x << " : " << x << std::endl
#define scanf scanf_s

using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;

template<typename T>
class hashmap64 {
	std::vector<std::pair<uint64, T>> map;
	uint64 mask, count, temp;
	uint64 hash64(uint64 key) {
		key = ~key;
		key ^= key << 13;
		key ^= key >> 19;
		return key ^ (key << 17);
	}
public:
	hashmap64() :map(8192, std::make_pair(~static_cast<std::uint_fast64_t>(0), T())) {
		mask = 8191; count = 0;
	}
	hashmap64(size_t s) {
		s |= s << 1;
		s |= s >> 2;
		s |= s >> 4;
		s |= s >> 8;
		s |= s >> 16;
		s |= s >> 32;
		mask = s;
		count = 0;
		map.resize(s + 1, std::make_pair(~static_cast<std::uint_fast64_t>(0), T()));
	}
	T &operator[](uint64 suf) {
		temp = mask&hash64(suf);
		while (map[temp].first != suf) {
			temp = mask&(temp + 1);
		}
		return map[temp].second;
	}
	void insert(uint64 key, const T &value) {
		temp = mask&hash64(key);
		while (~map[temp].first) {
			if (map[temp].first == key) {
				map[temp].second = value;
				return;
			}
			temp = mask&(temp + 1);
		}
		map[temp] = std::make_pair(key, value);
		++count;
		if ((count << 1) > mask) {
			std::pair<uint64, T> mkey;
			mask = mask << 1 | 1;
			map.resize(mask + 1, std::make_pair(~static_cast<std::uint_fast64_t>(0), T()));
			for (uint64 t = 0;t <= mask >> 1;++t) {
				if (!~map[t].first) {
					mkey = map[t];
					map[t].first = ~0;
					temp = mask&hash64(mkey.first);
					while (~map[temp].first) {
						temp = mask&(temp + 1);
					}
					map[temp] = mkey;
				}
			}
		}
		return;
	}
	bool find(uint64 key) {
		temp = mask&hash64(key);
		while (~map[temp].first) {
			if (map[temp].first == key) {
				return true;
			}
			temp = mask&(temp + 1);
		}
		return false;
	}
	bool empty(void) {
		return !count;
	}
	size_t size(void) {
		return count;
	}
};

int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	hashmap64<uint32> map(100000);
	uint32 n;
	std::cin >> n;
	int64 a, sum = 1e15;
	uint32 ans = 0;
	map.insert(sum, 0);
	rep(i, 0, n) {
		std::cin >> a;
		sum += a;
		if (map.find(sum)) {
			ans = std::max(ans, i + 1 - map[sum]);
		}
		else {
			map.insert(sum, i + 1);
		}
	}
	std::cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 15012
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
    
    string s;
    cin >> s;
    
    int n = (int)s.size();
    int t = (int)s.size();
    int num = 0;
    for (int i = 0; i < n - 1; ++i)
    {
        if (s[i] != s[i + 1])
        {
            num = max(i + 1, n - i - 1);
            t = min(t, num);
        }
    }
    
    cout << t << endl;
    
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
using namespace std;
int main(){
    int N;
    cin>>N;

    int num;
    int cnt_max=0;
    int ans=1;

    for(int i=1;i<=N;i++){
        int cnt=0;
        num=i;
        while(num%2==0){
            num=num/2;
            cnt++;
        }
        if(cnt_max<cnt){
            ans=i;
            cnt_max=cnt;
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    string s;
    cin >> s;
    int ans = 700;
    rep(i, s.size()) if (s[i] == 'o') ans += 100;
    cout << ans << endl;
}


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

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		//int n = 2;
		Point[] p = Koch(n);
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < p.length; ++i){
			sb.append(p[i] + "\n");
		}
		System.out.println(sb);
	}
	public static Point[] Koch(int n) {
		Point[] p, p2;
		if(n == 0){
			p = new Point[2];
			p[0] = new Point(0.0f, 0.0f);
			p[1] = new Point(100.0f, 0.0f);
			return p;
		}else{
			p = Koch(n-1);
			p2 = new Point[(p.length - 1)*4 + 1];
			for(int i = 0; i < p.length; ++i) {
				// left edge
				p2[i*4] = new Point(p[i].x, p[i].y);
				if(i == p.length - 1){
					break;
				}
				// 3 middle points
				float mx = (p[i+1].x - p[i].x);
				float my = (p[i+1].y - p[i].y);
				
				p2[i*4 + 1] =  new Point(mx / 3.0f + p[i].x, my / 3.0f + p[i].y);
				p2[i*4 + 2] =  new Point(mx / 2.0f - my / (2.0f * (float)Math.sqrt(3.0)) + p[i].x,
						my / 2.0f + mx / (2.0f * (float)Math.sqrt(3.0)) + p[i].y);
				p2[i*4 + 3] =  new Point(mx * 2.0f / 3.0f + p[i].x, my * 2.0f / 3.0f + p[i].y);
			}
			return p2;
		}
	}
	
}
class Point{
	public float x;
	public float y;
	@Override
	public String toString(){
		return String.format("%.5f %.5f", x, y);
	}
	public Point(float x, float y){
		this.x = x;
		this.y = y;
	}
}

Measured memory_bytes: 42332
#include<iostream>
#include<math.h>
using namespace std;

int main(){
	int n;
	cin >> n;
	int min_a = 0;
	int second_min_a=0;
	int* a = new int[n];
	cin >> a[0];
	cin >> a[1];
	min_a = min(a[0], a[1]);
	second_min_a = max(a[0], a[1]);

	for(int i=2;i<n;i++){
		cin >> a[i];
		if(a[i] < second_min_a){
			if(a[i] < min_a){
				second_min_a = min_a;
				min_a = a[i];
			}else{
				second_min_a = a[i];
			}
		}
	}
	int life=2;
	int max_cand=0;
	bool accepted;
	for(int i = (int)sqrt(second_min_a); i>=1; i--){
		if(second_min_a%i != 0) continue;
		life=2;
		accepted = false;
		for(int k = 0; k<n;k++){
			if(a[k] % i != 0) life--;
			if(life==0) break;
			if(k == n-1) accepted=true;
		}
		if(accepted & (i>max_cand)) max_cand=i;
		life=2;
		accepted = false;
		int j = second_min_a/i;
		for(int k = 0; k<n;k++){
			if(a[k] % j != 0) life--;
			if(life==0) break;
			if(k == n-1) accepted=true;
		}
		if(accepted & (j>max_cand)) max_cand=j;
	}

	for(int i = (int)sqrt(min_a); i>=1; i--){
		if(min_a%i != 0) continue;
		life=2;
		accepted = false;
		for(int k = 0; k<n;k++){
			if(a[k] % i != 0) life--;
			if(life==0) break;
			if(k == n-1) accepted=true;
		}
		if(accepted & (i>max_cand)) max_cand=i;
		life=2;
		accepted = false;
		int j = min_a/i;
		for(int k = 0; k<n;k++){
			if(a[k] % j != 0) life--;
			if(life==0) break;
			if(k == n-1) accepted=true;
		}
		if(accepted & (j>max_cand)) max_cand=j;
	}

	cout << max_cand << endl;  
}



Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>/*toupperとかが入っている*/
#include<vector>/*可変長配列vectorのインクルード*/

const int MOD=1000000007;/* 1,000,000,007 で割った余りを出力する　のとき使う*/
using namespace std;/*標準名前空間を利用する。cinやcoutはこれによって利用可能になる*/

int N;
long long int A[100005];
long long int B[100005];

int main(void) {
  cin >> N;
  
  for(int i=0; i<N+1; i++){
    cin >> A[i];
  }
  for(int i=0; i<N; i++){
    cin >> B[i];
  }
  
  long long int M=A[0];
  long long int ans=0;
  
  for(int i=0; i<N; i++){
    if(B[i]>=M){
      ans=ans+M;
      B[i]=B[i]-M;
    }
    else{
      ans=ans+B[i];
      B[i]=0;
    }
    
    if(B[i]>=A[i+1]){
      ans=ans+A[i+1];
      M=0;
    }
    else{
      ans=ans+B[i];
      M=A[i+1]-B[i];
    }
  }
  
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1792
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect

n=int(input())
v=tuple(tuple(map(lambda x: int(x)-1,input().split())) for _ in range(n-1))
c=list(map(int,input().split()))
c.sort(reverse=True)
node=[[] for _ in range(n)]
d=deque()
d.append(0)
seen=[0]*n
seen[0]=1
ans=[0]*n
for pair in v:
    node[pair[0]].append(pair[1])
    node[pair[1]].append(pair[0])

s=0
while d:
    i=d.pop()
    ans[i]=c[s]
    s+=1
    for j in node[i]:
        if seen[j]==0:
            d.append(j)
            seen[j]=1
print(sum(ans)-c[0])
print(*ans)

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

int main() {
  string s; cin >> s;
  string ans = "";
  rep(i, s.size()) {
    if (i % 2 == 0) {
      ans += s[i];
    }
  }
  cout << ans << endl;
}

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

using namespace std;
typedef long long ll;
typedef long int li;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
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; }
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL<<60;

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

int main(){

  ll n,a,b;cin>>n>>a>>b;
  string s;cin>>s;

  ll count=0;ll bcount=1;
  rep(i,0,n){
    bool e=false;
    if(s[i]=='a'&&count<a+b){out("Yes");e=true;}
    else if(s[i]=='b'&&count<a+b&&bcount<=b){
      out("Yes");
      e=true;
      bcount++;
    }
    else out("No");
    // else if(s[i]=='c')
    if(e)count++;
  }


  return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
int n,a[201],b[201],c[201];
int main()
{
	scanf("%d",&n);
	int sum=0;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)
		scanf("%d",&b[i]),sum+=b[i];
	for(int i=1;i<n;i++)
		scanf("%d",&c[i]);
	for(int i=1;i<n;i++)
	if(a[i]+1==a[i+1])
		sum+=c[a[i]];
	printf("%d\n",sum);
	return 0;
}

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

int main(void){
  string s1, s2; cin >> s1 >> s2;
  if(s1.at(0) == s2.at(2) && s1.at(1) == s2.at(1) && s1.at(2) == s2.at(0)) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


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

using namespace std;

using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FORE(i, a, b) for(int i=(a);i<=(b);++i)
#define rep(i, n) for(int i=0;i<(n);++i)
#define repe(i, n) for(int i=0;i<=(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define SP cout<<fixed<<setprecision(10)
typedef pair<int, int> P;
const int INF = (int) 1e9;
const int MOD = (int) 1e9 + 7;

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int d;
	cin >> d;
	
	if (d == 22) cout << "Christmas Eve Eve Eve" << endl;
	if (d == 23) cout << "Christmas Eve Eve" << endl;
	if (d == 24) cout << "Christmas Eve" << endl;
	if (d == 25) cout << "Christmas" << endl;
	
	return 0;
}

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

using namespace std;

int main(){
  long long n, a[100009], q;
  map<long long, long long> mp;
  cin >> n;
  long long sm=0;
  for(int i=0;i<n;i++){
    cin >> a[i];
    mp[a[i]]++;
    sm += a[i];
  }
  cin >> q;
  for(int i=0;i<q;i++){
    int b, c;
    cin >> b >> c;
    long long cnt=mp[b];
    mp[b]=0;
    mp[c]+=cnt;
    long long diff = cnt*(c-b);
    sm += diff;
    cout << sm << endl;
  }
}



Measured memory_bytes: 10164
$n, $m = gets.split(' ').map(&:to_i)
$cnt = 0
$edges = []
$m.times do 
  $edges << gets.split(' ').map(&:to_i).sort
end	
$nodes = $edges.flatten.uniq.sort

def find_edges(node, edges)
  edges.select{|e| e[0] == node} + edges.select{|e| e[1] == node}.map{|e| [e[1], e[0]]}
end

def traverse(start_node, visited_nodes, used_edges, previous_edge)
  used_edges << previous_edge.sort unless previous_edge.nil?
  if visited_nodes.include? start_node
    return
  end
  visited_nodes << start_node
  if visited_nodes.length == $n
    $cnt += 1
    return
  end
  if used_edges == $m
    return
  end
  find_edges(start_node, $edges - used_edges).each do |next_edge|
    traverse(next_edge[1], visited_nodes.dup, used_edges.dup, next_edge)
  end
end

traverse(1, [], [], nil)

print "#{$cnt}\n"



Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
#define inf 999999999
#define loop(i, a, b) for (int i = (a), i##len = (b); i < i##len; ++i)
#define rep(i, n) loop(i, 0, n)
#define lin long long

string s;
int w;

int main(void)
{
    cin >> s >> w;
    for(int i = 0; i < s.length(); i += w)
    {
        cout << s[i];
    }
    cout << endl;

    return 0;
}


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

int main()
{
  string str = "";
  cin >> str;
  int N = str.length();
  string tmpstrA = "";
  string tmpstrB = "";
  int a = 0;
  int b = (N + 3) / 2;

  while (true)
  {
    if ((N - 1) / 2 < a || b > N)
    {
      break;
    }
    tmpstrA += str[a];
    tmpstrB += str[b-1];
    a++;
    b++;
  }

  if (tmpstrA == tmpstrB)
  {
    cout << "Yes";
  }
  else
  {
    cout << "No";
  }
  return 0;
}

Measured memory_bytes: 256
def counting_sort(A, k):
    n = len(A)
    B = ['0' for i in range(n + 1)]
    C = [0 for i in range(0, k + 1)]

    # C[i]???i???????????°????¨??????????
    for j in range(0, n):
        C[A[j]] += 1

    # C[i]???i??\????????°???????????°????¨??????????
    for i in range(0, k):
        C[i + 1] +=  C[i]

    for j in reversed(range(0, n)):
        B[C[A[j]]] = str(A[j])
        C[A[j]] -= 1
    return ' '.join(B[1:])

n = int(input())
A = list(map(int, input().split()))
k = max(A)
print(counting_sort(A, k))

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

#define fi first
#define se second
#define pb push_back
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define FOR(i, a, b) for (int i = a; i <= (b); i++)
#define ROF(i, a, b) for (int i = a; i >= (b); i--)

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

int main() {
    int x; cin >> x;
    FOR(i, -118, 119) FOR(j, -119, 118) {
        ll a = i, b = j;
        if (a*a*a*a*a - b*b*b*b*b == x)
            return cout << a << ' ' << b << endl, 0;
    }
}

Measured memory_bytes: 3632
#B
S = input()
T = input()
def counter(A,B):
    tmp = 0
    for j in range(len(A)):
        if A[j]==B[j]:
            tmp += 1
    return tmp
result = 0
if S == T:
    result = len(T)
else:
    for i in range(len(S)-len(T)+1):
        if counter(S[i:i+len(T)],T) > result:
            result = counter(S[i:i+len(T)],T)
print(len(T)-result)

Measured memory_bytes: 9132
import sys

readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

from math import gcd
from collections import defaultdict


n = readint()

mod = 1000000007

d = defaultdict(int)

for i in range(n):
    a,b = readints()
    g = gcd(a,b)
    if g!=0:
        a//=g
        b//=g
    if a<0:
        a*=-1
        b*=-1
    elif a==0 and b<0:
        b*=-1
    d[(a,b)]+=1

ans = 1
k = tuple(d.keys())
ans2 = 0
for x in k:
    if x[0]>0:
        if x[1]>0:
            ans *= pow(2,d[x],mod)+pow(2,d[(x[1],-x[0])],mod)-1
        elif x[1]<0:
            if d[(-x[1],x[0])]==0:
                ans *= pow(2, d[x], mod)
        else:
            ans *= pow(2,d[x],mod)+pow(2,d[(x[1],x[0])],mod)-1
    else:
        if x[1]==0:
            ans2 += d[x]
        else:
            if d[(x[1], x[0])] == 0:
                ans *= pow(2, d[x], mod)
    ans %= mod

print((ans+ans2+mod-1)%mod)






Measured memory_bytes: 172560
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;
int main() {
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	printf("%d\n",max(max(a*10+b+c,b*10+a+c),c*10+a+b));
} 

Measured memory_bytes: 256
a,b,c = map(int,input().split())

if ((a == 5) and (b == 5) and (c == 7)):
    print("YES")
elif ((a == 5) and (b == 7) and (c == 5)):
    print("YES")
elif ((a == 7) and (b == 5) and (c == 5)):
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3060
#include<stdio.h>
 
int main()
{
	int n;
	int a, b;
	scanf("%d", &n);
	a = n / 100;
	b = n % 10;
	if(a == b){
		printf("Yes\n");
	}else {
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 128
S = list(input())
pre = S[0]
ans = 0
for i in range(1,len(S)):
  if pre == S[i]:
    if S[i] == "0":
      S[i] =  "1"
    else:
      S[i] = "0"
    ans += 1
  pre = S[i]
print(ans)

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

using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

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

  if (k == 1) cout << 0 << endl;
  else cout << n - k << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>

int main()
{
        int A, B, C;
        std::cin >> A >> B >> C;

        if (B >= C - 1) {
                std::cout << (B+C) << "\n";
        } else if (A + B >= C - 1) {
                std::cout << (B+C) << "\n";
        } else {
                // 解毒剤が足りないケース
                std::cout << (B+A+B+1) << "\n";
        }
}

Measured memory_bytes: 256
using System;

class Program
{
    static void Main()
    {
        new Program().Solve();
    }

    long MOD = 1000000007L;

    void Solve()
    {
        long[] nmk = ReadLongArray();
        var n = nmk[0];
        var m = nmk[1];
        var k = nmk[2];

        var xy = 0L;

        for (var d = 1; d < n; d++)
        {
            xy += (n - d) * m % MOD * m % MOD * d % MOD;
            xy %= MOD;
        }

        for (var d = 1; d < m; d++)
        {
            xy += (m - d) * n % MOD * n % MOD * d % MOD;
            xy %= MOD;
        }

        Console.WriteLine(xy * Combination(n * m - 2, k - 2) % MOD);
    }

    /// <summary>
    /// 組合せ nCr = n! / r! / (n-r)!
    /// [フェルマーの小定理を使用] n! * r!^(m-2) * (n-r)!^(m-2)
    /// </summary>
    long Combination(long n, long r)
    {
        var p = new long[n + 1];
        p[0] = 1;
        p[1] = 1;
        for (var i = 2; i <= n; i++)
        {
            p[i] = i * p[i - 1] % MOD;
        }
        return p[n] * Power(p[r], MOD - 2) % MOD * Power(p[n - r], MOD - 2) % MOD;
    }

    /// <summary>
    /// べき乗 [バイナリ法/繰返し二乗法を使用]
    /// </summary>
    long Power(long a, long n)
    {
        var x = 1L;
        while (n > 0)
        {
            if ((n & 1) != 0) x = x * a % MOD;
            n >>= 1;
            a = a * a % MOD;
        }
        return x;
    }

    #region Console.Read 関係
    long[] ReadLongArray() => Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
    long ReadLong() => long.Parse(Console.ReadLine());
    #endregion
}


Measured memory_bytes: 12512
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	N %= 10
	if N == 2 || N == 4 || N == 5 || N == 7 || N == 9 {
		fmt.Println("hon")
	} else if N == 3 {
		fmt.Println("bon")
	} else {
		fmt.Println("pon")
	}
}


Measured memory_bytes: 1752
#ifndef LOCAL
#pragma GCC optimize ("O3")
#endif
#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define mor > muu & operator << (
#define R22(r) sim > typename \
  enable_if<1 r sizeof dud<c>(0), muu&>::type operator<<(c g) {
sim > struct rge { c b, e; };
sim > rge<c> range(c h, c n) { return {h, n}; }
sim > auto dud(c* r) -> decltype(cerr << *r);
sim > char dud(...);
struct muu {
#ifdef LOCAL
stringstream a;
~muu() { cerr << a.str() << endl; }
R22(<) a << boolalpha << g; ris; }
R22(==) ris << range(begin(g), end(g)); }
sim, class b mor pair < b, c > r) { ris << "(" << r.first << ", " << r.second << ")"; }
sim mor rge<c> u) {
  a << "[";
  for (c i = u.b; i != u.e; ++i)
    *this << ", " + 2 * (i == u.b) << *i;
  ris << "]";
}
#else
sim mor const c&) { ris; }
#endif
muu & operator()() { ris; }
};
#define imie(r...) "[" #r ": " << (r) << "] "
#define imask(r...) "[" #r ": " << bitset<8 * sizeof(r)>(r) << "] "
#define arr(a, i) "[" #a imie(i) ": " << a[i] << "] "
#define arr2(a, i, j) "[" #a imie(i) imie(j) ": " << a[i][j] << "] "
#define debug (muu() << __FUNCTION__ << "#" << __LINE__ << ": ")

const int N = 1e5 + 7;
int h[N];
int dp[N];
int n, K;

int main() {
    dp[0] = 1e9 + 7;
    scanf("%d %d", &n, &K);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &h[i]);
        dp[i] = 1e9 + 7;
        for (int j = 1; j <= K; ++j) if (i - j > 0) dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]));
        if (i == 1) dp[i] = 0;
    }
    printf("%d\n", dp[n]);
    return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>
int n, a[100], tmp, minj,c=0;

void print(){
    for(int i=0 ; i<n ; i++)
        if(i==n-1)    printf("%d\n", a[i]);
        else            printf("%d ", a[i]);
}
int select_sort(){
    for(int i=0 ; i<n-1 ; i++){
        minj=i;
        for(int j=i ; j<n ; j++)
            if(a[j]<a[minj]) minj=j;
        tmp=a[i], a[i]=a[minj] , a[minj]=tmp;
        if(i!=minj) c++;
    }
    return c;
}
int main(void){
    scanf("%d", &n);
    for(int i=0 ; i<n ; i++)
        scanf("%d",&a[i]);
    c=select_sort();
    print();
    printf("%d\n", c);
    return 0;
}


Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
int main()
{
  string S;
  cin >> S;
  int ans = 0;
  int N = S.size();
  for (int i = 0; i < N; i++)
  {
    if (S.at(i) != S.at(N - 1 - i))
    {
      ans++;
    }
  }
  cout << ans/2 << endl;
}

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

#define  BeatMeScanf    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define  tc(x)          int x; cin >> x; while(x--)
#define  ll             long long
#define  vi             vector<int>
#define  pii            pair<int,int>
#define  mii            map<int,int>
#define  inf            1<<28
#define  mem(x,y)       memset(x, y, sizeof(x))
#define  ps(x,y)        fixed<<setprecision(y)<<x
#define  show(val)      cout<< #val << " -> " << val << endl
#define  Case           cout<< "Case "<< ++cs << ": "
#define  all(v)         (v).begin(), (v).end()
#define  rall(v)        (v).rbegin(), (v).rend()
#define  mod            1000000007
#define MAX             1000


int main()
{
    BeatMeScanf;

    int n;
    cin >> n;
    bool flag = 0;

    while (n)
    {
        int x = n%10;
        if(x == 7)
        {
            flag = 1;
            break;
        }
        n /= 10;
    }

    if(flag == 1) cout<< "Yes" <<'\n';
    else cout<< "No" <<'\n';

    return 0;
}



Measured memory_bytes: 3652