akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

void solve() {
	int X; cin >> X;
	cout << 360 / __gcd(360, X) << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}




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

using namespace std;
using nagai = long long;
#define sz(x) int((x).size())

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin>>n;
	cout<<(n-2)*180<<'\n';
	return 0;
}



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

#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x >= y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x <= y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

void solve() {
  int n;
  cin >> n;
  vi32 a(n);
  cin >> a;
  i64 ans = 0;
  rep(i, n - 1) {
    ans += a[i] / 2;
    a[i] %= 2;
    if (a[i] && a[i + 1]) {
      ans++;
      a[i]--, a[i + 1]--;
    }
  }
  ans += a[n - 1] / 2;
  cout << ans << '\n';
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long int  ll;
typedef long double ld;


#define MAXN 100005
vector <ll> V[MAXN]; 
ll depth[MAXN];


void boost()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);  
}


void dfs(ll cur, ll prev) 
{ 
    ll i,j;
    
    depth[cur]=depth[prev]+1;

    for (i=0; i<V[cur].size(); i++) 
    { 
        if (V[cur][i] != prev) 
        {
            dfs(V[cur][i], cur);
            
        }
    }
} 

int main()
{
    boost();
 
    ll i,j,k,n,z,t,l,r,d=0,c=0;
  ld h,g,u,v;
    
    cin>>n>>d;
  
  g=(ld)d;
  ll x[n],y[n];
  
  for(i=0;i<n;i++)
  {
    cin>>x[i]>>y[i];
    u=(ld)x[i];
    v=(ld)y[i];
    
    h=sqrt(u*u+v*v);
    
    if(h<=g)
    {
      c++;
    }

      
  }
  
  cout<<c<<endl;
  
return 0;
}


Measured memory_bytes: 9164
#include <iostream>
#include <vector>
#include <queue>

using namespace std;
#define INF 999999999

int v[100000];
int memo[100000];
int N;
int ans;

void dfs(int pos, int step, int count, queue<int>& Que)
{
	int next = pos + step;
	if(next >= N - 1)
	{
		ans = min(ans, count);
		return;
	}
	if(memo[next] <= count)
	{
		return;
	}
	memo[next] = count;
	if(v[next] == 0)
	{
		Que.push(next);
	}
	else
	{
		dfs(next, v[next], count, Que);
	}
}

void solve()
{
	cin >> N;
	for(int i = 0; i < N; ++i)
	{
		cin >> v[i];
		memo[i] = INF;
	}
	ans = INF;
	memo[0] = 0;
	queue<int> Que;
	Que.push(0);
	while(!Que.empty())
	{
		int pos = Que.front();
		Que.pop();
		for(int step = 1; step <= 6; ++step)
		{
			dfs(pos, step, memo[pos] + 1, Que);
		}
	}
	cout << ans << endl;
}

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

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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
using ll = long long;

int main()
{
    ll i,j;
    ll n,m;
    cin >> n >> m;
    vector<ll> a(n);
    map<ll,ll> mp;
    for(i = 0;i < n;++i){
        cin >> a.at(i);
    }
    vector<ll> b(n+1,0);
    for(i = 0;i < n;++i){
        b.at(i+1) = a.at(i) + b.at(i);
        b.at(i+1) %= m;
        ll tmp = b.at(i+1);
        if(mp.count(tmp)){
            ++mp[tmp];
        }else{
            mp[tmp] = 1;
        }
    }
    if(mp.count(0)){
        ++mp[0];
    }else{
        mp[0] = 1;
    }
    ll ans = 0;
    for(auto x: mp){
        ll tmp = x.second;
        ans += tmp*(tmp-1)/2;
    }
    cout << ans << endl;

    return 0;
}

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

signed main()
{
	string s;
	cin >> s;
	string a = "";

	int sp = 0;
	int ep = s.size() - 1;
	int sc = 0;
	int ec = 0;
	int dp = 0;

	while (true)
	{
		while (s[sp] == 'x')
		{
			sp++;
			sc++;
		}
		while (s[ep] == 'x')
		{
			ep--;
			ec++;
		}
		// cout << "j" << endl;
		// cout << sp << "," << ep << endl;
		// cout << s[sp] << "," << s[ep] << endl;
		dp += abs(sc - ec);
		sc = 0;
		ec = 0;
		if (sp >= ep)
		{
			cout << dp << endl;
			break;
		}
		if (s[sp] != s[ep])
		{
			cout << -1 << endl;
			break;
		}
		sp++;
		ep--;
	}
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    string S;
    cin >>S;
    ll ans = 0;
    rep(i,4){
        if(S[i]=='+'){
            ans++;
        }else{
            ans--;
        }
    }
    
    cout << ans << endl;


    return 0;
    

}

Measured memory_bytes: 3572
import java.util.*;
public class Main {
    public static void main (String args[]) {
        Scanner s = new Scanner(System.in);
        int x = s.nextInt();
        int a = x / 3600;
        int y = x - a * 3600;
        int b = y / 60;
        int c = y - b * 60;
        System.out.println(a + ":" + b + ":" + c);
    }
}


Measured memory_bytes: 26248
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
using namespace std;


int main()
{
    int N,T;
    cin >> N >> T;
    int c[N],t[N];
    for(int i = 0; i < N; i++)
    {
        cin >> c[i];
        cin >> t[i];
    }
    int res = 1001;
    for(int i = 0; i < N; i++)
    {
        if(t[i] <= T)
        {
            res = min(res,c[i]);
        }
    }
    if (res == 1001)
    {
        cout << "TLE" << endl;
    }
    else cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define srep(i,s,t) for (int i = s; i < t; i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
#define MOD 1e9+7;
using namespace std;
using Graph = vector<vector<int>>;
typedef vector<vector<char>> field_t;
typedef  unsigned long long int ull;
typedef pair<int, int> point_t;
typedef long long ll;
ll chr[100001];
ll N;


signed main()
{
    cin >> N;
    vector<ll> a(N);
    ll be;
    rep(i,N){
        cin >> a[i];
        if(i==0){
            be=a[i];
        }else{
            be^=a[i];
        }
    }
    rep(i,N){
        ll go=be;
        go^=a[i];
        cout << go << " " ;
    }

    return 0;
}

Measured memory_bytes: 4748
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

ll digitSum(ll a){
    int ret = 0;
    while(a != 0){
        ret += a%10;
        a /= 10;
    }

    return ret;
}


int main(){
    ll N; cin >> N;
    string s = to_string(N);
    int size = s.size();

    if(size == 1){
        cout << N << endl;
        return 0;
    }

    bool flg = true;
    for(int i=1; i<size; i++) if(s[i] != '9') flg = false;

    if(flg){
        cout << digitSum(N) << endl;
    }
    else{
        int ans = 0;
        ans += stoi(s.substr(0,1))-1;
        ans += 9*(size-1);
        cout << ans << endl;
    }
}

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

int main() {
  int K,N;
  cin>>K>>N;
  vector<int> site(N);
  for (int i=0;i<N; i++){
    cin>>site.at(i);
  }
  vector<int> X(N);
  for(int i=0;i<N-1; i++){
    X.at(i)=site.at(i+1)-site.at(i);
  }
  X.at(N-1)=K-site.at(N-1)+site.at(0);
  sort(X.begin(),X.end());
  
  cout<<K-X.at(N-1)<< endl;
}
  


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

typedef long long ll;

int main()
{
    int A, B;
    cin >> A >> B;
    int i = 1;
    int ans = A;
    if (B <= 1)
    {
        cout << 0 << endl;
        return 0;
    }
    if (A >= B)
    {
        cout << i << endl;
        return 0;
    }
    while (true)
    {
        ++i;
        ans += A - 1;
        if (ans >= B)
        {
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
//ll mod = 998244353;
#define rep(i,n) for(int i = 0; i < (n); ++i)

const int MAX_N = 1005;
const int MAX_V = MAX_N * MAX_N / 2;

vector<int> to[MAX_V];
int ids[MAX_N][MAX_N];

bool visited[MAX_V];
bool calculated[MAX_V];
int dp[MAX_V];

int toId (int i, int j) {
    if (i > j) swap(i, j);
    return ids[i][j];
}

int dfs(int v) {
    if (visited[v]) {
        if (!calculated[v]) return -1;
        return dp[v];
    }
    visited[v] = true;
    dp[v] = 1;
    for (int u: to[v]) {
        int res = dfs(u);
        if (res == -1) return -1;
        dp[v] = max(dp[v], res + 1);
    }
    calculated[v] = true;
    return dp[v];
}

int main() {
    int n;
    cin >> n;
    vector<vector<int>> a(n, vector<int>(n-1));
    rep(i, n) {
        rep(j, n-1) {
            cin >> a[i][j];
            --a[i][j];
        }
    }
    int v = 0;
    rep(i, n) rep(j, n) {
        if (i < j) {
            ids[i][j] = v++;
        }
    }
    rep(i, n) {
        rep(j, n-1) {
            a[i][j] = toId(i, a[i][j]);
        }
        rep(j, n-2) {
            to[a[i][j+1]].push_back(a[i][j]);
        }
    }
    int ans = 0;
    rep(i, MAX_V) {
        int res = dfs(i);
        if (res == -1) {
            puts("-1");
            return 0;
        }
        ans = max(ans, res);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 41744
n = int(input())

li = [list(map(int,input().split())) for _ in range(n)]

dp = [[0,0,0] for _ in range(n)]


for i in range(n):
    if i == 0:
        for j in range(3):
            dp[i][j] = li[i][j]
    else:
        for j in range(3):
            for k in range(3):
                if j == k:
                    continue
                else:
                    dp[i][j] = max(dp[i-1][k] + li[i][j], dp[i][j])
                    
print(max(dp[-1]))
    

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

int n;

void solve(){
    int s = 0;
    int t = n;
    while(t > 0){
        s += t % 10;
        t /= 10;
    }

    if(n%s == 0){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

int main(){
    cin >> n;
    solve();
}

Measured memory_bytes: 256
program example
	implicit none

	character(1) S(3)
    integer :: i,a=0,b=0
    
    do i=1,3
    	read(*,"(a1)",advance="no") S(i)
    end do
    
    do i=1,3
    	if(S(i)=="A") then
        	a=a+1
        else if (S(i)=="B") then
        	b=b+1
        end if
    end do
    
    if(a==3 .or. b==3) then
    	write(*,*) "No"
    else
    	write(*,*) "Yes"
    end if
    	

end program example

Measured memory_bytes: 640
#include<iostream>
#include<cmath> 
#include<algorithm>
#include<cstdio>
using namespace std;
typedef long long ll;

struct node{
	ll x,y;
	
}r[1010];
bool cmp(node a,node b){
		return atan2(a.x,a.y) < atan2(b.x,b.y);//atan2：斜角计算函数 
	}
int main(){
	ll n,x,y;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>r[i].x>>r[i].y;
	}
	ll ans=0;
	sort(r,r+n,cmp);//只有按照极角排序之后才能保证可以达到最大的向量和是最大的。 
	for(int i=0;i<n;i++){
		x=r[i].x;
		y=r[i].y;
		ans=max(ans,x*x+y*y);
		for(int j=(i+1)%n;j!=i;j=(j+1)%n){
			x+=r[j].x;
			y+=r[j].y;
			ans=max(ans,x*x+y*y);
		}
	}
//	cout<<ans<<endl;
	double ans1=sqrt(ans);
	printf("%.13lf\n",ans1);
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main(){
  int N,y;
  scanf("%d",&N);
  y=(int)log10(N);
  switch(y){
  case 0:{
    printf("%d\n",N);
    break;
  }
  case 1:{
    printf("9\n");
    break;
  }
  case 2:{
    printf("%d\n",9+(N-99));
    break;
  }
  case 3:{
    printf("909\n");
    break;
  }
  case 4:{
    printf("%d\n",909+(N-9999));
    break;
  }  
  case 5:{
    printf("90909\n");
    break;
  }
  } 
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    cout << s.substr(0, 3) << "\n";
    return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <string>

using namespace std;

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

  int wins = 0, losses = 0;
  for (char c : s) {
    if (c == 'o') wins++;
    else losses++;
  }

  wins += 15 - (wins + losses);
  if (wins >= 8) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}


Measured memory_bytes: 3616
using System;
using static System.Console;

public class Hello{
    public static void Main(){
        int leng = int.Parse(ReadLine());
        string[] num = ReadLine().Split(' ');
        int[] numint = new int[leng];
        for(int i=0;i<leng;i++){
            numint[i] = int.Parse(num[i]);
        }
        
        int count =0;
        for(int i=0;i<leng;i++){
            while(numint[i] %2 == 0){
                numint[i] /= 2;
                count++;
            }
        }
        WriteLine(count);
    }
}


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

static const int MAX = 1e+5;
int s[MAX], t[MAX], c[MAX];

int main(){
    int n, maxc;
    cin >> n >> maxc;
    for(int i = 0; i < n; i++){
        cin >> s[i] >> t[i] >> c[i];
    }

    int nn = 2 * MAX + 1;
    vector<int> sm(nn, 0);
    for(int i = 1; i <= maxc; i++){
        vector<int> tt(nn, 0);
        for(int j = 0; j < n; j++){
            if(c[j] == i){
                tt[2*s[j]-1]++;
                tt[2*t[j]]--;
            }
        }
        for(int j = 0; j < nn-1; j++){
            tt[j+1] += tt[j];
        }
        for(int j = 0; j < nn; j++){
            if(tt[j] > 0) sm[j]++;
        }
    }
    int ans = 0;
    for(int i = 0; i < nn; i++){
        if(ans < sm[i]) ans = sm[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2944
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
typedef unsigned long long ull;
#define rep(i,a) for(int i=0;i<a;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1);
const double inf = (int)1e8;

void solve(){
  string s;int state=0;bool used=true;
  cin>>s;
  rep(i,s.size()){
    if(s[i]=='A'){state=1;}
    if(s[i]=='Z'&&state){state=0;cout<<"AZ";used=false;}
  }
  cout<<(used?"-1\n":"\n");
}
int main(void){
  solve();
  return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];
  ll ans = longinf;
  rep(i, N) {
    ll X = A[i];
    vector<ll> Y;
    multiset<ll> tmp;
    rep(j, N) {
      if(A[j] < X) {
        if((int)tmp.size() >= K) {
          auto itr = tmp.begin();
          rep(k, tmp.size()-K+1) {
            Y.push_back(*itr);
            itr++;
          }
        }
        tmp.clear();
      } else {
        tmp.insert(A[j]);
      }
    }
    auto itr = tmp.begin();
    rep(k, tmp.size()-K+1) {
      Y.push_back(*itr);
      itr++;
    }
    sort(all(Y));
    if((int)Y.size() >= Q) {
      ans = min(Y[Q-1]-Y[0], ans);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3816
#include <iostream>
#include <vector>

using namespace std;

int main(){
	int num  = 1;
	vector<int> List;
	
	List.clear();
	while(num != 0){
		cin >> num;
		if(num != 0)	List.push_back(num);
	}
	
	for(int i = 0; i < List.size(); i++){
		cout << "Case " << i+1 << ": " << List[i] << endl;
	}
}

Measured memory_bytes: 1320
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a, b, v, w, t;
    scanf("%lld %lld %lld %lld %lld", &a, &v, &b, &w, &t);
    long long int res1, res2;
    if (a > b) swap(a, b);

    res1 = a + (v * t);

    res2 = b + (w * t);

    if(res1 >= res2) printf("YES\n");
    else printf("NO\n");
    return 0;
}


Measured memory_bytes: 3616
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		int K = sc.nextInt();
		ArrayList<String> subs = new ArrayList<String>();
		for (char tg = 'a'; tg <= 'z'; tg++) {
			for (int i = 0; i < S.length(); i++) {
				if (S.charAt(i) == tg) {
					for (int r = 1; r <= K && i + r <= S.length(); r++) {
						String add = S.substring(i, i + r);
						if (!subs.contains(add))
							subs.add(add);
					}
				}
			}
			if (subs.size() >= K) {
				subs.sort(Comparator.naturalOrder());
				// System.out.println(Arrays.toString(subs.toArray()));
				System.out.println(subs.get(K - 1));
				return;
			}
		}
	}

}


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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

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

const int INF = 1e9;
const int MOD = 1e9 + 7;

bool check( int x, vector<int> h ){
    int cnt = 0;

    while( 1 ){
        int id = -1;
        REP( i, h.size() ){
            if( h[i] ){
                id = i;
                break;
            }
        }

        if( id == -1 ) break;

        FOR( i, id, h.size() ){
            if( h[i] > 0 ) h[i]--;
            else break;
        }

        cnt++;
    }

    return cnt <= x;
}

signed main(){
    int N; cin >> N;
    vector<int> h( N );
    REP( i, N ) cin >> h[i];

    int left = 0, right = INF;
    while( right - left > 1 ){
        int mid = ( right + left ) / 2;
        if( check( mid, h ) ){
            right = mid;
        }else{
            left = mid;
        }
    }

    if( count( ALL( h ), 0 ) == h.size() ) cout << 0 << endl;
    else cout << right << endl;

}


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

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)

int M;

// まず頂点 0 が黒である場合の答えを求める (木DP)
void dfs(int curr, int par, vector<long long>& dp, vector<vector<int>>& G)
{
    dp[curr] = 1;
    for(int v: G[curr]){
        if(v != par){
            dfs(v, curr, dp, G);
            dp[curr] *= dp[v]+1;
            dp[curr] %= M;
        }
    }
}

// 次に、上の結果を用いて全ての頂点についての答えを求める (全方位木DPと言われる所以)
void dfs_all(int curr, int par, vector<long long>& ans, vector<long long>& dp, vector<vector<int>>& G)
{
    ans[curr] = 1;
    for(int v: G[curr]){
        ans[curr] *= dp[v]+1;
        ans[curr] %= M;
    }

    // 頂点を curr -> v に変えるために下準備
    int n = G[curr].size();
    // lft[i]: (dp[c1]+1)*...*(dp[ci]+1)
    // rht[i]: (dp[ci]+1)*...*(dp[cn]+1)
    vector<long long> lft(n), rht(n);
    REP(i, n) lft[i] = rht[i] = dp[G[curr][i]]+1;
    FOR(i, 1, n){
        lft[i] *= lft[i-1];
        lft[i] %= M;
    }
    for(int i = n-2; i >= 0; --i){
        rht[i] *= rht[i + 1];
        rht[i] %= M;
    }
 
    REP(i, n){  // G[curr][i] を次の頂点にする場合
        if(G[curr][i] != par){
            dp[curr] = 1;
            if(i > 0) dp[curr] *= lft[i-1];
            dp[curr] %= M;
            if(i+1 < n) dp[curr] *= rht[i+1];
            dp[curr] %= M;
            dfs_all(G[curr][i], curr, ans, dp, G);
        }
    }
}

int main()
{
    int N;
    cin >> N >> M;
    vector<vector<int>> G(N);
    REP(i, N-1){
        int x, y;
        cin >> x >> y;
        --x, --y;
        G[x].push_back(y);
        G[y].push_back(x);
    }

    // dp[i]: 頂点を i とする部分木に置いて、i が黒色に塗られており、
    //        かつ黒色の頂点を辿って全ての黒色の頂点に行ける塗り方の組合せ
    vector<long long> dp(N), ans(N);
    dfs(0, -1, dp, G);
    dfs_all(0, -1, ans, dp, G);

    REP(i, N) cout << ans[i] << endl;

    return 0;
}

Measured memory_bytes: 20608
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000000;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}
///////////////////////////

ll N,M ;
string s;

void solve() {
	ll ans[MAX];
	
	ll now = N;
	ll tesu = 0;

	while (now > 0) {
		ll tsugi = max(now - M, 0);
		while (s[tsugi] == '1') {
			tsugi++;
			if (tsugi == now) { 
				cout << -1;
				return;
			}
		}

		ans[tesu] = now - tsugi;
		now = tsugi;
		tesu++;
	}

	repn(i, tesu) {
		cout << ans[tesu - i] <<" ";
	}
	return;
}






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

	cin >> s;

	solve();

	

	system("PAUSE");
}

Measured memory_bytes: 1656
use std::io::*;
use std::str::FromStr;
 
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
 
fn main() {
    let s: String = read();
    let mut ans = 0;
    for c in s.chars().collect::<Vec<char>>() {
        if c == '1' { ans += 1; }
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;

int main() {
    int N;
    cin >> N;
    ll ans = 1;
    double sumlog = 0;
    vector<ll> vec(N);
    rep(i, N) {
        ll A;
        cin >> A;
        if (A == 0) {
            cout << 0 << endl;
            return 0;
        }
        vec[i] = A;
    }
    rep(i, N) {
        ans *= vec[i];
        if (ans > 1000000000000000000 || ans < 1) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4048
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

const int MAX = 1000000;
const int MOD = 1000000007;

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
  ll X, Y;
  cin >> X >> Y;
  if ((X + Y) % 3 != 0 || X > 2*Y || Y > 2*X) {
    cout << 0 << endl;
  }
  else {
    ll A, B;
    A = (X + Y) / 3;
    B = X - A;
    COMinit();
    cout << COM(A, B) << endl;
  }
}

Measured memory_bytes: 23680
fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(' ').map { it.toInt() }
    var a = readLine()!!.split(' ').map { it.toInt() }.toIntArray()

    for (j in 0 until k) {
        val b = IntArray(n)
        var lb = 0
        var rb = 0
        val led = IntArray(n)
        val red = IntArray(n)
        for (i in 0 until n) {
            val llight = a[i]
            lb++
            val max = Math.min(n - 1, i + llight)
            b[i] += lb
            led[max]++
            lb -= led[i]

            val rix = n - i - 1
            val rlight = a[rix]
            rb++
            val min = Math.max(0, rix - rlight)
            b[rix] += rb-1
            red[min]++
            rb -= red[rix]


        }
        var maxCount = 0
        a = b
        for (i in 0 until n) {
            if (b[i] == n) maxCount++
        }
        if (maxCount == n) break
    }
    println(a.joinToString(" "))
}


Measured memory_bytes: 73404
#include<iostream>
#include<algorithm>
#define INF (1<<26)
using namespace std;

int n,ans;
int checkA(int);
int checkB(int);
int checkC(int);

int main(){
  while(cin>>n){
    if(n==0)break;

    ans=INF;

    for(int i=0;i<100;i++){
      for(int j=0;j<100;j++){
	for(int k=0;k<100;k++){
	  //if(i==5&&j==0&&k==0)cout<<checkA(i)<<' '<<checkB(j)<<' '<<checkC(k)<<endl;
	  if( i*200+j*300+k*500 == n){
	    ans=min(ans,checkA(i)+checkB(j)+checkC(k));
	  }

	}
      }
    }    
    cout<<ans<<endl;
  }
  return 0;
}
int checkA(int cnt){

  int x = cnt - (cnt % 5), y = cnt % 5;
  return x*304 + y*380;
}

int checkB(int cnt){

  int x = cnt - (cnt % 4), y = cnt % 4;
  x/=4;
  return x*1870 + y*550;
}

int checkC(int cnt){

  int x = cnt - (cnt % 3), y = cnt % 3;
  return x*748 + y*850;
}

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

int main()
{
  int k,n;
  int a[200000];
  int distall=0;
  int max=0;

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

  for (int i = 0; i < n-1; i++)
  {
    if(a[i+1] - a[i]>max){
      max=a[i+1] - a[i];
    }
  }
  if(k- a[n-1]+a[0] > max){
    max=k- a[n-1]+a[0];
  }

  cout << k-max << endl;

  return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>

int main(){
	int R;
	scanf("%d", &R);

	if(R<1200){
		printf("ABC\n");
		return 0;
	}else if(R<2800){
		printf("ARC\n");
		return 0;
	}else{
		printf("AGC\n");
		return 0;
	}
}


Measured memory_bytes: 128
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
#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() {
  string s, t;
  cin >> s >> t;

  int Min = t.size();
  int m = t.size();
  int n = s.size() - t.size() + 1;
  rep(i, n) {
    int replace_num = t.size();
    for (int j = 0; j < m; ++j) {
      if (s[j + i] == t[j]) replace_num--;
    }
    Min = min(Min, replace_num);
  }
  cout << Min << endl;

  return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
int main(){
    string S;
    cin >> S;
    int n = S.size();
    /*vector<char> S;
    for(int i = 0;i < s.size();i++){
        S[i] = s[i];
    }*/
    bool strong = true;
    for(int i = 0;i < (n-1)/2;i++){
        if(S[i] != S[n-1-i]) strong = false;
    }
    for(int i = 0;i < ((n-1)/2-1)/2;i++){
        if(S[i] != S[(n-1)/2-1-i]) strong = false;
    }
    int j = (n+3)/2;
    for(int i = 0;i < (n-j+1)/2;i++){
        if(S[i+j-1] != S[n-i-1]) strong = false;
    }
    if(strong) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cctype>
#include <map>
#include <set>

const int INT_INF = 1e9;
const long long LONG_INF = 1e18;
const long long MOD = 1e9 + 7;
const double PI = 3.14159265358979323846;

using namespace std;

int main()
{
    double n, k;
    cin >> n >> k;

    double percent = 0.0;
    for (double j = 1.0; j <= n; j++)
    {
        double i;
        if (j >= k)
        {
            i = 0.0;
        }
        else
        {
            i = ceil(log2l(k) - log2l(j));
        }
        double temp = (1.0 / n) * powl(1.0 / 2.0, i);
        percent += temp;
    }

    printf("%.10lf\n", percent);
    return 0;
}

Measured memory_bytes: 512
n,k=map(int,input().split())
a=list(map(int,input().split()))

s=[]
d=[-1]*(n+1)

v=1
while(d[v]==-1):
    d[v]=len(s)
    s.append(v)
    v=a[v-1]
c=len(s)-d[v]
l=d[v]

if(k<l):print(s[k])
else:
    k-=l
    k%=c
    print(s[k+l])

Measured memory_bytes: 32380
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

const int MAX_N = 200000;
int k, n;
int a[MAX_N];

int main() {
    fastio();

    cin >> k >> n;

    forn(i, n) {
        cin >> a[i];
    }

    int maxd = 0;
    forn(i, n - 1) {
        if (maxd <= a[i + 1] - a[i]) {
            maxd = a[i + 1] - a[i];
        }
    }

    if (maxd <= (k + a[0]) - a[n - 1]) {
        maxd = (k + a[0]) - a[n - 1];
    }

    cout << k - maxd << endl;

    return 0;
}

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

using namespace std;

#define int long long

void solve() {
    int num1 = 0, num2 = 0;
    int n;
    cin >> n;
    vector <int> a(n), b(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) cin >> b[i];
    int tn = 1;
    vector <int> kek(n);
    for (int i = 0; i < n; ++i) kek[i] = i + 1;
    if (a == kek) num1 = 1;
    if (b == kek) num2 = 1;
    while (next_permutation(kek.begin(), kek.end())) {
        ++tn;
        if (a == kek) num1 = tn;
        if (b == kek) num2 = tn;
    }
    cout << abs(num1 - num2);
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
const int MOD = 1e9 + 7;

ll N, M, K, Q;
string S;

int main() {
    cin >> N;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }

    map<ll, ll> m;
    for (int i = 0; i < N; i++) {
        m[A[i]]++;
    }

    ll ans = 0;
    for (auto p : m) {
        ans += p.second * (p.second - 1) / 2;
    }

    for (int i = 0; i < N; i++) {
        ll a = m[A[i]] * (m[A[i]] - 1) / 2;
        ll b = (m[A[i]] - 2) * (m[A[i]] - 1) / 2;
        cout << ans - a + b << endl;
    }

    return 0;
}


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

using namespace std;
typedef long long ll;

int main(){
    int n,y;
    cin>>n>>y;
    int ans1 = -1,ans2 = -1, ans3 = -1;
    rep(i,n+1){
        rep(j,n+1){
            int total = 10000*i + 5000*j + 1000*(n-i-j);
            if(total == y && n-i-j >=0){
                ans1 = i;ans2 = j;ans3 = n-i-j;
            }
        }
    }
    cout<<ans1<<" "<<ans2<<" "<<ans3<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
 
using namespace std;
 
 
const int MAX_N = int(1e6) + 10;
long long int MOD=1e9+7;
const long long int INF=1e18;
 
typedef long long int ll;
typedef unsigned long long int llu;
 
 
 
inline ll mul(ll a,ll b){
 
    a=(a+MOD)%MOD;
    b=(b+MOD)%MOD;
    ll c=a*b;
    c=(c+MOD)%MOD;
    return c;
}
inline ll add(ll a,ll b){
    a=(a+MOD)%MOD;
    b=(b+MOD)%MOD;
    ll ans=(a+b);
    ans=(ans+MOD)%MOD;
    return ans;
}
ll power(ll a,ll b,ll c=0){
    ll ans=1;
    while(b){
        if(b&1){
            ans=mul(ans,a);
        }
        a=mul(a,a);
        b=b/2;
    }
    return ans;
}
 
  
 
 
#define all(x) (x).begin(),(x).end()
 
 
 
 
//s.reserve(32768); //updated !
//s.max_load_factor(0.25);

const int N=1e5+5;
ll dp[N];
ll p[N];



int main(){
    


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

    dp[0]=1000;
    for(int i=1;i<n;i++){
        ll ans=0;
        for(int j=0;j<i;j++){
            if(p[j]<=dp[j]){
                ll cnt=dp[j]/p[j];
                ll ans22=cnt*p[i] + dp[j]%p[j];
                ans=max(ans,ans22);
            }
        }

        dp[i]=max(dp[i-1],ans);
    }

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


Measured memory_bytes: 3636
//コンパイラ最適化用
#pragma GCC optimize("Ofast")
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<chrono>//実行時間計測
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm,accumulate
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//順序保持しないmap
#include<unordered_set>//順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define print(a) cout << a << endl;
#define cin(x) cin >> x;

signed main(){
    //入力の高速化用のコード
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int N;
    cin(N);
    vector<int> L(N);
    REP(i,N){cin(L.at(i))}
    
    int lon = 0, total = 0;
    REP(i,N){
        lon = max(lon,L.at(i));
        total += L.at(i);
    }

    lon<total-lon?cout<<("Yes"):cout<<("No");


  
  return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
#define ll long long
#define fo(i,n) for(int i=0;i<n;i++)
#define rfo(i,n) for(int i=n-1;i>=0;i--)
#define Fo(i,q,n) for(int i=q;i<n;i++)
#define rFo(i,q,n) for(int i=n-1;i>=q;i--)
#define fO(i,n,k) for(int i=0;i<n;i+=k)
#define FO(i,q,n,k) for(int i=q;i<n;i+=k)
#define zero(a,n) memset(a,0,sizeof(a[0])*n)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define endl "\n"
#define Endl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
using namespace std;
const int MOD=1000000007;
void print(){cout <<endl;}
template <typename T, typename... Types> 
void print(T var1, Types... var2){cout << var1 << " " ;print(var2...) ;}
//ceil of a/b
template <typename T>
T fceil(T a,T b){return (T)(a+b-1)/b;}
template <typename T>
void printvec(vector<T> v){ for(int i=0;i<(int)v.size();i++){ cout<<v[i]<<" ";} cout<<endl;}
template <typename T>
void printarr(T a[],int n){ for(int i=0;i<n;i++){ cout<<a[i]<<" ";} cout<<endl;}
//const int N=2e5;
//int arr[N+1];
void dfs(vector<int> g[],int src,bool visited[],int &count){
	if(!visited[src]){
		visited[src]=true;
		count++;
		for(auto x:g[src]){
			if(!visited[x]){
				dfs(g,x,visited,count);	
			}	
		}	
	}	
}
int DFS(vector<int> g[],int n){
	bool visited[n];
	fo(i,n){visited[i]=false;}
	int count;
	int maxm=0;
	fo(i,n){
		count=0;
		if(!visited[i]){
			dfs(g,i,visited,count);	
		}
		//cout<<count<<endl;
		maxm = max(maxm,count);	
	}
	return maxm;	
} 
int main(){
	int n,m;
	cin>>n>>m;
	vector<int> g[n];
	int src,dest;
	fo(i,m){
		cin>>src>>dest;
		src--;dest--;
		g[src].pb(dest);
		g[dest].pb(src);	
	}
	cout<<DFS(g,n)<<endl;
	return 0;
}






/*NOTE: Take MOD after sorting and not before sorting!*/


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

#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(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

const double EPS = 1e-14;
const double PI  = acos(-1.0);


int main(){
  int n;
  scanf("%d", &n);

  int p[n];
  int t[n + 2];

  REP (i, n) {
    scanf("%d", &p[i]);
    t[i] = 0;
  }
  t[n] = 0;
  t[n + 1] = 0;

  RREP(i, n) {
    t[p[i]] = t[p[i] + 1] + 1;
  }

  int ans = 0;
  FOR (i, 1, n + 1) {
    ans = max(ans, t[i]);
  }

  cout << n - ans << endl;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>

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

using namespace std;
typedef long long ll;



int main(void)
{
	int w, a, b;
	int ans;
	cin >> w >> a >> b;
	int A = a + w;
	int B = b + w;


	if (a <= b) {
		if (A >= b) {
			cout << 0;
		}
		else {
			ans = b - A;
			cout << ans;
		}
	}
	else {
		if (B >= a) {
			cout << 0;
		}
		else {
			ans = a - B;
			cout << ans;
		}
	}

	
	cout << endl;
}


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

int gcd(int p, int q) {
        if (p % q == 0) return q;
        return gcd(q, p % q);
    } 

int main() {
    int k, ans = 0;
    cin >> k;
    for (int i = 1; i <= k; i++) {
        for (int j = 1; j <= k; j++) {
            for (int l = 1; l <= k; l++) {
                ans += gcd(gcd(i, j), l);
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef pair<ll, ll> P;


int main(){
    ll n, k;    cin >> n >> k;
    ll x = n % k;
    cout << min(x, k - x) << endl;


    return 0;
}

Measured memory_bytes: 256
main = do
    st <- getContents
    putStrLn $ show $ ans st

ans :: String -> Int
ans = snd . foldl revnum ('n', -2) 

revnum :: (Char, Int) -> Char -> (Char, Int)
revnum (c,n) newc
    | c == newc = (c,n)
    | otherwise = (newc, n+1)


Measured memory_bytes: 1020
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-13;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
int x[110000];
int p[110000];
int main(){
	int a,b;scanf("%d%d",&a,&b);
	for(int i=0;i<a;i++){
		scanf("%d%d",x+i,p+i);
	}
	if(b>x[a-1]){
		printf("%d\n",b-x[0]);return 0;
	}
	if(b<x[0]){
		printf("%d\n",x[a-1]-b);return 0;
	}
	long long ret=0;
	long long cur=0;
	int L=0;
	int R=a-1;
	bool left=false;
	if(p[0]>=p[a-1]){
		left=true;
	}else{
	}
	ret+=x[a-1]-x[0];
	while(L<=R){
		if(left){
			while(1){
			//	printf("%d %d %lld %lld\n",L,R,cur,ret);
				cur+=p[R];
				R--;
				if(x[R]<b){
					ret+=b-x[L];
					R=-1;
					break;
				}
				if(p[R]>p[L]+cur){
					left=false;
			//		printf("%d %d\n",R,L);
					ret+=x[R]-x[L];
					break;
				}
			}
		}else{
			while(1){
			//	printf("%d %d %lld %lld\n",L,R,cur,ret);
				cur+=p[L];
				L++;
				if(x[L]>b){
					ret+=x[R]-b;
					R=-1;
					break;
				}
				if(p[L]>=p[R]+cur){
					left=true;
			//		printf("%d %d\n",L,R);
					ret+=x[R]-x[L];
					break;
				}
			}
		}
	}
	printf("%lld\n",ret);
}

Measured memory_bytes: 896
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

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

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<ll> vec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-5;

vector<int> G[1 << 18];
int add[1 << 18];
int ans[1 << 18];

void dfs(int id, int fr,int sum) {
	sum += add[id];
	ans[id] = sum;
	rep(j, G[id].size()) {
		int to = G[id][j];
		if (to == fr)continue;
		dfs(to, id, sum);
	}
}
void solve() {
	int n, q; cin >> n >> q;
	rep(i, n - 1) {
		int a, b; cin >> a >> b; a--; b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	rep(i, q) {
		int v, val; cin >> v >> val;
		v--;
		add[v] += val;
	}
	dfs(0, -1, 0);
	rep(i, n) {
		if (i > 0)cout << " ";
		cout << ans[i];
	}
	cout << endl;
}
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(5);
	//init();
	solve();

	//cout << "finish" << endl;
	//stop
	return 0;
}

Measured memory_bytes: 28672
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#include<string.h>

using namespace std;

#define t() int t; cin>>t; while(t--)
#define ll long long int

int main(){
    int d,t,s;
    cin >> d >> t >> s;
    t *= s;
    if(d>t){
        cout << "No";
    }
    else{
        cout << "Yes";
    }
    return 0;
}

Measured memory_bytes: 3632
let () =
  let check x = if x = 2 then 1 else 0 in
  Scanf.scanf "%d\n" @@ fun n ->
  Printf.printf "%d\n" 
  ((check (n mod 10))+(check ((n mod 100) / 10))+(check ((n mod 1000) / 100))+(check (n / 1000)))


Measured memory_bytes: 3824
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
const int MAX = 510000;
const int MOD = 1000000007;


     signed main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)cin>>a[i];
int ans=0,ans2=0;
for(int i=0;i<n;i++)ans+=a[i];
for(int i=0;i<n;i++){
     if(a[i]==0){
          ans-=ans2%2;
          ans2=0;
     }
     ans2+=a[i]%2;
}
cout<<ans/2<<endl;


 }

 


 






    





      

        


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

int main() {
    int n, k;
    cin >> n >> k;
    long ans = 0;
    for (long a = 1; a <= n; a++) {
        long m = ((a % k) + k) % k;
        if (2 * m % k) continue;
        long t = (n - m) / k + (m != 0);
        ans += t * t;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256