akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cctype>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

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();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#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 range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

const ll MOD = 1000000007;

int main(void){
    ll res;

    for(int n; cin >> n;){
        res = 0;
        string ranks;
        rep(i, n){
            char r; cin >> r;
            ranks.pb(r);
        }

        vector< vector<ll> > dp(n + 1, vector<ll>(n + 1));
        dp[0][0] = 1;

        rep(i, n){
            rep(j, n){
                if(ranks[i] == '-'){
                    dp[i + 1][j] = dp[i][j];
                }
                else if(ranks[i] == 'U'){
                   (dp[i + 1][j] += dp[i][j] * j) %= MOD;
                   (dp[i + 1][j + 1] += dp[i][j]) %= MOD;
                }
                else{
                    (dp[i + 1][j] += dp[i][j] * j) %= MOD;
                    if(j != 0){
                       (dp[i + 1][j - 1] += dp[i][j] * j * j) %= MOD;
                    }
                }
            }
        }

        cout << dp[n][0] << endl;
    }

	return 0;
}

Measured memory_bytes: 1348
A = list(input())
n = len(A)
l = [0] * (n+1)
count = 0

for i in range(n):
    if A[i] == '<':
        count += 1
        l[i+1] = count
    else:
        count = 0

A.reverse()
l.reverse()
count = 0

for i in range(n):
    if A[i] == '>':
        count += 1
        l[i+1] = max(count, l[i+1])
    else:
        count = 0

print(sum(l))

Measured memory_bytes: 27208
s=input()
lenlen=len(s)
count=0
if s[0]=="A":
  t=s[2:lenlen-1]
  for i in range(0,len(t)):
    if t[i]=="C":
      count+=1
  if count==1:
    tttt=0
    for j in range(0,lenlen):
      if not 97<=ord(s[j])<=122:
        tttt+=1
    if tttt==2:
      print("AC")
    else:
      print("WA")
  else:
    print("WA")
else:
  print("WA")
 

Measured memory_bytes: 3060
using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.IO;

class Solve
{
	const int mod = 1000000007;
	static void Main(string[] args)
	{
		var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
		Console.SetOut(sw);

		int N = int.Parse(Console.ReadLine());
		var A = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

		int[] ball = new int[N];


		for (int i = N; i >= 1; i--)
		{
			int sum = 0;
			int num = 1;
			while (num * i <= N)
			{
				if (ball[num * i - 1] == 1)
				{
					sum++;
				}
				num++;
			}
			if (sum % 2 == A[i - 1])
			{
				ball[i - 1] = 0;

			}
			else { ball[i - 1] = 1; }
		}
		int bsum = 0;
		for (int i = 0; i < N; i++)
		{
			bsum += ball[i];
		}
		if (bsum == 0) { Console.WriteLine(0); }
		else
		{
			Console.WriteLine(bsum);
			for (int i = 0; i < N; i++)
			{
				if (ball[i] == 1)
				{
					Console.Write(i + 1 + " ");
				}
			}
		}


		Console.Out.Flush();
	}
}


Measured memory_bytes: 28636
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const long long INF = 1LL << 60;
const int MOD = 1000000007;
signed main(void){
    string s; cin>>s;
    rep(i,s.size()){
        if(i%2 == 0){
            //奇数
            if(!(s[i] == 'R' || s[i] == 'U'||s[i] == 'D')) {cout<<"No"<<endl; return 0;}
        }else{
            if(!(s[i]=='L'||s[i]=='U'||s[i]=='D')) {cout<<"No"<<endl; return 0;}
        }
    }
    cout<<"Yes"<<endl;
}


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

int main (void){
    int n, h, w;
    int ans = 0;
    cin >> n >> h >> w;
    for (int i =0; i < n; i++ ){
        int a, b;
        cin >> a >> b;
        if (a >= h && b >= w) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cctype>
#include <array>
using namespace std;

#define si static inline
#define gcu getchar_unlocked
si int in() {
	int n = 0, c = gcu();
	// bool minus = false; if (c == '-') minus = true, c = gcu();
	do {n = 10 * n + (c - '0'), c = gcu();} while (c >= '0');
	return n; }
	// return minus ? -n : n; }
si void scan(char *s) {while (!isspace(*s++ = gcu()));}
#define pcu putchar_unlocked
#define svo si void out
template <typename T>
svo(T n) {
	static char buf[20];
	char *p = buf;
	//if(n < 0) pcu('-'), n *= -1;
	if (!n) *p++ = '0';
	else while (n) *p++ = n % 10 + '0', n /= 10;
	while (p != buf) pcu(*--p); }
svo(const char *s){while(*s)pcu(*s++);}
svo(char *s){while(*s)pcu(*s++);}
svo(char c){pcu(c);}
//template <typename T>
//svo(vector<T> &v){for(T &x:v)out(' '),out(x);out('\n');}
//svo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
template <typename head, typename... tail>
svo(head&& h, tail&&... t){out(h);out(move(t)...);}
#undef svo
#undef si

struct board {
	array<array<int, 8>, 8> b = {};

	void print() {
		for (auto r : b) {
			for (int c : r)
				out(c == 2 ? 'Q' : '.');
			out('\n');
		}
	}

	board put(int r, int c) {
		board t = *this;
		auto cross = [&](int r, int c) {
			if (0 <= r && r < 8 && 0 <= c && c < 8)
				t.b[r][c] = 1;
		};
		for (int i = 0; i < 8; i++) {
			t.b[i][c] = t.b[r][i] = 1;
			cross(r + i, c + i);
			cross(r - i, c - i);
			cross(r + i, c - i);
			cross(r - i, c + i);
		}
		t.b[r][c] = 2;
		return move(t);
	}

	bool solver(int r) {
		if (r >= 8) {
			print();
			return true;
		}
		for (int i = 0; i < 8; i++)
			if (!b[r][i]) {
				board t = put(r, i);
				if (t.solver(r + 1))
					return true;
			} else if (b[r][i] == 2)
				return solver(r + 1);
		return false;
	}
};

int main() {
	board b;
	int k = in();
	while (k--) {
		int r = in();
		b = b.put(r, in());
	}
	b.solver(0);
}


Measured memory_bytes: 2624
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    System.out.println(c < (a-b) ? 0 : c - (a-b));
  }
}

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

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

    int h, w;
    while(1){
        cin >> h >> w;
        if (h == 0 && w == 0) break;
        rep(i, h){
            rep(j, w){
                if ((i + j) % 2 == 0) cout << '#';
                else cout << '.';
            }
            cout << endl;
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3196
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) int(x.size())

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; }

const double PI=3.14159265358979323846;

int mod = 1e9+7;
const long long INF = 1LL<<60;

int main(){

  ll H, W;
  cin >> H >> W;

  ll ans = 1e15;
  // 最初縦、次横
  for(int h=1; h<=H-1; h++){
    ll first_area = h * W;
    ll rest_H = H - h;
    if(rest_H%2 == 0 || W%2 == 0){
      ll tmp_area = rest_H * W / 2;
      ll tmp_diff = abs(first_area - tmp_area);
      ans = min(ans, tmp_diff);
    }else{
      // 小さい方
      ll tmp_area1 = rest_H * (W/2);
      ll tmp_diff1 = abs(first_area - tmp_area1);
      // 大きい方 
      ll tmp_area2 = rest_H * ((W/2) + 1);
      ll tmp_diff2 = abs(first_area - tmp_area2);
      // 分割エリア同士
      ll tmp_diff3 = abs(tmp_area1 - tmp_area2);

      // 最大差
      ll tmp_diff = max(tmp_diff1, max(tmp_diff2, tmp_diff3));
      // 解更新
      ans = min(ans, tmp_diff);
    }
  }
  // 最初横、次縦
  for(int w=1; w<=W-1; w++){
    ll first_area = w * H;
    ll rest_W = W - w;
    if(rest_W%2 == 0 || H%2 == 0){
      ll tmp_area = rest_W * H / 2;
      ll tmp_diff = abs(first_area - tmp_area);
      ans = min(ans, tmp_diff);
    }else{
      // 小さい方
      ll tmp_area1 = rest_W * (H/2);
      ll tmp_diff1 = abs(first_area - tmp_area1);
      // 大きい方 
      ll tmp_area2 = rest_W * ((H/2) + 1);
      ll tmp_diff2 = abs(first_area - tmp_area2);
      // 分割エリア同士
      ll tmp_diff3 = abs(tmp_area1 - tmp_area2);

      // 最大差
      ll tmp_diff = max(tmp_diff1, max(tmp_diff2, tmp_diff3));
      // 解更新
      ans = min(ans, tmp_diff);
    }
  }

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


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

constexpr Int TEN(int n) { return n == 0 ? 1 : 10 * TEN(n-1); }

int main(void) {
    int a,p;
    cin>>a>>p;

    cout<<(p+3*a)/2<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(;;){
        ll b;
        cin>>b;
        if(!b) return 0;
        set<ll> div;
        for(ll i=1; i*i<=2*b; i++){
            if(2*b%i==0){
                div.insert(i);
                div.insert(2*b/i);
            }
        }
        for(auto e: div){
            ll f=2*b/e;
            if(f%2){
                e/=2;
                if(e>f/2){
                    cout <<e-f/2<<" "<<f<<"\n";
                    break;
                }
            }
            else{
                if(e%2){
                    if(e/2>=f/2){
                        cout <<e/2-f/2+1<<" "<<f<<"\n";
                        break;
                    }
                }
            }
        }
    }
}


Measured memory_bytes: 3144
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll X, Y;
  cin >> X >> Y;
  if ((X == 0 && Y == 0) || (X == 0 && Y == 1) || (X == 1 && Y == 0) ||
      (X == 1 && Y == 1) || X == 2 || Y == 2 || X == Y || X == Y - 1 ||
      Y == X - 1)
    cout << "Brown" << endl;
  else
    cout << "Alice" << endl;
  return 0;
}


Measured memory_bytes: 256
//   Author:Arturia
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cctype>
#include<ctime>
#include<cstdlib>
#include<string>
#include<queue>
#include<cmath>
#include<set>
#include<map>
#include<bitset>
#include<vector>
#define rep(x,a,b) for (int x=a;x<=(int)b;x++)
#define drp(x,a,b) for (int x=a;x>=(int)b;x--)
#define cross(x,a) for (int x=hd[a];~x;x=nx[x])
#define ll long long
#define inf (1<<29)
#define PII pair<int,int>
#define PDD pair<double,double>
#define mk(a,b) make_pair(a,b)
#define fs first
#define sc second
#define pb push_back
#define VI vector<int>
#define VS vector<string>
#define MC(a,b) memcpy(a,b,sizeof b)
#define MS(a,b) memset(a,b,sizeof a)
using namespace std;
inline ll rd(){
	ll x=0;int ch=getchar(),f=1;
	while (!isdigit(ch)&&(ch!='-')&&(ch!=EOF)) ch=getchar();
	if (ch=='-'){f=-1;ch=getchar();}
	while (isdigit(ch)){x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
	return x*f;
}
inline void rt(ll x){
	if (x<0) putchar('-'),x=-x;
	if (x>=10) rt(x/10),putchar(x%10+'0');
		else putchar(x+'0');
}
const int maxn=205;
int n,a[maxn];
int main(){
	n=rd();
	rep(i,1,2*n) a[i]=rd();
	sort(a+1,a+2*n+1);
	int ans=0;
	rep(i,1,n) ans+=a[i*2-1];
	rt(ans),putchar('\n');
}

Measured memory_bytes: 128
#include <iostream>

int main() {
    int a, b, s;
    std::cin >> a >> b;
    s = (a+b);
    if(s == 3) {
        std::cout << 3;
    }
    else if(s == 4) {
        std::cout << 2;
    }
    else {
        std::cout << 1;
    }

    return 0;
}

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

using namespace std;

using ll = long long;

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

    constexpr ll MOD = 1e9 + 7;

    int n;
    string s;
    cin >> n >> s;

    vector<ll> cur(n + 1, 1), nxt(n + 1);
    cur[0] = 0;

    for (int i = 2; i <= n; ++i) {
        for (int j = 1; j <= n - i + 2; ++j) {
            cur[j] += cur[j - 1];
            nxt[j] = 0;
        }

        if (s[i - 2] == '<')
            for (int j = 1; j <= n - i + 1; ++j)
                (nxt[j] += (cur[j] - cur[0] + MOD)) %= MOD;
        else
            for (int j = 1; j <= n - i + 1; ++j)
                (nxt[j] += (cur[n - i + 2] - cur[j] + MOD)) %= MOD;

        swap(cur, nxt);
    }

    cout << cur[1] << endl;

    return 0;
}


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

using namespace std;


char s[1004];

int visa[26];
int visb[26];

int dp[105];
int main(){
    int n;
    scanf("%d%s", &n, s);
    for(int i = 0; i < n; i++){
        int chr = s[i] - 'a';
        visb[chr]++;
    }
    int mx = 0;
    for(int i = 0; i < n; i++){
        int chr = s[i] - 'a';
        if(!visa[chr] && visb[chr] >= 2){
            dp[i] = dp[i - 1] + 1;
            mx = max(dp[i], mx);
            visa[chr] = 1;
        }
        else if(visa[chr] && visb[chr] == 1){
            dp[i] = dp[i - 1] - 1;
        }
        else{
            dp[i] = dp[i - 1];
        }
        visb[chr] --;
    }

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


Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=1000003;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	cin.tie(0);ios::sync_with_stdio(false);
	int n,a,b,c,d,i;cin>>n>>a>>b>>c>>d;n++;
	string str;cin>>str;str.ins(str.begin(),'#');str.ins(str.end(),'#');str.ins(str.end(),'#');
	if(c<d){
		while(a<c||b<d){
			//c優先的に動かすとよさそう?
			if(b+1<=d&&str[b+1]=='.'&&b+1!=a){b++;continue;}
			if(b+2<=d&&str[b+2]=='.'&&b+2!=a){b+=2;continue;}
			if(a+1<=c&&str[a+1]=='.'&&a+1!=b){a++;continue;}
			if(a+2<=c&&str[a+2]=='.'&&a+2!=b){a+=2;continue;}
			cout<<"No"<<endl;return 0;
		}
		cout<<"Yes"<<endl;return 0;
	}else{
		while(a<c||b<d){
			//c優先的に動かすとよさそう?
			
			if(a+1<=c&&str[a+1]=='.'&&a+1!=b){a++;continue;}
			if(a+2<=c&&str[a+2]=='.'&&a+2!=b){a+=2;continue;}
			if(b+1<=d&&str[b+1]=='.'&&b+1!=a){b++;continue;}
			if(b+2<=d&&str[b+2]=='.'&&b+2!=a){b+=2;continue;}
			cout<<"No"<<endl;return 0;
		}
		cout<<"Yes"<<endl;return 0;
	}
	
	return 0;
}


Measured memory_bytes: 592
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, a[maxn];
int X, cnt[maxn], ans;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; i++) {
		int tmp;
		cin >> a[i];
		X = X ^ a[i];
		tmp = a[i];
		int res = 0;
		res = __builtin_ctz(a[i]);
		cnt[res]++;
	}
	
	for(int i = 30; i >= 0; i--) {
		if((X >> (i)) & 1) {
			if(cnt[i] > 0) {
				X = X ^ ((1LL << (i + 1) )- 1);
				ans++;
			}
			else 
				return cout << -1, 0;
		}
	}
	return cout << ans, 0;
}

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

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));

		String inputValue = br.readLine();
		String[] valueArray = inputValue.split(" ");

		int a = Integer.parseInt(valueArray[0]);
		int b = Integer.parseInt(valueArray[1]);

		if(a < b){
			System.out.println("a < b");
		}else if(a > b){
			System.out.println("a > b");
		}else if(a == b){
			System.out.println("a == b");
		}
	}

}

Measured memory_bytes: 24252
#include <bits/stdc++.h>
using namespace std;
 
int sum (int n) {
  if (n == 1)
    return 1;
  else
    return sum(n-1) + n;
}
int main () {
  
  int N;  
  cin >> N;
  
  cout << sum(N) << endl; 
  
}

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

int main() {
	int a, b;
	cin >> a >> b;
	if (a == 1)a = 14;
	if (b == 1)b = 14;

	if (a == b)
		cout << "Draw" << endl;
	else if (a < b)
		cout << "Bob" << endl;
	else
		cout << "Alice" << endl;

	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define repi(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)
#define rep(i,n) repi(i,0,n)
#define repi_(i,a,b) for(int i=(a), i##_len=(b); i<=i##_len; ++i)
#define rep_(i,n) repi_(i,0,n)
#define all(x) (x).begin(),(x).end()
#define vsort(v) sort((v).begin(), (v).end())
#define gsort(v) tsort(v); reverse((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())
#define siz(v) ((int)(v).size())
#define ers(v, n) (v).erase((v).begin() + n)
#define cnt(v, n) count(all(v), n)
#define vmin(v) *min_element(v.begin(), v.end())
#define vmax(v) *max_element(v.begin(), v.end())
#define el "\n"
#define co(x) cout<<(x)<<el
#define coc(c, a, b) if(c)co((a));else co((b))
#define cosp(x) cout<<(x)<<' '
#define YES(c) coc(c,"YES", "NO")
#define Yes(c) coc(c,"Yes", "No")
#define yes(c) coc(c,"yes", "no")
#define POSSIBLE(c) coc(c, "POSSIBLE", "IMPOSSIBLE")
#define Possible(c) coc(c, "Possible", "Impossible")
#define possible(c) coc(c, "possible", "impossible")
#define inf INT_MAX
#ifdef tqktmp_2
#define gc() getchar(); getchar()
#else
#define gc() 1
#endif
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))


typedef long long lint;

lint dx[8] = { 0,1,1,1,0,-1,-1,-1 },
dy[8] = { 1,1,0,-1,-1,-1,0,1 };

template<class T>inline bool maxi(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>inline bool mini(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }



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

	string s, t; cin >> s >> t; s += s;
	Yes(s.find(t) != string::npos);
	gc();
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;

const ll MOD = 1000000007;
const long double EPS = 1e-10;
const int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    std::ios::sync_with_stdio(0); cin.tie(0);
    int a,p;
    cin >> a >> p;
    cout << (3*a+p)/2 << endl;
}


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

int main() {
  int n, m;
  cin >> n >> m;
  cout << (n * (n-1) / 2) + (m * (m-1) / 2) << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IO                       \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
#define mem(a, x) memset(a, x, sizeof(a))
#define per(x, a, b) for (int x = a; x <= b; x++)
#define rep(x, a, b) for (int x = a; x >= b; x--)

using namespace std;
typedef long long LL;
typedef pair<int, int> P;
const int maxn = 1e5 + 10;
const int mod = 1e9 + 7;
const double eps = 1e-8;

int main() {
#ifdef LOCAL_IM0QIANQIAN
    freopen("test.in", "r", stdin);
//    freopen("test.out", "w", stdout);
#else
    IO;
#endif // LOCAL_IM0QIANQIAN

    int a, b, c;
    while (cin >> a >> b >> c) {
        cout << min(b / a, c) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("Ofast","unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define F first
#define S second
#define MEM(a,b) memset(a,b,sizeof a)
#define Tie ios::sync_with_stdio(0),cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

ll n,k,v,w,dp[100001],ans;

int main()
{Tie
	cin>>n>>k;
	for(int i=0;i<n;i++)
	{
		cin>>w>>v;
		for(int i=k-w;i>-1;i--)
			if(dp[i])
				dp[i+w]=max(dp[i+w],dp[i]+v);
		dp[w]=max(dp[w],v);
	}
	for(int i=0;i<=k;i++)
		ans=max(ans,dp[i]);
	cout << ans<<'\n';
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
 
int ans,n,m,x,y,z,a[111][111],used[111];
 
 
void dfs(int d,int b){
  if(d==n){
    int res=0;
    if(b<2)return;
    r(i,b){
      int A=1e9;
      r(j,b)if(i!=j){
        A=min(A,a[used[i]][used[j]]);
      }
      res+=A;
    }
    ans=max(ans,res);
    return;
  }
  int f=1;
  r(i,b)if(a[d][used[i]]==0)f=0;
  if(f){
    used[b]=d;
    dfs(d+1,b+1);
  }
  dfs(d+1,b);
}
 
int main(){
  cin>>n>>m;
  r(i,m){
    cin>>x>>y>>z;
    x--;y--;
    a[x][y]=a[y][x]=z;
  }
  dfs(0,0);
  cout<<ans<<endl;
}


Measured memory_bytes: 3148
#include <iostream>

using namespace std;

typedef long long ll;

ll dp[51][51][2501];
ll N,A;
ll x[50];

int main(){
    cin >> N >> A;
    for(int i=0;i<N;i++) cin >> x[i];
    for(int i=0;i<=N;i++){
        for(int j=0;j<=N;j++){
            for(int k=0;k<=2500;k++){
                dp[i][j][k] = 0;
            }
        }
    }
    dp[0][0][0] = 1;
    for(int i=1;i<=N;i++){
        for(int j=0;j<=i;j++){
            for(int k=0;k<=2500;k++){
                dp[i][j][k] += dp[i-1][j][k];
                if(j>0 && k >= x[i-1]) dp[i][j][k] += dp[i-1][j-1][k-x[i-1]];
            }
        }
    }
    ll sum = 0;
    for(int j=1;j<=50;j++){
        sum += dp[N][j][j*A];
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 51072
#include <bits/stdc++.h>
using namespace std;
int a[30]={},b[30]={};
int main() {
    string s,t;
    cin >> s >> t;
    int n=s.size();
    for(int i=0;i<n;i++){
        int num1=s[i]-'a';
        int num2=t[i]-'a';
        a[num1]++,b[num2]++;
        if(a[num1]!=b[num2]){cout<<"No"; return 0;}
    }
    cout<<"Yes";
}


Measured memory_bytes: 3916
N = int(input())

def num_divisors_table(n):
    table = [0] * (n + 1)
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    return table

p = num_divisors_table(N)

print(sum(p[:N]))

Measured memory_bytes: 24700
import static java.lang.System.out;
import java.util.Scanner;
import java.util.Arrays;

public class Main{
   static Scanner sc = new Scanner(System.in);
   public static void main(String[] args){
      String N = sc.next();
      int NN = Integer.parseInt(N);
      int leng = String.valueOf(N).length();
      int result = 0;
      for(int i=0; i<leng; i++){
         
         result += Integer.parseInt(N.substring(i,i+1));

      }
      if(NN%result ==0){
         out.println("Yes");
         return;
      }
      out.println("No");

   }
}

Measured memory_bytes: 22996
function Main(input) {
    var arr = input.split("\n");
    var nums = arr[0].split(" ");
    var n = parseInt(nums[0], 10);
    var q = parseInt(nums[1], 10);
    var set = new Array();
    for (i = 0; i < n; i++) {
        set.push(new UnionFind());
    }
    var uf = new UnionFind();
    for (i = 0; i < q; i++) {
        var command = arr[i + 1].split(" ");
        var a = parseInt(command[1], 10);
        var b = parseInt(command[2], 10);
        if (command[0] == "0") {    
            uf.unite(set[a], set[b]);
        } else {
            console.log(uf.same(set[a], set[b]));
        }
    }
}

function UnionFind() {
    this.parent = this;
    this.size = 1;
    this.find = function(){
        if (this.parent == this) {
            return this;
        } else {
            return this.parent.find();
        }
    };
    this.unite = function(x, y) {
        var xtop = x.find();
        var ytop = y.find();
        if (xtop == ytop) {
            return false;
        } else {
            if (xtop.size < ytop.size) {
                xtop.parent = ytop;
                ytop.size += xtop.size;
            } else {
                ytop.parent = xtop;
                xtop.size += ytop.size;
            }
            return true;
        }
    };
    this.same = function(x, y) {
        if (x.find() == y.find()) {
            return 1;
        } else {
            return 0;
        }
    };
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

typedef long long ll;

const long long MOD = 1000000007;
long long modpow(long long a, long long n, long long m)
{
    long long ans = 1;
    while (n)
    {
        if (n & 1)
        {
            ans = (ans * a) % m;
        }
        a = (a * a) % m;
        n >>= 1;
    }
    return ans;
}
long long combi(long long n, long long a)
{
    long long ans = 1, ans1 = 1;
    for (long long i = n - a + 1; i <= n; i++)
    {
        ans *= i % MOD;
        ans %= MOD;
    }

    for (long long i = 2; i <= a; i++)
        ans1 = (ans1 * i) % MOD;
    ans1 = modpow(ans1, MOD - 2, MOD);
    return ((ans % MOD) * ans1) % MOD;
}

void dfs(string s, char mx, ll N)
{
    if (s.length() == N)
    {
        cout << s.c_str() << endl;
    }
    else
    {
        for (char c = 'a'; c <= mx; c++)
        {
            dfs(s + c, ((c == mx) ? (char)(mx + 1) : mx), N);
        }
    }
}

int main()
{
    ll H, W;
    cin >> H >> W;

    if (H == 1 || W == 1)
    {
        cout << 1 << endl;
        return 0;
    }

    if (H % 2 == 0)
    {
        cout << W * (H / 2) << endl;
    }
    else
    {
        ll tmp = (W * ((H - 1) / 2)) + ceil(W / 2.0);
        cout << tmp << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a,b,c,k,sum=0,i;
    scanf("%d %d %d %d",&a,&b,&c,&k);
    if(a==b && b==c && c==a)
    {
        for(int i=0;i<k;i++)
        {
            a=a*2;
        }
        sum=a+b+c;
    }
    else if(a>b && a>c)
    {
        for(int i=0;i<k;i++)
        {
            a=a*2;
        }
        sum=a+b+c;
    }
    else if(b>a && b>c)
    {
        for(int i=0;i<k;i++)
        {
            b=b*2;
        }
        sum=a+b+c;
    }
    else
    {
        for(int i=0;i<k;i++)
        {
            c=c*2;
        }
        sum=a+b+c;

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


Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
	int a;
	int b;
	int c;
	int x;
	int y=0;
	int z;

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

	for(x=a; x<=b; x++)
	{

		z=c%x;

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

		if (z==0)
		{
			y=y+1;
		}
		
	}

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

	return 0;
}

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

int main() {
	int r,c;
	cin>>r>>c;
	int a[r][c],b[r+1][c+1];
	for (int i = 0; i < r; ++i)
	{
		for (int j = 0; j < c; ++j)
		{
			cin>>a[i][j];
			b[i][j]=a[i][j];
		}
	}

	for (int i = 0; i < r; ++i)
	{
		b[i][c]=0;
		for (int j = 0; j < c; ++j)
		{
			b[i][c]+=a[i][j];
		}
		
	}
	for (int i = 0; i < c; ++i)
	{
		b[r][i]=0;
		for (int j = 0; j < r; ++j)
		{
			b[r][i]+=a[j][i];
		}
		
	}

	b[r][c]=0;
	for (int i = 0; i < r; ++i)
	{
		for (int j = 0; j < c; ++j)
		{
			b[r][c]+=a[i][j];
		}
	}

	for (int i = 0; i <= r; ++i)
	{
		for (int j = 0; j < c; ++j)
		{
			cout<<b[i][j]<<" ";
		}
		cout<<b[i][c]<<endl;
	}


	return 0;
}

Measured memory_bytes: 1236
package main

import (
	"fmt"
)

const MOD = 1e9 + 7

var fact [5e5 + 1]int
var finv [5e5 + 1]int
var inv [5e5 + 1]int

func comb(n, k int) int {
	return fact[n] * (finv[k] * finv[n-k] % MOD) % MOD
}

func perm(n, k int) int {
	return fact[n] * (finv[n-k] % MOD) % MOD
}

func main() {
	var n, m, ans int
	fmt.Scan(&n, &m)
	fact[0], fact[1] = 1, 1
	finv[0], finv[1] = 1, 1
	inv[1] = 1
	for i := 2; i < m+1; i++ {
		fact[i] = i * fact[i-1] % MOD
		inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD
		finv[i] = finv[i-1] * inv[i] % MOD
	}
	s := -1
	for k := 0; k <= n; k++ {
		s *= -1
		ans += comb(n, k) * perm(m, k) % MOD * perm(m-k, n-k) % MOD * perm(m-k, n-k) % MOD * s
		ans %= MOD
		if ans < 0 {
			ans += MOD
		}
	}
	fmt.Println(ans)
}


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

int main() {
    int64_t a, b;
    cin >> a >> b;

    int64_t n = __gcd(a, b);
    map<int64_t, int64_t> fans;
    fans[1]++;
    for (int64_t m = 2, lim = sqrt(n) + 2; m < lim; m++) {
        while (n % m == 0) {
            fans[m]++;
            n /= m;
        }
    }

    if (n > 1) fans[n]++;

    cout << fans.size() << endl;
}


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

int main()
{
  char b;
  cin >> b;

  if(b=='A') cout << 'T' << endl;
  if(b=='T') cout << 'A' << endl;
  if(b=='C') cout << 'G' << endl;
  if(b=='G') cout << 'C' << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;


int main() {
    int N, K;
    cin >> N >> K;

    int MAX_PAIR = (N-1) * (N-2) / 2;

    if (K > MAX_PAIR) {
        cout << "-1" << endl;
        return 0;
    }

    int diff = MAX_PAIR - K;
    cout << N  - 1 + diff << endl;
    for(int i = 2; i <= N; i++) {
        cout << "1 " << i << endl;
    }

    for(int i = 2; i <= N; i++) {
        for(int j = i+1; j <= N;j++ ) {
            if(diff == 0) return 0;
            cout << i << " " << j << endl;
            diff--;            
        }
    }
}


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

const int MAX_N = 1e5+10;
int N, A, B;
ll h[MAX_N];
ll mx, cnt, tot;

bool ok(int x)
{
	ll needed = 0;
	for(int i=0;i<N;++i){
		if(h[i]>1LL*B*x) needed+=(h[i]-1LL*B*x-1)/(A-B)+1;
	}
	return needed <= x;
}

void solve()
{
    mx = *max_element(h,h+N);
    cnt = count(h,h+N,mx);
    tot = accumulate(h,h+N,0LL);
    int lo=0, hi=(mx+B-1)/B;
    while(lo+1<hi){
        int mid = 1LL*(lo+hi)/2;
        if(ok(mid)) hi = mid;
        else lo=mid;
    }
    cout << hi << '\n';
}


int main()
{
	cin >> N >> A >> B;
	for(int i=0;i<N;++i) cin >> h[i];
	solve();
	return 0;
}

Measured memory_bytes: 4396
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int D;
	cin >> D;
	int N = 25 - D;

	cout << "Christmas";
	for (int i = 0; i < N; i++)cout << " Eve";
	cout << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define N 200040
using namespace std;
int n,k;
long long ans=0,aux[N],sum[N];
long long tree[N];
int lowbit(int x)
{
	return x&-x;
}
long long getsum(int x)
{
	long long ans=0;
	for(int i=x;i;i-=lowbit(i))
	ans+=tree[i];
	return ans;
}
void add(int x,int k)
{
	for(int i=x;i<=n+16;i+=lowbit(i))
	tree[i]+=k;
}

int main()
{
	memset(sum,0,sizeof(sum));
	memset(aux,0,sizeof(aux));
	memset(tree,0,sizeof(tree));
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		int x;
		scanf("%d",&x);
		sum[i]=sum[i-1]+x-k;
		aux[i]=sum[i];
	}
	sort(aux,aux+1+n);
	int m=unique(aux,aux+1+n)-aux;
	for(int i=0;i<=n;i++)
	sum[i]=lower_bound(aux,aux+1+m,sum[i])-aux+1;
	for(int i=0;i<=n;i++)
	{
		ans+=getsum(sum[i]);
		add(sum[i],1);
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 4992
N = int(input())
A = [int(i) for i in input().split()]
ans = 0
flag=True
while flag:
  for a in A:
    if a%2 == 1:
      flag = False
  if not flag:
    break
   
  ans+=1
  for i in range(N):
    A[i] = A[i] // 2

print(ans)

Measured memory_bytes: 3060
#include <stdio.h>

int main(void){
    int N,num[1000],i=0;
    scanf("%d",&N);
    if(N==0){
        printf("0\n");
        return 0;
    }
    while(N!=0){
        if(N<0) num[i] = -N % 2;
        else num[i] = N % 2;
        if(N<0&&num[i]==1) N = (N / (-2)) + 1;
        else N /= (-2); 
        i++;
    }
    for(i--;i>=0;i--){
        printf("%d",num[i]);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 128
N=int(input())

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

for i in range(N):
    for j in range(i, N):
        for k in range(j, N):
            flag = True
            L_max = max(L[i], L[j], L[k])
            L_nokori = L[i] + L[j] + L[k] - L_max
            if L_max >= L_nokori:
                flag = False
            if L[i]==L[j] or L[j]==L[k] or L[i]==L[k]:
                flag = False
            if flag:
                ans += 1
                
print(ans)

Measured memory_bytes: 9236
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <limits>
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define pint_INF 2000000000
#define ll_INF 	9223372036854775807
#define MOD 1000000007
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvll vector<vector<long long>>
#define vvc vector<vector<char>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define endl "\n"
#define pno cout << "no" << endl
#define pyes cout << "yes" << endl
#define pYes cout << "Yes" << endl
#define pNo cout << "No" << endl
#define pNO cout << "NO" << endl
#define pYES cout << "YES" << endl
using namespace std;
using ll = long long;

struct Node {
public:
    int parent;
    vector<vector<int>> to_child; // {node_number,weight}
};

bool comp(const vector<int>& a, const vector<int>& b) {
    if (a[1] != b[1]) {
        return a[1] > b[1];
    }
    else {
        return a[0] < b[0];
    }
}


//startを起点にするDjikstra
vector<int> Dijkstra(vector<Node> Graph_V, int start) {
    vector<int> Cost(Graph_V.size(), pint_INF);
    vector<bool> isVisited(Graph_V.size());
    priority_queue<vector<int>, vector<vector<int>>, decltype(&comp)> pq(&comp);
    Cost[start] = 0;
    pq.push({ start,0 });
    while (!pq.empty()) {
        int parent = pq.top()[0]; pq.pop();
        Node u = Graph_V[parent];
        if (isVisited[parent] == true) {
            continue;
        }
        isVisited[parent] = true;
        
        for (vector<int> child : u.to_child) {
            if (Cost[parent] + child[1] < Cost[child[0]]) {
                Cost[child[0]] = Cost[parent] + child[1];
                pq.push({ child[0],Cost[child[0]] });
            }
        }
    }

    return Cost;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int V, E, r; cin >> V >> E >> r;
    vector<Node> graph(V);
    for (int i = 0; i < E; i++) {
        int s, t, d; cin >> s >> t >> d;
        graph[s].to_child.push_back({ t,d });
    }
    vector<int> cost = Dijkstra(graph, r);

    for (auto v : cost) {
        if (v == pint_INF) {
            cout << "INF" << "\n";
        }
        else {
            cout << v << "\n";
        }
    }

}


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

namespace ConsoleApp7
{
	class Program
	{
		static void Main(string[] args)
		{
			var str = Console.ReadLine().Split(' ');
			var x1 = double.Parse(str[0]);
			var y1 = double.Parse(str[1]);
			var x2 = double.Parse(str[2]);
			var y2 = double.Parse(str[3]);

			double x = x1 - x2;
			double y = y1 - y2;

			double z = Math.Sqrt((x * x) + (y * y));
			Console.WriteLine(z);

		}
	}
}



Measured memory_bytes: 15976
#include<iostream>
#include<cmath>

#define all(x) (x).begin(),(x).end()
#define puts(x) cout<< x << endl;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define fore(i,a) for(auto i:a)
#define ll long long
using namespace std;

int N;
int main(){
    cin>>N;
    int checker=0;
    rep(i,0,N){
        int x=0;
        cin>>x;
        if(x%2==0&&(x%3!=0&&x%5!=0)){
            checker=1;
        }
    }
    if(checker==0){
        puts("APPROVED");
    }else{
        puts("DENIED");
    }
    
}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int k = scan.nextInt();
		String s = scan.next();

		String ans = s;

		if(s.length() > k) {
			ans = s.substring(0, k) + "...";
		}

		System.out.println(ans);


	}

}

Measured memory_bytes: 38636
#include <stdio.h>
int main()
{
    int n,count,i,j,k,l;

    while(~scanf("%d",&n)) {
        count=0;
        for(i=0;i<=9;i++){
            for(j=0;j<=9;j++){
                for(k=0;k<=9;k++){
                    for(l=0;l<=9;l++){
                        if(i+j+k+l==n)
                            count++;
                    }
                }
            }
        }
        printf("%d\n",count);
    }
return 0;
}



Measured memory_bytes: 2040
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scanf("%s", &s)
	answer := isBusNeeded(s)
	if answer {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func isBusNeeded(s string) bool {
	prev := rune(s[0])
	busNeeded := false
	for _, val := range s {
		if val != prev {
			busNeeded = true
		}
		prev = val
	}
	return busNeeded
}


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

#define repd(i,a,b) for (ll i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;

const long long INF = 1LL << 60;

int main()
{
    ll N, M;
    cin >> N >> M;

    vector<vector<ll>> value(N, vector<ll>(3));
    rep(i, N) {
        cin >> value[i][0] >> value[i][1] >> value[i][2];
    }

    ll res = -INF;

    rep(i, 8) {
        vector<ll> total;
        rep(j, N) {
            ll tmp = 0;
            rep(k, 3) {
                if (i & (1 << k)) {
                    tmp += value[j][k];
                }
                else {
                    tmp -= value[j][k];
                }
            }
            total.push_back(tmp);
        }
        sort(total.begin(), total.end());
        reverse(total.begin(), total.end());
        ll sum = 0;
        rep(j, M) {
            sum += total[j];
        }
        res = max(res, sum);
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
//#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;


// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T>
constexpr int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F>
constexpr int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T>
void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C>
void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U>
constexpr void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U>
constexpr void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C>
constexpr void reverse(C& c) { reverse(ALL(c)); }
template<typename C>
constexpr void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred>
constexpr void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
#define PI (2*acos(0.0))
#define EPS (1e-9)
#define MOD (int)(1e9+7)
#pragma endregion


int main()
{
    int n;
    cin >> n;
    rep(i,n) {
        string s;
        cin >> s;
        sort(s);
        string rs(s);
        reverse(rs);
        P(stoi(rs)-stoi(s));
    }
    return 0;
}

Measured memory_bytes: 3148
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	int sum = 0;
	for (int i = 1; i <= n; i++) {
		int t, c;
		t = i; c = 0;
		while (t > 0) {
			c += t % 10;
			t /= 10;
		}
		if(c >= a && c <= b) sum += i;
	}
	printf("%d\n", sum);
	return 0;
}

Measured memory_bytes: 3776
N = int(input())
S1 = input()
S2 = input()
mod = 10 ** 9 + 7

# False->tate True->yoko
if S1[0] == S2[0] :
    ret = 3
    pre = False
    i = 1
else :
    ret = 6
    pre = True
    i = 2

while i < N :
    cur = (S1[i] != S2[i])
    if not pre :
        ret *= 2
    elif pre and cur :
        ret *= 3
    
    ret %= mod
    
    if cur :
        i += 2
    else :
        i += 1
    pre = cur
    
print(ret)


Measured memory_bytes: 38384
#include <stdio.h>

const int MAX_N = 1005;
const int MOD = 1000000007;

int h,w,dp[MAX_N][MAX_N];
char grid[MAX_N][MAX_N];

int main()
{
	scanf("%d %d",&h,&w);
	for (int i=1; i<=h; i++)
		scanf("%s",grid[i]+1);
	for (int i=1; i<=h; i++)
		for (int j=1; j<=w; j++)
			if (i==1&&j==1)
				dp[i][j]=1;
			else if (grid[i][j]=='.')
				dp[i][j]=(dp[i-1][j]+dp[i][j-1])%MOD;
	printf("%d\n",dp[h][w]);
	return 0;
}


Measured memory_bytes: 5120
inf = float('inf')

n = int(input())
h = list(map(int, input().split())) + [inf]

dp = [inf] * (n + 1)
dp[0] = 0

# 配る
for i in range(n - 1):
    dp[i + 1] = min(dp[i + 1], dp[i] + abs(h[i + 1] - h[i]))
    dp[i + 2] = min(dp[i + 2], dp[i] + abs(h[i + 2] - h[i]))
print(dp[n - 1])


Measured memory_bytes: 13928