akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanNum = new Scanner(System.in);
		int a = scanNum.nextInt();
		int b = scanNum.nextInt();
		int c = scanNum.nextInt();
		if (a<b && b<c) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 17156
def main():
    N = int(input())
    p = list(map(int, input().split()))
    sort_p = sorted(p)

    flag = []

    for i in range(N):
        if sort_p[i] == p[i]:
            flag.append(True)
        else:
            flag.append(False)
    if flag.count(False) <= 2:
        print('YES')
    else:
        print('NO')

main()

Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <map>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;

int main()
{
    int x,y,z;
    cin >> x >> y >> z;
    swap(x,y);
    swap(x,z);
    cout << x << " " << y << " " << z << endl;
}

Measured memory_bytes: 3568
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define rrep(X, Y) for (int(X) = (Y)-1; (X) >= 0; --(X))
#define all(X) (X).begin(), (X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define print(x) cout << x << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

void solve(long long N, std::vector<long long> D) {
  sort(all(D));

  map<ll, ll> dCnts;
  rep(i, N) { dCnts[D[i]]++; }

  vl fixedD;

  bool right = true;
  for (auto iter = dCnts.begin(); iter != dCnts.end(); iter++) {
    ll d = iter->first;
    ll cnt = iter->second;

    if (cnt == 1) {
      if (right) {
        fixedD.push_back(d);
        right = false;
      } else {
        fixedD.push_back(24 - d);
        right = true;
      }
    } else if (cnt == 2) {
      fixedD.push_back(d);
      fixedD.push_back(24 - d);
    } else {
      print(0);
      return;
    }
  }

  sort(all(fixedD));
  ll ans = 1e10;
  ll pre = 0;
  for (ll i = 0; i < fixedD.size(); i++) {
    ans = min(ans, fixedD[i] - pre);
    pre = fixedD[i];
  }
  ans = min(ans, 24 - fixedD[fixedD.size() - 1]);
  print(ans);
}

int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> D(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &D[i]);
  }
  solve(N, std::move(D));
  return 0;
}


Measured memory_bytes: 256
//include,using,define等
#pragma region header
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#include <cstring>

// ===============================================================
//using系
#pragma region header
using namespace std;
using ll = long long;
using lint = long long;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
using vvi = vector<vector<int>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;
using ui = unsigned int;
using qul = queue<ll>;
using pql = priority_queue<ll>;
const int dx[] = { 1,0,-1,0 };
const int dy[] = { 0,1,0,-1 };
constexpr ll mod = 1e9 + 7;
constexpr long double pi = 3.141592653589793238462643383279;
#pragma endregion
// ========================================================================
//define
#pragma region header
//#define int long long
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define INF (ll)10000000000000000
#define mod (ll)1000000007
#define P pair<lint,lint>
#pragma endregion
#pragma endregion
vector<bool> IsPrime;
void sieve(size_t max) {
    if (max + 1 > IsPrime.size()) {     // resizeで要素数が減らないように
        IsPrime.resize(max + 1, true); // IsPrimeに必要な要素数を確保
    }
    IsPrime[0] = false; // 0は素数ではない
    IsPrime[1] = false; // 1は素数ではない

    for (size_t i = 2; i * i <= max; ++i) // 0からsqrt(max)まで調べる
        if (IsPrime[i]) // iが素数ならば
            for (size_t j = 2; i * j <= max; ++j) // (max以下の)iの倍数は
                IsPrime[i * j] = false;      // 素数ではない
}


int main(void) {
    lint q; cin >> q;
    sieve(250000);
    vl r(100010);
    r[0] = 0;
    for (int i = 1; i < 100005; i++) {
        if (IsPrime[i] && IsPrime[(i + 1) / 2]) r[i] = r[i - 1] + 1;
        else r[i] = r[i - 1];
    }
    for (int i = 0; i < q; i++) {
        lint a, b; cin >> a >> b;
        printf("%lld\n", r[b] - r[a - 1]);
    }

	return 0;
}

Measured memory_bytes: 4024
#include<stdio.h>

int main(void){

int a,b;

scanf("%d %d",&a,&b);

if(a<b){

printf("a < b\n");

}

if(a>b){


printf("a > b\n");


}


if(a==b){


printf("a == b\n");


}


return 0;

}

Measured memory_bytes: 580
import java.util.*;

public class Main implements Runnable {

    private static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        // Run with 32MB stack
        Thread thread = new Thread(null, new Main(), "", 32 * 1024 * 1024);
        thread.start();
    }

    @Override
    public void run() {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    static void solve(Scanner scanner) {
        int N = Integer.parseInt(scanner.next());
        int M = Integer.parseInt(scanner.next());
        Set<Integer> accepted = new HashSet<>();
        Map<Integer, Integer> penalty = new HashMap<>();
        for (int i = 0; i < M; i++) {
            int p = Integer.parseInt(scanner.next());
            boolean ac = scanner.next().equals("AC");
            if (ac) {
                accepted.add(p);
            } else {
                if (!accepted.contains(p)) {
                    penalty.put(p, penalty.getOrDefault(p, 0) + 1);
                }
            }
        }

        int pen = 0;
        for (int i = 1; i <= N; i++) {
            if (accepted.contains(i)) {
                pen += penalty.getOrDefault(i, 0);
            }
        }

        System.out.printf("%d %d\n", accepted.size(), pen);
    }

}



Measured memory_bytes: 63628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


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

  int n;
  cin >> n;
  int a[n];
  rep(i,n) cin >> a[i];
  sort(a,a+n);
  if(n==2){
      cout << a[1]-a[0] << endl;
      cout << a[1] << " " << a[0] << endl;
      return 0;
  }
  ll m=0;
  ll t=0;
  if(a[0]>0){
    t=a[0]-a[1];
  }
  else if (a[n-1]<0){
    t=a[n-1]-a[n-2];
  }
    
  if(a[0]>0){    
    rep1(i,n-1) m+=a[i];
    m-=a[0];
    cout << m << endl;
    cout << a[0] << " " << a[1] << endl;
    t=a[0]-a[1];
    rep1(i,n-3){
      cout << t << " " << a[i+1] << endl;
      t=t-a[i+1];
    }
    cout << a[n-1]  <<" " << t << endl;
  }
  else if (a[n-1]<0){
    rep(i,n) m+=abs(a[i]);
    m-=abs(a[n-1])*2;
    cout << m << endl;
    cout << a[n-1] << " " << a[n-2] << endl;
    t=a[n-1]-a[n-2];
    rep(i,n-2){
      cout << t << " " <<  a[i] << endl;
      t=t-a[i];
    }
  }
  else{
    rep(i,n) m+=abs(a[i]);
    cout << m << endl;
    t=a[0];
    for(int i=n-2; i>=0; i--){
      if(a[i]>0){
	cout << t << " " << a[i] << endl;
	t= t-a[i];
      }
      else if(t<=0){
	cout << a[n-1] << " " << t << endl;
	t = a[n-1] -t;
	if(i==0) break;
      }
      if(a[i]<=0){
	if(i==0)break;
	cout << t << " " << a[i] << endl;
	t= t-a[i];
      }      
    }
  }
  return 0;
    

}


Measured memory_bytes: 2304
input_lines1 = input()
int_a = int(input_lines1)
input_lines2 = input()
int_b = int(input_lines2)
input_lines3 = input()
int_c = int(input_lines3)
input_lines4 = input()
int_x = int(input_lines4)
count = 0
for i in range(int_c + 1):
    for j in range(int_b + 1):
        for h in range(int_a + 1):
            if (i * 50) + (j * 100) + (h * 500) == int_x:
                count = count + 1



print(int(count))


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

int main(){
  int n;
  cin >> n;
  vector<int> a(n),x(100002);
  for(int i = 0;i < n;i++){
    cin >> a.at(i);
    x.at(a.at(i))++;x.at(a.at(i) + 1)++;x.at(a.at(i) + 2)++;
  }
  sort(x.begin(),x.end());
  reverse(x.begin(),x.end());
  cout << x.at(0) << endl;
}   

Measured memory_bytes: 1024
n,k=map(int,input().split())
A=list(map(int,input().split()))
if k==0:
    print(sum(A))
    exit()
ans=sum(A)
for i in range(40,-1,-1):
    if 2**i > k:
        continue
    cnt=0
    for a in A:
        if 1<<i & a:
            cnt+=1
    if cnt<n-cnt:
        k-=2**i
        ans -=cnt*2**i
        ans += (n-cnt)*2**i

print(ans)


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

#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define RFOR(i, a, b) for(int i=(a); i>=(b); i--)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) RFOR(i, n, 0)
#define dump(x)  cout << #x << " = " << (x) << endl;

typedef long long ll;
typedef pair<int, int> ii;
const ll INF = 1e18;
const int inf = 1e8;


void solve()
{
  ll T;
  scanf("%lld",&T);
  ll X;
  scanf("%lld",&X);
  printf("%0.10lf\n", 1.0*T/X);
}

int main()
{
  solve();
  return 0;
}


Measured memory_bytes: 256
N = int(input())
a = list(map(int,input().split()))

num = [0]*(10**5+1)
for i in a:
    if i-1 >= 0:
        num[i-1] += 1
    num[i] += 1
    if i+1 <= N:
        num[i+1] += 1

print(max(num))

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

int main() {
  int n, y, m, d;
  cin >> n;
  rep(i, n) {
    int c = 0;
    cin >> y >> m >> d;
    for (int j = y; j <= 999; ++j) {
      for (int k = m; k <= 10; ++k) {
        int day = (j % 3 == 0 || k % 2 == 1) ? 20 : 19;
        for (int l = d; l <= day; ++l) {
          c++;
        }
        d = 1;
      }
      m = 1;
    }
    cout << c << endl;
  }
  return 0;
}



Measured memory_bytes: 3092
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//#include <regex>

/* g++ -g -std=c++0x */
/* g++ -g -std=c++11 */

using namespace std;

// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

int main()
{
/* #ifndef ONLINE_JUDGE */
/*     freopen("foo", "rt", stdin); */
/* #endif */
    std::ios::sync_with_stdio(false);

    int n;
    string s;
    while (cin >> n) {
        cin >> s;
        int x = 0, x2 = 0;
        FOR(i,0,n) {
            if (s[i] == 'I')
                x++;
            else x--;
            if (x > x2)
                x2 = x;
        }
        if (x2 > 0)
            cout << x2 << endl;
        else cout << '0' << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
#include <unordered_map>
#include <fstream>
#include <ctime>
#include <complex>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef pair<int,int> pii;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {1,-1,0,0,1,-1,1,-1};
ll dx[8] = {0,0,1,-1,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T> inline void print(T &a){
    rep(i,a.size()) cout << a[i] << " ";
    cout << "\n";
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
ll pcount(ll x) {return __builtin_popcountll(x);}
//const int mod = 1e9 + 7;
const int mod = 998244353;

int main(){
	int h,w; cin >> h >> w;
	vs s(h); rep(i,h) cin >> s[i];
	vvl dist(h+1,vl(w,0));
	rep(j,w) rep(k,2) dist[0][j] = w-j;
	int ans = w;
	rep(j,w){
		vector<pii> st;
		st.emplace_back(0,0);
		REP(i,1,h+1){
			if(i < h){
				if(j==0 || dist[i][j-1] == 1){
					int d = 0;
					bool rev = s[i][j] != s[i-1][j];
					REP(k,j,w){
						if(rev == (s[i][k] != s[i-1][k])) d++;
						else break;
					}
					dist[i][j] = d;
				}else{
					dist[i][j] = dist[i][j-1] - 1;
				}
			}
			if(st.empty() || st.back().first < dist[i][j]){
				st.emplace_back(dist[i][j],i);
			}else{
				int pos = i;
				while(!st.empty()){
					if(st.back().first >= dist[i][j]){
						pii p = st.back();
						chmax(ans, p.first*(i-p.second)+p.first);
						pos = p.second;
						st.pop_back();
					}else{
						st.emplace_back(dist[i][j], pos);
						break;
					}
				}
			}
		}
	}
	cout << ans << "\n";
}

Measured memory_bytes: 42308
#include "iostream"
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
using namespace std;
using ll=long long;
#define mod  1000000007

int main(int argc, char const *argv[]) {
  int n;
  std::cin >> n;
  int a[n];

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

  sort(a,a+n);
  int ans=a[n-1]-a[0];

  std::cout << ans << '\n';

  return 0;
}


Measured memory_bytes: 256
N, A = map(int, input().split())
cards = list(map(lambda x: int(x)-A, input().split()))

X = max(cards)
X = max(X, A)

dp = [[0]*(2*N*X+1) for _ in range(N+1)]

dp[0][N*X] = 1
for i in range(N):
    for j in range(2*N*X+1):
        c = cards[i]
        if j - c < 0 or j-c > 2*N*X:
            dp[i+1][j] = dp[i][j]
        else:
            dp[i+1][j] = dp[i][j]+dp[i][j-c]


print(dp[N][N*X]-1)


Measured memory_bytes: 5228
#define ll long long
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define fo(i , n) for(ll i = 0 ; i < n ; i++)
//#include<bits/stdc++.h>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<utility>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<queue>
#include<set>
#include<stack>
ll pi = acos(-1) ;
ll z =  1000000007 ;
ll inf = 100000000000000000 ;
ll p1 = 37 ;
ll p2 = 53 ;
ll mod1 =  202976689 ;
ll mod2 =  203034253 ;
ll gcd(ll a , ll b){ if(b > a) return gcd(b , a) ; if(b == 0) return a ; return gcd(b , a%b) ;}
ll power(ll a ,ll b , ll p){if(b == 0) return 1 ; ll c = power(a , b/2 , p) ; if(b%2 == 0) return ((c*c)%p) ; else return ((((c*c)%p)*a)%p) ;}
ll inverse(ll a ,ll n){return power(a , n-2 , n) ;}
ll max(ll a , ll b){if(a > b) return a ; return b ;}
ll left(ll i){return ((2*i)+1) ;}
ll right(ll i){return (2*(i+1)) ;}
//ios_base::sync_with_stdio(0);
//cin.tie(0); cout.tie(0);
using namespace std ;
void solve()
{
	ll n , x , y ;
	cin >> n >> x >> y ;
	//x-- ; y-- ;
	ll dist[n+1] ;
	fo(i , n+1)
		dist[i] = 0 ;
	ll a = min(x , y) ;
	ll b = max(x , y) ;

	for(ll i = 1 ; i <= n ; i++)
	{
		for(ll j = i+1 ; j <= n ; j++)
		{
			ll d = min(j - i , abs(a - i) + 1 + abs(b - j)) ;
			dist[d] ++ ;
		}
	}
	for(ll i = 1 ; i < n ; i++)
	{
		cout << dist[i] << '\n' ;
	}
	return ;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
	freopen("inputf.txt" , "r" , stdin) ;
	freopen("outputf.txt" , "w" , stdout) ;
	freopen("error.txt" , "w" , stderr) ;
	#endif*/
	
	ll t ;
	//cin >> t ;
	t = 1 ;
	while(t--)
	{
		solve() ;
	}
	return 0;
}

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

int main(void) {
    int N;
    int64_t sum = 0;
    cin >> N;
    vector<int> d(N);

    
    for(int i=0;i<N;i++) {
        cin >> d[i];
    }

    for(int i=0;i<N-1;i++) {
        for(int j=i+1;j<N;j++) {
            sum += d[i] * d[j];
        }
    }

    cout << sum << "\n";
    return 0;
}


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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=n;i>=0;i--)
#define rrepa(i,a,n) for(int i=n;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define maxs(a,b) a=max(a,b)
#define mins(a,b) a=min(a,b)
#define vc vector

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pi;

int ctoi(char c){
    switch (c){
        case '0':return 0;
        case '1':return 1;
        case '2':return 2;
        case '3':return 3;
        case '4':return 4;
        case '5':return 5;
        case '6':return 6;
        case '7':return 7;
        case '8':return 8;
        case '9':return 9;
        default:return -1;
    }
}

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

    vi sn(n);
    rep(i,n)sn[i]=ctoi(s[i]);

    int ans=0,keta100,keta10,keta1,frag1,frag10;
    rep(i,1000){
        frag1=frag10=0;
        keta100=i/100;
        keta10=(i%100)/10;
        keta1=i%10;
        rep(j,n-2){
            if(sn[j]==keta100){
                repa(k,j+1,n-1){
                    if(sn[k]==keta10){
                        repa(l,k+1,n){
                            if(sn[l]==keta1){
                                ans++;
                                break;
                            }
                        }
                        frag1=1;
                    }
                    if(frag1)break;
                }
                frag10=1;
            }
            if(frag10)break;
        }
    }

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

Measured memory_bytes: 512
program main;
var
    n : integer;
begin
    readln(n);
    n := n mod 10;
    if n = 3
        then writeln('bon')
        else if (n = 0) or (n = 1) or (n = 6) or (n = 8)
            then writeln('pon')
            else writeln('hon');
end.


Measured memory_bytes: 1348
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long
#define double long double
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,ans=LINF;
string s,t;
int32_t main(){
CODE_START;
cin>>s>>t;
for(ll i=0;i<=s.size()-t.size();i++)
{
    ll s1=0;
    ll pos=0;
    for(ll j=i;j<i+t.size();j++)
    {
        if(s[j]!=t[pos]){
            s1++;
        }
        pos++;
    }
    ans=min(ans,s1);
}
cout<<ans<<endl;
}



Measured memory_bytes: 3648
#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<ll, ll>;
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() {
    ll n, k;
    cin >> n >> k;
    ll ans = powl((ll)n/k, 3);
    if (k%2==0) {
        ll tmp = 0;
        for (int i=1; i<=n; ++i) {
            if (i%k == k/2) tmp++;
        }
        ans += powl(tmp, 3);
    }
    cout << ans << endl;
}


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

int main(void){
	int a,b,c,max;
	char in[100];

	if(scanf("%100[^\n]%*[^\n]", in) < 1){return -1;}
	getchar();

	if(sscanf(in, "%d %d %d", &a,&b,&c) != 3){
  		return -1;
	}

	max = a;
	if(max < b){ max = b;}
	if(max < c){ max = c;}

	max = max * -1;

	printf("%d",max+a+b+c);
	return 0;
	
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int cnt[26];
int main()
{
	string S;
	cin >> S;
	for (int i = 0; i < S.size(); i++) {
		cnt[S[i] - 'a']++;
	}
	//cout << cnt[0] << " " << cnt[1] << " " << cnt[2] << endl;
	if (abs(cnt[0] - cnt[1]) <= 1 && abs(cnt[1] - cnt[2]) <= 1 && abs(cnt[0] - cnt[2]) <= 1) cout << "YES" << endl;
	else cout << "NO" << endl;
}


Measured memory_bytes: 512
#include<iostream>
#include<cmath>
#include<vector>
#include<cstdio>
#include<algorithm>
using namespace std;
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS )
class Point{
public:
  double x, y;
  Point ( double x = 0, double y = 0): x(x), y(y){}
  Point operator + ( Point p ){ return Point(x + p.x, y + p.y); }
  Point operator - ( Point p ){ return Point(x - p.x, y - p.y); }
  Point operator * ( double a ){ return Point(x*a, y*a); }
  Point operator / ( double a ){ return Point(x/a, y/a); }
  double abs() { return sqrt(norm());}
  double norm() { return x*x + y*y; }
  bool operator < ( const Point &p ) const {
    return x != p.x ? x < p.x : y < p.y;
  }
  bool operator == ( const Point &p ) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
class Segment{
public:
  Point p1, p2;
  Segment ( Point p1 = Point(0.0,0.0), Point p2 = Point(0.0,0.0)): p1(p1), p2(p2){}
  double abs() { return sqrt(norm());}
  double norm() { return (p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y); }
};
typedef Point Vector;
typedef Segment Line;
double norm( Vector a ){ return a.x*a.x + a.y*a.y; }
double abs( Vector a ){ return sqrt(norm(a)); }
double dot( Vector a, Vector b ){ return a.x*b.x + a.y*b.y; }
double cross( Vector a, Vector b ){ return a.x*b.y - a.y*b.x; }
double getDistanceLP(Line s,Point p){
  return abs(cross(s.p2-s.p1,p-s.p1)/abs(s.p2-s.p1));
}
double getDistanceSP(Segment s,Point p){
  if(dot(s.p2-s.p1,p-s.p1)<0.0)return abs(p-s.p1);
  if(dot(s.p1-s.p2,p-s.p2)<0.0)return abs(p-s.p2);
  return getDistanceLP(s,p);
}
 
Point project(Segment s,Point p){
  Vector base = s.p2-s.p1;
  double t = dot(p-s.p1,base)/norm(base);
  return s.p1+base*t;
}
 
Point p;
double r;
Segment s;
 
Point rotate( Point a, double si,double co){
  return Point(a.x*co-a.y*si,a.x*si+a.y*co);
}
 
vector<Point> solve(){
  vector<Point> res;
  Point q=project(s,p);
  double d=sqrt(r*r-abs(p-q)*abs(p-q));
  Vector base=s.p1-s.p2;
  res.push_back(q+base*(d/abs(base)));
  res.push_back(q-base*(d/abs(base)));
  return res;
}
 
int main(){
  cin>>p.x>>p.y>>r;
  int tc;
  cin>>tc;
  for(int i=0;i<tc;i++){
    cin>>s.p1.x>>s.p1.y>>s.p2.x>>s.p2.y;
    vector<Point> t=solve();
sort(t.begin(),t.end());
    printf("%.8f %.8f %.8f %.8f\n",t[0].x,t[0].y,t[1].x,t[1].y);
  }
  return 0;
}

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



int main(){
    int N,cnt=1;
    cin >> N;
    int H[N]={0};
    for(int i=0;i<N;++i) cin >> H[i];

    bool flag = true;
    for(int i=1;i<N;++i){
        for(int j=0;j<i;++j){
            if(H[i]<H[j]){
                flag = false;
                break;
            }
        }
        if(flag){
            cnt += 1;
        }
        flag = true;
    }
    cout << cnt << endl;
}





Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define   sz(s)         s.size()
#define   ll            long long int
#define   ull           unsigned ll
#define   ld            long double
#define   print(v)      for(ll i=0;i<v.size();i++)cout<<v[i]<<" "
#define   printpair(v)  for(ll i=0;i<v.size();i++)cout<<v[i].first<<" "<<v[i].second<<"\n"
#define   bmd           1000000007
#define   bmd1          998244353
#define   umll          unordered_map<ll,ll>
#define   mll           map<ll,ll>
#define   mcl           map<char,ll>
#define   pll           pair<ll,ll>
#define   F             first
#define   S             second
#define   setp(x)       setprecision(x)
#define   pb            push_back
#define   all(v)        v.begin(),v.end()
#define   tr(a)         for(auto it=a.begin();it!=a.end();it++)
#define   trr(a)        for(auto it1=a.begin();it1!=a.end();it1++)
#define   vll           vector<long long int>
#define   sorty(v)      sort(v.begin(),v.end())
#define   rsort(v)      sort(v.rbegin(),v.rend())
#define   PI            3.1415926535897932384626
#define   db()          cout<<"\n"<<"here"<<"\n"
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;


//---------------------------------------------------------------------------
const int MOD = bmd;
const int N=1e6+100;
inline  ll sqr(ll x){return x*x;}
inline  void normal(ll &a) { a = (a+MOD)%MOD; }
inline  ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline  ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline  ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline  ll modPow(ll b, ll p) { ll r = 1;b=b%MOD; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline  ll modInv(ll a) { return modPow(a, MOD-2); }
inline  ll modDiv(ll a,ll b) { return modMul(a, modInv(b)); }
//---------------------------------------------------------------------------
void solve()
{
    ll a,b;
    cin>>a>>b;
    cout <<a*b<<"\n";
    
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);//first give all input then gives output
    ll t=1;
    //cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


Measured memory_bytes: 3652
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            A();
        }

        static void A()
        {
            var abx = ReadSplitLong();
            var a = abx[0];
            var b = abx[1];
            var x = abx[2];
            var c = a == 0 ? -1 : (a - 1) / x;
            Println(b / x - c);
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int SumDigits(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static int Gcd(int a, int b) => b == 0 ? a : Gcd(b, a % b);

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());

        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}


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

int main(){
	ll n,k;
	cin >> n >> k;
	
	ll ans = 1;
	rep(i,n){
		if(i==0){
			ans*=k;
		}else{
			ans*=k-1;
		}
	}
	
	cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
int main() {
    int h, w;
    cin >> h >> w;
    const int N = 100;
    char a[N][N];
    for (int i = 0; i < h; ++i) {
        cin >> a[i];
    }
    int f[N], g[N];
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            if (a[i][j] == '#') {
                f[i] = g[j] = 1; //#がある行、列を出力
            }
        }
    }
    for (int i = 0; i < h; ++i) {
        if (f[i]) {
            for (int j = 0; j < w; ++j) {
                if (g[j]) {
                    cout << a[i][j];
                }
            }
            cout << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define EPS 1e-10
#define set0(x) memset((x),0,sizeof(x))
#define setINF(x) memset((x),63,sizeof(x))
/*
	Problem: Getting Difference
	Source: AtCoder Grand Contest 018
	Author: fts2001 (the_silliest)
 */
using namespace std;
int n,k,a[100005],mx,g;
inline int gcd(int x,int y){
    if(!y)return x;
    return gcd(y,x%y);
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>k;
    for(int i=0;i<n;i++){
        cin>>a[i];
        mx=max(mx,a[i]);
        if(i)g=gcd(g,a[i]);
        else g=a[i];
    }
    if(k>mx){
        cout<<"IMPOSSIBLE\n";
        return 0;
    }
    for(int i=0;i<n;i++){
        if(a[i]>=k && (a[i]-k)%g==0){
            cout<<"POSSIBLE\n";
            return 0;
        }
    }
    cout<<"IMPOSSIBLE\n";
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=mod*mod*3LL;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, m, x;
    cin >> n >> m >> x;
    ll ans = INF;
    vector<ll> c(n);
    vector<vector<ll> > a(n, vector<ll> (m));
    for(int i=0;i<n;i++){
    	cin >> c[i];
    	for(int j=0;j<m;j++){
    		cin >> a[i][j];
    	}
    }
    ll maki = (1<<n);
    for(int bit = 0; bit < maki; bit++){
    	vector<ll> d;
    	for(int i=0;i<n;i++){
    		if(bit >> i & 1){
    			d.pb(i);
    		}
    	}
        ll cost = 0;
    	vector<ll> num(m, 0);
    	for(auto i: d){
    		cost += c[i];
    		for(int j=0;j<m;j++){
    		    num[j] += a[i][j];
    		}
    	}
    	bool maki = true;
    	for(int i=0;i<m;i++){
    		maki &= (num[i] >= x);
    	}
    	if(maki) ans = min(ans, cost);
    }
    if(ans == INF){
    	cout << -1 << endl;
    	return 0;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL gcd(LL m,LL n){
    LL temp;
    while(n!=0){
    temp=n;
    n=m%n;
    m=temp;
  }
  return m;
}
LL lcm(LL m,LL n){
  return m*n/gcd(m,n);
}
int main(){
  LL A,B,C,D;
  cin>>A>>B>>C>>D;
  A--;
  A-=(A/C)+(A/D)-A/lcm(C,D);
  B-=(B/C)+(B/D)-B/lcm(C,D);
  cout<<B-A<<endl;
  return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){

	string s;
	int k;
	map<string,int> mp;
	cin>>s>>k;
	int all=0;
	int l=s.length();
	FOR(i,0,'z'-'a'+1){
	FOR(j,0,l){
		if(s[j]!='a'+i)continue;
		string key=s.substr(j,1);
		all+=1-mp[key];
		mp[key]=1;
		FOR(i,j+1,l){
			if(i-j>k)break;
			key+=s[i];
			all+=1-mp[key];
			mp[key]=1;

		}
	}
	if(all>k)break;
	}
	//cout<<all<<endl;
	//k=all-k;
	string tmp="";
	for(auto x:mp){
		//cout<<" "<<x.ST<<"! "<<endl;
		if(tmp!=x.ST)k--;
		tmp=x.ST;
		if(k==0){
			cout<<x.ST<<endl;
		}
	}






    return 0;
}


Measured memory_bytes: 384
// Problem : B - Harshad Number
// Contest : AtCoder - AtCoder Beginner Contest 080
// URL : https://atcoder.jp/contests/abc080/tasks/abc080_b
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define eb emplace_back
#define pb push_back
#define size(s) (int)s.size()
#define int long long
#define vi vector<int>
#define vs vector<string>
#define vv vector<vector<int>>
#define pii pair<int,int>
#define m_p(x,y) make_pair(x,y)
#define vp vector<pair<int,int>>
#define setbits(x) __builtin_popcountll(x)
#define f first
#define se second
#define inc(v,n,x) v.assign(n,x)
#define incd(v,n) v.resize(n)
#define iniz(n) memset(n,0,sizeof(n))
#define inin(n) memset(n,-1,sizeof(n))
#define inimi(n) memset(n,0xc0,sizeof(n))
#define inima(n) memset(n,0x3f,sizeof(n))
#define all(v) (v).begin(),(v).end()

using namespace std;

template<typename T1,typename T2>istream &operator>>(istream &is, vector<pair<T1,T2>> &v) { for (pair<T1,T2> &t : v) is >> t.f>>t.se; return is; }
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }

const int N=200001;
double pi=acos(-1.0);
int md=1e9+7;
const int INF=1e15;
int dx1[]={0,0,-1,1};
int dy1[]={1,-1,0,0};

template<class T>
T abst(T a)
{return a<0?-a:a;}

template<class T>
T max2(T a,T b){return a>b?a:b;}
template<class T>
T min2(T a,T b){return a<b?a:b;}

void solve()
{
	int n;cin>>n;
	string s=to_string(n);
	int sum=0;
	for(char c:s)
	sum+=(c-'0');
	if(n%sum==0)
	cout<<"Yes";
	else
	cout<<"No";
}

int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int t=1;
//cin>>t;
for(int i=1;i<=t;i++)
{
    solve();
}
return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define FORI(i,v) for (auto i = v.begin(); i != v.end(); i++)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)
#define YES(b) cout << ((b) ? "YES" : "NO") << endl
#define Yes(b) cout << ((b) ? "Yes" : "No") << endl
#define DOUBLE(d) cout << fixed << setprecision(15) << (d) << endl

ll A, B, N;

int main() {
    cin >> A >> B >> N;
    ll x = min(N, B-1);
    cout << A*x/B - x/B*A << endl;
}

Measured memory_bytes: 3552
#include<bits/stdc++.h> 
using namespace std;
int n;
vector<int> a, f, fac;
int main(int argc, char const *argv[])
{
    cin >> n;
    a.resize(n);
    f.resize(1000001);
    fac.resize(1000001);
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        f[a[i]] ++;
    }
    for (int i = 1; i <= 1000000; ++i)
    {
        for (int j = i; j <= 1000000; j+=i)
            fac[j] += f[i];
    }
    int ans = 0;
    for (int i = 0; i < n; ++i)
    {
        if (fac[a[i]] == 1)
            ans ++;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 11884
N, K = map(int, input().split())
S = list(input())

if S[K-1] == 'A':
  S[K-1] = 'a'
elif S[K-1] == 'B':
  S[K-1] = 'b'
else:
  S[K-1] = 'c'
print(''.join(S))

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

int main() {
    char b;
    cin >> b;
    if (b == 'A') cout << 'T' << endl;
    else if (b == 'T') cout << 'A' << endl;
    else if (b == 'C') cout << 'G' << endl;
    else cout << 'C' << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args){
        //入力
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] x = new int[N];
        for(int i=0;i<N;i++){
            x[i] = sc.nextInt();
        }
        // 出力
        int sum = 0;
        int minDist;
        for(int i=0;i<N;i++){
            minDist = Math.min(x[i], K-x[i]);
            sum += minDist;
        }
        System.out.println(2*sum);
    }
}



Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int N,C;
  cin >> N >> C;
  vv(P) A(C);
  rep(i,N) {
    int s,t,c;
    cin >> s >> t >> c;
    c--;
    A[c].push_back(P(s,t));
  }
  rep(i,C) {
    sort(rng(A[i]));
    vp a;
    rep(j,sz(A[i])) {
      if(j+1<sz(A[i]) && A[i][j].second == A[i][j+1].first) {
        int k = j+1;
        while(k+1<sz(A[i])&&A[i][k].second == A[i][k+1].first) {
          k++;
        }
        a.push_back(P(A[i][j].first,A[i][k].second));
        j = k;
      } else {
        a.push_back(A[i][j]);
      }
    }
    A[i] = a;
  }
  vi imos(100010,0);
  rep(i,sz(A)) {
    rep(j,sz(A[i])) {
      imos[A[i][j].first-1]++;
      imos[A[i][j].second]--;
    }
  }
  int ans = 0;
  int tmp = 0;
  rep(i,100010) {
    tmp += imos[i];
    ans = max(ans,tmp);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1920
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)
from pprint import pprint


'''

'''

def solve(x):
	d = {}
	for i in range(1,10):
		for j in range(1,10):
			s = str(i) + str(j)
			d[s] = 0
	# pprint(d)
	rr = {}
	for i in d:
		rr[i] = i[::-1]
		rr[i[::-1]] = i
	# l = [i for i in range(1,x+1)]
	ans = 0
	for i in range(1,x+1):
		ii = str(i)
		if(ii[-1] != '0'):
			s = ii[0] + ii[-1]
			r = rr[s]
			d[s] += 1
			# d[r] += 1
			# dd[s].append(i)
			# if(len(ii) > 1):
				# if(i not in dd[r]):
					# dd[r].append(i)
	# print(d)
	# pprint(dd)
	# pprint(d)
	for i in d:
		ans += d[i]*d[rr[i]]
	return ans

N = int(stdin.readline())
ans = solve(N)
print(ans)


Measured memory_bytes: 5228
s=int(input())
lst=[]

while s>0:
    lst.append(s%10)
    s//=10

lst.reverse()
a=len(lst)
abslst=[]
for i in range(a-2):
    b=lst[i]*100+lst[i+1]*10+lst[i+2]
    abslst.append(abs(753-b))

print(min(abslst))

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

#define FILE
#define fr first
#define se second

using namespace std;

const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;

int x;
int y;
int z;
int main()
{
    #ifdef FILEs
        freopen("input.txt", "r", stdin);
        /// freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);

    cin >> x >> y >> z;
    swap(x, y);
    swap(x, z);
    cout << x << " " << y << " " << z << "\n";
}


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

from __future__ import division, print_function
import sys


def main():
    x, a, b = map(int, sys.stdin.readline().strip().split(" "))
    if b - a <= 0:
        print("delicious")
    elif b - a <= x:
        print("safe")
    else:
        print("dangerous")


if __name__ == '__main__':
    main()


Measured memory_bytes: 2692
n, k = map(int, input().split())

s = []
for a in range(1, n + 1):
    if (2 * a) % k == 0:
        s.append(a)

t = []
for a in range(1, n + 1):
    if a % k == 0:
        t.append(a)

print((len(s) - len(t)) ** 3 + len(t) ** 3)

Measured memory_bytes: 18932
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define all(x) x.begin(),x.end()
#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL);
#define N

int main(){
	FIO;
	int a,b,k; cin >> k >> a >> b;
    cout << ((b/k) - ((a-1)/k) > 0 ? "OK" : "NG") << endl;
	return 0;
}

Measured memory_bytes: 3620
// Try Educational DP Contest
// author: Leonardone @ NEETSDKASU

fn main() {
	let mut stdin = String::new();
	std::io::Read::read_to_string(
		&mut std::io::stdin(),
		&mut stdin).unwrap();
	let mut stdin = stdin.split_whitespace();
	let mut get = || stdin.next().unwrap();
	macro_rules! get {
		($t:ty) => (get().parse::<$t>().unwrap());
		() => (get!(i64));
	}
	
	let n = get!(usize);
	let mut hs = vec![];
	for _ in 0..n {
		hs.push(get!());
	}
	let mut dp = vec![std::i64::MAX; n + 3];
	dp[0] = 0;
	use std::cmp::min;
	for i in 0..n-1 {
		dp[i+1] = min(dp[i+1],dp[i]+
			(hs[i]-hs[i+1]).abs());
		if i+2<n {
			dp[i+2] = min(dp[i+2],dp[i]+
				(hs[i]-hs[i+2]).abs());
		}
	}
	println!("{}", dp[n-1]);
}

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

using namespace std;

typedef unsigned long long ll;

void calc(ll n, ll a, ll b, ll c, ll d, map<ll,ll>&m) {
  if (m.find(n) != m.end() || n == 0) {
    return;
  }
  m[n] = n*d;
  ll u2 = n,l2 = n,u3 = n,l3 = n,u5 = n,l5 = n;
  while (u2 % 2 != 0) ++u2;
  while (l2 % 2 != 0) --l2;
  while (u3 % 3 != 0) ++u3;
  while (l3 % 3 != 0) --l3;
  while (u5 % 5 != 0) ++u5;
  while (l5 % 5 != 0) --l5;
  calc(u2/2,a,b,c,d,m);
  calc(l2/2,a,b,c,d,m);
  calc(u3/3,a,b,c,d,m);
  calc(l3/3,a,b,c,d,m);
  calc(u5/5,a,b,c,d,m);
  calc(l5/5,a,b,c,d,m);
  m[n] = min(m[n], a+m[u2/2]+d*(u2-n));
  m[n] = min(m[n], a+m[l2/2]+d*(n-l2));
  m[n] = min(m[n], b+m[u3/3]+d*(u3-n));
  m[n] = min(m[n], b+m[l3/3]+d*(n-l3));
  m[n] = min(m[n], c+m[u5/5]+d*(u5-n));
  m[n] = min(m[n], c+m[l5/5]+d*(n-l5));
}

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int tt; cin >> tt;
  while (tt--) {
    ll n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    map<ll,ll> m;
    calc(n,a,b,c,d,m);
    cout << m[n] << endl;
  }

  
  return 0;
}




Measured memory_bytes: 4420