akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
#define tpl(...) make_tuple(__VA_ARGS__)
const int INF = 0x3f3f3f3f;
const double EPS = 1e-8;
const double PI = acos(-1);
typedef long long ll;
typedef pair<int,int> pii;
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; }
template<class T>ostream&operator<<(ostream &o,const vector<T>&t){o<<'[';FOR(i,t){if(i!=t.begin())o<<',';o<<*i;}return o<<']';}
template<class S,class T>ostream&operator<<(ostream &o,const pair<S,T>&t){return o<<'('<<t.first<<','<<t.second<<')';}
template<int N,class Tp>void output(ostream&,const Tp&){}
template<int N,class Tp,class,class ...Ts>void output(ostream &o,const Tp&t){if(N)o<<',';o<<get<N>(t);output<N+1,Tp,Ts...>(o,t);}
template<class ...Ts>ostream&operator<<(ostream&o,const tuple<Ts...>&t){o<<'(';output<0,tuple<Ts...>,Ts...>(o,t);return o<<')';}
template<class T>void output(T t,char z=10){if(t<0)t=-t,putchar(45);int c[20];
int k=0;while(t)c[k++]=t%10,t/=10;for(k||(c[k++]=0);k;)putchar(c[--k]^48);putchar(z);}
template<class T>void outputs(T t){output(t);}
template<class S,class ...T>void outputs(S a,T...t){output(a,32);outputs(t...);}
template<class T>void output(T *a,int n){REP(i,n)output(a[i],i!=n-1?',':10);}
template<class T>void output(T *a,int n,int m){REP(i,n)output(a[i],m);}
template<class T>bool input(T &t){int n=1,c;for(t=0;!isdigit(c=getchar())&&~c&&c-45;);
if(!~c)return 0;for(c-45&&(n=0,t=c^48);isdigit(c=getchar());)t=10*t+c-48;t=n?-t:t;return 1;}
template<class S,class ...T>bool input(S&a,T&...t){input(a);return input(t...);}

int b[20];
int p[20];
int q[20];

int main() {
  int n,m;
  while(cin>>n>>m) {
    vector<int> a(n);
    REP(i,n) {
      cin >> a[i];
      b[i] = a[i];
    }
    REP(i,m) cin >> p[i];
    queue<vector<int> > Q;
    map<vector<int>, int> dist;
    Q.push(a);
    dist[a] = 0;
    int ans = -1;
    while(!Q.empty()) {
      vector<int> v = Q.front(); Q.pop();
      int d = dist[v];
      int pre = -1;
      int ct = 0;
      int h = 0;
      REP(i,n) {
        if (pre != v[i]) {
          if (pre != -1) {
            q[h++] = ct;
          }
          pre = v[i];
          ct = 1;
        } else ct++;
      }
      q[h++] = ct;
      if (h == m) {
        bool ok = 1;
        REP(i,m) {
          ok &= p[i] == q[i];
        }
        if (ok) {
          ans = d;
          break;
        }
      }
      REP(i,n-1) {
        swap(v[i],v[i+1]);
        if (dist.count(v) == 0) {
          dist[v] = d + 1;
          Q.push(v);
        }
        swap(v[i],v[i+1]);
      }
    }
    cout << ans << endl;
  }
}

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

int main(void)
{
	int n, min=2, max =2;

	while (cin >> n)
	{
		bool f;
		for (int i = n-1; i >= 2; i--)
		{
			if (i == 2)
			{
				max = 2;
				continue;
			}
			f = true;
			for (int j = i-1; j >= 2; j--)
			{
				if (i % j == 0)
				{
					f = false;
					break;
				}
			}
			if (f == true)
			{
				max = i;
				break;
			}
		}
		for (int i = n + 1;; i++)
		{
			f = true;
			for (int j = i-1; j >= 2; j--)
			{
				if (i % j == 0)
				{
					f = false;
					break;
				}
			}
			if (f == true)
			{
				min = i;
				break;
			}
		}
		cout << max << " " << min << endl;
	}
	return 0;
}


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

int main()
{
    // 整数の入力
    int N,M,i,s,t;
    cin >> N >> M;
    int* loadCounts = new int[N+1];
    for (i=0;i < N+1;i++){
        loadCounts[i] = 0;
    }


    for (i=0;i < M;i++){
        cin >> s >> t;
        loadCounts[s] += 1;
        loadCounts[t] += 1;
    }

    for (i=1;i <= N;i++){
        cout << loadCounts[i] << endl;
    }


    return 0;
}

Measured memory_bytes: 256
def sign(number):
    if number < 0:
        return -1
    elif number > 0:
        return 1
    else:
        return 0


n = int(input())
a = list(map(int, input().split()))
c_sum = 0
cnt_lst = []

for i in range(1, -2, -2):
    code = i
    cnt, c_sum = 0, 0
    for j in range(n):
        if sign(c_sum+a[j]) == code:
            c_sum += a[j]

        else:
            cnt += abs(code-(c_sum+a[j]))
            c_sum = code

        code *= -1

    cnt_lst.append(cnt)

print(min(cnt_lst))


Measured memory_bytes: 14468
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ul unsigned long int
#define ld long double
#define f(t) for(ll i =0;i<t;i++)
#define vi vector<int>
#define vl vector<ll>
#define pri pair<int,int>
#define mpi map<int,int>
#define prl pair<ll,ll>
#define mp make_pair
#define mpl map<ll,ll>
#define umpl unordered_map<ll,ll>
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
#define inf 2e18
#define EPS 1e-3
#define PI 3.1415926535897932385
#define display(v) f(v.size())cout << v[i]<<" "
const double h = 1e-6;
const int MAX_  = 100005;
#define all(v) v.begin(),v.end()

inline ll mul(ll a, ll b){ return (a * 1ll * b) % MOD; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += MOD; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > MOD) c -= MOD; return c; }
 //////////////////////*********CODE***********/////////////////////
 //////////////////////////////////////////////////////////////////


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n; cin>>n;
    vl v(n);
    ll xo = 0;
    for(int i=0;i<n;++i){
        cin>>v[i];
        xo ^= v[i];
    }
    for(int i= 0;i<n;++i)
    {   ll val = xo^v[i];
        cout << val << " ";
    }
    
  
}

// Химаншу

Measured memory_bytes: 4748
#include"bits/stdc++.h"
#define int long long
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define itr(i,x) for(auto i=(x).begin();i!=(x).end();++i)
#define All(x) (x).begin(),(x).end()
using namespace std;
typedef pair<int,int> P;
const int mod=1000000007;

int mpow(int a,int x);
int m_inv(int n){return mpow(n,mod-2);}

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

signed main(){
    int N;cin>>N;
    int ans=0;
    rep(i,N){
    	int l,r;
    	cin>>l>>r;
    	ans+=r-l+1;
    }
    cout<<ans<<endl;
}

int mpow(int a,int x){
	int ans=1;
	while(x>0){
		if(x%2==1) (ans*=a)%=mod;
		(a*=a)%=mod;
		x>>=1;
	}
	return ans;
}

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

#define ll long long
#define ull unsigned long long

#define min(a, b) ((a) > (b) ? (b) : (a))
#define max(a, b) ((a) > (b) ? (a) : (b))

bool isPalindrome(string s) {
    string t(s.rbegin(), s.rend());
    return s == t;
}

int main(void) {
    ll N;
    bool flag = false;
    cin >> N;
    for(ll i = 0;i < N;i++) {
        char temp;
        cin >> temp;
        if(temp == 'Y') flag = true;
    }
    if(flag) puts("Four");
    else puts("Three");
    return 0;
}


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

int n,k;
int arr[55];
long long dp[55][3000][55];

long long f(int pos,int sum,int counter)
{
   //cout<<pos<<" "<<sum<<endl;
   if(pos==n)
   {
       if(sum>0&&(sum%counter==0)&&sum/counter==k)return 1;
       else return 0;
   }


    if(dp[pos][sum][counter]!=-1)return dp[pos][sum][counter];

    long long ans=0;

    ans+=f(pos+1,sum+arr[pos],counter+1);
    ans+=f(pos+1,sum,counter);

    return dp[pos][sum][counter]=ans;
}


int main()
{

    cin>>n>>k;
    for(int i=0;i<n;i++)cin>>arr[i];
    memset(dp,-1,sizeof dp);
    cout<<f(0,0,0)<<endl;
}


Measured memory_bytes: 71168
#include<bits/stdc++.h>
using namespace std;
typedef /*long long in*/int ll;
typedef long double ld;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define nl cout<<endl
#define N 1000004

int main()
{	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
        
	ll n;cin>>n;
	ll a[n+2];
	ll freq[1000004];
	rep(i,0,1000004)
		freq[i]=0;
	rep(i,1,n+1)
	{
		cin>>a[i];
		freq[a[i]]++;
	}
	//sort(a+1,a+n+1);
	ll ans=0;
	rep(i,1,n+1)
	{
        freq[a[i]]--;
		bool flag=1;
		for(ll j=1;j<=sqrt(a[i]);j++)
		{
			if(a[i]%j)
				continue;
			ll fir=j,sec=a[i]/j;
			//test2(fir,sec);
			if(freq[fir])
			{
				flag=0;
				break;
			}
			if(freq[sec])
			{
				flag=0;
				break;
			}
		}
		if(flag)
			ans++;
        freq[a[i]]++;
	}
	cout<<ans<<endl;
}


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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}

//main code

int main(int argc, char const* argv[])
{
	string s;
	cin >> s;
	int l = s.size();
	priority_queue<pair<int,char>> pq;
	multiset<int> st;
	map<char,int> mp;

	for (int i = 0; i < l; i++) {
		mp[s[i]]++;
	}
	for (auto&& var : mp) {
		pq.push({var.second, var.first});
	}

	vector<char> pre(2,'.');
	do  {
		vector<pair<int,char>> buf;
		for (int j = 0;; j++) {
			if (find(ALL(pre),pq.top().second) != pre.end()) { // pre内にある
				buf.push_back(pq.top());
				pq.pop();
				if (pq.empty()) {
					cout << "NO" << endl;
					return 0;
				}
				continue;
			}
			auto tmp = pq.top();
			pre[1] = pre[0];
			pre[0] = tmp.second;
			tmp.first--;
			pq.pop();
			if (tmp.first > 0) {
				pq.push(tmp);
			}
			break;
		}
		for (auto&& var : buf) {
			pq.push(var);
		}
	} while(!pq.empty());
	cout << "YES" << endl;
	return 0;
}


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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

typedef long long ll;

const bool debug = 0;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

#define MAX 100101
ll S,T,D,w[MAX];

ll fin(ll s,ll t) {
  rep(i,D) {
    s += w[i];
    if( s <= t ) return i + 1;
  }
  return -1;
}

bool check(ll x, ll delta, ll delta_max) {
  assert( x );
  return S + x * delta > T && S + ( x - 1 ) * delta + delta_max > T ;
}

ll bf() {
  ll cnt = 0;
  ll s = S, t = T;
  int  i = 0;
  while( s > t ) {
    s += w[i%D];
    ++cnt;
    ++i;
  }
  return cnt;
}

void compute() {
  {
    assert( S > T );
    ll tmp = fin(S,T);
    if( tmp != -1 ) {
      cout << tmp << endl;
      return;
    }
  }
  //cout << bf() << endl;
  ll delta = 0, delta_max = 0;
  rep(i,D) {
    delta += w[i];
    delta_max = min(delta_max,delta);
  }
  if( debug ) {
    cout << "delta = " << delta << ", delta_max = " << delta_max << endl;
  }

  if( delta >= 0LL ) { puts("-1"); return; }
  ll L = 0, R = 1000000LL;
  while( R - L ){
    ll M = ( L + R ) / 2LL;
    if( check(M,delta,delta_max) ) L = M + 1LL;
    else                 R = M;  
  }
  ll x = L - 1LL;
  if( debug ) {
    cout << "x = " << x << endl;
  }
  assert( x > 0LL );
  ll ans = x * D + fin( S + x * delta, T );
  
  //assert( bf() == ans );
  cout << ans << endl;
}

int main() {
  cin >> S >> T >> D;
  rep(i,D) cin >> w[i];
  compute();
  return 0;
}



Measured memory_bytes: 3856
///*
#include<iostream>
#include<string>
using namespace std;

int main() {

	char haiku[19];
	int i;

	for (i = 0; i < 19; i++) {
		cin >> haiku[i];
	}

	for (i = 0; i < 5; i++)cout << haiku[i];
	cout << " ";
	for (i = 6; i < 13; i++)cout << haiku[i];
	cout << " ";
	for (i = 14; i < 19; i++)cout << haiku[i];
	
	return 0;
}
//*/

Measured memory_bytes: 256
temp = Array.new(12, 0)
temp.size.times{ |i|
	temp[i] = Array.new(10,0)
}

n = gets.chomp.to_i #amount of info
n.times do
	str = gets.chomp.split(" ").map(&:to_i)
	if str[0] == 1
		str[0] = 0
	elsif str[0] == 2
		str[0] = 3
	elsif str[0] == 3
		str[0] = 6
	elsif str[0] == 4
		str[0] = 9
	end
	
	num = temp[str[0] + str[1] - 1][str[2]-1] + str[3]
	if num < 0
		temp[str[0] + str[1] - 1][str[2]-1] = 0
	elsif num > 9
		temp[str[0] + str[1] - 1][str[2]-1] = 9
	else
		temp[str[0] + str[1] - 1][str[2]-1] = num
	end
end

for i in 0...12 do
	for j in 0...10 do
		print  " " + temp[i][j].to_s
	end
	if i ==2 || i == 5 || i ==8
		puts
		puts "####################"
	else
		puts
	end
end

Measured memory_bytes: 8784
n,m,k = map(int,input().split())
a_list = list(map(int,input().split()))
b_list = list(map(int,input().split()))

from itertools import accumulate
import bisect

sum_a_list = list(accumulate([0] + a_list))
sum_b_list = list(accumulate([0] + b_list))

ans = 0
b_idx = 0
for a_idx in range(n+1):
    if sum_a_list[a_idx] > k:
        continue

    time_rest = k - sum_a_list[a_idx]
    b_idx = bisect.bisect_right(sum_b_list,time_rest)

    ans = max(ans, a_idx + b_idx - 1)

print(ans)

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

int main(){

  char s;

  cin >> s;

  switch(s){

    case 'A' :cout << "T\n"; break;
    case 'T' :cout << "A\n"; break;
    case 'G' :cout << "C\n"; break;
    case 'C' :cout << "G\n"; break;

  }

}


Measured memory_bytes: 256
use std::io;


fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).unwrap();
    buf.split(' ')
        .map(|s| s.trim().parse().unwrap())
        .collect()
}


fn main() {

    let (n, a, b) = {
        let input = read::<usize>();
        (input[0], input[1], input[2])
    };

    if (b - a) % 2 == 0 {
        println!("Alice");
    } else {
        println!("Borys");
    }
}

Measured memory_bytes: 4352
#include <iostream>

int main(void){
    long long A, B, C, ans = 0;
    std::cin >> A >> B >> C;

    for (int i = 0; i < 2; ++i){
        if (A > B){
            long long tmp = A;
            A = B;
            B = tmp;
        }
        if (B > C){
            long long tmp = B;
            B = C;
            C = tmp;
        }
    }

    ans = A * B * (C % 2);

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

    return 0;
}


Measured memory_bytes: 3616
from collections import defaultdict as dd
from collections import Counter
from pprint import pprint as pp

YN = {True: 'Yes', False: 'No'}
ri = lambda: int(input())
ria = lambda: list(map(int, input().split()))
rian = lambda n: [ria() for _ in range(n)]
rs = lambda: input()
rsa = lambda: input().split()
rsn = lambda n: [rs() for _ in range(n)]

S = rs()
print(YN[''.join(sorted(S)) == 'abc'])

Measured memory_bytes: 3828
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
 
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define ktya(x) sort(all(x))
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 200105
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
 
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD = 1000000007;
//ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
ll mat_beki[55][55][110];
ll a[55][55];
ll ans[55][55]={0};
ll temp[55][55];
int N;
void calc_mat(int num){
	rep(i,N)rep(j,N){
		ll sum=0;
		rep(k,N){
			sum+=mat_beki[i][k][num-1]*mat_beki[k][j][num-1];
			sum%=MOD;
		}
		mat_beki[i][j][num]=sum;
	}
	
}

int main(){

	ll K;
	cin>>N>>K;
	rep(i,N)rep(j,N)cin>>mat_beki[i][j][1];
	
	rep(i,100)calc_mat(i+2);
	rep(i,N)ans[i][i]=1;
	int cnt=0;
	while(K){
		if(K%2==1){
			rep(i,N)rep(j,N){
				ll sum=0;
				rep(k,N){
					sum+=ans[i][k]*mat_beki[k][j][cnt+1];
					sum%=MOD;
				}
				temp[i][j]=sum;
			}
			rep(i,N)rep(j,N)ans[i][j]=temp[i][j];
		}
		
		K/=2;
		cnt++;
		
	}
	ll hoge=0;
	rep(i,N)rep(j,N)hoge=(hoge+ans[i][j])%MOD;
	cout<<hoge<<endl;
}

Measured memory_bytes: 2688
#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
typedef long long ll;
#include <cmath>
#include <iomanip>

const int MOD = 1000000007;


ll POWER(ll x,ll y)
{
	ll ret=1;
	ll p=x;
	for (ll i=y;i>0;i/=2)
	{
		if (i%2) ret=(ret*p)%MOD;
		p=(p*p)%MOD;
	}
	return ret;
}
ll gcm(ll a, ll b)
{
	if (b>a) {ll c=a; a=b; b=c;}
	while (b>0)
	{
		ll r=a%b;
		a=b;
		b=r;
	}
	return a;
}


int main(int argc, char *argv[])
{
	ll n,k;
	cin>>n>>k;
	vector<int> a(n+1),b(n+1);
	for (int i=1;i<=n;i++) {cin>>a[i];b[i]=0;}
	
	int loc=1;
	for (ll i=1;i<=k;i++)
	{
		int next=a[loc];
		if (b[next]>0)
		{
			int d=i-b[next];
			k=(k-i)%d+i;
		}
		b[next]=i;
		loc=next;
	}

	cout<<loc<<endl;
	return 0;
}



Measured memory_bytes: 4844
#include<iostream>
#include<vector>
#include<bitset>

int main(void){
    std::string s;
    std::cin >> s;
    int a, b, c, d;
    a = s[0] - '0';
    b = s[1] - '0';
    c = s[2] - '0';
    d = s[3] - '0';
    std::vector<int> numbers = {b, c, d};

    std::vector<char> op = {'-', '-', '-'};

    for(int temp = 0; temp < (1<<3); temp++){
        std::bitset<3> s(temp);
        for(int i = 0; i < 3; i++){
            if(s.test(i)){
                op.at(i) = '+';
            }
            else{
                op.at(i) = '-';
            }
        }

        int temp_ans = a;
        for(int i = 0; i < 3; i++){
            if(op.at(i) == '+')temp_ans += numbers.at(i);
            else temp_ans -= numbers.at(i);
        }

        if(temp_ans == 7){
            std::cout << a << op.at(0) << b << op.at(1) << c << op.at(2) << d << "=7" << std::endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    int ans=0,sum=0;
    for(int i=1;i<=999;i++)
    {
        ans+=i;
        sum=ans+i+1;
        if((ans-a)==(sum-b)&&ans>=a&&sum>=b) break;
    }
    printf("%d\n",ans-a);
}


Measured memory_bytes: 256
#include "stdio.h"

int n,m,x,y;
int ball[100005];
bool isRed[100005];
int c;

int main(){
	scanf("%d%d",&n,&m);
	for(int i = 1; i <= n; i++){
		ball[i] = 1;
	}
	isRed[1] = true;
	for(int i = 0; i < m; i++){
		scanf("%d%d",&x,&y);
		if(isRed[x]) isRed[y] = true;
		ball[x]--,ball[y]++;
		if(ball[x]==0) isRed[x] = false;
	}
	for(int i = 1; i <= n; i++){
		if(isRed[i]) c++;
	}
	printf("%d\n",c);
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <vector>

using namespace std;

typedef long long ll;
const int maxn=1e5+7;

int main()
{
//    freopen("input.txt","r",stdin);
    
    int n,k;
    cin>>n>>k;
	cout<<n-(k-1)<<endl; 

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        // int x = sc.nextInt();
        // int a = sc.nextInt();
        // int b = sc.nextInt();
        String s = sc.next();
        int count = s.length();
        String ss[] = new String[count];


        char[] moji = s.toCharArray();

        for(int i=0;i<count;i++) {
            moji[i]+=n;
            if(moji[i]>90)
            {
                moji[i]-=26;
            }
            System.out.print(moji[i]);
        }




    }
}


Measured memory_bytes: 26196
#include<bits/stdc++.h> 
#define ll                 long long                            
#define ra                 return a;                                          
#define pb                 push_back                                                     
#define sti                stack<ll>
#define spi                stack<pair<ll,ll>>
#define S                  second
#define msi                map<string,ll >
#define msi                map<string,ll >
#define mii                map<ll ,ll >
#define dbg(x)             { cerr<<#x<<": "<<x<< endl; }
#define dbg2(x,y)          { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z)        { cerr<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define mis                map<ll , string>
#define rep(i,a,b)         for(ll  i=a;i<b;i++)
#define mpi                map<pair<ll ,ll >,ll >                                                
#define pii                pair<ll ,ll >
#define ppb                pop_back
#define F                  first 
#define vi                 vector<ll >
#define vii                vector<pair<ll , ll >>
#define si                 set <ll>
#define vs                 vector<string>
#define all(a)             (a).begin(),(a).end()
#define sz(x)              (ll )x.size()
#define hell               1000000007
#define bs                 binary_search
#define mp                 make_pair
#define qi                 queue<ll>
#define qs                 queue<string>
#define qpi                queue<pair<ll,ll>>
#define qps                queue<pair<ll,string>> 
#define endl               '\n' 
#define itr(a,it)          for(typeof(a.begin()) it=a.begin();it!=a.end();it++)// This will produce const_iterator for const object and normal iterator for non-const object
#define ss                 set<string>
using namespace std;
#define N  300005
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t=1;
//    cin>>t;
    while(t--)
{
    ll n,k;
    cin>>n>>k;
    n--;
    if(k>(n*(n-1))/2)
    {
    	cout<<-1<<endl;
    	return 0;
    }
    cout<<n+((n-1)*n)/2-k<<endl;
    k=(n*(n-1))/2-k;
    n++;
    rep(i,1,n)
    {
    	cout<<"1 "<<i+1<<endl;
    }
    ll j=2;
    while(k)
    {
    	ll i=j+1;
    	while(1)
    	{
    		if(k)
    		{
    			if(i!=n+1)
    			{
    				k--;
    				cout<<j<<" "<<i<<endl;
    				i++;
    			}
    			else break;
    		}
    		else break;
    }	
    	    	if(k==0)break;
    	j++;
    }
}
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
		using namespace std;
		#define ll long long
		#define endl "\n"
		void solve();
		int main()
		{
			ios_base::sync_with_stdio(false);
			cin.tie(NULL);

		/*#ifndef ONLINE_JUDGE
			freopen("input.txt","r",stdin);
			freopen("output.txt","w",stdout);
		#endif*/
		
			int t=1;
			//cin>>t;
			while(t--){
			solve();
			cout << endl;
			}

			cerr << "time taken : "	<< (float)clock() / CLOCKS_PER_SEC << " secs" << endl; 
			return 0;		
		}
		void solve(){
			int a,b,c,d;
			cin>>a>>b>>c>>d;
			cout<<max(a*b,c*d);
		}
	

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define endl "\n"     
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

const int N=(1<<16)+5;

int n,a[17][17],cost[N],cache[N];

int dp(int mask)
{
     if(mask==0)
          return 0;
     int &ans=cache[mask];
     if(ans!=-1)
          return ans;
     ans=-1e18;
     for (int sm = mask; sm > 0; sm = (sm - 1) & mask) 
            ans= max(ans, cost[sm] + dp(mask ^ sm));
     return ans;       
}

int32_t main()
{
     IOS;
     memset(cache,-1,sizeof cache);
     cin>>n;
     for(int i=0;i<n;i++)
     {
          for(int j=0;j<n;j++)
               cin>>a[i][j];
     }
     int total=(1<<n);
     for(int i=0;i<total;i++)
     {
          vector <int> v;
          for(int j=0;j<n;j++)
               if(i&(1<<j))
                    v.pb(j);
          int num=v.size();
          for(int j=0;j<num;j++)
          {
               for(int k=j;k<num;k++)
                    cost[i]+=a[v[j]][v[k]];
          }
     }
     total--;
     cout<<dp(total);
}


Measured memory_bytes: 1280
#pragma GCC optimize("O3")

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")\
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

const ll mod = 1e9+7;
const int MAX = 2100000;
const int N = 21;

int mat[N][N];
int n;

ll DP[N][MAX];

ll add(ll a ,ll b){
    ll rta = a+b;
    return rta >= mod ? rta - mod : rta;
}

ll dp(int m, int i){
    if(i==n) return 1;
    if(DP[i][m]!=-1) return DP[i][m];
    ll rta = 0;
    for(int j = 0; j<n; ++j){
        if(mat[i][j] && ! (m&(1<<j)) ){
            //cout<<"holi"<<"\n";
            int d = dp(m | 1<<j, i+1);
            rta=add(rta, d);
        }
    }
    return DP[i][m] = rta;
}

int main(){

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

    memset(DP, -1, sizeof(DP));
    cout<<dp(0,0)<<"\n";


}



Measured memory_bytes: 344832
#include <cstdio>

using namespace std;

char s[4'009];

int main() {
  int n;
  scanf("%d%s", &n, s);
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    int r = 0, g = 0, b = 0;
    for (int j = i + 1; j < n; ++j) {
      if (s[j] != s[i]) {
        if (s[i] != 'B' && s[j] != 'B') {
          ans += b;
          if ((j - i + 1) % 2 == 1 && s[(i + j) / 2] == 'B') {
            --ans;
          }
        } else
        if (s[i] != 'G' && s[j] != 'G') {
          ans += g;
          if ((j - i + 1) % 2 == 1 && s[(i + j) / 2] == 'G') {
            --ans;
          }
        } else {
          ans += r;
          if ((j - i + 1) % 2 == 1 && s[(i + j) / 2] == 'R') {
            --ans;
          }
        }
      }
      r += s[j] == 'R';
      g += s[j] == 'G';
      b += s[j] == 'B';
    }
  }
  printf("%lld\n", ans);
}


Measured memory_bytes: 1732
from heapq import*;X,Y,Z=map(int,input().split());N=X+Y+Z;A=[];q1=[];q2=[];L=[0];R=[0]
for _ in[0]*N:A.append([int(e)for e in input().split()])
A.sort(key=lambda a:a[0]-a[1])
for i in range(N):
	L+=[L[i]+A[i][1]];heappush(q1,A[i][1]-A[i][2]);R+=[R[i]+A[-1-i][0]];heappush(q2,A[~i][0]-A[~i][2])
	if i>=Y:L[i+1]-=heappop(q1)
	if i>=X:R[i+1]-=heappop(q2)
print(max(L[i]+R[~i]for i in range(Y,N-X+1)))

Measured memory_bytes: 106180
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define P pair<int, int>
#define debug(x) cout << #x << ": " << x << ", "
#define debugln(x) cout << #x << ": " << x << '\n'

using namespace std;
using ll = long long;
const int mod = 1e9+7;

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

  int n, i; cin >> n >> i;
  cout << n - i + 1 << endl;
}

Measured memory_bytes: 256
n = int(input())
alpha = list('abcdefghijklmnopqrstuvwxyz')
num_s = dict(zip(alpha, [50]*len(alpha)))

for i in range(n):
  S = input()
  d = dict(zip(alpha, [0]*len(alpha)))
  for s in S:
    d[s] += 1
  for s in d:
    num_s[s] = min(num_s[s], d[s])

ans = ''
for s in num_s:
  ans += s*num_s[s]

print(''.join(sorted(ans)))

Measured memory_bytes: 3064
// AOJ Volume 5 Problem 0521 Change

#include <stdio.h>

int main(void)
{
    int price;
    int change;
    int n;
    
    while (1){
        scanf("%d", &price);
        
        if (price == 0){
            break;
        }
        
        change = 1000 - price;

        n = change / 500;
        change %= 500;
        
        n += change / 100;
        change %= 100;

        n += change / 50;
        change %= 50;

        n += change / 10;
        change %= 10;

        n += change / 5;
        change %= 5;

        n += change;
        
        printf("%d\n", n);
    }
    
    return (0);
}

Measured memory_bytes: 600
#include <stdio.h>
#include <math.h>
#define MAX(x,y) x>y?x:y
int main(){
	int a,b,c,k;
	scanf("%d %d %d %d",&a,&b,&c,&k);
	int sum=a+b+c+(pow(2,k)-1)*(MAX(a, (MAX(b,c))));
	printf("%d",sum);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);

const int MAXN = 1e5 + 5;

int n, a[MAXN][3 + 5], dp[MAXN][3 + 5];

int main() {
    IOS

    cin >> n;

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= 3; j++) {
            cin >> a[i][j];
        }
    }

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= 3; j++) {
            for (int k = 1; k <= 3; k++) {
                if (j == k) {
                    continue;
                }

                dp[i][j] = max(dp[i][j], dp[i - 1][k] + a[i][j]);
            }
        }
    }

    cout << max(dp[n][1], max(dp[n][2], dp[n][3])) << '\n';
}

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

using namespace std;

typedef long long int ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define nl '\n'
#define debug1(x)       cout<<" #x "<< ": " << x << endl
#define debug2(x, y)    cout << #x << ": " << x << '\t' << #y << ": " << y << endl
#define debug3(x, y, z) cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z << endl

string to_upper(string &in)
{
    for (int i = 0; i < in.length(); i++)
          if('A'<=in[i] and 'Z'>=in[i]){
              continue;
          }
          else{
              in[i] = in[i] - 'a' + 'A';
          }
          return in;
}

void solve(){
    //CC
    int n;
    cin>>n;
    int i=2;
    map<int,int>cnt;
    while(i<=n){
        int x;
        cin>>x;
        cnt[x]++;
        i++;
    }
    for(i=1;i<=n;i++){
        cout<<cnt[i]<<endl;
    }
    //BBB
    // int n,m;
    // ll tot=0;
    // cin>>n>>m;
    // while(m--){
    //     int time;
    //     cin>>time;
    //     tot+=time;
    // }
    // if(tot>n){
    //     cout<<"-1"<<endl;
    // }
    // else{
    //     cout<<n-tot<<endl;
    // }
    //aa
//   int r;
//   cin>>r;
//   cout << setprecision(15) <<2*3.141592653589793238*r<< '\n';

 }

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


Measured memory_bytes: 13036
#include<iostream>
using namespace std;
typedef long long ll;
const ll MAXN = 1e5+200;
ll a[MAXN]={0};
int main(){
    ll count = 0;
    string s;
    cin>>s;
    for(int i = 0; i < s.length(); i++){
      if(s[i] == '2'){
        count++;
      }
    }
    cout<<count<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int arr[n];
    int dp[n];
    for(int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    dp[0] = 0;
    dp[1] = abs(arr[1] - arr[0]);
    for(int i = 2; i < n; i++) {
		dp[i] = min(dp[i-1] + abs(arr[i-1] - arr[i]), dp[i-2] + abs(arr[i-2] - arr[i]));
	}
	cout << dp[n-1] << "\n";
    return 0;
}


Measured memory_bytes: 1024
//#include<bits/stdc++.h>
#pragma GCC optimize(2)
#pragma G++ optimize(2)
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<cstring>
#include<utility>
#include<iostream>
#include<algorithm>
#include<functional>
//#include<unordered_map>
using namespace std;

typedef long long ll;
typedef long double ld;

#define pa pair<int,int>
#define sc(n) scanf("%d",&n)
#define ss(s) scanf("%s",s)
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define of(i,a,b) for(int i=a;i>=b;i--)
#define mem(a,b) memset(a,b,sizeof a)
#define uint unsigned int

const  int N = 4e5 + 10;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;

int a[N];
string s;
int t, n, m;

int main()
{
	/*ios::sync_with_stdio(false);*/
	cin >> n;
	cin >> s;
	if (n < 3200)
		puts("red");
	else
		cout << s << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>

using namespace std;

#define ALL(c) c.begin(),c.end()
#define RALL(c) c.rbegin(),c.rend()
#define SORT(x) sort((x).begin(),(x).end())
#define REP(i,x,y) for(int i=(x);i<(y);++i)
#define MP(a,b) make_pair((a),(b))
#define F_ first
#define S_ second

typedef long long int lli;
typedef pair<int,int> P;

const int INF=1<<30;
const double EPS=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int N;
	while(cin >> N&&N){
		vector<vector<int> > schedule(31);
		REP(i,0,N){
			int F;
			cin >> F;
			REP(j,0,F){
				int a;
				cin >> a;
				schedule[a].push_back(i);
			}
		}
		vector<vector<int> > dp[31];
		REP(day,0,31){
			dp[day].resize(N);
			REP(person,0,N) dp[day][person].push_back(person);
		}
		int ans=-1;
		REP(day,1,31){
			REP(person,0,N) dp[day][person]=dp[day-1][person];
			for(const int &x:schedule[day]){
				for(const int &y:schedule[day]){
					for(const int&z:dp[day][y]){
						const auto it=find(dp[day][x].begin(),dp[day][x].end(),z);
						if(it==dp[day][x].end()) dp[day][x].push_back(z);
					}
				}
			}
			REP(person,0,N) if(dp[day][person].size()==N){
				ans=day;
				break;
			}
			if(ans!=-1) break;
		}
		cout << ans << endl;
	}
	return 0;
}

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

int x, y, z;
int main() {
    cin >> x >> y >> z;
    swap(x, y);
    swap(x, z);
    cout << x << " " << y << " " << z << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<cmath>
#include<iostream>
int main()
{
	double x = 0, y = 0;
	int a = 90;
	while (true)
	{
		int di, ai;
		char temp;
		std::cin >> di >> temp >> ai;
		if (di == 0 && ai == 0)
		{
			break;
		}
		x += di * cos(a * M_PI / 180);
		y += di * sin(a * M_PI / 180);
		a -= ai;
	}
	std::cout << static_cast<int>(x >= 0 ? floor(x) : ceil(x)) << std::endl;
	std::cout << static_cast<int>(y >= 0 ? floor(y) : ceil(y)) << std::endl;
	return 0;
}


Measured memory_bytes: 3452
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;

	void run() {
		Scanner sc = new Scanner(System.in);
		for(;;) {
			int n = sc.nextInt();
			if(n == 0) break;
			HashSet<P> ps = new HashSet<P>();
			for(int i=0;i<n;i++) {
				P p = new P(sc.nextInt(), sc.nextInt());
				ps.add(p);
			}
			int max = 0;
//			for(P p: ps) debug(ps);
			for(P p1: ps) for(P p2: ps){
				if(p1.equals(p2)) continue;
				int x = p1.x-p2.x;
				int y = p1.y-p2.y;
				P p3 = new P(p1.x + y, p1.y - x);
				P p4 = new P(p2.x + y, p2.y - x);
				if( ps.contains(p3) && ps.contains(p4) ) {
					max = max(max, x * x + y * y);
				}
				p3 = new P(p1.x - y, p1.y + x);
				p4 = new P(p2.x - y, p2.y + x);
				if( ps.contains(p3) && ps.contains(p4) ) {
					max = max(max, x * x + y * y);
				}
			}
			System.out.println(max);
		}
	}
	
	class P {
		int x, y;
		P(int x, int y) {
			this.x = x;
			this.y = y;
		}
		
		public boolean equals(Object o) {
			if(o instanceof P) {
				P p = (P) o;
				return x == p.x && y == p.y;
			}
			return false;
		}
		
		public int hashCode() {
			return x*5010 + y;
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}
}

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

int main(){
  int N, count=0;
  long result=0, min=LONG_MAX;
  cin >> N;
  int A[N];

  for(int i=0;i<N;i++){
    cin >> A[i];
    if(A[i]<0){
      count+=1;
    }
    result += abs(A[i]);
    if(abs(A[i])<min){
      min = abs(A[i]);
    }
  }

  if(count%2==0){

  }else{
    result -= 2*min;
  }

  cout << result << endl;
}


Measured memory_bytes: 640
#include<stdio.h>
int main(void){
  char rom[102];
  int fig[102];
  int k,n,sum;
  while(scanf("%c",&rom[1])!=EOF){
    n = 1, sum = 0;
    for(k=2;k<=101;k++){
      scanf("%c",&rom[k]);
      if(rom[k]=='\n') break;
      n++;
    }
    for(k=1;k<=n;k++){
      switch(rom[k]){
      case 'I':
        fig[k]=1;
        break;
      case 'V':
        fig[k]=5;
        break;
      case 'X':
        fig[k]=10;
        break;
      case 'L':
        fig[k]=50;
        break;
      case 'C':
        fig[k]=100;
        break;
      case 'D':
        fig[k]=500;
        break;
      case 'M':
        fig[k]=1000;
        break;
      }
    }

    fig[n+1] = 1;
    for(k=1;k<=n;k++){
      if(fig[k]>=fig[k+1]){
        sum += fig[k];
      }else{
        sum -= fig[k];
      }
    }
    printf("%d\n",sum);
  }
  return 0;
}

Measured memory_bytes: 540
// Contest: AtCoder Beginner Contest 177 (https://atcoder.jp/contests/abc177)
// Problem: A: Don't be late (https://atcoder.jp/contests/abc177/tasks/abc177_a)


// region boilerplate
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <chrono>
#include <cstdint>
#include <deque>
#include <exception>
#include <forward_list>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#if __cplusplus >= 201703L
#   include <optional>
#   include <string_view>
#   include <variant>
#endif

using namespace std;

#if __cplusplus >= 201703L
#   define all(a)      begin(a),end(a)
#   define sz(x)       ((int)size(x))
#else
#   define all(a)      (a).begin(),(a).end()
#   define sz(x)       ((int)(x).size())
#endif

#define rep(a, b)      for(int a = 0; a < (b); ++a)
#define reps(a, b, c)  for(int a = (b); a < (c); ++a)
#define trav(a, b)     for(auto& a : b)

using ll = long long;
using ld = long double;
using u64 = uint64_t;
using u32 = uint32_t;

using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vpi = vector<pi>;

#if __cplusplus >= 201703L
#   define MAYBE_UNUSED [[maybe_unused]]
#else
#   define MAYBE_UNUSED
#endif

MAYBE_UNUSED static constexpr int INF = (int)1e9 + 5;
MAYBE_UNUSED static constexpr ll INFL = (ll)1e18 + 5;
MAYBE_UNUSED static mt19937 rng((u32)chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
//endregion

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

    double d, t, s; cin >> d >> t >> s;
    cout << (d / s <= t ? "Yes\n" : "No\n");

    return 0;
}


Measured memory_bytes: 3736
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;


int main() {
    long long a,b,c;
    cin>>a>>b>>c;
    long long ans=a*min(b-1,c)/b;
    cout<<ans;
    return 0;
}


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


int main()
{
    int n;
    int a[150000];
    while(cin>>n)
    {
        int i;
    for(i=0;i<n;i++)
        cin>>a[i];
    int t=-1;
    int isTrans=0;
    for(i=0;i<n;i++)
    {
        if(a[i]>t)
        {
            isTrans=0;
            t=a[i];
        }
        else if(t-a[i]==1&&isTrans)
            break;
        else if(t-a[i]==1&&isTrans==0)
        {
            t=t-1;
            isTrans=1;
        }
        else if(t-a[i]>1)
            break;
    }
    if(i!=n)
        cout<<"No"<<endl;
    else
        cout<<"Yes"<<endl;
    }
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
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;
}
//グリッド：（典型）dp,dfs,bfs,最短経路,その他
int main(){
    ll n,l;cin>>n>>l;
    vl a(n+1);rrep(i,n)cin>>a[i];
    ll sum=a[1];
    P p={0,0};
    rrep(i,n-1){
        sum+=a[i+1];
        if(sum>=l){
            p={i,i+1};
            break;
        }
        sum-=a[i];
    }
    if(p.fi==0&&p.se==0){
        cout<<"Impossible"<<endl;
        return 0;
    }
    cout<<"Possible"<<endl;
    for(int i=1;i<p.fi;i++){
        cout<<i<<endl;
    }
    for(int i=n-1;i>p.fi;i--){
        cout<<i<<endl;
    }
    cout<<p.fi<<endl;
    return 0;
}

Measured memory_bytes: 1664
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main(){
	string s;
	while(cin >> s)
	{
		if(s[2] == s[3] && s[4] == s[5])
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
    int n;
    cin>>n;
    vector<int> v[n*n+1];
    rep(i,2*n*n-2*n){
        int a,b;
        cin>>a>>b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    vector<vector<int>> ans(n,vector<int>(n)) ;
    vector<int> used(n*n+1);
    rep(i,n*n+1){
        if(v[i].size()==2){
            ans[0][0]=i;
            used[i]=1;
            break;
        }
    }
    rep(i,n-1){
        rep(j,i){
            for(auto to1 : v[ans[i-j][j]])for(auto to2 : v[ans[i-j-1][j+1]]){
                if(to1==to2&&!used[to1]){
                    ans[i-j][j+1]=to1;
                    used[to1]=1;
                    break;
                }
            }
        }
        for(auto to : v[ans[i][0]]){
            if(v[to].size()<=3&&!used[to]){
                ans[i+1][0]=to;
                used[to]=true;
                break;
            }
        }
        for(auto to : v[ans[0][i]]){
            if(v[to].size()<=3&&!used[to]){
                ans[0][i+1]=to;
                used[to]=true;
                break;
            }
        }
    }
    rep(i,n-1){
        REP(j,i,n-1){
            for(auto to1 : v[ans[n-1+i-j][j]])for(auto to2 : v[ans[n-1+i-j-1][j+1]]){
                if(to1==to2&&!used[to1]){
                    ans[n-1+i-j][j+1]=to1;
                    used[to1]=1;
                    break;
                }
            }
        }
    }
    rep(i,n){
        rep(j,n){
            cout<<ans[i][j];
            if(j<n-1)cout<<" ";
            else cout<<endl;
        }
    }
    return 0;
}


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

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

    bool flag = false;
    if (c == 'a') flag = true;
    if (c == 'e') flag = true;
    if (c == 'i') flag = true;
    if (c == 'o') flag = true;
    if (c == 'u') flag = true;

    if (flag) cout << "vowel" << endl;
    else cout << "consonant" << endl;

    return 0;
}

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

int main() {
  int N, a, b, c;
  cin >> N;
  
  a = N / 100;
  b = N % 100 / 10;
  c = N % 100 % 10;
  
  if (a == 7) {
    cout << "Yes" << endl;
  }
  
  else if (b == 7) {
    cout << "Yes" << endl;
  }
  
  else if (c == 7) {
    cout << "Yes" << endl;
  }
  
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <iomanip>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
  int W, H, x, y;
  cin >> W >> H >> x >> y;
  double ans = (double)W*(double)H / (double)2;
  int num = (W == x * 2 && H == y * 2) ? 1 : 0;
  cout << setprecision(6) << ans << " " << num << endl;
}


Measured memory_bytes: 256