akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define PI 2 * acos(0.0)
#define MAX 1000000
#define INF 1000000 
#define M 1000000007
using namespace std;
/*
bool isPowerOfTwo(ll x){
    return (x && !(x & (x - 1)));
}
// counts no. of 1 in binary representation
ll count_one (ll n){
    ll count = 0;
    while( n ){
        n = n&(n-1);
        count++;
    }
    return count;
}
// checks ith bit is set 
bool is_bit_set(ll n ,ll i){
    if( n & (1<<i) ){
        return true;
    }
    else{
        return false;
    }
}
// generating subset using bit technique ; n -> no. of elements
void subset(char a[], ll n){
   for(ll i = 0;i < (1<<n);i++){
         for(ll j = 0;j<n;j++){
             if(i & (1 << j)){
                 cout<<a[j]<<" ";
             }
         }
         cout<<endl;
   }
}
// Properties  of Modular:
//  1. (a+b)%c = (a%c + b%c)%c
//  2. (a*b)%c = (a%c * b%c)%c
//  3. (a-b)%c = (a%c - b%c)%c
//  4. (a/b)%c = ((a%c) * ( inverse(b)%c ))%c

ll binaryExponentiation(ll x,ll n)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=result * x;
        x=x*x;
        n=n/2;
    }
    return result;
}
ll modularExponentiation(ll x,ll n,ll m)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x)%m;
        x=(x*x)% m;
        n=n/2;
    }
    return result;
}
ll gcd(ll a,ll b){
    if(b == 0) return a;
    else{
        return gcd(b,a%b);
    }
}
ll d, x, y;
void extendedEuclid(ll A, ll B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        extendedEuclid(B, A%B);
        ll temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}
// when a and m are co prime
ll modInverse(ll A, ll m){
    extendedEuclid(A,m);
    return (x%m+m)%m;   
}
ll countDivisors(ll n) 
{ 
    int cnt = 0; 
    for (int i = 1; i <= sqrt(n); i++) { 
        if (n % i == 0) { 
            if (n / i == i) 
                cnt++; 
            else 
                cnt = cnt + 2; 
        } 
    }
    return cnt; 
} 
*/
int main(){
    FAST
    ll n;
    cin>>n;
    ll a[n];
    for(ll i = 0;i<n;i++){
        cin>>a[i];
    }
    ll ans = 0;
    sort(a,a+n);
    for(ll i = 0;i<n;i++){
        for(ll j = i+1;j<n;j++){
            if(a[j] != a[i]){
                for(ll k = j+1;k<n;k++){
                    if(a[j]+a[i] > a[k] && a[k] != a[j] && a[k] != a[i]){
                        ans++;
                    }
                }
            }
        }
    }
    cout<<ans<<endl;
   return 0;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#include <algorithm>
#include<string>
using namespace std;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (B <= C) {
        cout << 0 << endl;
    } else if (A <= C && C <= B && B <= D) {
        cout << (B - C) << endl;
    } else if (C <= A && B <= D) {
        cout << (B - A) << endl;
    } else if (C <= A && A <= D && D <= B) {
        cout << (D - A) << endl;
    } else if (A <= C && D <= B) {
        cout << (D- C) << endl;
    } else if (D <= A) {
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
    long long n, p;
    cin >> n >> p;

    long long ans = 1;
    for (int i = 2; 1ll * i * i <= p; i++){
        if (p % i == 0) {
            int c = 0;
            while (p % i == 0) {
                c++;
                p /= i;
            }

            for (int j = 0; j < c / n; j++) {
                ans *= i;
            }
        }
    }

    if (n == 1) {
        ans *= p;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
def main():
    N = int( input())
    U = []
    V = []
    for _ in range(N):
        x, y = map( int, input().split())
        u, v = x+y, x-y
        U.append(u)
        V.append(v)
    U.sort()
    V.sort()
    print( max(U[-1]-U[0], V[-1]-V[0]))
if __name__ == '__main__':
    main()


Measured memory_bytes: 25788
#include <bits/stdc++.h>
    
#define int long long
    
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define FORR(i,m,n) for(int i=m;i>=n;i--)
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y) 
#define SORT(x) sort((x).begin(),(x).end())
#define INF 99999999999
#define MOD (int)(1e9)+7
    
using namespace std;
    
int dy[4]={1, 0, -1, 0};
int dx[4]={0, 1, 0, -1};
    
bool check(int a, int b){
    if((a<=0 && b>0) || (a>=0 && b<0)) return true;
    return false;
}
    
int32_t main(){
    int n;
    cin >> n;

    int ans=(n/11)*2;
    if(!(n%11)){
        cout << ans << endl;
    }
    else if(n%11<=6){
        cout << ans+1 << endl;
    }
    else if(n%11>6){
        cout << ans+2 << endl;
    }
}

Measured memory_bytes: 256
S = input()
ans = ["AKIHABARA",                                                                  
        "KIHABARA","AKIHBARA","AKIHABRA","AKIHABAR",                      
        "KIHBARA","KIHABRA","KIHABAR",
        "AKIHBRA","AKIHBAR","AKIHABR",
        "KIHBRA","KIHBAR","KIHABR","AKIHBR",
        "KIHBR"]

for a in ans:
    if S==a:
        print("YES")
        break
else:
    print("NO")


Measured memory_bytes: 38256
n=int(input())
s=[]
t=[]
flag=0
ans=0
for i in range(n):
    ss,tt=map(str,input().split())
    s.append(ss)
    t.append(int(tt))
x=input()

for i in range(n):
    if s[i]==x:
        flag=1
        continue
    if flag == 1:
        ans+=t[i]
print(ans)

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(void){
    
    
   int e,y;
   cin>>e>>y;
   
   if(e==0&&y<=1911){
       cout<<"M"<<y-1867<<endl;
   }
   else if(e==0&&y<=1925){
       cout<<"T"<<y-1911<<endl;
   }
   else if(e==0&&y<=1988){
       cout<<"S"<<y-1925<<endl;
   }
   else if(e==0&&y<=2016){
       cout<<"H"<<y-1988<<endl;
   }
   
   if(e==1){
       cout<<1867+y<<endl;
   }
    else if(e==2){
        cout<<1911+y<<endl;
    }
    else if(e==3){
        cout<<1925+y<<endl;
    }
    else if(e==4){
        cout<<1988+y<<endl;
    }
    
    
}



Measured memory_bytes: 3100
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;


int main(){
  int n;
  cin >> n;
  cout << n*n*n << endl;

  return 0;
}








// EOF

Measured memory_bytes: 3076
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if ( a <= c && c <= b ) cout << "Yes" << endl;
    else                    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include"iostream"
using namespace std;

int main() {
	int r;
	cin >> r;
	if (r < 1200)
	{
		cout << "ABC" << endl;
	}
	else if (r < 2800)
	{
		cout << "ARC" << endl;
	}
	else
	{
		cout << "AGC" << endl;
	}
}


Measured memory_bytes: 256
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''

import heapq


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        # self.pqueue.append(x)
        heapq.heappush(self.pqueue, -x)

    def extractMax(self):
        # return self.pqueue.pop(self.pqueue.index(max(self.pqueue)))
        return -heapq.heappop(self.pqueue)


if __name__ == '__main__':

    pqueue = PQueue()
    result = []

    while True:
        line = input()
        if line == 'end':
            break

        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            result.append(pqueue.extractMax())

    for i in range(len(result)):
        print(result[i])

Measured memory_bytes: 67220
N,K=map(int,input().split())
A=list(map(int,input().split()))

dp=[[-1]*2 for i in range(51)]
dp[50][0]=0

for i in reversed(range(50)):
    mask=1<<i
    bit1=0
    bit0=0
    for a in A:
        if a&mask:
            bit1+=1
        else:
            bit0+=1
    p1=bit0*mask
    p0=bit1*mask
    if dp[i+1][1]!=-1:
        dp[i][1]=dp[i+1][1]+max(p1,p0)
    if K&mask:
        dp[i][0]=dp[i+1][0]+p1
        dp[i][1]=max(dp[i][1],dp[i+1][0]+p0)
    else:
        dp[i][0]=dp[i+1][0]+p0
print(max(dp[0]))

Measured memory_bytes: 86584
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
using namespace std;
using ll=long long;

int main(){
	int h,w;
	char ch[55][55];
	bool f;

	cin>>h>>w;
	for(int i=0;i<h;i++)
			cin>>ch[i];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			f=false;
			if(ch[i][j]=='.')f=true;
			else if(ch[i][j]=='#'){
				if(ch[i-1][j]=='#'||ch[i+1][j]=='#'||ch[i][j-1]=='#'||ch[i][j+1]=='#')
					f=true;
			}
			if(!f){
				cout<<"No";
				return 0;
			}
		}
	}
	cout<<"Yes";
}

Measured memory_bytes: 256
//2018年  3月 22日 木曜日 17:06:36 JST
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 200010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 29;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int N, M;
ll dist[MAX_N];
bool used[MAX_N];

vector<pi> G[MAX_N];

bool loop(int v) {
	used[v] = true;
	rep(i, 0, sz(G[v])) {
		int n = G[v][i].fst, c = G[v][i].sec;
		if(dist[n] == -linf) {
			dist[n] = dist[v] + c;
		}
		else {
			if(dist[n] != dist[v] + c) {
				return false;
			}
		}
		if(!used[n]) {
			if(!loop(n)) return false;
		}
	}
	return true;
}

void solve() {
	cin >> N >> M;
	rep(i, 0, M) {
		int a, b, c;
		cin >> a >> b >> c; a--; b--;
		G[a].pb(pi(b, c));
		G[b].pb(pi(a, -c));
	}
	fill(dist, dist + N, -linf);
	rep(i, 0, N) {
		if(used[i]) continue;
		dist[i] = 0;
		if(!loop(i)) {
			cout<< "No\n";
			return;
		}
	}
	cout << "Yes\n";
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
	srand((unsigned int)time(NULL));
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



Measured memory_bytes: 15360
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,a[15],sum;
int main(){
    ios::sync_with_stdio(false);
    cin >> n;
    for(int i=0;i<n;i++){
    	cin >> a[i];
    	sum+=a[i];
	}
	sort(a,a+n,greater<int>());
	sum-=a[0];
	if(sum>a[0])cout << "Yes";
	else cout << "No";
    return 0;
}

Measured memory_bytes: 256
K = int(input())

def make(i):
    if int(i) > 3234566667:  return
    lun.append(int(i))
    if i[-1] == "0":
        temp = i + "0"
        make(temp)
        temp = i + "1"
        make(temp)
    elif i[-1] == "9":
        temp = i + "8"
        make(temp)
        temp = i + "9"
        make(temp) 
    else:
        temp = i + str(int(i[-1]) - 1)
        make(temp)
        temp = i + i[-1]
        make(temp)   
        temp = i + str(int(i[-1]) + 1)
        make(temp)
        
lun = []
for i in range(1, 10):
    make(str(i))
lun = sorted(lun)
ans = lun[K - 1]
print(ans)

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

int main() {
  int n;
  string s;
  cin >> n >> s;
  int c = 0;
  for (int i = 0; i < n - 2; i++) {
    if (s.at(i) == 'A' && s.at(i + 1) == 'B' && s.at(i + 2) == 'C') {
      c++;
    }
  }
  cout << c << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{
    private const int INF = 1000000007;
    public static void Main()
    {
        int[] inp = IntLine();
        int N = inp[0], W = inp[1];
        long[] w = new long[N];
        long[] v = new long[N];
        for (int i = 0; i < N; i++)
        {
            long[] box = LongLine();
            w[i] = box[0];
            v[i] = box[1];
        }
        long[,] dp = new long[110, 100010];
        for (int i = 0; i <= W; i++) dp[0, i] = 0;
        for (int i = 0; i < N; i++)
        {
            for (int j = 0; j <= W; j++)
            {
                if (j >= w[i]) dp[i + 1, j] = Math.Max(dp[i, j - w[i]] + v[i], dp[i, j]);
                else dp[i + 1, j] = dp[i, j];
            }
        }
        Console.WriteLine(dp[N, W]);
    }
}



public class Atcoder
{
    public static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static int GCD(int a, int b)
    {
        if (a < b) Swap(ref a, ref b);
        int d = a % b;
        while (b != 0)
        {
            d = a % b;
            a = b;
            b = d;
        }
        return a;
    }
    public static long LCM(int a, int b)
    {
        return (long)a * b / GCD(a, b);
    }
    public static string StrReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static int IntRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static long[] LSRead()
    {
        return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    }
    public static long Combination(int n, int r)
    {
        if (n == r) return 1;
        return
            Enumerable.Range((n - r + 1), r).ToList().Aggregate((now, next) => now * next) /
            Enumerable.Range(1, r).ToList().Aggregate((now, next) => now * next);
    }
    public static long Permutation(int n, int r)
    {
        if (n == r) return 1;
        return
            Enumerable.Range((n - r), r).ToList().Aggregate((now, next) => now * next);
    }
    public static long LongRead()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] LongLine()
    {
        return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    }
    public static int[] IntLine()
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }
}


Measured memory_bytes: 94944
//{{{
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printw) FUNC(printwe) FUNC(printb) FUNC(printbe) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    a--; b--; c--; d--;
    string s; cin >> s;
    bool ok = true;
    for(int i = b; i < d; i++){
        if(s[i] == '#' && s[i + 1] == '#'){
            ok = false;
            break;
        }
    }
    for(int i = a; i < c; i++){
        if(s[i] == '#' && s[i + 1] == '#'){
            ok = false;
            break;
        }
    }
    if(!ok){
        cout << "No" << '\n';
        return 0;
    }
    if(c > d){
        ok = false;
        for(int i = b - 1; i < d; i++){
            if(s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.'){
                ok = true;
                break;
            }
        }
        if(!ok){
            cout << "No" << '\n';
            return 0;
        }
    }
    cout << "Yes" << '\n';
}


Measured memory_bytes: 888
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define MOD (ll)1000000007 //10^9 + 7
#define endl printf("\n")
typedef long long ll;
#define MAX_N (1 << 17)

bool
check(int n, int *d, int k)
{
  while (n > 0) {
    int x = n % 10;
    for (int i = 0; i < k; i++) {
      if (d[i] == x) return false;
    }
    n /= 10;
  }
  return true;
}

int
main(int argc, char *argv[])
{
  int n, k, d[10];
  scanf("%d %d", &n, &k);
  for (int i = 0; i < k; i++) scanf("%d", &d[i]);

  while(!check(n, d, k)) n++;

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

  return 0;
}


Measured memory_bytes: 128
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)
#pragma GCC optimize("unroll-loops")
// -------------------</optimizations>--------------------
 
#include <bits/stdc++.h>
 
using namespace std;
 
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define f first
#define s second
#define sz(x) ll(x.size())
#define endl '\n'
#define forn(i,n) for(int i=0;i<n;++i)
#define fore(i,l,r) for(int i=int(l);i<=int(r);++i)
#define rep(i,begin,end) for(__typeof(end) i=(begin);i!=(end);i++)
#define fill(a,value) memset(a,value,sizeof(a));
#define gcd(a,b) __gcd((a),(b))
#define watch1(x) cout << (x) << endl
#define watch2(x,y) cout << (x) << " " << (y) << endl
#define watch3(x,y,z) cout << (x) << " " << (y) << " " << (z) << endl
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
 
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
 
const ll mod = 998244353;
const int inf = 1e9 + 5;
const int N = 4e5 + 5;

signed main(){
    fastio;
    int i,q,rev=0;
    deque<char> d;
    string s,ans;
    cin>>s>>q;
    for(auto i:s){
        d.push_back(i);
    }
    while(q--){
        int t; cin>>t;
        if(t==2){
            int f; char c;
            cin>>f>>c;
            if(f==1){
                if(rev & 1)
                    d.push_back(c);
                else
                    d.push_front(c);
            }
            else{
                if(rev & 1)
                    d.push_front(c);
                else
                    d.push_back(c);
            }
        }
        else
            ++rev;
    }
    for(auto i:d){
        ans+=i;
    }
    if(rev & 1)
        reverse(all(ans));
    cout<<ans;
    return 0;
}



Measured memory_bytes: 1368
#include<stdio.h>

int main(void){
  int n,i,j,m;
  
  scanf("%d",&n);
  
  for(i=0;i<26;i++){
    for(j=0;j<16;j++){
      m = 4*i+7*j;
      if(m==n){
        printf("Yes\n");
        return 0;
      }
    }
  }
  
  printf("No\n");
  
  return 0;
}

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

int main(){
  int N, T;
  cin >> N >> T;
  vector<int> t(N);
  rep(i,N){
    cin >> t.at(i);
  }
  ll ans = T;
  for(int i=1; i<N; i++){
    int a = t.at(i)-t.at(i-1);
    if(a>=T){
      ans += T;
    }else{
      ans += a;
    }
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 3952
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CF
{
    class Program
    {
        static void Main(string[] args)
        {
            var c = Console.ReadLine().Split().Select(int.Parse).ToList();
            int k = c[0], n = c[1];
            //       var n = int.Parse(Console.ReadLine());

            if (k * 500 >= n)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");

        }
    }
}

Measured memory_bytes: 11220
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int N, K, a[111];

int memo[111][111111];


int dfs(int i, int k)
{
  if (i == N)
    return k == 0 ? 1 : 0;

  int lb = std::max(k - a[i], 0);
  
  if (memo[i][k] >= 0)
    return (memo[i][k + 1] - memo[i][lb] + MOD) % MOD;

  int c = 0;

  memo[i][0] = 0;

  for (int j = 0; j <= K; j ++)
    memo[i][j + 1] = (c += dfs(i + 1, j)) %= MOD;

  return (memo[i][k + 1] - memo[i][lb] + MOD) % MOD;
}


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  std::cin >> N >> K;

  for (int i = 0; i < N; i ++)
    std::cin >> a[i];

  memset(memo, -1, sizeof(memo));

  std::cout << dfs(0, K) << std::endl;

  return 0;
}


Measured memory_bytes: 48384
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['No', 'Yes']
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']


show_flg = True
show_flg = False


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


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


def lcm_n(A, N):
    # A = sorted(A)
    ans = A[0]
    # for i in range(1, N):
    #     ans = fractions.gcd(A[i], ans)
    for i in range(1, N):
        ans = lcm(ans, A[i])
    return ans


def main():
    N, M = MI()
    a = LI()

    if any([i % 2 for i in a]):
        print(0)
        return

    n = lcm_n(a, N)
    n = n // 2

    if not all([(2 * n // x) % 2 for x in a]):
        print(0)
        return

    if n > M:
        print(0)
    else:
        t = M // n
        if t % 2 == 0:
            t -= 1
        print(t // 2 + 1)


if __name__ == '__main__':
    main()


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

int main(){
    int n;
    while(cin >> n){
        if(n==0) break;
        vector<vector<int>> sq(n, vector<int>(n,0));
        int num = 1, x = (n-1)/2, y = (n-1)/2 + 1;
        while(num!=n*n+1){
            if(sq[y][x] != 0){
                x--;
                y++;
            }
            else{
                sq[y][x] = num++;
                x++;
                y++;
            }
            x = (x+n)%n;
            y =(y+n)%n;
        }
        for(int i = 0;i<n;i++){
            for(int j =0;j<n;j++){
                printf("%4d", sq[i][j]);
            }
            cout << endl;
        }
    }
    return 0;
}

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

#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
 
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
 
#if 1
//-------------
// DUMPマクロ
// https://www.creativ.xyz/dump-cpp-652/
 
// vector
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    for (T& x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&& ... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef DEBUG
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif
#endif


signed main() {
    string s;
    cin>>s;
    
    rep(i,s.size()+1){
        if(i<4) cout << s[i];
        else if(i==4) cout << " ";
        else cout << s[i-1];
    }
    cout << endl;
    return 0;
}


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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



int main(){
  
  ll n,k;
  cin >> n >> k;
  vector<pair<ll,ll>> v(n);
  rep(i,n)cin >> v[i].first >> v[i].second;
  sort(ALL(v));
  ll res = -1;
  res += 1ull << 63;
  rep(i,n)for(ll j = i+1;j < n;j++){
    if(j-i+1 < k)continue;
    ll width = v[j].first-v[i].first,height = 1e18;
    ll mn = min(v[i].second,v[j].second),mx = max(v[i].second,v[j].second);
    vector<ll> hei;
    for(ll g = i+1;g < j;g++)hei.push_back(v[g].second);
    sort(ALL(hei));
    rep(g,hei.size())if(g+k-2 <= hei.size())height = min(height,max(mx,hei[g+k-3])-min(height,min(mn,hei[g])));
    if(k == 2)height = min(height,mx-mn);
    res = min(res,width*height);
  }
  cout << res << endl;



  return 0;
}

Measured memory_bytes: 256
using System;
using System.Text;
 
namespace ALDS1_14_D
{
	class SuffixArray
	{
		internal int[] sa, rank, tmp;
		internal string S;
		internal int n, k;
		
		public SuffixArray(string SS)
		{
			S = SS;
			n = S.Length;
			sa = new int[n + 1];
			rank = new int[n + 1];
			tmp = new int[n + 1];
			Construct_SA();
		}
		
		public int Compare_SA(int i, int j)
		{
			if(rank[i] != rank[j]) return rank[i] - rank[j];
			
			int ri = i + k  <= n ? rank[i + k] : -1;
			int rj = j + k <= n ? rank[j + k] : -1;

			return  ri - rj; 
		}
		
		public void Construct_SA()
		{
			for(int i = 0; i < n; i++)
			{
				sa[i] = i;
				rank[i] = S[i];
			}
			sa[n] = n; rank[n] = -1;
			
			for(k = 1; k <= n; k*= 2)
			{
				Array.Sort(sa, Compare_SA);
                
                tmp[sa[0]] = 0;
                for (int i = 1; i <= n; i++)
                {
                    tmp[sa[i]] = tmp[sa[i - 1]] + ((Compare_SA(sa[i - 1], sa[i]) < 0) ? 1 : 0);
                }
                for (int i = 0; i <= n; i++)
                {
                    rank[i] = tmp[i];
                }
 
			}
		}
		
		public string Contains(string pattern)
		{
			int l = 1, r = n + 1;
			int pl = pattern.Length;
			
			while(l < r)
			{
				int m = (l + r) / 2;
				
				string subStr = (sa[m] + pl >= n) ? S.Substring(sa[m]) : S.Substring(sa[m], pl);
                    
                int comp = subStr.CompareTo(pattern);
                if (comp == 0) return "1";
                
                if (comp < 0) l = m + 1;
                else r = m;
			}
			return "0";
		}
	}
	
	
    class Program
    {
        static void Main(string[] args)
        {
        	var T = Console.ReadLine();
        	
            SuffixArray SA = new SuffixArray(T);
            StringBuilder sb = new StringBuilder();
 
            var Q = int.Parse(Console.ReadLine());
 
            for (int i = 0; i < Q; i++)
            {
                var P = Console.ReadLine();
 
                sb.AppendLine(SA.Contains(P));
            }
            Console.Write(sb);
        }
    }
}

Measured memory_bytes: 33452
#include <bits/stdc++.h>
#define ll long long int

using namespace std;

const ll MOD = 998244353 ;
const int MAXN = 2e3 + 10;
//EAZY..PIZZIIEE

int n, m;
vector<string> grid(105);
int dp[105][105];

int rec(int i = 0, int j = 0){
    if( i >= n or j >= m ) return INT_MAX;
    if( i == n - 1 and j == m - 1){
        return 0;
    }
    auto & res = dp[i][j];
    if(res != -1)
        return res;
    res = INT_MAX;
    if(i + 1 < n and j < m){
        res = min(res, rec(i + 1, j) + (grid[i][j] == '.' and grid[i + 1][j] == '#') );
    }
    if( i < n and j + 1 < m){
        res = min(res, rec(i , j + 1) + (grid[i][j] == '.' and grid[i][j + 1] == '#') );
    }
    return res;
}

void solve(){
    cin >> n >> m;
    grid.resize(n);
    for(int i = 0; i < n; ++i){
        cin >> grid[i];
    }
    
    memset(dp, -1, sizeof dp);
    cout << rec() + (grid[0][0] == '#') << '\n';
}

int main(){
    //int t; cin >> t;
    //while(t--)
        solve();
}


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

int main(){
    int x;
    cin>>x;
    long long n=0;
    for(int i=1;i<=x;i++){
        n=i*(i+1)/2;
        if(n>=x){
            cout<<i<<endl;
            return 0;
        }
    }
}



Measured memory_bytes: 256
use proconio::{fastout, input};

fn gcd(a: usize, b: usize) -> usize {
    use std::cmp::{max, min};
    let mi = min(a, b);
    let ma = max(a, b);

    let r = ma % mi;
    if r == 0 {
        return mi;
    }

    gcd(mi, r)
}

fn reduce(mut a: isize, mut b: isize) -> (isize, isize) {
    if a == 0 {
        return (0, 1);
    }

    if b == 0 {
        return (1, 0);
    }

    if b < 0 {
        b = -b;
        a = -a;
    }

    let g = gcd(a.abs() as usize, b.abs() as usize) as isize;
    (a / g, b / g)
}

fn inv(ab: (isize, isize)) -> (isize, isize) {
    if ab == (1, 0) {
        return (0, 1);
    }

    if ab == (0, 1) {
        return (1, 0);
    }

    if ab.0 < 0 {
        (ab.1, -ab.0)
    } else {
        (-ab.1, ab.0)
    }
}

static MOD: isize = 1000000007;

#[fastout]
fn main() {
    input! {
        n: usize,
        abs: [(isize, isize); n]
    };

    let mut f = vec![0; n + 1];
    f[0] = 1;
    for i in 1..=n {
        f[i] = (f[i - 1] * 2) % MOD;
    }

    let mut abzero = 0;
    let mut abs2 = vec![];
    let mut hash = std::collections::HashMap::<(isize, isize), usize>::new();
    for (a, b) in abs {
        if a == 0 && b == 0 {
            abzero += 1;
            continue;
        }

        let rab = reduce(a, b);
        if let Some(v) = hash.get_mut(&rab) {
            *v = *v + 1;
        } else {
            hash.insert(rab, 1);
        }

        abs2.push((a, b));
    }

    let mut set = std::collections::HashSet::<(isize, isize)>::new();
    let mut m = 1;
    let abs2len = abs2.len();
    for (a, b) in abs2 {
        let rab = reduce(a, b);
        if set.contains(&rab) {
            continue;
        }

        set.insert(rab);

        let rab_n = *hash.get(&rab).unwrap() as usize;
        let mut s = 1;
        for _ in 0..rab_n {
            s *= 2;
            s %= MOD;
        }

        let rab_inv = inv(rab);
        if !hash.contains_key(&rab_inv) {
            m *= s;
            m %= MOD;
            continue;
        }

        set.insert(rab_inv);

        s += (MOD - 1);
        s %= MOD;

        let inv_n = *hash.get(&rab_inv).unwrap() as usize;
        let mut t = 1;
        for _ in 0..inv_n {
            t *= 2;
            t %= MOD;
        }

        t += (MOD - 1);
        t %= MOD;

        m *= (s + t + 1) % MOD;
        m %= MOD;
    }

    if abzero == n {
        println!("{}", n);
    } else {
        println!("{}", (abzero as isize + m + (MOD - 1)) % MOD);
    }
}


Measured memory_bytes: 29388
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")



void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){return n%=MOD1;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{
    ll aa;
    ll bb;
}frequent;

int main(void){
    char s[55][55],t[55][55];
    ll n,m;
    scanf("%lld%lld",&n,&m);
    rep(i,0,n){
        scanf("%s",s[i]);
    }
    rep(i,0,m) scanf("%s",t[i]);

    rep(i,0,n-m+1){
        rep(j,0,n-m+1){
            ll k,l;
            if(s[i][j]==t[0][0]){
                for(k=0;k<m;k++){
                    for(l=0;l<m;l++){
                        if(s[i+k][j+l]!=t[k][l]) break;
                    }
                    if(l!=m) break;
                }
                if(k==m){
                    YES;
                    return 0;
                }
            }
        }
    }
    NO;
    return 0;
}


Measured memory_bytes: 128
import sys
input = sys.stdin.readline

def biggest_idx(abc):
    res = -1
    for i, v in enumerate(abc):
        if i == 0 or v > abc[res]:
            res = i
    return res
def smallest_idx(abc):
    res = -1
    for i, v in enumerate(abc):
        if i == 0 or v < abc[res]:
            res = i
    return res

abc = list(map(int, input().split(' ')))
ans = 0
while abc[0] != abc[1] or abc[1] != abc[2]:
    is_mid = [1, 1, 1]
    biggest = biggest_idx(abc)
    is_mid[biggest] = 0
    smallest = smallest_idx(abc)
    is_mid[smallest] = 0
    if abc[biggest] - abc[smallest] >= 2:
        abc[smallest] += 2
        ans += 1
        continue
    mid = is_mid.index(1)
    if abc[biggest] - abc[smallest] == 1 and abc[biggest] == abc[mid]:
        abc[biggest] += 1
        abc[mid] += 1
        ans += 1
        continue
    if abc[biggest] - abc[smallest] == 1 and abc[mid] == abc[smallest]:
        abc[mid] += 1
        abc[smallest] += 1
        ans += 1
print(ans)

Measured memory_bytes: 3064
// In the name of GOD
#include<bits/stdc++.h>
using namespace std;

#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";

#define     SPEED       ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define 	setprecn(x) cout<<fixed<<setprecision(x);
#define 	ll          long long int
#define 	pb          push_back
#define 	pll         pair<ll,ll>
#define 	vll         vector<ll>
#define 	ff          first
#define 	ss          second
#define 	all(a)      (a).begin(),(a).end()
#define 	sz(x)       (ll)x.size()
#define 	hell        1000000007
#define 	rep(i,n)    for(ll i=0;i<n;i++)
#define 	repe(i,a,b) for(ll i=a;i<b;i++)
#define 	lbnd        lower_bound
#define 	ubnd        upper_bound
#define 	bs          binary_search

ll power(ll a,ll b)
{
	if(b==0)
		return 1;
	if(b==1)
		return a;
	ll c=power(a,b/2);
	if(b%2==0)
		return((c%hell)*(c%hell))%hell;
	return ((((c%hell)*(c%hell))%hell)*(a%hell))%hell;
}

/********************************************************/
//	d.erase(unique(all(d)), d.end());


vector<ll> g[100005];
int vis[100005];

void dfs(ll x)
{
	vis[x]=1;
	// debug(x);
	for(auto q:g[x])
	{
		// debug2(x,q);
		if(vis[q]==0)
			dfs(q);
	}
}

int main()
{
	SPEED;
	ll n,k,m,i,j,c=0,cs=0,t;
	t=1;

	// cin>>t;
	string s;
	while(t--)
	{
		cin>>n>>m;
		// n=s.length();
		ll x,y,z;
		memset(vis,0,sizeof(vis));
		rep(i,m)
		{
			cin>>x>>y>>z;
			g[x].pb(y);
			g[y].pb(x);
		}

		repe(i,1,n+1)
		{
			if(vis[i]==0)
			{
				c++;
				dfs(i);
			}
		}
		
		cout<<c;
		if(t!=0)
	   		cout<<"\n";
	}
	return 0;
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  ll w,h,x,y;
  cin>>w>>h>>x>>y;
  double ans=w*h/2.0;
  int num=(w==2*x && h==2*y);
  printf("%10lf %d\n",ans,num);
}

Measured memory_bytes: 256
l=[]
while True:
  e = list(map(int,input().split()))
  if e==[0, 0]:
    break
  l.append(e)

for p in range(0, len(l)):
  count = 0
  n = l[p][0]
  x = l[p][1]
  for i in range(1, n+1):
    for j in range(1, n+1):
      if i < j:
        for k in range(1, n+1):
          if j < k and i + j + k == x:
            count += 1
  print(count)
    



Measured memory_bytes: 5600
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(ll i = (begin); i < (end); i++)
#define rep(i, n) FOR(i, 0, n)
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>;
template<typename T, typename U> static void chmin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void chmax(T &x, U y) { if (x < y) x = y; }

int a[size_t(1e6) + 2];
signed main() {
    int n;
    cin>>n;
    unordered_map<int, int> as;
    int mx = -1;
    rep(i, n) {
        int xx;
        cin>>xx;
        as[xx]++;
        mx = max(mx, xx);
    }
    unordered_set<int> divisible;
    for(auto a : as) {
        int j = a.first * 2;
        while (j <= mx) {
            if(as.find(j) != as.end())
                divisible.insert(j);
            j += a.first;
        }
    }
    int ans = 0;
    for(auto a: as) {
        if(a.second == 1 && divisible.find(a.first) == divisible.end()) {
            ans += a.second;
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

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

	if(A%2==0||B%2==0||C%2==0){
		cout << 0 << endl;
	}else{
		cout << min(C*A, min(A*B, B*C)) << endl;
	}
    return 0;
}

Measured memory_bytes: 256
from collections import *
d=deque([i for i in range(1,10)])
for _ in range(int(input())):
    i=d.popleft()
    j=i%10
    if j!=0:
        d.append(i*10-1+j)
    d.append(i*10+j)    
    if j!=9:
        d.append(i*10+1+j) 
print(i)

Measured memory_bytes: 12376
#include<stdio.h>
int main(void){

    int member;
    int member_number[200020];
    int ans[200020][1];
    scanf("%d",&member);
    
    for(int k = 0; k <= member; k++){
        ans[k][0] = 0; 
    }

    for(int i = 0; i < member-1; i++){
        scanf("%d",&member_number[i]);
        ans[member_number[i]][0] += 1;
    }

    for(int j = 1; j <= member; j++){
        printf("%d\n",ans[j][0]);
    }

    
    return 0;
}

Measured memory_bytes: 3296
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#define int64 long long

int main()
{
int64 dd, gg, min = LLONG_MAX, xx;//LLong:longlong max
scanf("%lld %lld", &dd, &gg);
int64 pp[dd], cc[dd], score[dd];
for(int64 ii = 0;ii < dd;ii++){
 scanf("%lld %lld", &pp[ii], &cc[ii]);
 score[ii] = pp[ii] * (ii + 1) * 100 + cc[ii];//ボーナスあり
}
int64 tmp, kosu;
for(int64 bit = 0;bit < (1 << dd);bit++){//2^ddまで
 tmp = 0;
 kosu = 0;
 for(int64 ii = 0;ii < dd;ii++){
  if(bit & (1 << ii)){//2^(ii-1)の数字を比べる
   tmp += score[ii];//完全に解く
   kosu += pp[ii];
}}
if(tmp < gg){
for(int64 ii = dd - 1;ii >= 0;ii--){
 if(!(bit & (1 << ii))){//点数高いものから：上から
  xx = (gg - tmp) / ((ii + 1) * 100);
 //残り点数/配点：残り問題数
 if((gg - tmp) % ((ii + 1) * 100))xx++;
 //割り切れないときの調整
 if(xx > pp[ii])break;//ボーナスもらえるはず、おかしい
  tmp += xx * (ii + 1) * 100;//中途半端に解いた時
  kosu += xx;
 break;
}}}
		
if(min > kosu && tmp >= gg){
 //目標点数以上且つ個数(初期値最大)を小さめに
 min = kosu;
}}
printf("%lld\n", min);

return 0;}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

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

  if (s == "ABC") COUT("ARC");
  else COUT("ABC");
  return 0;
}


Measured memory_bytes: 3592
D, G = list(map(int, input().split()))
p_c = [list(map(int, input().split())) for _ in range(D)]

N = 1<<D
cnts = []
for one in range(N):
    s = 0
    flag=False
    cnt = 0
    for i in range(D):
        if (one>>i &1)==1:
            s+=p_c[i][0]*(i+1)*100+p_c[i][1]
            cnt+=p_c[i][0]
    if G<=s:
        flag=True
    else:
        for i in range(D-1, -1, -1):
            if (one>>i&1)==0:
                if G-s<=p_c[i][0]*100*(i+1):
                    cnt+=(G-s)//(100*(i+1))
                    if (G-s)%(100*(i+1))!=0:
                        cnt+=1
                    flag=True
                    break
    if flag:
        cnts.append(cnt)
print(min(cnts))

Measured memory_bytes: 40688
#include <iostream>

using namespace std;

int main(int argc, char* argv[]) {
  long long D, N;
  cin >> D >> N;

  if (D == 0) {
    int ret = 0;
    int i = 1;
    while (true) {
      if (i % 100 != 0)
        ret += 1;
      if (ret == N) {
        cout << i << endl;
        return 0;
      }
      ++i;
    }
  }

  if (D == 1) {
    int ret = 0;
    int i = 1;
    while (true) {
      if (i % 100 == 0 && i % 10000 != 0)
        ret += 1;
      if (ret == N) {
        cout << i << endl;
        return 0;
      }
      ++i;
    }
  }

  if (D == 2) {
    int ret = 0;
    int i = 1;
    while (true) {
      if (i % 10000 == 0 && i % 1000000 != 0)
        ret += 1;
      if (ret == N) {
        cout << i << endl;
        return 0;
      }
      ++i;
    }
  }

  return 0;
}

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


typedef  long long ll;

ll n,m=0,k=0;

bool test=false,test1=false;

ll const N=1e5+7;

ll const oo=1000000007 ;

ll nChoosek( ll n, ll k )
{
    if (k > n) return 0;
    if (k * 2 > n) /*return*/ k = n-k;  //remove the commented section
    if (k == 0) return 1;

    ll result = n;
    for( ll i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

vector<ll> v,v1;

vector<pair<ll,ll> > vv;

//ll  t[oo][oo];

map<pair<ll,ll> ,ll> my;

map<ll,ll> my1;

priority_queue<ll> q;

ll t[N];

ll t1[2][N];

ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};



bool in_da_prison(ll x,ll y)
{
    return (x<9   && x>=0  && y<9 && y>=0);
}
//ll mem[]

ll dp(ll a ,ll b,ll c ,ll x)
{ll choice1,choice2,choice3;
if(x==0) return 1;
    if(a   && x>=500 ) choice1= dp(a-1,b,c,x-500);
else choice1=0;
if(b   && x>=100 )choice2= dp(a,b-1,c,x-100);
else choice2=0;
if(c   && x>=50 )choice3= dp(a,b,c-1,x-50);
else choice3=0;
    return choice1+choice2+choice3;
}
bool cont(ll x)
{
    if(x%10==7 || x/10==7) return true;
    else return false;
}


vector<ll> v2[N];
ll z[N];
void dfs(ll s)
{
    if (z[s]) return;
 z[s] = 1;
 for (ll u=0;u<v2[s].size();u++)
    { dfs(v2[s][u]); }
 }

int main() {


ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

ll i=0,j=0,a=0,b=0,c=0,d=-1e18,x=0,y=0,s=0;
string s1,s2,s3,s4,s5;
cin>>n;
for(i=0;i<2;i++)
    for(j=0;j<n;j++)
    cin>>t1[i][j];
for(i=0;i<n;i++)
{a=0;b=0;
    for(j=0;j<=i;j++)
         a+=t1[0][j];
        for(k=i;k<=n;k++)
          b+=t1[1][k];
d=max(d,a+b);
}
cout<<d;
   return 0;

}

Measured memory_bytes: 3584
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();
        String c = sc.next();


        if(a.charAt(a.length()-1)==b.charAt(0) && b.charAt(b.length()-1)==c.charAt(0)){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }

}


Measured memory_bytes: 21844