akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
 
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

bool all_reachable(const std::vector<std::vector<int> >& adjacencies, int start_idx, int end_index) {
    std::vector<bool> visited(adjacencies.size(), false);
    std::queue<int> queue;
    queue.push(start_idx);
    while (!queue.empty()) {
        int node_idx = queue.front();
        queue.pop();
        visited[node_idx] = true;

        for (int neighbour_idx : adjacencies[node_idx]) {
            if (!visited[neighbour_idx]) {
                queue.push(neighbour_idx);
            }
        }
    }
    return visited[end_index];
}

void cut_edge(VVI& adj, int start_idx, int end_index){
  for(auto it = begin(adj[start_idx]); it!=end(adj[start_idx]); ++it){
    if(end_index == *it){
      adj[start_idx].erase(it);
      break;
    }
  }
  for(vector<int>::iterator it = adj[end_index].begin(); it!=adj[end_index].end(); ++it){
    if(*it == start_idx){
      adj[end_index].erase(it);
      return;
    }
  }
}

void dispGraph(VVI& adj){
  for(auto i : adj){
    for(auto j : i){
        cout << j << " ";
    }
    cout << "\n";
  }
}

int main(void){
  int n;
  VI a;
  cin>>n;
  REP(i, n){
    int v;
    cin>>v;
    a.push_back(v);
  }
  SORT(a);
  cout<<a[n-1] - a[0]<<endl;
  return 0;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

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

using namespace std;

namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

using ll = long long;
ll mod = pow(10, 9) + 7;

template <typename T> void output(T, ll);
ll gcd(ll, ll);
ll lcm(ll, ll);
Bint comb(Bint, Bint);
void prime_map(map<ll, ll> &, ll);

int main() {
    // source
    ll n;
    cin >> n;
    ll l[2 * n];
    rep(i, n * 2) { cin >> l[i]; }
    sort(l, l + 2 * n, greater<ll>());
    ll ans = 0;
    rep(i, n * 2) {
        if (i % 2 == 1) {
            ans += l[i];
        }
    }

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

Bint comb(Bint a, Bint b) {
    Bint ans = 1;

    if (a < b) {
        return 0;
    }

    rep(i, b) {
        ans *= a - i;
        ans /= i + 1;
    }

    return ans;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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

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

void prime_map(map<ll, ll> &m, ll num) {

    if (num == 1) {
        return;
    }
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }
    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }

        return;
    }
    prime_map(m, num);
    return;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    long long n, d, x, y, ans = 0;
    cin >> n >> d;
    for(int i = 0; i < n; i++)
    {
        cin >> x >> y;
        if(sqrt(x * x + y * y) <= d)
            ans++;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		String[] weather = { "Sunny", "Cloudy", "Rainy" };
		Scanner scanner = new Scanner(System.in);
		String s = scanner.next();
		for (int i = 0; i < 3; i++) {
			if (s.equals(weather[i]))
				System.out.println(weather[(i + 1) % 3]);
		}
	}

}


Measured memory_bytes: 21460
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<set>
#include<queue>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}
	
	vector<int> ex(1000006,0);
	for(int i=0;i<n;i++)
	{
		ex[a[i]]++;
	}

	int ans=0;
	for(int i=0;i<n;i++)
	{
		bool can=true;
		for(int j=1;j*j<=a[i];j++)
		{
			if(a[i]%j==0)
			{
				if(ex[j]>=1)
					can=false;
				if(j!=1 and ex[a[i]/j]>=1)
					can=false;
			}
		}
		if(ex[a[i]]>=2)
			can=false;

		if(a[i]==1)
		{
			if(ex[1]==1)
				can=true;
			else
				can=false;
		}
		if(can)
		{
			ans++;
		}
	}

	cout << ans << endl;








}

Measured memory_bytes: 7576
s = input()
# print(s[:-1])
if len(s) != 26:
    for c in range(ord('a'), ord('z')+1):
        c = chr(c)
        if not c in s:
            print(s+c)
            exit()
s = list(s)
t = []
while s:
    for c in t:
        if c > s[-1]:
            print(''.join(s[:-1])+c)
            exit()
    t.append(s.pop())

print('-1')

Measured memory_bytes: 3060
//Arayi
//#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <vector>
#include <cstring>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <ctime>
#include <climits>
#include <cassert>
#include <chrono>
#include <random>
#include <complex>

#define fr first
#define sc second
#define MP make_pair
#define ad push_back
#define PB push_back
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
#define lli long long int
#define y1 arayikhalatyan
#define j1 jigglypuff
#define ld long double
#define itn int
#define pir pair<int, int> 
#define all(x) (x).begin(), (x).end()
#define str string
#define enl endl
#define en endl
#define cd complex<long double>
#define vcd vector<cd>
#define vii vector<int>
#define vlli vector<lli>
using namespace std;

lli gcd(lli a, lli b) { return (b == 0LL ? a : gcd(b, a % b)); }
ld dist(ld x, ld y1, ld x2, ld y2)
{
    return sqrt((x - x2) * (x - x2) + (y1 - y2) * (y1 - y2));
}
lli S(lli a)
{
    return (a * (a + 1LL)) / 2;
}
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
char vow[] = { 'a', 'e', 'i', 'o', 'u' };
int dx[] = { 1, -1, 0, 0, -1, -1, 1, 1, 0 };
int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1, 0 };


const int N = 3030;
const lli mod = 998244353;
const ld pi = acos(-1);
const int T = 238;
const ld e = 1e-13;

lli bp(lli a, lli b = mod - 2LL)
{
    lli ret = 1;
    while (b)
    {
        if (b & 1) ret *= a, ret %= mod;
        a *= a;
        a %= mod;
        b >>= 1;
    }
    return ret;
}
ostream& operator<<(ostream& c, pir a)
{
    c << a.fr << " " << a.sc;
    return c;
}
struct pt
{
    lli x, y;
    int ind;
    int bl;
    bool operator==(const pt& a)
    {
        return ind == a.ind;
    }
    bool operator<(const pt& b)
    {
        if (x == b.x) return y < b.y;
        return x < b.x;
    }
};


int n, m, k;
lli a[N][N], dp[N][N][5];
int main()
{
    fastio;
    cin >> n >> m >> k;
    for (int i = 0; i < k; i++)
    {
        int x, y;
        lli c;
        cin >> x >> y >> c;
        a[x][y] = c;
    }
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            dp[i][j][0] = max(dp[i - 1][j][4], dp[i][j - 1][0]);
            dp[i][j][1] = max(dp[i][j - 1][1], max(dp[i][j - 1][0], dp[i - 1][j][4]) + a[i][j]);
            dp[i][j][2] = max(dp[i][j - 1][2], dp[i][j - 1][1] + a[i][j]);
            dp[i][j][3] = max(dp[i][j - 1][3], dp[i][j - 1][2] + a[i][j]);
            dp[i][j][4] = max(max(dp[i][j][0], dp[i][j][1]), max(dp[i][j][2], dp[i][j][3]));
        }
    }
    cout << dp[n][m][4] << endl;
    return 0;
}

/*

  __
*(><)*
  \/ /
  ||/
--||
  ||
  /\
 /  \
/    \
*/

Measured memory_bytes: 429496
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String arr[] = new String[n];
		for(int i=0;i<n;i++) {
			arr[i]  =sc.next();
		}
		HashMap<String, Integer> map = new HashMap<String, Integer> ();
		map.put("AC", 0);map.put("WA", 0);map.put("TLE", 0);map.put("RE", 0);
		for(int i=0;i<n;i++) {
			map.put(arr[i], map.get(arr[i])+1);
		}
		System.out.println("AC x "+map.get("AC"));
		System.out.println("WA x "+map.get("WA"));
		System.out.println("TLE x "+map.get("TLE"));
		System.out.println("RE x "+map.get("RE"));
		sc.close();

	}
}


Measured memory_bytes: 63836
#include <bits/stdc++.h> 
#define F(i,a,b) for(int i=a;i<=(b);++i)
#define dF(i,a,b) for(int i=a;i>=(b);--i)
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define pb push_back
#define maxnkp make_pair
#define fi first
#define se second
#define eps 1e-6
using namespace std;
typedef long long ll;
const int mods = 1e9+7;
const int maxn = 1e3+10;
const int N = 1e5+10;
const int E = 1e6+10; 
int h,n;
int a[maxn],b[maxn];
int f[maxn][maxn*20];
int main() {
	cin>>h>>n;
	int tmp = h;
	h*=2;
	F(i,1,n){
		cin>>a[i]>>b[i];
	}
	F(i,1,n){
		F(j,1,h){
			f[i][j] = inf/2;
		}
	}
	F(i,1,(h-1)/a[1]+1){
		f[1][i*a[1]]=i*b[1];
	}
	F(i,2,n){
		F(j,1,h){
			f[i][j]=min(f[i][j-a[i]]+b[i],f[i-1][j]);
		}
	}
	int ans = inf;
	F(i,tmp,h){
		//cout<<f[n][i]<<endl;
		ans=min(ans,f[n][i]);
	}
	cout<<ans<<endl;
}
	

Measured memory_bytes: 79104
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lowbit(a) ((a)&-(a))
#define clean(a,b) memset(a,b,sizeof(a))
const int mod = 1e9 + 7;
const int inf=0x3f3f3f3f;
const int maxn = 1e5+9;
const double pi=acos(-1);
int _;

//========================================================================

vector<int>ve[maxn];
int vis[maxn],ans[maxn];
void bfs()
{
    queue<int>qu;
    qu.push(1);
    vis[1]=1;
    while(!qu.empty())
    {
        int now=qu.front();
        qu.pop();
        int l=ve[now].size();
        for(int i=0;i<l;i++)
        {
            if(!vis[ve[now][i]])
            {
                vis[ve[now][i]]=1;
                ans[ve[now][i]]=now;
                // printf("%d %d\n",ve[now][i],now);
                qu.push(ve[now][i]);
            }
        }
    }
}
//========================================================================

int main()
{
    int n,m,u,v;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&u,&v);
        ve[u].push_back(v);
        ve[v].push_back(u);
    }
    bfs();
    int flag=0;
    for(int i=2;i<=n;i++)
    {
        if(ans[i]==0) flag=1;
    }
    if(flag==1) 
    {
        printf("No\n");
        return 0;
    }
    printf("Yes\n");
    for(int i=2;i<=n;i++)
    {
        printf("%d\n",ans[i]);
    }
    return 0;
}


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

int main() {
  int l,r,d;
  cin >> l >> r >> d;
  int a = 0;
  for(int i = l; i < r+1; i++){
    if(i % d == 0)  a++;
  }
  cout << a << endl;
}


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

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i)
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(a) ((int)(a).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define SQ(x) ((x) * (x))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main() {
    int m, mi, ma;
    while (cin >> m >> mi >> ma, m|mi|ma) {
        vi p(m);
        REP(i, m) cin >> p[i];
        pii gap = {0, 0};
        FOR(i, max(0, mi-1), ma) {
            gap = max(gap, {-(p[i+1] - p[i]), i+1});
        }
        cout << gap.second << endl;
    }
}

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

typedef long long ll;
using namespace std;

// ll mod = 1'000'000'000 + 7;
int main() {
    int N, M;
    cin >> N >> M;
    int ans = 0;
    for (int i = 0, l = pow(2, M); i < l; i++) {
        ans += 100 * (N - M) + 1900 * M;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int W=0, H=0, x=0, y=0, r=0;
        
        W=scan.nextInt();
        H=scan.nextInt();
        x=scan.nextInt();
        y=scan.nextInt();
        r=scan.nextInt();
        
        if(0<=x-r&&x+r<=W&&0<=y-r&&y+r<=H)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}


Measured memory_bytes: 26412
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			double v = sc.nextDouble();
			double N = 2;
			double t = Math.sqrt(50 * (N - 1)) / 7;
			double u = 9.8 * t;
			while(u < v) {
				N += 1.0;
				t = Math.sqrt(50 * (N - 1)) / 7;
				u = 9.8 * t;
			}
			System.out.println((int)N);
		}
		sc.close();
	}
}


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

std::string s;

bool acgt(char c) {
  return (c == 'A' || c == 'C' || c == 'G' || c == 'T');
}

int main() {
  std::cin >> s;

  int ans = 0;
  for(int i = 0; i < s.size(); ++i) {
    int tmp = 0;
    for(int j = i; j < s.size(); ++j) {
      if(acgt(s[j])) ++tmp;
      else break;
    }
    ans = std::max(ans, tmp);
  }

  std::cout << ans << std::endl;
}


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

#define INF 1000000007

int main(void){
  int a[1000];
  int n,q,c,b,e;
  int ans;
  
  cin >> n;
  for (int i=0; i<n; i++) cin >> a[i];
  cin >> q;
  for (int i=0; i<q; i++){
    cin >> c >> b >> e;
    ans = c? -INF: INF;
    for (int j=b; j<e; j++){
      if (c){
        ans = a[j]>ans? a[j]: ans;
      } else {
        ans = a[j]<ans? a[j]: ans;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
  
  



Measured memory_bytes: 3124
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i=0;i<(n);++i)
#define RANGE(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(n)-1;i>= 0;--i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define PI 3.141592653589793238
#define dcout cout<<fixed<<setprecision(50)

const long long dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long
#define double long double

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};

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

  int N; cin >> N;
  int cnt[10][10] = {};
  for(int num = 1; num <= N; num++){
    string s = to_string(num);
    int front = s.front()-'0', end = s.back()-'0';
    cnt[front][end]++;
  }
  int ans = 0;
  REP(i, 10) REP(j, 10){
    ans += cnt[i][j]*cnt[j][i];
  }
  cout << ans << endl;
}

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

int A, B, C;

int main()
{
	cin >> A >> B >> C;
	int d = max(max(A, B), C);
	int e = A + B + C - d;
	int n = d * 10 + e;
	cout << n << endl;
	return 0;
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
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*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    ll N;
    cin >> N;

    vector<ll> P(N);

    REP(i, N){
        ll p;
        cin >> p;
        p--;
        P[i] = p;
    }

    ll ans = 0;
    REP(i, N-1){
        if(P[i] == i){
            ll temp;
            temp = P[i];
            P[i] = P[i+1];
            P[i+1] = temp;
            ans++;
        }
    }
    if(P[N-1] == N-1) ans++;
    cout << ans << endl;
    return 0;
}

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

//#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define rep(i,n) for( int i = 0; i < n; ++i )
#define repi(i,n) for( int i = 1 ; i <= n; ++i )
#define repn(i,n) for( int i = n - 1 ; i >= 0 ; --i )
#define repf(j,i,n) for( int j = i ; j < n ; ++j )
#define die(s) {std::cout << s << nl;}
#define dier(s) {std::cout << s; return 0;}
#define dbg(var) {std::cout << #var << "  = " << var << nl;}
#define vi vector<int>
typedef long long ll;

using namespace std;

constexpr ll INF = numeric_limits<ll>::max();

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.precision(0); 

	int n;
	cin >> n;
	
	vi v(istream_iterator<int>{cin} , istream_iterator<int>());
	vector<vector<vector<ll>>> dp { n + 1 , { n + 1 , { INF , INF } } }; 
	
	function<ll(int,int,bool)> rec = [&](int l , int r , bool player)
	{
		if(l == r)
			return (player ? -1LL : 1LL) * v[l];
			
		if(dp[l][r][player] != INF)
			return dp[l][r][player];
			
		ll res1 = rec(l + 1 , r , !player) + (player ? -1LL : 1LL) * v[l];
		ll res2 = rec(l , r - 1 , !player) + (player ? -1LL : 1LL) * v[r];
		
		if(player)
		{
			return dp[l][r][player] = min(res1 , res2);
		}
		else
		{
			return dp[l][r][player] = max(res1 , res2);
		}
	};

	cout << rec(0 , n - 1 , 0);

	return 0;
}

Measured memory_bytes: 493440
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define int ll
using pint = pair<int,int>;
using Graph = vector<vector<int>>;
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define out(n) cout << n << '\n'
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 1e10; //10^10
const double PI = acos(-1.0L);
const int dx[4] = {1, 0, -1, 0} , dy[4] = {0, 1, 0, -1};
/*mod逆元*/long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}
template< typename T >T mod_pow(T x, T n, T p=MOD) {T ret = 1;while(n > 0) {if(n & 1) (ret *= x) %= p;(x *= x) %= p;n >>= 1;}return ret;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n >>= 1; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}

//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int n,m,x; cin >> n >> m >> x;
    VI a(m); REP(i,m) cin >> a[i];
    int ans1 = 0 , ans2 = 0;
    REP(i,m){if(a[i]<x) ans1++; else ans2++;}
    out(min(ans1,ans2));

    return 0;
}

Measured memory_bytes: 256
M,D = map(int,input().split())

ans = 0
for m in range(4,M+1):
    for d in range(22,D+1):
        d = str(d)
        da = d[0]
        db = d[1]
        if int(db) < 2:continue
        if m == int(da)*int(db):
            ans += 1
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define UM unordered_map
#define ALL(a) (a).begin(), (a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll, ll> pii;
const long long INF = 1LL << 58;
struct Edge
{
    ll s, t, d;
};
typedef vector<vector<Edge>> Graph;
typedef vector<pii> vpii;
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;
}

signed main()
{
    string S, T;
    cin >> S >> T;
    cout << T + S << endl;
    // system("pause");
}

Measured memory_bytes: 256
import bisect
N,M = map(int,input().split())
A = [[] for _ in range(N)] #重複がある場合にはsetにする？
original = []
for i in range(M):
  a,b = map(int,input().split())
  a-=1 #県を0indexに直す
  A[a].append(b)
  original.append((a,b))
for X in A:
  X.sort()
#print(A)
for i in range(M):
  ken,now = original[i]
  ID = bisect.bisect_left(A[ken],now)
  ken += 1; ID+=1
  ans = "0"*(6-len(str(ken)))+str(ken)+"0"*(6-len(str(ID)))+str(ID)
  print(ans)


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

int main(){
	string n;
	cin>>n;
	int S=0;
	int len=n.length();
	for(int i=0;i<len;i++){
		string piece =  n.substr(i, 1);
		int number = atoi(piece.c_str());
		S += number;
	}
	int n_int = atoi(n.c_str());
	if(n_int%S==0){
		cout<<"Yes";
	}	else{
		cout<<"No";
	}
	return 0;
}	


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi 2*acos(0.0)
#define f first
#define s second
#define pb push_back
#define gap ' '
#define fastio {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define mod 998244353
#define N 405
ll ara[N],dp[N][N];
ll ans[N][N];
ll solve(int l,int r)
{
    if(l==r) return ara[l];
    if(dp[l][r]!=-1) return dp[l][r];
    dp[l][r]=LLONG_MAX;
    ans[l][r]=LLONG_MAX;
    for(int i=l;i<r;i++)
    {
        dp[l][r]=min(dp[l][r],solve(l,i)+solve(i+1,r));
        ans[l][r]=min(ans[l][r],ans[l][i]+ans[i+1][r]+dp[l][r]);
    }
    return  dp[l][r];
}
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++) cin>>ara[i];
    memset(dp,-1,sizeof dp);
    solve(0,n-1);
    cout<<ans[0][n-1]<<endl;
}


Measured memory_bytes: 6156
#include <bits/stdc++.h>
using namespace std;
typedef long long in;
typedef pair<in,in> ii;
#define F first
#define S second
#define sqr(x) (x)*(x)
#define pb(x) push_back(x)
#define sz(x) (in)x.size()
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rep(i,x,y) for(in i=x;i<(y);++i)
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
/* start */

int main(){
    IOS;
    in k,s,ans=0;
    cin >> k >> s;
    rep(i,0,k+1){
        rep(j,0,k+1){
            if(s-i-j>= 0 and s-i-j<=k) ans++;
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 256
import java.util.Scanner;
    public class Main{
  public static void main(String[] args){
          Scanner scan = new Scanner(System.in);
          int num1 = scan.nextInt();
          int num2 = scan.nextInt();
          if(num1>num2){
            System.out.println("a > b");
          }else if(num1<num2){
              System.out.println("a < b");
          }else{
            System.out.println("a == b"); 
          }
          scan.close();
}
}



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

long long int K;

template<size_t mx>
struct SnukeNumber{
    long long int ans[mx];
    long double a, b;

    constexpr long long int dsum(long long a){
        long long ret = 0;
        while(a){
            ret += a % 10;
            a /= 10;
        }
        return ret;
    }

    constexpr long double f(long long a){
        long long ret = dsum(a);
        return a / static_cast<long double>(ret);
    }

    constexpr SnukeNumber() : ans(), a(f(1)), b(){
        size_t cnt = 0;
        long long int s = 1, t = 1;
        for(long long int i = 1; cnt < mx; i += s){
            b = f(i + s);
            if(a < b){
                s = t;
                b = f(i + s);
            }
            if(a > b){
                if(s == t)t *= 10;
            }else{
                ans[cnt] = i;
                ++cnt;
            }
            long double tmp = a;
            a = b;
            b = tmp;
        }
    }
};

constexpr SnukeNumber<792> S = SnukeNumber<792>();

int main(){
    scanf("%lld", &K);
    for(int i = 0; i < K; ++i)printf("%lld\n", S.ans[i]);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

  if(D == 25){
    cout << "Christmas" << endl;
  }else if(D == 24){
    cout << "Christmas Eve" << endl;
  }else if(D == 23){
    cout << "Christmas Eve Eve" << endl;
  }else if(D == 22){
    cout << "Christmas Eve Eve Eve" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
# AOJ 513: Shuffle The Cards
# Python3 2018.6.30 bal4u

n = int(input())*2
c = [ i for i in range(1,n+1)]
m = int(input())
for _ in range(m):
	k = int(input())
	if k == 0:
		a = c[:n//2]
		b = c[n//2:]
		c = []
		for i in range(n//2): c += [a[i], b[i]]
	else: c = c[k:] + c[:k]
print(*c, sep='\n')


Measured memory_bytes: 5632
#include<bits/stdc++.h>
#define assn(n,a,b) assert(n<=b && n>=a)
using namespace std;
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,b) for(i=0;i<b;i++)
#define rep1(i,b) for(i=1;i<=b;i++)
#define pdn(n) printf("%d\n",n)
#define sl(n) scanf("%lld",&n)
#define sd(n) scanf("%d",&n)
#define pn printf("\n")
typedef pair<int,int> PII;
typedef vector<PII> VPII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef long long LL;
#define MOD 1000000007
LL mpow(LL a, LL n)
{LL ret=1;LL b=a;while(n) {if(n&1)
    ret=(ret*b)%MOD;b=(b*b)%MOD;n>>=1;}
return (LL)ret;}
#define MAXK 100000
#define MAXN 1000000000
int ar[MAXK];
int get(int n, int k){
    int i=0;
    while(i<k and ar[i]<=n)i++;
    return n-i;
}
typedef unsigned long long int ULL;
#define SSTR( x ) static_cast< std::ostringstream & >( \
        ( std::ostringstream() << std::dec << x ) ).str()

bool isSafe(int r, int c, vector<vector<int> > arr) {
	int n = arr.size();
	int m = arr[0].size();
	return (r>=0 && r<n && c>=0 && c<m);
}

/////////////////////////////////////////////////////////////
bool diffSign(int a,int b) {
	return ((a>0 && b<0) || (a<0 && b>0));
}  

int main() 
{ 
	int x,i,cnt5=0,cnt7=0;
	rep(i,3) {
		cin>>x;
		if(x==5) cnt5++;
		else if(x==7) cnt7++;
	}
	if(cnt5 == 2 && cnt7==1) cout<<"YES";
	else cout<<"NO";
	return 0; 
} 


Measured memory_bytes: 256
from collections import deque
def farthest(yi,xi):
    q = deque([])
    q.append((yi,xi))
    dis = [[-1]*(w+2) for i in range(h+2)]
    dis[yi][xi] = 0
    while q:
        y,x = q.popleft()
        for i in range(4):
            nexty = y + dy[i]
            nextx = x + dx[i]
            if maze[nexty][nextx] == '.' and dis[nexty][nextx] == -1:
                q.append((nexty,nextx))
                dis[nexty][nextx] = dis[y][x] + 1
    return dis[y][x]
h,w = map(int,input().split())
maze = [['#'] * (w+2)]
maze += [['#']+[x for x in input()]+['#'] for _ in range(h)]
maze += [['#'] * (w+2)]
dx = [-1,0,0,1]
dy = [0,1,-1,0]
maxdis = 1
for i in range(1,h+1):
    for j in range(1,w+1):
        if maze[i][j] == '.':
                maxdis = max(maxdis,farthest(i,j))
print(maxdis)


Measured memory_bytes: 3316
//============================================================================
// Name        : c.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int main() {
	int n,m,x;cin>>n>>m>>x;
	vector<int> c(n);
	vector<vector<int>> a(n,vector<int>(m));
	for(int i=0;i<n;i++){
		cin>>c[i];
		for(int j=0;j<m;j++){
			cin>>a[i][j];
		}
	}
	int max=1<<n;
	int ans=0;
	for(int i=0;i<max;i++){
		int tempi=i;
		vector<int> tempv(m);
		int tempc=0;
		for(int j=0;j<n;j++){
			if(tempi%2){
				for(int k=0;k<m;k++){
					tempv[k]+=a[j][k];
				}
				tempc+=c[j];
			}


			tempi/=2;
		}
		int flag=1;
		for(int j=0;j<m;j++){
			if(tempv[j]<x){
				flag=0;
			}
		}
		if(flag){
			if(ans){
				ans=min(ans,tempc);
			}else{
				ans=tempc;
			}
		}
	}
	if(ans){
		cout<<ans<<endl;
	}else{
		cout<<-1<<endl;
	}
	return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
const ll INF=1000000000000001;
const double PI=3.141592653589;


int main(){
  int n; cin>>n;
  int ans=0;
  rep(i,n){
    int a; cin>>a;
    ans+=a-1;
  }
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main() {
	int a, b,c,d;
	while (true) {
		cin >> a >> b;
		c = b;
		d = a;
		if (a > b) {
			a = c;
			b = d;
		}
		if (a == 0 && b == 0) {
			break;
		}
		cout << a <<" "<< b << endl;
	}
}


Measured memory_bytes: 3052
#include<iostream>
#include<vector>
#include<cmath>

using namespace std;

int main(){
  int cost = 100000;
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];  
  for(int i = 0; i < 3; i++){
    for(int j = 0; j < 3; j++){
      if(i == j) continue;
      for(int k = 0; k < 3; k++){
        if(j == k || i == k) continue;
        cost = min(abs(a[k] - a[j]) + abs(a[j] - a[i]),cost);
      }
    }
  }
  cout << cost;
}


Measured memory_bytes: 256
from itertools import permutations

N, C = map(int, input().split())
D = [[int(x) for x in input().split()] for _ in range(C)]
c = [[int(x) for x in input().split()] for _ in range(N)]

n_color = [[0 for _ in range(C)] for _ in range(3)]
for i in range(N):
    for j in range(N):
        X = c[i][j] - 1
        n_color[(i + j + 2) % 3][X] += 1

ans = float('inf')
for paint in permutations(range(C), 3):
    cost = 0
    for ij3 in range(3):
        Y = paint[ij3]
        for X in range(C):
            cost += D[X][Y] * n_color[ij3][X]
    ans = min(ans, cost)
print(ans)


Measured memory_bytes: 5492
#include<bits/stdc++.h>
typedef long long LL;
using namespace std; 
LL n,m;
LL xxn,yyn,zzn; 
struct node
{
	LL x,y,z;
}z[1005];
bool operator<(node aa, node bb)
{
    LL ax = aa.x*xxn;
	LL ay = aa.y*yyn;
	LL az = aa.z*zzn;
	LL bx = bb.x*xxn;
    LL by = bb.y*yyn;
    LL bz = bb.z*zzn;
    return ax+ay+az>bx+by+bz;
}
LL ans;
LL so(LL a,LL b,LL c)
{
	xxn = a; yyn = b; zzn = c;
	sort(z+1,z+1+n);
	LL sumx = 0,sumy = 0,sumz = 0;
	for(LL i=1;i<=m;i++)
	{
		sumx+=z[i].x; sumy+=z[i].y; sumz+=z[i].z;
	}
	return  llabs(sumx) + llabs(sumy) + llabs(sumz);
}
main()
{
	scanf("%lld%lld",&n,&m);
	for(LL i=1;i<=n;i++)
	{
		scanf("%lld%lld%lld",&z[i].x,&z[i].y,&z[i].z);
	} 
	ans = max(ans,so(1,1,1));
	ans = max(ans,so(1,1,-1));
	ans = max(ans,so(-1,1,1));
	ans = max(ans,so(1,-1,1));
	ans = max(ans,so(-1,-1,1));
	ans = max(ans,so(-1,1,-1));
	ans = max(ans,so(1,-1,-1));
	ans = max(ans,so(-1,-1,-1));
	printf("%lld",ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;

//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

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; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define RES(a,i,j) a.resize(i);rep(ii,i)a[ii].resize(j); 
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout<<a<<" "<<b<<" "<<c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 
#define gre(n) greater<n>()

typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
const int INF = 1000000000;
const double dINF = 1000000000;
const ll INF64 = 922337203685477580ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;
//メモ
//二次元配列のresizeのしかた
//vv.resize(n);
//for(size_t i=0; i<n; i++){
// vv[i].resize(n);
//}

//メモ
//負の辺を持つ最短経路問題では到達不可経路でも初期化値より小さくなりうるので注意しよう！
int main(){
    int n,m;
    std::cin >> n>>m;
    if(n%2==0){
        rep(i,m/2){
            ppri(i+1,2*m-i+1);
        }
        rrep(i,m/2,m){
            ppri(i+1,2*m-i);
        }
    }
    else{
        rep(i,m){
            ppri(i+1,2*m-i);
        }
    }
}

Measured memory_bytes: 3636
def bubble(a):
    for i in range(len(a)-1):
        for j in range(len(a)-1-i):
            if a[j] > a[j+1]:
                tmp=a[j]
                a[j]=a[j+1]
                a[j+1]=tmp

N,x=list(map(int,input().split()))

a = list(map(int,input().split()))
bubble(a)
ans = 0

for i in range(N):
    x -= a[i]
    if x < 0:
        break
    ans += 1
if x > 0:
    ans -= 1
print(ans)

Measured memory_bytes: 3064
class InputLine
  def self.to_s
    gets.chomp
  end

  def self.to_i
    InputLine.to_s.to_i
  end
  
  def self.to_f
    InputLine.to_s.to_f
  end

  def self.to_sa
    InputLine.to_s.split(' ')
  end

  def self.to_ia
    InputLine.to_sa.map(&:to_i)
  end
  
  def self.to_fa
    InputLine.to_sa.map(&:to_f)
  end
end

def main(argv)
  (a, b) = InputLine.to_ia

  puts (a * b).to_s
end

if self.to_s == 'main' then
  main(ARGV)
end

Measured memory_bytes: 14308
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define eb          emplace_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mp(x,y)     make_pair(x,y) 
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,a,n)   for(ll i=a;i<n;i++)
#define frr(i,a,n)  for(ll i=n-1;i>=a;i--)


const ll N   =  500005;
const ll mod = 1e9 + 7;

using namespace std;


void solve()
{
 string s;
  ll n,m,k,x=0,y=0,c=0,q,ans=0;
  cin>>s;
  sort(s.begin(), s.end());
  if(s[0]==s[1] and s[2]==s[3] and s[1]!=s[2])
  {
    c("Yes");
  }
  else c("No");

}

signed main(){
  
      ios_base::sync_with_stdio(false);   
      cin.tie(NULL);
      ll T=1;
      //cin>>T;
      while(T--)
      {
      solve();
      }
      return 0;
    }


Measured memory_bytes: 256
import java.util.Objects;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scanner = null;
      scanner = new Scanner(System.in);

      float A = (float)scanner.nextInt();
      float B = (float)scanner.nextInt();
      
      float C = A / B;
      System.out.println(C);

	}
}


Measured memory_bytes: 21972
#include <iostream>
#include <string>
using namespace std;
int main(){
    int w,a,b;
    cin >> w >> a >>b;
    if(a+w<b ){
        cout << b-a-w;
    }
    else if(b+w<a){
        cout << a-b-w;
    }
    else{
        cout << "0";
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<math.h>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<sstream>
#include<set>
 
using namespace std;
 
#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define esta(x,v) (find((v).begin(),(v).end(),(x)) !=  (v).end())
#define index(x,v) (find((v).begin(),(v).end(),(x)) - (v).begin())
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair
 
typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;
 
typedef vector<int> vint;
 
int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}
 
string toString (int number)
{
	ostringstream ostr;
	ostr << number;
	return  ostr.str();
}
 
int main (){
	tint n;
	cin>>n;
	tint vu=n/11;
	tint fal=n%11;
	tint an=2*vu+2;
	if(fal==0){
		cout<<an-2<<endl;
	}else if(fal<=6){
		cout<<an-1<<endl;
	}else{
		cout<<an<<endl;
	}
}


Measured memory_bytes: 384
#include<stdio.h>
#include<memory.h>
#include<algorithm>

using namespace std;
long dp[3001][3001];
int A[3001];
int main()
{
    int N;
    //freopen("input.txt", "r", stdin);
    scanf("%d", &N);
    int x;
    for(int i=0; i<N; i++)
    {
        scanf("%d", &A[i]);
        dp[i][i] = A[i];
        for(int j=i-1; j>=0; j--)
        {
            dp[j][i] = max((A[j]-dp[j+1][i]), (A[i]-dp[j][i-1]));
        }
    }
    printf("%ld\n", dp[0][N-1]);
    return 0;
}

Measured memory_bytes: 69888
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace abc123_a
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int e = int.Parse(Console.ReadLine());
            int k = int.Parse(Console.ReadLine());

            if(e - a > k)
            {
                Console.WriteLine(":(");
            }
            else
            {
                Console.WriteLine("Yay!");
            }
            Console.Read();

        }
    }
}


Measured memory_bytes: 11092
package main

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

func main() {
	fsc := NewFastScanner()
	N := fsc.NextInt()
	D := make([]int, 0)
	for i := 0; i < N; i++ {
		D = append(D, fsc.NextInt())
	}
	sort.Ints(D)
	R := D[0]
	result := 1
	for i := 1; i < N; i++ {
		if D[i] > R {
			R = D[i]
			result++
		}
	}
	fmt.Println(result)
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &FastScanner{r: rdr}
}
func (s *FastScanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *FastScanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *FastScanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *FastScanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *FastScanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}

func (s *FastScanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *FastScanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *FastScanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

//Max,Min
func IntMax(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func Int64Max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func Float64Max(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

func IntMin(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func Int64Min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func Float64Min(a, b float64) float64 {
	if a > b {
		return b
	}
	return a
}

//Gcd
func IntGcd(a, b int) int {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return IntGcd(b, a%b)
}
func Int64Gcd(a, b int64) int64 {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return Int64Gcd(b, a%b)
}

func IntAbs(a int) int {
	if a < 0 {
		a *= -1
	}
	return a
}

func Int64Abs(a int64) int64 {
	if a < 0 {
		a *= -1
	}
	return a
}


Measured memory_bytes: 640
def main():
  from collections import deque
  
  s,q,*r = [list(k.split()) for k in open(0)]
  que = deque(s[0])
  p = False
  for x in r:
    if len(x)==1:
      p = not p
      continue
    if (p==False and x[1]=='1') or (p==True and x[1]=='2'):
        que.appendleft(x[2])
    else:
        que.append(x[2])
  print("".join(que) if p==False else "".join(que)[::-1])
  
if __name__=='__main__':
  main()

Measured memory_bytes: 35416
#include <iostream>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <limits>
#include <numeric>
#include <algorithm>
#include <functional>

#include <vector>

using namespace std;

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

	int N, M;
	cin >> N >> M;

	vector<int> card(N, 0);

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

	vector<pair<int, int>> op_info(M, make_pair(0, 0));

	for (int i = 0; i < M; i++)
	{
		cin >> op_info[i].first >> op_info[i].second;
	}

	sort(card.begin(), card.end());
	sort(op_info.begin(), op_info.end(), [](const pair<int, int>& l, const pair<int, int>& r)
	{
		if (l.second == r.second) return l.first > r.first;
		return l.second > r.second;
	});

	int idx = 0;
	for (int i = 0; i < M; i++)
	{
		bool check = false;
		int change = 0;
		while (change < op_info[i].first && idx < N)
		{
			if (card[idx] >= op_info[i].second)
			{
				check = true;
				break;
			}

			card[idx] = op_info[i].second;

			change++;
			idx++;
		}

		if (idx == N || check)
		{
			break;
		}
	}

	long long result = 0;
	for (int i = 0; i < N; i++)
	{
		result += card[i];
	}

	cout << result;

	return 0;
}


Measured memory_bytes: 1408
#include <algorithm>
#include <array>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <utility>
#include <vector>
#define FOR(i,a,b) for (int i=(a),for_##i##_max=(b);i<=(for_##i##_max);++i)
#define RFOR(i,a,b) for (int i=(a),rfor_##i##_min=(b);i>=(rfor_##i##_min);--i)
#define REP(i,n) for (int i=0,rep_##i##_len=(n);i<(rep_##i##_len);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)
constexpr int INF = 100100100;

template<typename T>
void chmin(T &x, T y) {
  x = std::min(x, y);
}

template<typename T>
void chmax(T &x, T y) {
  x = std::max(x, y);
}

using namespace std;

int main() {
  // cout << fixed << setprecision(10);
  int R, G, B, N;
  cin >> R >> G >> B >> N;
  int ans = 0;
  FOR(r, 0, N/R+1) FOR(g, 0, N/G+1) {
    auto const rem = N - (r*R + g*G);
    if (rem >= 0 && rem % B == 0) {
      ++ans;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#C
N=int(input())
A=[int(i) for i in input().split()]

CS=[A[0]]
for i in range(1,N-1):
    CS.append(CS[-1]+A[i])

ans=10**19
SUM=sum(A)
for s in CS:
    ans=min(ans,abs(SUM-s-s))
print(ans)



Measured memory_bytes: 24936