akhauriyash/Code-Regression huggingface dataset:
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

long a,b,n;
inline void solve(){
  IN2(a,b);
  n=b-a-1;
  OUT(n*(n+1)/2-a);
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
/*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<long long> vll;
typedef vector<int> vi;

#define io ios_base::sync_with_stdio(false)
#define pb push_back
#define eb emplace_back
#define mod   998244353
#define PI 2*acos(0.0)
int dirx[] = {1, -1,0, 0}, diry[] = {0, 0, 1, -1};

ll bigmod(ll x, ll p)
{
    ll res = 1;
    while(p)
    {
        if(p&1)
            res = (res*x)%mod;
        x = (x*x)%mod;
        p >>= 1;
    }
    return res;
}

//=============================================ASIFAZAD==============================================//

int32_t main()
{
    io;
    int n;
    cin>>n;
    map<ll, int> rit;
    vll inp(n+1);
    for(int i = 1; i<= n;i++)
    {
        cin>>inp[i];
        rit[i-inp[i]]++;
    }
    ll ans = 0;
    for(int i = 1; i <= n; i++)
        ans += rit[i + inp[i]];
    cout<<ans;
    return 0;
}

Measured memory_bytes: 27376
#include <iostream>
#include <cstdio>

using namespace std;

struct Node {
    int key;
    Node *parent,*left,*right;
};

Node *root,*NIL;

void insert(int k) {
    Node *y=NIL;
    Node *x=root;
    Node *z;

    z=new Node;
    z->key=k;
    z->left=NIL;
    z->right=NIL;
    while(x!=NIL) {
        y=x;
        if(z->key < x->key) {
            x=x->left;
        }
        else {
            x=x->right;
        }
    }

    z->parent=y;
    if(y==NIL) {
        root=z;
    }
    else {
        if(z->key<y->key) y->left=z;
        else y->right=z;
    }
}

Node* find(Node *u,int k) {
    while(u!=NIL&&k!=u->key) {
        if(k<u->key) u=u->left;
        else u=u->right;
        
    }
    return u;
}

void inorder(Node *u) {
    if(u==NIL) return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}
void preorder(Node *u) {
    if(u==NIL) return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}

int main() {
    int n,x;
    string com;

    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>com;
        if(com=="insert") {
            cin>>x;
            insert(x);
        }
        else if(com=="print") {
            inorder(root);
            cout<<endl;
            preorder(root);
            cout<<endl;
        }
        else if(com=="find") {
            cin>>x;
            if(find(root,x)!=NIL) cout<<"yes"<<endl;
            else cout<<"no"<<endl;

        }
    }

    return 0;

}

Measured memory_bytes: 19980
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
ll a[200020];
int main(void)
{
    ll n,m,s=0,k,t,T,x,y;
    scanf("%lld %lld",&n,&k);
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
    }
    sort(a,a+n);
    for(int i=0;i<n-k;i++)
    {
        s+=a[i];
    }
    printf("%lld\n",s);
    return 0;
}




Measured memory_bytes: 1792
// Template Headers {{{
#include <bits/stdc++.h>
using namespace std;

using pii = pair<int, int>; using vpii = vector<pii>;
using vi = vector<int>; using vvi = vector<vi>;
using ll = long long;
using pll = pair<ll, ll>; using vpll = vector<pll>;
using vll = vector<long long>; using vvll = vector<vll>;
template <class T> using min_queue = priority_queue<T, vector<T>, greater<T>>;
template <class T> istream &operator>>(istream &, vector<T> &);
template <class T> ostream &operator<<(ostream &, const vector<T> &);
template <class T, class U> istream &operator>>(istream &, pair<T, U> &);
template <class T, class U> ostream &operator<<(ostream &, const pair<T, U> &);
template <class T> struct Inf { static constexpr T inf() { return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : std::numeric_limits<T>::max(); } };
template <> struct Inf<int> { static constexpr int inf() { return 0x3f3f3f3f; } };
template <> struct Inf<long long> { static constexpr long long inf() { return 0x3f3f3f3f3f3f3f3fLL; } };
constexpr int INF = Inf<int>::inf(); constexpr ll BINF = Inf<ll>::inf();
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// }}}
// Preprocessing & "Global" variables {{{
struct Solver {
	Solver() {}
	int solve();
};
// }}}

int Solver::solve() {
	ll n; cin >> n; n--;
	int cnt = 1;
	ll b = 26;
	while (n >= b) n -= b, cnt++, b *= 26;
	string ans;
	for (int i = 0; i < cnt; i++) {
		ans.push_back('a' + n % 26);
		n /= 26;
	}
	reverse(ans.begin(), ans.end());
	cout << ans << endl;
	return 0;
}

// Template Main {{{
int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	Solver solver;
	#ifdef JUDGE_MULTI_CASE
		int t; cin >> t; for (int i = 1; i <= t; i++)
	#endif
	solver.solve();
	// cout << "Case #" << i << ": ", solve();
	return 0;
}

template <class T> istream &operator>>(istream &is, vector<T> &v) {
	for (auto it=v.begin();it!=v.end();++it) is >> *it;
	return is;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
	for (auto it=v.begin();it!=v.end();) os << *it, os << " \n"[++it==v.end()];
	return os;
}

template <class T, class U> istream &operator>>(istream &is, pair<T, U> &p) {
	return is >> p.first >> p.second;
}

template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p) {
	return os << p.first << ' ' << p.second;
}
// }}}

// vim: fdm=marker


Measured memory_bytes: 3648
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
signed main(){
  init_io();
  ll n,ans=100000000000000,x,y;
  cin >> n;
  for(ll i=1;i*i<=n;i++){
    if(n%i==0){
      x = i-1;
      y = (n/i) - 1;
      ans = min(ans,x+y);
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	static int p[][];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long k = sc.nextLong();

		if(a < k) {
			k -= a;
			a = 0;

			if(b < k) {
				b = 0;
			}else {
				b -= k;
			}

		}else {
			a -= k;
		}



		System.out.println("" + a + " " + b);

        return;
    }
}



Measured memory_bytes: 23764
a, b, c = [0] * 3

def format_input(filename = None):
	global a, b, c
	if filename == None:
		a, b, c = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		a = rng(1, 9)
		b = rng(1, 9)
		c = rng(1, 9)

def get_answer():
	poorness = 'No'
	if len(set([a, b, c])) == 2:
		poorness = 'Yes'
	return poorness

if __name__ == '__main__':
	format_input()

	ans = get_answer()
	print(ans)

Measured memory_bytes: 3064
import java.util.*;
//import java.util.stream.Collectors;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());
		int[] a = new int[n];
		Arrays.setAll(a, i -> Integer.parseInt(sc.next()));
		int count = 0;
		for(int i=0; i<n; i++){
			count += (d - 1) / a[i] + 1;
		}
		System.out.println(x + count);
	}
}


Measured memory_bytes: 35824
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] path = new int[n+1];
        for(int i = 0; i<m; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            if(a==1) path[b]++;
            if(b==1) path[a]++;

            if(a==n) path[b]++;
            if(b==n) path[a]++;
        }
        for(int p : path) {
            if(p==2) {
                System.out.println("POSSIBLE");
                return;
            }
        }
        System.out.println("IMPOSSIBLE");
    }
}


Measured memory_bytes: 96004
#include<bits/stdc++.h>
#define f first
#define s second
#define ll long long
#define vi vector<int>
#define pii pair<int, int>
#define si set<int>
#define y1 yy
#define debug if(printDebug)
using namespace std;
bool printDebug=false;
int main(){
    //printDebug=true;
    /*freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);//*/
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);//*/
    int n;
    cin >> n;
    cout << n+(n*n)+(n*n*n) << "\n";
    return 0;
}


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

#include <atcoder/dsu>
#include <boost/range/adaptors.hpp>
#include <boost/range/combine.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

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

    vector<std::tuple<int64_t, int64_t, int64_t>> p;
    for (auto i : irange(0L, n)) {
        int64_t x, y;
        cin >> x >> y;

        p.emplace_back(x - 1, y - 1, i);
    }

    std::set<pair<int64_t, int64_t>> s;
    atcoder::dsu d(n);

    sort(p.begin(), p.end());
    for (auto [x, y, i] : p) {
        auto it = s.lower_bound(std::make_pair(y, i));

        if (it == s.begin()) {
            s.emplace(y, i);
        } else {
            auto rit = std::make_reverse_iterator(it);
            while (rit != s.rend()) {
                d.merge(rit->second, i);
                ++rit;
            }

            auto b = s.begin();
            ++b;

            s.erase(b, it);
        }
    }

    for (auto i : irange(0L, n)) {
        cout << d.size(i) << "\n";
    }
}

Measured memory_bytes: 14600
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;

int main() {

    string s;
    cin >> s;
    
    s[5] = ' ';
    s[13] = ' ';

    cout << s << endl;
    
    return 0;
}

Measured memory_bytes: 256
n=int(input())
s=input()
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
result = []

for a in s:
  a = alphabet[(alphabet.index(a) + n) % 26]
  result.append(a)

st = "".join(result)
print(st)

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

const int N = 100004;
pair<long long, long long> dp[N];

int main()
{
	int n, k;
	cin >> n >> k;
	
	for(int i = 1; i <= n; i++)
	{
		cin >> dp[i].first;
		dp[i].second = 100000000000;
	}
	
	dp[2].second = abs(dp[2].first - dp[1].first);
	for(int i = 1; i <= k; i++)
	{
		dp[1 + i].second = abs(dp[1 + i].first - dp[1].first);
	}
	
	
	for(int i = k + 2; i <= n; i++)
	{
		for(int j = 1; j <= k; j++)
		dp[i].second = min(dp[i].second, (dp[i-j].second + abs(dp[i-j].first - dp[i].first)));
	}
	
	cout << dp[n].second;
	
	return 0;
}

Measured memory_bytes: 1792
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    static int gcd(int a, int b) {
        if (a % b != 0) {
            return gcd(b, a % b);
        } else {
            return b;
        }

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int n = sc.nextInt();
        int i = n / 111;
        if (n % 111 != 0) {
            i += 1;
        }

        System.out.println(i * 111);
    }
}


Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, a[N], pa[N], dep[N], deg[N], vis[N], bot[N], blue[N], black[N];
vector<int> ans;
inline void Rot(int u) {
	ans.push_back(u);
	int t = a[u];
	a[u] = a[0];
	for (u = pa[u]; u >= 0; swap(t, a[u]), u = pa[u]);
}
vector<int> lf;
int main() {
	scanf("%d", &n);
	pa[0] = -1;
	dep[0] = 0;
	for (int i = 1; i < n; i++) {
		scanf("%d", &pa[i]);
		dep[i] = dep[pa[i]] + 1;
		deg[pa[i]]++;
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		vis[i] = 0;
	}
	while (true) {
		lf.clear();
		memset(black, 0, sizeof(black));
		for (int i = n - 1; i >= 0; i--) if (!vis[i] && !deg[i]) {
			lf.push_back(i);
			vis[i] = 1;
			bot[i] = i;
			int u = pa[i];
			while (u >= 0 && deg[u] == 1) {
				lf.push_back(u);
				vis[u] = 1;
				bot[u] = i;
				u = pa[u];
			}
		}
		if (lf.empty()) break;
		int cur = lf.size();
		while (cur) {
			if (vis[a[0]]) {
				cur--;
				int u = bot[a[0]];
				while (true) {
					if (!blue[u] || a[u] < a[0]) break;
					u = pa[u];
				}
				Rot(u);
				while (blue[u]) u = pa[u];
				blue[u] = 1;
			} else {
				int mxdep = -1, u = -1;
				for (int i = 0; i < n; i++) {
					if (!blue[i] && !black[a[i]]) {
						if (mxdep < dep[i]) {
							mxdep = dep[i];
							u = i;
						}
					}
				}
				black[a[0]] = 1;
				Rot(u);
			}
		}
		for (int u : lf) {
			if (u > 0) deg[pa[u]]--;
		}
	}
	printf("%d\n", (int)ans.size());
	for (int x : ans) printf("%d\n", x);
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <cstring>


using namespace std;

typedef long long ll;

/*
ll mochila(ll i, ll k)
{
    if (k == 0) return 0;
    else if ( i == n ) return MAX;

    if ( memo[i][k] != -1) return memo[i][k];

    if ( v[i] <= k ) {
        memo[i][k] = min( p[i] + mochila(i+1, k - v[i] ), mochila(i+1,k));
    } else {
        memo[i][k] = mochila(i+1,k);
    }
    return memo[i][k];
}
*/

#define MAX 1000000001

ll dp[100+1][1000000+1];

int main()
{
    ll n, w;
    
    cin >> n >> w;
    ll p[n+1], v[n+1];

    int max_v = 0;
    for(int i=0; i<n; ++i) {
        cin >> p[i] >> v[i];
        max_v += v[i];
    }

    for(int i=n; i>=0; --i) {
        for(int j=0; j<=max_v; ++j) {
            if ( i == n ) {
                dp[i][j] = MAX;
            } else if( j - v[i] >= 0 ) {
                dp[i][j] = min( p[i] + ((j-v[i]==0)? 0 : dp[i+1][j-v[i]]), dp[i+1][j]) ;
            } else {
                dp[i][j] = dp[i+1][j];
            }
        }
    }
    ll ans = -1;
    for(int i=0; i<=max_v; ++i) {
        for(int j=0; j<=n; ++j) {
            if ( dp[j][i] <= w ) {
                ans = i;
            }
        }
    }
    cout << ans << '\n';
}

Measured memory_bytes: 289792
#include <stdio.h>

#define MAX 100000

int Parent[MAX];  
int Left[MAX];  
int Right[MAX];
int D[MAX];

void Depth(int ,int);

int main(){
  int i,j;
  int n=0;
  int depth=0;
  int id=0;
  int k=0;
  int c=0;
  int lef=0;
  scanf("%d",&n);

  for(i=0;i<n;i++){
    Left[i]=-1;
    Right[i]=-1;
    Parent[i]=-1;
  }
  
  for(i=0;i<n;i++){
    scanf("%d%d",&id,&k);
    for(j=0;j<k;j++){
      scanf("%d",&c);
      if(j==0)Left[id]=c;
      else Right[lef]=c;
      lef=c;
      Parent[c]=id;
    }
  }

  for(i=0;i<n;i++) {
    if(Parent[i]==-1)break;
  }
  Depth(i,0);

  for(i=0;i<n;i++){
    printf("node %d: ",i);
    printf("parent = %d, ",Parent[i]);
    printf("depth = %d, ",D[i]);
    if(Parent[i]==-1)printf("root, ");
    else if(Left[i]==-1)printf("leaf, ");
    else printf("internal node, ");
    printf("[");
    c=Left[i];
    for(j=0;c!=-1;j++){
      if(j!=0)printf(", ");
      printf("%d",c);
      c=Right[c];
    }
    printf("]\n");
  }
  
  return 0;
}

void Depth(int n, int d){
  D[n]=d;
  if(Right[n]!=-1) Depth(Right[n],d);
  if(Left[n]!=-1)Depth(Left[n],d+1);
}



Measured memory_bytes: 6404
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

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

using namespace std;
typedef long long ll;

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

    bool ans = false;
    int count = 0;
    rep(i, n) {
        int d1, d2;
        cin >> d1 >> d2;

        if (d1 == d2) {
            count++;
        } else {
            count = 0;
        }
        if (count >= 3) {
            ans = true;
        }
    }
    if (ans) {
        cout << "Yes";
    } else {
        cout << "No";
    }

    return 0;
}


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

using namespace std;

int main(){

  vector<int> a(3);
  int w = 0;
  int x = 0;
  int y = 0;
  int z = 0;

  while(1){
    cin >> a[0] >> a[1] >> a[2];
  
    if(a[0]+a[1] > a[2] && a[1]+a[2] > a[0] && a[2]+a[0] > a[1]){
      w++;

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

      if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1])
	x++;
      else if(a[2]*a[2] < a[0]*a[0] + a[1]*a[1])
	y++;
      else if(a[2]*a[2] > a[0]*a[0] + a[1]*a[1])
	z++;
    }
    else
      break;
  }

  cout << w << " " << x << " " << y << " " << z << endl;
  
}



Measured memory_bytes: 3120
#include<stdio.h>
#include<string.h>

char H[1000000][14]; 

int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
}

long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){ return key % 1000000; }
int h2(int key){ return 1 + (key % (1000000 -1)); }

int find(char str[]){

  long long key,i,h;

  key = getKey(str);
  for(i=0;;i++){
    h=(h1(key)+i*h2(key))%1000000;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0)return 0;
  }
}

int insert(char str[]){

  long long key,i,h;

  key = getKey(str);
  for(i=0;;i++){
    h=(h1(key)+i*h2(key))%1000000;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0){
      strcpy(H[h],str);
      return 0;
    }
  }
}

int main(){
    int i, n, h;
    char str[14], com[9];
    for ( i = 0; i < 1000000; i++ ) H[i][0] = '\0';
    
    scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ){
	scanf("%s %s", com, str);
	
	if ( com[0] == 'i' ){
	    insert(str);
	} else {
	    if (find(str)){
		printf("yes\n");
	    } else {
		printf("no\n");
	    }
	}
    }

    return 0;
}



Measured memory_bytes: 15416
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }

    private void solve(InputReader in, PrintWriter out) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());

        ArrayList<Integer> nextTImeList = new ArrayList<>();
        for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        }

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        }

        out.println(min);
    }
}

class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

    int nextInt() {
        return Integer.parseInt(this.sc.next());
    }

    long nextLong() {
        return Long.parseLong(this.sc.next());
    }

    double nextDouble() {
        return Double.parseDouble(this.sc.next());
    }

    @Override
    public void close() {
        this.sc.close();
    }
}


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

int main() {
	int N, L = 101, R = 0;
    cin >> N;
    int arr[N];
    for (int i = 0; i < N; i++) {
     	cin >> arr[i];
        if (arr[i] < L)
        L = arr[i];
        if (arr[i] > R)
        R = arr[i];
     }
     
     int ans = INT32_MAX;
     
     for (int i = L; i <= R; i++) {
     	int sum = 0;
     	for (int j = 0; j < N; j++) {
        	sum += (arr[j] - i)*(arr[j] - i);
        }
        ans = min(ans, sum);
     }
     
     cout << ans;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = input()
t = input()
flag = 0
for i in range(len(s)):
    s = s[1:]+s[0]
    #print(s)
    if t == s:
        flag = 1
print("Yes" if flag else "No")

Measured memory_bytes: 3060
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'
#define debugArrayP(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i].first<< " " << x[i].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int W,a,b;cin>>W>>a>>b;
  cout << max({0,b-(a+W),a-(b+W)})<<endl;
  return 0;
}


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

const int N = 1000000;
int dp[N + 1], primes[N + 1];
int main(){
    fill(primes, primes + N + 1, 1);
    primes[0] = primes[1] = 0;
    for(int i = 2;i <= sqrt(N);++i){
        if(primes[i]){
            for(int j = i + i;j <= N;j += i){
                primes[j] = 0;
            }
        }
    }
    int n, x, a, ans;
    int ps[30];
    while(cin >> n >> x, n && x){
        fill(dp, dp + N + 1, 0);
        ans = 0;
        for(int i = 0;i < n;++i){
            cin >> a;
            ps[i] = a;
            dp[a] = 1;
        }
        for(int i = 0;i <= x;++i){
            if(dp[i]){
                for(int j = 0;j < n;++j){
                    if(i + ps[j] <= N && !dp[i + ps[j]]){
                        dp[i + ps[j]] = 1;
                    }
                }
            }
        }
        for(int i = x;i > 0;--i){
            if(dp[i] && primes[i]){
                ans = i;
                break;
            }
        }
        if(ans) cout << ans << endl;
        else cout << "NA" << endl;
    }
}

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

using ll = long long;
using namespace std;
const int INFint = 2e9+1;
const ll INFll = 2e18+1;
ll MOD=1e9+7;

ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最小公倍数

int main() {
  int N,K;
  cin>>N>>K;
  if((N+1)/2 >= K){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }}

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

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

    int n;
    cin >> n;
    int a[2][n];
    int dp[2][n];

    rep(i, 2) rep(j, n) cin >> a[i][j];
    dp[0][0] = a[0][0];
    for(int i = 1; i < n; ++i) {
        dp[0][i] = a[0][i] + dp[0][i-1];
    }
    dp[1][0] = a[0][0] + a[1][0];
    for(int i = 1; i < n; ++i) {
        dp[1][i] = max((dp[0][i] + a[1][i]), (dp[1][i-1] + a[1][i]));
    }

    cout << dp[1][n-1] << endl;
    return 0;
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
#define long long long
using namespace std;
const int N=1e6;
int aa[N+2];
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);

  int n;cin>>n;
  for(int i=1;i<=n;i++)cin>>aa[i];
  int ans=0;
  for(int i=1;i<=n;i++)
  {
    for(int j=i+1;j<=n;j++)
    {
      ans+=aa[i]*aa[j];
    }
  }
  cout<<ans<<endl;
  return 0;
}


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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFやMODの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const ll MOD = 1000000007;

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

  vector<ll> p(A), q(B), r(C);
  rep(i, A) cin >> p[i];
  rep(i, B) cin >> q[i];
  rep(i, C) cin >> r[i];

  sort(rall(p));
  sort(rall(q));
  sort(rall(r));

  priority_queue<ll, vector<ll>, greater<ll>> pq;
  rep(i, X) pq.push(p[i]);
  rep(i, Y) pq.push(q[i]);

  rep(i, C) {
    ll v = pq.top();

    if (v > r[i]) break;

    pq.pop();
    pq.push(r[i]);
  }

  ll ans = 0;
  while (!pq.empty()) {
    ans += pq.top();
    pq.pop();
  }

  cout << ans << endl;
}


Measured memory_bytes: 5748
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;cin>>n;
  vector<int >pos(n+1,0);
  pos[0]=1;
  for(int i=1;i<=n;i++){
  	for(int coin=100;coin<106;coin++){
    		if(i-coin >= 0)pos[i]=pos[i]|pos[i-coin];
    }
  }
  cout<<pos[n];
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define N 2050
string ss[2][N+1];
int c[N+1][N+1];
string lcs(string X,string Y){
  int m = X.size();
  int n = Y.size();
  int maxl = 0;
  X = ' ' + X;
  Y = ' ' + Y;
  ss[0][0] = "";
  memset(c,0,sizeof(c));
  for(int i=0;i<N+1;i++) ss[0][i]=ss[1][i]="";
  for(int i=0;i<=m;i++) c[i][0]=0;
  for(int j=1;j<=n;j++) c[0][j]=0;
  for(int i=1;i<=m;i++){
    for(int j=1;j<=n;j++){
      if(X[i]==Y[j]) c[i][j]=c[i-1][j-1]+1, ss[i%2][j] = ss[(i-1)%2][j-1] + X[i];
      else {
	if(c[i-1][j] >= c[i][j-1]) c[i][j]=c[i-1][j], ss[i%2][j] = ss[(i-1)%2][j];
	else c[i][j] = c[i][j-1], ss[i%2][j] = ss[i%2][j-1];
      }
      maxl=max(maxl,c[i][j]);
    }
  }
  string ret=ss[m%2][n],ret2=ret;
  reverse(ret2.begin(),ret2.end());
  //assert(ret==ret2);
  assert((int)ret.size()==maxl);
  return ss[m%2][n];
}
int main(){
  string s;
  while(cin >> s) {
    string t = s;
    reverse(t.begin(), t.end());
    cout << lcs(s, t) << endl;
  }
  return 0;
}

Measured memory_bytes: 25592
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
#include <stdio.h>
using namespace std;



int main() {
	int n, l;
	int csum=0,lsum,i,ans,dif;
	bool first = true;

	cin >> n >> l;
	vector<int> azi(n,0);
	for (i = 0; i < n; i++) {
		azi[i] = l + i ;
		csum += azi[i];
	}
	for (i = 0; i < n; i++) {
		lsum = csum - azi[i];
		//cout << lsum << " ";
		if (first) {
			dif = abs(csum-lsum);
			ans = lsum;
			first = false;
		}
		else if (abs(csum-lsum) < dif) {
			dif = abs(csum-lsum);
			ans = lsum;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;

void solve(long long N, long long X, vector<long long> L){
	ll c = 0, res = 1;
	rep(i,N) {
		c += L[i];
		if (c <= X) res++;
	}
	cout << res << endl;
}

int main(){	
	long long N;
	long long X;
	scanf("%lld",&N);
	vector<long long> L(N-1+1);
	scanf("%lld",&X);
	for(int i = 0 ; i <= N-1 ; i++){
		scanf("%lld",&L[i]);
	}
	solve(N, X, L);
	return 0;
}



Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char s[30],maxone;
bool vis[30],app[30];
int main()
{
	scanf("%s",s);
	int len=strlen(s);
	for(int i=0;i<(int)len;i++)
		vis[s[i]-'a']++;
	if(len<26)
	{
		printf("%s",s);
		for(int i=0;i<26;i++)
			if(!vis[i])
			{
				printf("%c",i+'a');
				break;
			}
		return 0;
	}
	app[s[len-1]-'a']=1;
	for(int i=len-2;i>=0;i--)
	{
		for(int k=s[i]+1-'a';k<26;k++)
			if(app[k])
			{
				for(int j=0;j<i;j++)
					printf("%c",s[j]);
				printf("%c",k+'a');
				return 0;
			}
		app[s[i]-'a']=1;
	}
	printf("-1");
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
	 ios_base::sync_with_stdio(false);
	  cin.tie(NULL);cout.tie(NULL);
    int n,m;
    cin>>n>>m;
    vector<string> s(m);
    vector<int>p(m);
    for(int i=0;i<m;i++) cin>>p[i]>>s[i];
    int val[n+1]={0};
   int cor[n+1]={0};
    for(int i=0;i<m;i++){
    	if(s[i]=="AC"){
    		cor[p[i]]=1;
		}
		else{
       if(cor[p[i]]==0)			val[p[i]]--;
		}
	}
	int ans=0,pen=0;
	for(int i=1;i<=n;i++){
		if(cor[i]) ans++;
	 if(cor[i])	pen +=abs(val[i]); 
	}
	cout<<ans<<" "<<pen<<"\n";
}

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

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

    vector<ll> as(n);
    for (auto& a : as) cin >> a;
    sort(as.begin(), as.end());

    // 二分探索
    ll left = 0, right = 1e6 + 1e6;
    while(right - left > 1) {
        ll mid = (right + left) / 2;

        ll cnt = 0;
        for(int i=0; i<n; ++i) {
            ll tmp = mid - as[i];
            // tmp以上よ要素の個数
            int r = as.end() - lower_bound(as.begin(), as.end(), tmp);
            cnt += r;
        }
        if(cnt >= m) {
            left = mid;
        } else {
            right = mid;
        }
    }

    // 累積和
    vector<ll> ss(n+1, 0);
    for (int i=0; i<n; ++i) {
        ss[i+1] = ss[i] + as[i];
    }

    // 
    ll ans = 0;
    ll already_cnt = 0;
    rep(i, n) {
        ll tmp = right - as.at(i);
        // right以上となる要素の数
        int r = as.end() - lower_bound(as.begin(), as.end(), tmp);
        m -= r;
        ans += ss[n]  - ss[n-r] + as[i] * r;
    }

    ans += left * m;

    cout << ans << endl;

    return 0;
}

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
ostream &operator<<(ostream &os, pair<ll, ll>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<ll>a(n);
  rep(i,0,n)cin>>a[i];
  vector<ll>two(31,1);
  rep(i,0,30)two[i+1]=two[i]*2;
  map<ll,ll>mp;
  rep(i,0,n)mp[a[i]]++;
  for(auto itr=--mp.end();;itr--){
    ll v=itr->fi;
    rrep(i,0,31){
      if(itr->se==0)break;
      auto itr2=mp.find(two[i]-v);
      if(itr2==mp.end())continue;
      if(itr->fi==itr2->fi){
        ll k=itr->se/2;
        res+=k;
        itr->se-=2*k;
      }
      else{
        ll k=min(itr2->se,itr->se);
        //if(k>0)cout<<itr->fi spa itr2->fi spa k<<endl;
        res+=k;
        itr2->se-=k;
        itr->se-=k;
      }
    }
    if(itr==mp.begin())break;
  }
  cout<<res<<endl;
  return 0;
}

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

int main() {
	int N, s;
	bool dp[10001];

	for (int i=0; i<10001; i++) dp[i] = false;

	cin >> N;
	dp[0] = true;

	for (int i=0; i<N; i++) {
		cin >> s;
		for (int j=10000; j>=0; j--) {
			if (dp[j]) {
				dp[j+s] = true;
			}
		}
	}

	int ans = 0;

	for (int j=10000; j>=0; j--) {
		if (dp[j] && j%10) {
			ans = j;
			break;
		}
	}

	cout << ans << endl;

	return 0;
}


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

int main(void) {
    int n;
    scanf("%d", &n);
    int p[n];
    for (int i = 0; i < n; i++) {
        scanf("%d", &p[i]);
    }

    int min = p[0], cnt = 1;
    for (int i = 1; i < n; i++) {
        if (p[i] < min) {
            min = p[i];
            cnt++;
        }
    }

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

    return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1.0)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    int n, ans = 0;
    cin >> n;
    REP(i, n){
        int a;
        cin >> a;
        ans += (a % 2 == 1 && i % 2 == 1);
    }
    cout << ans << endl;
}


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

typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int,V,greater<int>>

#define pb(a) push_back(a)
#define mp make_pair

#define dump(x)  cout << #x << " = " << (x) << "\n";
#define COUT(x) cout<<(x)<<"\n"

int func (int x)
{
    if (x % 100 != 0)
    {
        return 0;
    }

    return func(x * 100) + 1;
}

int main()
{
    string s, t = "";
    cin >> s >> t;
    string ans = "No";

    REP(i, s.length())
    {
        s.insert(s.begin(), s.back());
        s.pop_back();
        if (s == t)
        {
            ans = "Yes";
        }
    }

    COUT(ans);

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<vector<ll> > mat;

int main()
{ios_base::sync_with_stdio(false);
ll a,b;
cin>>a>>b;
if(a%2!=b%2)
{
	ol("IMPOSSIBLE");
	return 0;
}
if(a>b)swap(a,b);
ol(a+(b-a)/2);
return 0;
}



Measured memory_bytes: 256
N,A,B,C=map(int,input().split())
l=[int(input()) for i in range(N)]
inf=10**9
def dfs(cur,a,b,c):
  if cur==N:
    return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf
  ret0 = dfs(cur+1,a,b,c)
  ret1 = dfs(cur+1,a+l[cur],b,c)+10
  ret2 = dfs(cur+1,a,b+l[cur],c)+10
  ret3 = dfs(cur+1,a,b,c+l[cur])+10
  return min(ret0,ret1,ret2,ret3)
print(dfs(0,0,0,0))

Measured memory_bytes: 3316
function Main (input){
  input = input.split("\n");
  tmp = input[0].split(" ");
  var N = parseInt(tmp[0],10);
  var gouri = 0;
  for(x = 1; x < 10; x++){
    for(y = 1; y < 10; y++){
      if(x*y === N){
        gouri++;
      }else{
      }
    }
  }
  if(gouri > 0){
    console.log("Yes");
  }else{
    console.log("No");
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 11468
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <unordered_set>
using namespace std;

int main(void){
    int N, R;
    cin >> N >> R;
    if(N >= 10){
        cout << R << endl;
    }else{
        cout << R+100*(10-N) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
	int k;cin>>k;
	queue<ll> q;
	//lunlun数を求めていく
	for(ll i=1;i<10;i++) q.push(i);

	ll x;
	while(k){
		x=q.front();
		q.pop();
		if(x%10!=0) q.push(10*x+x%10-1);
		q.push(10*x+x%10);
		if(x%10!=9) q.push(10*x+x%10+1);
		k--;
	}

	cout<<x<<endl;
}

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

using namespace std;

typedef long long ll;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    cin>>n;
    ll*a=new ll[n];
    map<ll,ll>b;
    for(int i=0;i<n;i++){
        cin>>a[i];
        b[a[i]]++;
    }
    ll r,s=0;
    for(auto k:b){
        r=k.second;
        if(r>=2){
            s+=r*(r-1)/2;
        }
    }
    for(int i=0;i<n;i++){
        if(b[a[i]]>=2){
            r=b[a[i]];
            cout<<s-r*(r-1)/2+(r-1)*(r-2)/2<<'\n';
        }else
            cout<<s<<'\n';
    }
    return 0;
}

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

int main(){
  long long r, d, x;
  cin >> r >> d >> x;
  for(int i=1;i<11; i++){
    long long y = x*r-d;
    cout << y << endl;
    x = y;
  }
  return 0;
}

Measured memory_bytes: 256
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    
    let flagC = false;
    
    for(let i in S) {
        if(S[i] === "C") flagC = true;
        if(S[i] === "F" && flagC) {
            console.log("Yes");
            return;
        }
    }
    
    console.log("No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int N = sc.nextInt();
		long[] Hs=sc.nextLongsN(N);
		
		for(int i=N-1;i>0;i--) {
			if(Hs[i]-Hs[i-1]>=0) {
				
			}else if(Hs[i]-Hs[i-1]==-1) {
				Hs[i-1]--;
			}else {
				System.out.println("No");
				return;
			}
		}
		
		out.print("Yes");
		out.flush();
	}

}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntsN(int N) {
		int[] ints = new int[N];
		for (int i = 0; i < N; i++) {
			ints[i] = nextInt();
		}
		return ints;
	}
	
	public long[] nextLongsN(int N) {
		long[] longs = new long[N];
		for (int i = 0; i < N; i++) {
			longs[i] = nextLong();
		}
		return longs;
	}
	
	public char[] nextCharsN(int N) {
		char[] chars = new char[N];
		String msg=next();
		for (int i = 0; i < N; i++) {
			chars[i] = msg.charAt(i);
		}
		return chars;
	}

	public char[][] nextCharsHW(int H, int W) {
		char[][] chars = new char[H][W];
		for (int i = 0; i < H; i++) {
			String str = next();
			for (int j = 0; j < W; j++) {
				chars[i][j] = str.charAt(j);
			}
		}
		return chars;
	}

	public int[][] nextIntsNM(int N, int M) {
		int[][] ints = new int[N][M];
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < M; j++) {
				ints[i][j] = nextInt();
			}
		}
		return ints;
	}
}


Measured memory_bytes: 22456
#include<iostream>
#include<vector>
#include<string>
#include<set>
using namespace std;

int main() {
	string a = "CODEFESTIVAL2016";
	string b; cin >> b;
	int c = 0;
	for (int d = 0; d < a.length(); d++) {
		if (a[d] != b[d])c++;
	}
	cout << c << endl;
}

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

int main(){

    int N;
    cin >> N;
    vector<int> a(N);
    rep(i, N) cin >> a.at(i);
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    int ans=0;
    rep(i,N){
        if(i%2==0)
            ans += a.at(i);
        else
            ans -= a.at(i);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

int main() {
    int n,m,c=0,d=0,ans=1;
    cin >> n;

    for (int i = 1; i < n+1; i++)
    {
        m = i;
        while (m%2==0)
        {
            m=m/2;
            c++;
        }
        if(c>d){
            d = c;
            ans = i;
        }
        c = 0;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3584
n, m, l = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(n)]
# いろいろとめんどくさいので転置します
# B = list(zip(*[list(map(int, input().split())) for _ in range(m)]))
# やっぱやめます
B = [list(map(int, input().split())) for _ in range(m)]
for i in range(n):
    line = []
    for j in range(l):
        ele = 0
        for k in range(m):
            ele += A[i][k]*B[k][j]
        line.append(ele)
    print(" ".join(list(map(str, line))))



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

int main() {
    int N, A;
    int mi = 1000000005;
    int ma = 0;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A;
        mi = min(mi, A);
        ma = max(ma, A);
    }

    cout << ma - mi << endl;
}

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

int main() {
    int N, X, Y;
    cin >> N >> X >> Y;

    X--;
    Y--;
    vector<int> ans(N, 0);
    for (int i = 0; i < N; i++){
        for (int j = i +1; j < N; j++){
            int d = min(min(j - i, abs(X-i)+abs(Y-j)+1), abs(Y-i)+abs(X-j)+1);
            ans.at(d) ++;
        }
    }
    for(int d =1; d<N; d++) cout << ans.at(d) << endl;
}

Measured memory_bytes: 256
#include <queue>
#include <algorithm>
#include <cstdio>
#define INF 100000000
//#define MAX_E 100
#define MAX_V 105
using namespace std;

struct edge{int to, cost;};
typedef pair<int,int> P;

int V; //????????°
vector<edge> G[MAX_V];
int d[MAX_V];

void dijkstra(int s){
  priority_queue<P,vector<P>,greater<P> > que;
  fill(d,d+V,INF);
  d[s]=0;
  que.push(P(0,s));
  while(!que.empty()){
    P p=que.top();que.pop();
    int v=p.second;
    if(d[v]<p.first)continue;
    for(int i=0;i<G[v].size();i++){
      edge e=G[v][i];
      if(d[e.to]>d[v]+e.cost){
        d[e.to]=d[v]+e.cost;
        que.push(P(d[e.to],e.to));
      }
    }
  }
}

int main(){
  int n,u,k;
  edge e;
  scanf("%d",&n);
  V=n;
  for(int i=0;i<n;i++){
    scanf("%d%d",&u,&k);
    for(int j=0;j<k;j++){
      scanf("%d%d",&e.to,&e.cost);
      G[u].push_back(e);
    }
  }
  dijkstra(0);
  for(int i=0;i<n;i++){
    printf("%d %d\n",i,d[i]);
  }
  return 0;
}

Measured memory_bytes: 2788