akhauriyash/Code-Regression huggingface dataset:
// eddy1021
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
#define mod9 1000000009LL
#define mod7 1000000007LL
#define INF  1023456789LL
#define INF16 10000000000000000LL
#define eps 1e-9
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(), (x).end()
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#ifndef ONLINE_JUDGE
#define debug(...) printf(__VA_ARGS__)
#else 
#define debug(...)
#endif
inline LL getint(){
  LL _x=0,_tmp=1; char _tc=getchar();    
  while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
  if( _tc == '-' ) _tc=getchar() , _tmp = -1;
  while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
  return _x*_tmp;
}
inline LL add( LL _x , LL _y , LL _mod = mod7 ){
  _x += _y;
  return _x >= _mod ? _x - _mod : _x;
}
inline LL sub( LL _x , LL _y , LL _mod = mod7 ){
  _x -= _y;
  return _x < 0 ? _x + _mod : _x;
}
inline LL mul( LL _x , LL _y , LL _mod = mod7 ){
  _x *= _y;
  return _x >= _mod ? _x % _mod : _x;
}
LL mypow( LL _a , LL _x , LL _mod ){
  if( _x == 0 ) return 1LL;
  LL _ret = mypow( mul( _a , _a , _mod ) , _x >> 1 , _mod );
  if( _x & 1 ) _ret = mul( _ret , _a , _mod );
  return _ret;
}
LL mymul( LL _a , LL _x , LL _mod ){
  if( _x == 0 ) return 0LL;
  LL _ret = mymul( add( _a , _a , _mod ) , _x >> 1 , _mod );
  if( _x & 1 ) _ret = add( _ret , _a , _mod );
  return _ret;
}
inline bool equal( D _x ,  D _y ){
  return _x > _y - eps && _x < _y + eps;
}
void sleep( double sec = 1021 ){
  clock_t s = clock();
  while( clock() - s < CLOCKS_PER_SEC * sec );
}
#define Bye exit(0)
int __ = 1 , _cs;
/*********default*********/
#define N 202020
void build(){

}
char s[ N ];
map<int,int> M;
void init(){
  scanf( "%s" , s + 1 );
}
int dp[ N ];
void modify( int x , int v ){
  auto it = M.find( x );
  if( it == M.end() ){
    M[ x ] = v;
  }else{
    it->second = min( it->second , v );
  }
}
int query_M( int x ){
  auto it = M.find( x );
  if( it == M.end() ) return N;
  return it->second;
}
int query( int x ){
  int ret = query_M( x );
  for( int i = 0 ; i < 26 ; i ++ )
    ret = min( ret , query_M( x ^ (1 << i) ) );
  return ret;
}
void solve(){
  M[ 0 ] = 0;
  int msk = 0;
  int len = strlen( s + 1 );
  for( int i = 1 ; i <= len ; i ++ ){
    msk ^= (1 << (s[ i ] - 'a'));
    dp[ i ] = query( msk ) + 1;
    modify( msk , dp[ i ] );
  }
  printf( "%d\n" , dp[ len ] );
}
int main(){
  build();
  //__ = getint();
  while( __ -- ){
    init();
    solve();
  }
}


Measured memory_bytes: 10624
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cstring>
using namespace std;
using P = pair<int, pair<int, int>>;

const int H_MAX = 1005;
const int W_MAX = 1005;
const int INF = 1000005;

char S[H_MAX][W_MAX];
int root[H_MAX][W_MAX];


int main(){
    int h, w;
    int ch, dh, cw, dw;
    cin >> h >> w;
    cin >> ch >> cw >> dh >> dw;
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++)cin >> S[i][j];
    }

    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++)root[i][j] = INF;
    }
    root[ch][cw] = 0;
    priority_queue<P> Q;
    Q.push(make_pair(0, make_pair(ch, cw)));
    vector<int> zh{1, -1, 0, 0};
    vector<int> zw{0, 0, 1, -1};
    while(!Q.empty()){
        int nowh = Q.top().second.first;
        int noww = Q.top().second.second;
        int num = -1 * Q.top().first;
        Q.pop();
        if (root[nowh][noww] < num)continue;
        for(int i = 0; i < 4; i++){
            int newh = nowh + zh[i];
            int neww = noww + zw[i];
            if (newh < 1 || newh > h || neww < 1 || neww > w)continue;
            if (S[newh][neww] == '.' && root[newh][neww] > num){
                root[newh][neww] = num;
                Q.push(make_pair(-num, make_pair(newh, neww)));
            }
        }
        for(int i = -2; i <= 2; i++){
            for(int j = -2; j <= 2; j++){
                int newh = nowh + i;
                int neww = noww + j;
                if (newh < 1 || newh > h || neww < 1 || neww > w)continue;
                if (S[newh][neww] == '.' && root[newh][neww] > num+1){
                    root[newh][neww] = num+1;
                    Q.push(make_pair(-(num+1), make_pair(newh, neww)));
                }
            }
        }
    }
    if (root[dh][dw] == INF) cout << -1 << endl;
    else cout << root[dh][dw] << endl;
    return 0;
}

Measured memory_bytes: 8036
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repe(i,n) for (int i = 0; i <= (n); ++i)
#define repe1(i,n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
#define eb(k,v) emplace_back(k,v)
#define ct(res) cout << res << "\n";
#define vi vector<int>
#define vl vector<ll>
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n; cin >> n;
    ll res = (n-1)*((n-1)+1)/2;
    cout << res << "\n";
}



Measured memory_bytes: 256
/* Doubly Linked List */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct node
{
    unsigned int key;
    struct node *next;
    struct node *prev;
};

typedef struct node *NodePointer;

NodePointer nil;

NodePointer listSearch(int key)
{
    NodePointer p = nil -> next;
    while(1){
        if(p -> key == key){ break; }
        if(p -> next == nil){ return nil; }
        p = p -> next;
    }
    return p;
}

void init()
{
    nil = malloc(sizeof(struct node));
    nil -> next = nil;
    nil -> prev = nil;
    return;
}

void printList()
{
    NodePointer cur = nil -> next;
    int isf = 1;
    while(1){
        if(cur == nil){ break; }
        if(isf == 0){ printf(" "); }
        printf("%d", cur -> key);
        cur = cur -> next;
        isf = 0;
    }
    printf("\n");
    return;
}

void deleteNode(NodePointer t)
{
    t -> prev -> next = t -> next;
    t -> next -> prev = t -> prev;
    free(t);
    return;
}

void deleteFirst()
{
    NodePointer t = nil -> next;
    if(t == nil){ return; }
    deleteNode(t);
    return;
}

void deleteLast()
{
    NodePointer t = nil -> prev;
    if(t == nil){ return; }
    deleteNode(t);
    return;
}

void delete(int key)
{
    NodePointer x;
    x = listSearch(key);
    if(x != nil){ deleteNode(x); }
    return;
}

void insert(int key)
{
    NodePointer x;
    x = malloc(sizeof(struct node));
    x -> key = key;
    x -> prev = nil;
    if(nil -> next == nil){
        nil -> next = x;
        x -> next = nil;
        nil -> prev = x;
    } else{
        nil -> next -> prev = x;
        x -> next = nil -> next;
        nil -> next = x;
    }
    return;
}

int main()
{
    int key, n, i;
    int size = 0;
    char com[20];
    int np = 0, nd = 0;
    scanf("%d", &n);
    init();
    for(i=0; i<n; i++){
        scanf("%s", com);
        if(com[0] == 'i'){
            scanf("%d", &key);
            insert(key);
            np++;
            size++;
        } else if(com[0] == 'd'){
            if(strlen(com) > 6){
                if(com[6] == 'F'){ deleteFirst(); }
                else if(com[6] == 'L'){ deleteLast(); }
                } else{
                    scanf("%d", &key);
                    delete(key);
                    nd++;
                }
                size--;
        }
    }
    printList();
    return 0;
}


Measured memory_bytes: 32920
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <utility>

#include <cassert>
#include <cmath>
#include <cstdio>

using namespace std;

#define fi first
#define se second
#define mkp make_pair
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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

int main() {
	int N;
	int res = 0;
	cin >> N;
	vector<ll> A(N), B(N);
	rep(i, N) cin >> A[i];
	rep(i, N) cin >> B[i];

	priority_queue<ll> C;
	ll D = 0;
	rep(i, N) {
		if(A[i] > B[i]) {
			C.push(A[i]-B[i]);
		}
		else if(A[i] < B[i]) {
			D += B[i]-A[i];
			res++;
		}
	}

	while(D > 0 && C.size()) {
		D -= C.top(); C.pop();
		res++;
	}
	if(D > 0)
		cout << -1 << endl;
	else
		cout << res << endl;
	return 0;
}


Measured memory_bytes: 2428
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi atan(1.0)*4
#define pb(x) push_back(x)
#define in(x) insert(x)
#define fl(x,y) for(ll i=x;i<y;i++)
#define vi vector<long long>
#define vs  vector<string>
#define vp(vi,x) cin>>x; vi.pb(x);
string en="\n";
string t="hello";
string Y="YES\n";
string N="NO\n";
#define E end()
#define B begin()
#define sz size()
#define EM empty()
#define fi first
#define se second
#define clr clear()
#define sqr(a) (a*a)
#define mk make_pair
#define mem(a,b) memset(a,b,sizeof(a))
#define all(cont) cont.begin(),cont.end()
/*bool isprm(LL a){for(LL i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
bool palin(string a){for(int i=0;i<a.sz;i++){if(a.at(i)!=a.at(a.sz-i-1))return 0;} return 1;}
bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}
int toInt(string s){int sm;stringstream ss(s);ss>>sm;return sm;}
LL bpow(LL a,LL b){if(b==0)return 1;LL r=bpow(a,b/2);if(b%2)return r*r*a;else return r*r;}
LL binpow(LL a,LL b){LL r=1;while(b>0){if(b&1)r=r*a;a=a*a;b>>=1;}return r;}
LL binpow(LL a,LL b,LL m){a%=m;LL r=1;while(b>0){if(b&1) r=r*a%m;a=a*a%m; b>>=1;}return r;}
template<typename T>inline T gcd(T a,T b){if(a<0)return gcd(-a,b);if(b<0)return gcd(a,-b);return (b==0)?a:gcd(b,a%b);}
template<typename T>inline T lcm(T a,T b) {if(a<0)return lcm(-a,b);if(b<0)return lcm(a,-b);return a*(b/gcd(a,b));}
*/
int main()
{
    ll X,R,m,a,b,c,d,x,y,z,w,t,n,k,p,q,r,sum,ct=0,flag=0;
    string s,s1,s2,s3,s4,s6="yellow",s5="red",s7;
    set<ll>st;
    cin>>t; ll mx=0,c1=0,c2=0,c3=0,c4=0;
    while(t--)
    {
        cin>>s;
        if(s=="AC") c1++;
        if(s=="WA") c2++;
        if(s=="TLE") c3++;
        if(s=="RE") c4++;
    }
        cout<<"AC x "<<c1<<endl;
        cout<<"WA x "<<c2<<endl;
        cout<<"TLE x "<<c3<<endl;
        cout<<"RE x "<<c4<<endl;

}



Measured memory_bytes: 3624
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

int max(int a, int b) {
	return (a < b) ? b : a;
}

int max(int a, int b, int c) {
	return (max(a, b) < c) ? c : max(a, b);
}
int main() {
	int N;
	cin >> N;

	vector<int> L(N);

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

	int ans = 0;
	
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			if (L.at(i) == L.at(j)) {
			}
			else {
				for (int k = j + 1; k < N; k++) {
					if (L.at(i) == L.at(k)) {

					}
					else if(L.at(j)==L.at(k)){

					}
					else {
						int li = L.at(i);
						int lj = L.at(j);
						int lk = L.at(k);
						if (li + lj > lk && lj + lk > li && lk + li > lj) {
							ans++;
						}
					}
				}
			}
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 3636
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    s = input()
    
    if len(s) == 2:
        print(s)
    else:
        print(s[::-1])

Measured memory_bytes: 3828
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
namespace mp = boost::multiprecision;

// using Bint = mp::cpp_int;
// using Real = mp::number<mp::cpp_dec_float<1024>>;
// const int INF = 1000000007;
// #define rep(i, n) for (int i = 0; i < (int)(n); i++)
// #define all(v) v.begin(), v.end()

int main(){
    int l, r;
    cin >> l >> r;
    int div = 2019;

    if( l / div < r / div) cout << 0 << endl;
    else{
        int a = l % div;
        int b = r % div;
        int ans = 2019;
        for(int i = a; i <= b - 1; i++){
            for(int j = i + 1; j <= b; j++){
                ans = min(ans, (i * j) % div);
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 256
N,M,X = map(int,input().split())
l = list(map(int,input().split()))
num = X
ans1 = 0
ans2 = 0
while num <= N:
  if num in l:
    ans1 += 1
  num += 1
num = X
while num >= 0:
  if num in l:
    ans2 += 1
  num -= 1
print(min(ans1,ans2))

Measured memory_bytes: 9160
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,b,a) for(int i=b;i>=a;i--)
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Forenska(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
#define lowbit(x) ((x)&(-x))
#define GREATER(x) x,vector<x>,greater<x>
#define randIn(L,R) (((LL)rand()*rand())%(R-L)+L)
#define __lcm(a,b) ((a)/__gcd(a,b)*(b))
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pLL;
typedef vector<int> vec;
typedef vector<LL> vecL;
typedef vector<pii> vecP;
typedef vector<pLL> vecPL;
typedef vector<string> vecS;
typedef vector<vec> mat;
typedef complex<double> point;
const long double PI=3.14159265358979323846264338327950288419716939937510582097;
const LL INFLL=0x3f3f3f3f3f3f3f3f;
const int INF=0x3f3f3f3f;
const long double EPS=1e-10;
int read()
{
    int x=0;
    char ch=' ';
    bool flag=false;
    while(ch<'0' || ch>'9')
    {
        if(ch=='-')flag=true;
        ch=getchar();
    }
    while(ch>='0' && ch<='9')
    {
        x=(x<<3)+(x<<1)+ch-'0';
        ch=getchar();
    }
    return flag?-x:x;
}

int main()
{
	int L=read();
	int id=-1,ans=0;
	rep(i,0,20)if(L&(1<<i))ans++,id=i;
	if(id==19)ans--;
	ans+=id*2;
	cout<<20<<" "<<ans<<endl;
	For(i,1,id)
	{
		cout<<i<<" "<<i+1<<" "<<0<<endl;
		cout<<i<<" "<<i+1<<" "<<(1<<(i-1))<<endl;
	}
	int x=(id==19)?524288:0;
	rep(i,0,19)
	{
		if(L&(1<<i))
		{
			cout<<i+1<<" "<<20<<" "<<x<<endl;
			x+=(1<<i);
		}
	}
	return 0;
}



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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
int w,h;
char board[61][30];
typedef tuple< ll, ll, PII> State;
const ll INF = 1e15;
ll dijkstra(){
  ll res = INF;
  ll dist[h][w][2];
  rep(a,h)rep(b,w)rep(c,2) dist[a][b][c] = INF;
  priority_queue< State, vector<State>, greater<State>> que;
  rep(i,w){
    if(board[h-1][i] == 'S'){
      que.push(State(0,1,{h-1,i}));
      que.push(State(0,0,{h-1,i}));
    }
  }

  while(que.empty() == false){
    State s = que.top(); que.pop();
    ll cdist = get<0>(s);
    ll cturn = get<1>(s);
    PII current = get<2>(s);
    int ci = current.first, cj = current.second;

    if(dist[ci][cj][cturn] < cdist) continue;
    if(board[ci][cj] == 'T') res = min(cdist,res);
    if(cturn == 0){//左足を動かす
      FOR(i,ci-3, ci+4) FOR(j,cj-4,cj){
        if(i >= 0 && j >= 0 && i < h && j < w &&
          (abs(ci - i) + abs(cj - j) <= 3) && board[i][j] != 'X'){

            ll cost = 0;
            if(board[i][j]!= 'T' && board[i][j]!= 'S') cost += board[i][j] - '0';
            if( dist[i][j][1] > cdist + cost){
              dist[i][j][1] = cdist + cost;
              que.push(State(cdist+cost,1,{i,j}));
            }
          }
        }
    }else{
      FOR(i,ci-3, ci+4) FOR(j,cj+1,cj+4){
        if(i >= 0 && j >= 0 && i < h && j < w &&
          (abs(ci - i) + abs(cj - j)) <= 3 && board[i][j] != 'X'){
            ll cost = 0;
            if(board[i][j]!= 'T' && board[i][j]!= 'S') cost += board[i][j] - '0';
            if( dist[i][j][0] > cdist + cost){
              dist[i][j][0] = cdist + cost;
              que.push(State(cdist+cost,0,{i,j}));
            }
          }
        }
    }
  }
  return res;
}

void solve(){
  ll ans = dijkstra();
  if(ans == INF) cout << -1 << endl;
  else cout << ans << endl;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  while(true){
    cin >> w >> h;
    if( w == 0 && h == 0) break;
    rep(i,h)rep(j,w) cin >> board[i][j];
    solve();
  }
  return 0;
}



Measured memory_bytes: 3192
#include <bits/stdc++.h>
#define sqr(x) (x) * (x)
using namespace std;
int X[11][11];
int pfs[205];
void init()
{
	for (int i = 0; i <= 200; i ++) pfs[i] = sqr(i);
}
int main()
{
	init();
	int N, D, res = 0;
	cin >> N >> D;
	for (int i = 0; i < N; i ++) for (int j = 0; j < D; j ++) cin >> X[i][j];
	for (int i = 0; i < N; i ++) for (int j = i + 1; j < N; j ++)
	{
		int p = 0;
		for (int k = 0; k < D; k ++) p += sqr(X[i][k] - X[j][k]);
		for (int k = 0; k <= 200; k ++) if (p == pfs[k]) {res ++; break;}
	}
	cout << res << endl;
} 

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

using namespace std;

using ll = int64_t;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = INT_MAX;
constexpr ll L_INF = LLONG_MAX;

//===




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

	ll N, K;
	cin >> N >> K;

	Vl A(N);

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

	Vl sums(N + 1);
	for (int i = 0; i < N; ++i) {
		sums[i + 1] = sums[i] + A[i];
	}

	map<ll, ll> val_num;

	ll ans = 0;

	for (int j = 1; j <= N; ++j) {
		++val_num[((sums[j - 1] - (j - 1)) % K + K) % K];
		if (j - K + 1 >= 1) --val_num[((sums[j - K] - (j - K)) % K + K) % K];
		ans += val_num[((sums[j] - j) % K + K) % K];
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 15872
import java.util.*;
public class Main{
    public static void main(String[] args) {
  Scanner sc=new Scanner(System.in);
String S=sc.next();
String ans; 
if(S.length()==2){
ans=S;
}
else{
        ans=S.substring(2,3)+S.substring(1,2)+S.substring(0,1);
        }
System.out.println(ans);
    }
}

Measured memory_bytes: 23508
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * File:   main.cpp
 * Author: shrif
 *
 * Created on January 20, 2017, 8:32 AM
 */

//============================================================================
// Name        : recursion.cpp
// Author      : Sherif Embarak
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;

int n, s;
int table[50010];

int main() {

    cin >> s>>n;
    vector<int>v(n);
    for (int i = 0; i < n; i++)
        cin >> v[i];

    sort(v.begin(),v.end());

    table[0] = 0;
    for (int i = 1; i <= s; i++)
        table[i] = i/v[0];

    for (int i = 0; i < n; i++) {
        for (int j = 1; j <= s; j++) {
            if (j >= v[i])
                    table[j] = min(table[j], table[j - v[i]] + 1);
        }
    }
    cout << table[s] << endl;
    return 0;
}

Measured memory_bytes: 3316
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val a = sc.nextInt()
    val b = sc.nextInt()
    val c = sc.nextInt()

    val y = a - b
    if (c <= y) {
        print(0)
    } else {
        print(c - y)
    }
}


Measured memory_bytes: 29604
import java.util.*;
 
public class Main{
 
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int[][] route = new int[2*M][2];
		boolean[] used = new boolean[N];
		used[0] = true;
		for(int i=0; i<M; i++){
			route[2*i][0] = sc.nextInt()-1;
			route[2*i][1] = sc.nextInt()-1;
			route[2*i+1][0] = route[2*i][1];
			route[2*i+1][1] = route[2*i][0];
		}
 
		int ans = dfs(route,0,used);
		System.out.println(ans);
		return;
	}
 
	public static int dfs(int[][] route,int start,boolean[] used){
		boolean check = true;
		for(int i=0; i<used.length; i++){
			check = check & used[i];
		}
 
		if(check) return 1;
		else{
			int ret = 0;
			for(int i=0; i<route.length; i++){
				if(route[i][0] == start && !used[route[i][1]]){
					used[route[i][1]] = true;
					ret += dfs( route,route[i][1],used);
					used[route[i][1]] = false;
				}
			}
			return ret;
		}
	}
}

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

int main() {
    int N; cin >> N;
    string S; cin >> S;

    int res = 1;
    for(int i=0; i+1<N; ++i) {
        if(S[i] != S[i + 1]) ++res;
    }
    cout << res << endl;
}

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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    System.out.println((a==b && a==c) || (a!=b && a!=c && b!=c) ?"No":"Yes");
  }
}

Measured memory_bytes: 21204
#include <stdio.h>
#include <math.h>
int main()
{
  long long int n,i,j,value;
  scanf ("%lld",&n);
  i = sqrt(n);
  for (; ;i--)
  {
    if (n%i==0)
    {
      j=n/i;
      break;
    }
  }
  value=i+j-2;
  printf ("%lld",value);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
//const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

int gcds(int a, int b){
    int c = a % b;
    while (c != 0){
        a = b;
        b = c;
        c = a % b;
    }
    return b;
}

int main() {
    int x, a, b; cin >> x >> a >> b;
    x -= a;
    x %= b;
    cout << x << endl;
}

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

using namespace std;

const int N = 705;

bool edge[N][N], dp[N][N];
int n, m, cntcolor[2], color[N];

bool dfs (int u, int col) {
    color[u] = col; cntcolor[color[u]]++;
    for (int i = 1; i <= n; i++) {
        if (edge[u][i] && u != i) {
            if (color[i] == color[u]) return false;
            else if (color[i] == -1 && !dfs(i, col ^ 1)) return false;
        }
    }

    return true;
}

int main(){
    scanf("%d %d", &n, &m);
    memset(color, -1, sizeof(color)); memset(edge, true, sizeof(edge)); memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= n; i++) edge[i][i] = false;
    for (int i = 1; i <= m; i++) {
        int u, v;
        scanf("%d %d", &u, &v);
        edge[u][v] = edge[v][u] = false;
    }

    dp[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        memset(cntcolor, 0, sizeof(cntcolor));
        if (color[i] == -1 && !dfs(i, 0)) return !printf("%d", -1);
        for (int j = 0; j <= n; j++) {
            if (j + cntcolor[0] <= n) dp[i][j + cntcolor[0]] |= dp[i - 1][j];
            if (j + cntcolor[1] <= n) dp[i][j + cntcolor[1]] |= dp[i - 1][j];
        }
    }

    int ans = 1e9;
    for (int i = 0; i <= n; i++) if (dp[n][i]) ans = min(ans, i * (i - 1) / 2 + (n - i) * (n - i - 1) / 2);
    printf("%d", ans);
    return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
const int inf=1e9+7;
int main()
{
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	int g[5];
	cin>>g[1]>>g[2]>>g[3];
	sort(g+1,g+4);
	cout<<g[1]+g[2]+g[3]*10<<endl; 
	return 0;
}

Measured memory_bytes: 384
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC170_c solver = new ABC170_c();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC170_c {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int X = in.nextInt();
            int N = in.nextInt();
            int p[] = new int[N];
            int mas[] = new int[110];
            for (int i = 0; i < mas.length; i++) {
                mas[i] = Integer.MAX_VALUE;
            }
            for (int i = 0; i < N; i++) {
                p[i] = in.nextInt();
            }
            Arrays.sort(p);
            for (int i = 0; i < p.length; i++) {
                mas[p[i]] = p[i];
            }
            if (mas[X] == Integer.MAX_VALUE) {
                out.println(X);
                return;
            }
            int plus = 0;
            for (int i = X; i < mas.length; i++) {
                if (mas[i] == Integer.MAX_VALUE) {
                    plus = i;
                    break;
                }
            }
            int minus = 0;
            for (int i = X; i >= 0; i--) {
                if (mas[i] == Integer.MAX_VALUE) {
                    minus = i;
                    break;
                }
            }
            if (Math.abs(X - plus) >= Math.abs(X - minus)) {
                out.println(minus);
            } else {
                out.println(plus);
            }
        }

    }
}



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


int main() {
    /* 入力受け取り */
    int n, Q;
    cin >> n >> Q;
    vector<long long> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    
    /* Q 回分のクエリを処理 */
    for (int j = 0; j < Q; ++j) {
        long long x; cin >> x; // 各クエリ x
        
        /* 合計値 */
        long long res = 0;
        
        /* 区間の左端 left で場合分け */
        int right = 0;     // 毎回 right を使い回すようにする
        long long sum = 0; // sum も使い回す
        for (int left = 0; left < n; ++left) {
            /* sum に a[right] を加えても大丈夫なら right を動かす */
            while (right < n && sum + a[right] <= x) {
                sum += a[right];
                ++right;
            }
            
            /* break した状態で [left, right) は条件を満たす最大 */
            res += (right - left);
            
            /* left を除く */
            sum -= a[left];
        }
        
        cout << res << endl;
    }
}


Measured memory_bytes: 3512
void main() {
  problem();
}

void problem() {
  auto A = scan!int;
  auto B = scan!int;
  auto C = scan!int;
  auto D = scan!int;

  bool solve() {
    while(true) {
      C -= B;
      if (C <= 0) return true;

      A -= D;
      if (A <= 0) return false;
    }
  }

  writeln(solve() ? "Yes" : "No");
}

// ----------------------------------------------

import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");

// -----------------------------------------------


Measured memory_bytes: 2700
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <random>
#include <fstream>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, m, z = 0;
    ll a[200005] = {}, b[200005] = {}, k;
    cin >> n >> m >> k;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= m; i++) cin >> b[i];
    for (int i = 1; i <= n; i++) a[i] += a[i - 1];
    for (int i = 1; i <= m; i++) b[i] += b[i - 1];
    for (int i = 0; i <= n; i++) {
        if (a[i] <= k) {
            int l = 0, r = m + 1;
            while (l + 1 < r) {
                int x = (l + r) / 2;
                if (a[i] + b[x] <= k) {
                    l = x;
                } else {
                    r = x;
                }
            }
            z = max(z, i + l);
        }
    }
    cout << z;
}


Measured memory_bytes: 6308
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define test long long int t; cin>>t; while(t-->0)
#define fIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define loop(n) for(long long int i=0;i<n;i++)
using namespace std;
int main()
{
    fIO
       string s;
       cin>>s;
       int n=s.length();
       int c=0;
       char c1,c2;
       for(int i=0;i<n;i++)
       {
           c1=s[i];
           c2=s[i+1];
           if(c1=='0')
           {
               if(c2==c1)
               {
                   s[i+1]='1';
                   c++;
               }
           }
           else if(c1=='1')
           {
               if(c2==c1)
               {
                   s[i+1]='0';
                   c++;
               }
           }
       }
       cout<<c;
    return 0;
}

Measured memory_bytes: 512
N = int(input())
A = []
for i in range(N):
  A.append(int(input()))
sorted_A = sorted(A,reverse=True)
m1 = sorted_A[0]
m2 = sorted_A[1]

for Ai in A:
  if Ai != m1:
    print(m1)
  else:
    print(m2)
  

Measured memory_bytes: 14112
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (int)(b); ++i)

using namespace std;

vector<int> vec;

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

int main(void) {
	long long a;
	long long b;

	vector<long long> vec;

	long long ans = 0;


	cin >> a >> b;




	cout << ceil((double)(a / (double)(b * 2 + 1)));



}




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

int cmp(const void *a,const void *b){
  return *(int*)a - *(int*)b;
}

int main(void){
  int i,n,ans=0;
  scanf("%d",&n);
  int a[n];
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  qsort(a,n,sizeof(int),cmp);
  if(n%2==0){
    for(i=0;i<n;i++){
      if(i%2==0) ans-=a[i];
      else ans+=a[i];
    }
  }else{
    for(i=0;i<n;i++){
      if(i%2==0) ans+=a[i];
      else ans-=a[i];
    }
  }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 128
package main

import (
	"fmt"
	"strconv"
	"strings"
)

// go run ./main.go < in

func main() {
	var a, b string
	fmt.Scan(&a, &b)

	b100 := strings.Replace(b, ".", "", -1)

	aa, _ := strconv.Atoi(a)
	bb, _ := strconv.Atoi(b100)

	fmt.Println(aa * bb / 100)
}

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

int main()
{
    long long a=0,b=0,c=0,count=0;
    scanf("%lld",&a);
    scanf("%lld",&b);
    scanf("%lld",&c);
    if(a+b==0)
    {
        count=0;
    }
    if(a+b!=0&&c==0)
    {
        count=b;
    }
    if(a+b==c||a+b>c&&a+b!=0&&c!=0)
    {
        count=b+c;
    }
    if(a+b<c&&a+b!=0&&c!=0)
    {
        count=a+b*2+1;
    }
    printf("%lld",count);
}


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

int main(){
  int n;
  cin >> n;
  ll a[n];
  rep(i,n) cin >> a[i];
  ll ans = 0;
  ans += a[0]-1;
  int p = 2;
  for(int i = 1; i < n; i++) {
    if(a[i] != p) ans += (a[i]-1)/p;
    else p++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>

#define REP(i,n) for(i=0; i < (n); i++)
#define REPONE(i, n) for(i=1; i <= (n); i++)
#define LOOP(n) for(int loopCount=1; loopCount <= (n); loopCount++)
#define ITER(c) __typeof((c).begin())
#define EACH(c,it) for(ITER(c) it =(c).begin(); it!=(c).end(); it++)
#define SZ(c) ((int) (c).size())
#define ALL(c) c.begin(), c.end()
#define SUM(c) accumulate(ALL(c), 0)
#define EXIST(c,v) (find(ALL(c), (v)) != (c).end())
#define PB push_back
#define MP make_pair

using namespace std;
static const double EPS = 1e-9;
static const double PI = 3.141592653589793238462643383279;
typedef long long ll;

vector<int> primeTable(int n){
    vector<int> ps;
    vector<int> table(n+1, 0);
    for(int i=2; i<=n; i++){
        if(!table[i]){
            ps.push_back(i);
        if(i <= sqrt(n)) table[i*i] = i;
        }
        else{
        int j = i, step = table[i];
            while(j+step<=n){
                if(!table[j+step]) {
                    table[j+step] = step;
                    break;
                }
                else {
                    int tmp = step;
                    step = table[j+step];
                    table[j+tmp] = tmp;
                    j += tmp;
                }
            }
        }
    }
    return ps;
}

int main(){
    ll n;
    vector<int> ps=primeTable(1100000);
    int i, s = SZ(ps);
    while(cin>>n){
        if(n==0) break;
        vector<int> es;
        for(i=0;n!=1 && i<s;i++){
            if(n%ps[i]==0){
                int cnt=1;
                n/=ps[i];
                while(n%ps[i]==0){
                    n /= ps[i];
                    cnt++;
                }
                es.PB(cnt);
            }
        }
        if(i==s && n!=1) es.PB(1);
        ll ans=1;
        for(i=0;i<SZ(es);i++){
            ans *= (2*es[i]+1);
        }
        cout << ans/2 + 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 1372
#include<iostream>
#include<vector>
#include<numeric>
#include<cmath>

int main(){

    while(true){
        size_t n;
        std::cin >> n;

        if(n == 0) break;

        std::vector<double> s(n);
        for(auto&& e : s){
            std::cin >> e;
        }

        auto ave = std::accumulate(s.begin(), s.end(), 0.0) / n;

        auto ans = 0.0;
        for(const auto& e : s){
            ans += (e - ave) * (e - ave);
        }
        ans /= n;

        std::printf("%f\n", std::sqrt(ans));
    }

    return 0;
}



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



int main() {

  int N;
  cin >> N;

  vector<pair<int ,int>> task;
  for(int i=0; i<N; i++){
    int A, B;
    cin >> A >> B;
    task.push_back(make_pair(B, A));
  }

  sort(task.begin(), task.end());

  string ans = "Yes";
  int time = 0;
  for(int i=0; i<N; i++){
    time += task.at(i).second;
    if(time > task.at(i).first) ans = "No";
  }

  cout << ans << endl;

  

  
  
}


Measured memory_bytes: 2420
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String s = sc.next();
		String t = sc.next();

		int length = s.length() + t.length();
		for (int i = 0; i < s.length(); i++) {
			boolean match = true;
			for (int j = 0; j < Math.min(s.length() - i, t.length()); j++) {
				if (s.charAt(i + j) != t.charAt(j)) {
					match = false;
					break;
				}
			}

			if (match) {
				length = Math.min(i + t.length(), length);
			}
		}

		System.out.println(length);
	}
}


Measured memory_bytes: 9684
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define sz(a)  int((a).size())
#define pb  push_back
#define eb  emplace_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define repC3(vari,varj,vark,n)  for(int vari=0;vari<(n)-2;++vari)for(int varj=vari+1;varj<(n)-1;++varj)for(int vark=varj+1;vark<(n);++vark)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
using namespace std;
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }


int main() {
    int N;
    int ans=0;
    cin>>N;
    ans=3*N*N;
    

    Out(ans);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define SZ(v) int((v).size())
#define ALL(vec) begin(vec), end(vec)
typedef long long i64;
template<typename T> inline bool uax(T &x, T y) {return (y > x) ? x = y, true : false;}
template<typename T> inline bool uin(T &x, T y) {return (y < x) ? x = y, true : false;}
#ifdef Rahul
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
  stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#else
#define error(...) 42;
#endif
string to_string(char c) { return "'" + string(1, c) + "'";}
string to_string(string s) { return '"' + s + '"';}
string to_string(const char* s) { return to_string((string) s);}
template<typename A> string to_string(A);
template<typename A, typename B> string to_string(pair<A, B> p){
  return "(" + to_string(p.first) + ": " + to_string(p.second) + ")";}
template<typename A> string to_string(A v) {bool f = false; string r = "{"; 
  for (auto x: v) {if (f) r += ", "; r += to_string(x); f = true;} return r += "}";}
template<typename A> string to_string(vector<vector<A>> v) {string r; 
  for (auto x: v) r += "\n" + to_string(x); return r;}
int Nerr;
template<typename A> string to_string(A *p) {return to_string(vector<A>(p, p + Nerr));}
void err(istream_iterator<string>) { cerr << endl; }
template<typename T,typename... Args> void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " =: " << to_string(a) << "; "; err(++it, args...); }
template<typename T> void kek(T ans) {cout << ans << endl; exit(0);}
int const MOD = 1e9 + 7;
long long const INF = 1e18 + 42;
/***********************************************************************/

int32_t main() {
  cin.tie(nullptr) -> sync_with_stdio(false);
  
  int n;
  cin >> n;
  int ok = 1;
  while (n--) {
    int x; cin >> x;
    if (x % 2 == 0) {
      if (x % 3 && x % 5) ok = 0;
    }
  }
  kek(ok ? "APPROVED":  "DENIED");
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
using namespace std;
int a,b,c,d,x,y,r[100]={};

struct Dice{
	int d1;
	int d2;
	int d3;
	int d4;
	int d5;
	int d6;
};

int main(){
	struct Dice da;
	int s;
	cin >> da.d1 >> da.d2 >> da.d3 >> da.d4 >> da.d5 >> da.d6;
	cin >> s;
	for(int i=0;i<s;i++){
	cin >> x >> y;
	if((x==da.d1&&y==da.d2)||(x==da.d2&&y==da.d6)||(x==da.d6&&y==da.d5)||(x==da.d5&&y==da.d1)){
		r[i]=da.d3;
	}else if((x==da.d1&&y==da.d3)||(x==da.d3&&y==da.d6)||(x==da.d6&&y==da.d4)||(x==da.d4&&y==da.d1)){
		r[i]=da.d5;
	}else if((x==da.d1&&y==da.d5)||(x==da.d5&&y==da.d6)||(x==da.d6&&y==da.d2)||(x==da.d2&&y==da.d1)){
		r[i]=da.d4;
	}else if((x==da.d1&&y==da.d4)||(x==da.d4&&y==da.d6)||(x==da.d6&&y==da.d3)||(x==da.d3&&y==da.d1)){
		r[i]=da.d2;
	}else if((x==da.d3&&y==da.d5)||(x==da.d5&&y==da.d4)||(x==da.d4&&y==da.d2)||(x==da.d2&&y==da.d3)){
		r[i]=da.d1;
	}else if((x==da.d3&&y==da.d2)||(x==da.d2&&y==da.d4)||(x==da.d4&&y==da.d5)||(x==da.d5&&y==da.d3)){
		r[i]=da.d6;
	}
	}
	for(int i=0;i<s;i++)cout << r[i] << endl;
	return 0;
}

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

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            Solve();
        }
        private const int MOD = 1000000007;
        private static long n = 0;
        private static long ans = 0;
        private static List<long> list = new List<long>();
        private static HashSet<int> hash = new HashSet<int>();
        static void Solve()
        {
             n = ReadAndParseLong();

            dfs(0);

            foreach(long x in list)
            {
                bool a = false;
                bool b = false;
                bool c = false;
                long y = x;
                while(y >= 1)
                {
                    long tmp = y % 10;
                    if(tmp == 3) { a = true; }
                    else if( tmp == 5) { b = true; }
                    else if( tmp == 7) { c = true; }
                    y /= 10;
                }
                if( a && b && c) { ans++; }
            }

            Console.WriteLine(ans);
        }

        private static void dfs(long x)
        {
            if( x > n) { return; }
            list.Add(x);

            dfs(10 * x + 3);
            dfs(10 * x + 5);
            dfs(10 * x + 7);

        }
#region よく使う便利関数
        private static bool isPrime(long x)
        {
            if (x == 2) { return true; }
            if (x < 2 || x % 2 == 0) { return false; }
            long i = 3;
            while (i * i <= x)
            {
                if (x % i == 0) { return false; }
                i = i + 2;
            }
            return true;
        }
        private static long lcm(long x, long y)
        {
            return x / gcd(x, y) * y;
        }
        private static long gcd(long x, long y)
        {
            return y > 0 ? gcd(y, x % y) : x;
        }
        private static long pow(long x, long n)
        {
            if (n == 0) { return 1; }
            long res = pow(x * x % MOD, n / 2);
            if (n % 2 == 1)
            {
                res = res * x % MOD;
            }
            return res;
        }
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
#endregion
    }
}

Measured memory_bytes: 13280
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)

	a, b, c, k := nextInt(), nextInt(), nextInt(), nextInt()
	max := a
	sum := 0

	if max < b {
		max = b
	}
	if max < c {
		max = c
	}

	switch max {
	case a: sum = b + c
	case b: sum = c + a
	case c: sum = a + b
	}

	for i := 0; i < k; i++ {
		max *= 2
	}

	fmt.Println(sum + max)
}


Measured memory_bytes: 640
#include<iostream>
#include<math.h>
#include<stdio.h>
#include<algorithm>
#include<queue>
#include<map>
#include<bitset>
#include<stack>
#include<set>
#include<vector>
#include <time.h>
#include<string.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

const int maxn = 1e5+5;
const int Mod=1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const double e=exp(1);
const db PI = acos(-1);
const db ERR = 1e-10;

#define Se second
#define Fi first
#define pb push_back
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
set<string> s;
int main()
{
    ios::sync_with_stdio(false);
    //freopen("a.txt","r",stdin);
    //freopen("b.txt","w",stdout);
    int n;
    int flag=0;
    string str,pre;
    cin>>n;
    cin>>str;
    s.insert(str);
    pre=str;
    int prelen=pre.size();
    for(int i=0;i<n-1;i++)
    {
        cin>>str;
        if(s.count(str)||pre[prelen-1]!=str[0])
        {
            flag=1;
        }
        s.insert(str);
        pre=str;
        prelen=pre.size();
    }
    if(flag==0)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    //cout << "time: " << (long long)clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl;
    return 0;
}


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

using namespace std;

bool digits(int a, int n){
    while(a>0){
        if(a%10>n or a%10==0) return false;
        a/=10;
    }
    return true;
}
int main () {

    int n;
    cin >> n;
    int i = 100, res = 0;
    while(i<1000){
        if(digits(i, n)){
            //cout << i << endl;
            res++;
        }
        i++;
    }
    cout << res << endl;
    
    

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INF = 1000000007;
const int mod = 1000000007;

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

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return (b);
    }
    else
    {
        return (gcd(b, a % b));
    }
}

ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

//----------------------------------------------------------------

int main()
{
    ll n, k;
    cin >> n >> k;
    ll a;
    map<int, int> rensou;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        rensou[a]++;
    }
    vector<int> ans;
    for (auto f : rensou)
    {
        if (f.second)
        {
            ans.push_back(f.second);
        }
    }
    int sum = 0;
    sort(ans.begin(), ans.end(), greater<int>());
    for (int i = k; i < ans.size(); i++)
    {
        sum += ans[i];
    }
    cout << sum << endl;
}

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

int main() {
  int A1, A2, A3;
  cin >> A1 >> A2 >> A3;
  int d12 = abs(A1-A2);
  int d13 = abs(A1-A3);
  int d23 = abs(A2-A3);
  vector<int> d = {d12, d13, d23};
  sort(d.begin(), d.end());
  int answer = d.at(0)+d.at(1);
  cout << answer << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
    int a,b;

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

    if (a > b)
    {
        printf("a > b\n");
    }
    else
    {
        if (a < b)
        {
            printf("a < b\n");
        }
        else
        {
            if (a == b)
            {
                printf("a == b\n");
            }
        }
    }
    return 0;
}


Measured memory_bytes: 2104