akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

vector<int> a;
vector<int> id;

bool cmp(int x, int y) {
    return a[x] > a[y];
}

int main() {
    int n, m;
    scanf("%d%d", &n, &m);// don't forget &
    a.resize(n);
    id.resize(n);
    
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);// don't forget &
        id[i] = i;
    }
    vector<int> G[n];
    for (int i = 1; i <= m; i++) {
        int x, y;
        scanf("%d%d", &x, &y);// don't forget &
        x--;
        y--;
        G[x].push_back(y);
        G[y].push_back(x);
    }
    sort(id.begin(), id.end(), cmp);
    vector<int> vis(n, 0);
    int ans = 0;
    for (int i = 0; i < n; i++) {
        bool f = true;
        for (auto x : G[id[i]]) {
            if (a[x] >= a[id[i]]) {
                f = false;
            }
        }
        if (f) {
            ans++;
        }
    }
    printf("%d", ans);
    return 0;
}


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

int main() {
  int a, b, c, d;
  int l, r;
  cin >> a >> b >> c >> d;
  
  l = a + b;
  r = c + d;
  
  if (l > r) {
    cout << "Left" << endl;
  } else if (r > l) {
    cout << "Right" << endl;
  } else {
    cout << "Balanced" << endl;
  }
}


Measured memory_bytes: 256
fn b_palace() {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input).unwrap();
    let num = input.trim_right().parse::<usize>().unwrap();

    let mut input = String::new();
    std::io::stdin().read_line(&mut input).unwrap();
    let tmp: Vec<f32> = input.trim_right()
        .split_whitespace()
        .map(|s| s.parse::<f32>().unwrap())
        .collect();
    let t = tmp[0];
    let a = tmp[1];

    let mut input = String::new();
    std::io::stdin().read_line(&mut input).unwrap();
    let mut heights : Vec<f32> = input.trim_right()
        .split_whitespace()
        .map(|s| s.parse::<f32>().unwrap())
        .collect();

    let heights : Vec<f32> = heights.iter()
        .map(|v| (a - (t - 0.006 * v)).abs())
        .collect();

    let mut v_min = std::f32::MAX;
    let mut v_idx = 0;

    for (idx, value) in heights.iter().enumerate() {
        if v_min > *value {
            v_min = *value;
            v_idx = idx;
        }
    }
    println!("{}", v_idx + 1);
}

fn main() {
    b_palace();
}


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

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1ll << 60;

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

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

    int n, k, rsl;
    cin >> n >> k;
    rsl = n - k + 1;
    cout << rsl << endl;


}


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

#define FOR(i,a,b)  for(ll (i)=a;(i)<(b);++(i))
#define RFOR(i,a,b) for(ll (i)=a;(i)>=(b);--(i))
#define REP(i,n)    FOR(i,0,n)
#define RREP(i,n)   RFOR(i,n,0)
#define ALL(v)      (v).begin(),(v).end()
#define BIT(n)      (1LL<<(n))
#define IN(x,l,r)   ((l)<=(x)&&(x)<=(r))
#define SHOW(x)     cout<<#x<<" = "<<x<<endl
#define SORT(v)     sort(ALL(v))
#define SZ(v)       (ll)(v).size()
#define UNIQ(v)     SORT(v);(v).erase(unique(ALL(v)),(v).end())
#define PERM(v)     for(bool p=1;p;p=next_permutation(ALL(v)))
#define PQ(T)       priority_queue<T,vector<T>,greater<T>>

template<typename T>string join(const vector<T>& v, string d=" ")
{stringstream s;REP(i,SZ(v))s<<d<<v[i];return s.str().substr(d.length());}

template<typename T> ostream& operator<<(ostream& s, const vector<T>& v)
{if(SZ(v))s<<join(v,", ");return s;}

const ll INF = 1e15;
const ll MOD = 1e9+7;
const double EPS = 1e-10;

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

int main() {
    ll N; cin >> N;
    vector<ll> A(N); REP(i, N) cin >> A[i];
    
    ll ans = 0;
    REP(i, N) {
        ans += A[i] / 2;
        if (i + 1 <= N - 1 and A[i] % 2 == 1 && A[i+1] > 0) {
            ans++;
            A[i+1]--;
        }
    }
    cout << ans << endl;
    
    return 0;
}


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

using namespace std;

typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
typedef pair<ll,ll> pll;
typedef pair<int, int> pii;

#define N 100010
#define M 200010
#define endl "\n"
#define mod 1000000007 

int main(){
	
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(NULL);
	
	ll x;
	
	cin >> x;
	
	for(int i = -1000; i <= 1000; i++){
		for(int j = -1000; j <= 1000; j++){
			ll a5 = (ll) pow(i, 5);
			ll b5 = (ll) pow(j, 5);
			
			if(a5 - b5 == x){
				cout << i << " " << j << endl;
				return 0;
			}
		}
	}
	
	return 0;
}

Measured memory_bytes: 4036
card = []
for i in range(3):
    card.append(list(map(int, input().split())))

n = int(input())
b = []
for i in range(n):
    b.append(int(input()))

if card[0][0] in b and card[1][1] in b and card[2][2] in b:
    print("Yes")
    exit()
if card[0][2] in b and card[1][1] in b and card[2][0] in b:
    print("Yes")
    exit()

for i in range(3):
    if card[i][0] in b and card[i][1] in b and card[i][2] in b:
        print("Yes")
        exit()


for i in range(3):
    if card[0][i] in b and card[1][i] in b and card[2][i] in b:
        print("Yes")
        exit()

print("No")


Measured memory_bytes: 9188
#include <stdio.h>
#include <stdlib.h>

int main (void)
{
  int i, n;
  long long int *array;

  scanf("%d", &n);
  array = (int*)malloc(sizeof(long long int) * (n+1));
  array[0] = 2;
  array[1] = 1;
  for (i = 2; i <= n; i++) {
    array[i] = array[i-1] + array[i-2];
  }
  printf("%lld", array[n]);

  free(array);
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long int llint;
typedef long int lint;
typedef vector<char> vchar;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
#define vsort(v) sort((v).begin(), (v).end())
#define vreverse(v) reverse((v).begin(), (v).end())
#define pb(a) push_back(a)
#define INF 1000000007
int main(){
  vint n(3);cin>>n[0]>>n[1]>>n[2];
  vsort(n);
  int ans=0;
  ans+=n[2]-n[1];
  if((n[1]-n[0])%2){ans+=(n[1]-n[0])/2;ans+=2;}
  else{ans+=(n[1]-n[0])/2;}cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#define ll long long

using namespace std;

int main(void) {
    int n, k;
    ll h[100000];

    ll ans = 10000000000;

    scanf("%d %d", &n, &k);
    for(int i=0; i<n; i++) {
        scanf("%lld", &h[i]);
    }

    sort(h, h+n);

    for(int i=k-1; i<n; i++) {
        ans = min(h[i]-h[i-k+1], ans);
    }

    printf("%lld\n", ans);

}


Measured memory_bytes: 1024
#include <iostream>

using namespace std;

int main() {
    int r,c,k;
    cin >> r >> c >> k;
    char sq[r][c];
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++) cin >> sq[i][j];
    }
    int ans = 0;
    for(int chooseR=0;chooseR<(1<<r);chooseR++){
        for(int chooseC=0;chooseC<(1<<c);chooseC++){
            int black = 0;
            for(int i=0;i<r;i++){
                for(int j=0;j<c;j++){
                    if(chooseR & (1<<i) && chooseC&(1<<j)){
                        if(sq[i][j]=='#'){
                            //cout << i << " " << j << " chooseR=" << chooseR << " chooseC=" << chooseC << endl;
                            black++;
                        }
                    }
                }
            }
           // cout << endl;
            if(black==k) ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
  int N, Q; cin >> N >> Q;
  string S; cin >> S;

  vector<int> sum(N + 1, 0);
  
  vector<int> l(Q), r(Q);
  for (int i = 0; i < Q; ++i) {
    cin >> l[i] >> r[i];
  }
  
  // 累積和
  for (int i = 1; i < N; ++i) {
    if (S[i - 1] == 'A' && S[i] == 'C') {
      sum[i + 1] = sum[i] + 1;
    }
    else sum [i + 1] = sum[i];
  }
  
  for (int i = 0; i < Q; ++i) {
    int ans = sum[r[i]] - sum[l[i]];
    cout << ans << endl;
  }
}

Measured memory_bytes: 2176
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <time.h>
#define _USE_MATH_DEFINES
#define LL long long
#define UN unsigned
using namespace std;
const double PI = acos(-1.0);

int max_num(int ary[], int length) {
	int max = ary[0];
	for (int i = 1; i < length; i++)
		if (max < ary[i]) max = ary[i];
	return max;
}

int max_ord(int ary[], int length) {
	int max;
	max = max_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == max) return i;
	}
	return -1;
}

int min_num(int ary[], int length) {
	int min = ary[0];
	for (int i = 1; i < length; i++)
		if (min > ary[i]) min = ary[i];
	return min;
}

int min_ord(int ary[], int length) {
	int min;
	min = min_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == min) return i;
	}
	return -1;
}

int main() {
	int a, b, c, d, st, go, ans;
	cin >> a >> b >> c >> d;
	st = max(a, c);
	go = min(b, d);
	ans = go - st;
	if (ans < 0)
		ans = 0;
	cout << ans << endl;

	return 0;
}


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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  a.begin(),a.end()

class CommonIO {
public:
    CommonIO() {
        std::cin.tie(0);
        std::ios::sync_with_stdio(false);
    }
    ~CommonIO() {}

    template <class T>
    void scan(T &v) {
        std::cin >> v;
    }
    template <class T, class... Rest>
    void scan(T &v, Rest&... rest) {
        scan(v);
        scan(rest...);
    }

    template <class T>
    void print(T v) {
        std::cout << v;
    }
    template <class T>
    void print(std::vector<T> &v) {
        if (v.size() == 0) return;
        print(*v.begin());
        for (auto it = ++v.begin(); it != v.end(); ++it) {
            print(' ');
            print(*it);
        }
    }
    template <class T>
    void print(std::vector< std::vector<T> > &grid) {
        if (grid.size() == 0) return;
        print(*grid.begin());
        for (auto it = ++grid.begin(); it != grid.end(); ++it) {
            print('\n');
            print(*it);
        }
    }
    template <class T, class... Rest>
    void print(T v, Rest... rest) {
        print(v);
        print(' ');
        print(rest...);
    }

    template <class T>
    void printl(T v) {
        print(v);
        std::cout << '\n';
    }
    template <class T, class... Rest>
    void printl(T v, Rest... rest) {
        print(v);
        print(' ');
        printl(rest...);
    }
} io;


struct Infant {
  int index;
  ll active;

  ll point(int i) {
    return active * abs(index - i);
  }
};

int main() {
  ll N; io.scan(N);
  vector<Infant> A(N+2);
  REP(i, N) {
    A[i].index = i+1;
    io.scan(A[i].active);
  }
  sort(ALL(A), [](Infant& a, Infant& b) {return a.active >= b.active;});
  
  ll dp[2002] = {0,}, dp2[2002] = {0,};
  ll i, x, y;
  for (int sum=1; sum<=N; ++sum) {
    swap(dp, dp2);
    Infant &a = A[sum-1];
    // x = 0, y = sum
    dp[0] = dp2[0] + a.active*abs(a.index - (N-sum+1));
    // x = 1 ~ sum-1
    ll xend = min(a.index, sum);
    for (i=1, x=a.active*(a.index-i), y=a.active*(N-sum+i+1-a.index); i<xend; x-=a.active, y+=a.active, ++i) {
      dp[i] = max(dp2[i-1] + x, dp2[i] + abs(y));
    }
    for (i=a.index, x=0, y=a.active*(N-sum+i+1-a.index); i<sum; x+=a.active, y+=a.active, ++i) {
      dp[i] = max(dp2[i-1] + x, dp2[i] + abs(y));
    }
    // x = sum, y = 0
    dp[sum] = dp2[sum-1] + a.active*abs(a.index-sum);
  }
  
  io.printl(*max_element(dp, dp+N+1));
  
  return 0;
}


Measured memory_bytes: 3700
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();
        outer: for (long a = 1000; a > 0; a--) {
            for (long b = a; b > -1000; b--) {
                if (pow(a, 5) - pow(b, 5) == x) {
                    System.out.printf("%d %d\n", a, b);
                    break outer;
                }
            }
        }
    }
    static  long pow(long num, long times) {
        long result = 1;
        for (long i = 0; i < times; i++) {
            result *=  num;
        }
        return result;
    }
}


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

int main(){
    ios_base::sync_with_stdio(0);
    long long a,b;
    cin>>a>>b;
    int ans = 0;
    while(a<=b){
        ans++;
        a = a*2;
    }
    cout<<ans;
    return 0;
}


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

using namespace std;
using ll = long long;

#pragma region Macros
#define FOR(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define rep(i, n) FOR(i, 0, n)

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

template <class T> string join(const T &v, const string delim = ",")
{
    if (v.empty())
        return "";

    ostringstream res;
    res << v[0];
    for (int i = 1; i < v.size(); i++)
    {
        res << delim << v[i];
    }
    return res.str();
}

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << ":" << #x << " = " << (x) << endl;
#else
#define dbg
#endif

#pragma endregion Macros

ll f(vector<int> a, int n, int bit){
    vector<ll> res;
    res.push_back(a[0]);

    for(int i=0;i<a.size()-1;i++){
        if ((bit >> i) & 1) {
            res.push_back(0);
        } else {
            res[res.size() - 1] *= 10;
        }
        res[res.size() - 1] += a[i + 1];
    }

    dbg(join(res));
    ll ans = 0;
    for(auto x : res){
        ans += x;
    }
    return ans;
}

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

    vector<int> a(s.size());
    rep(i, s.size()) a[i] = s[i] - '0';

    int n = s.size() - 1;

    ll ans = 0;
    for (int bit = 0; bit < (1 << n); bit++) {
        ans += f(a, n, bit);
    }

    cout << ans << endl;
}


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

int a[1000010], s, t, m;

int main(){
	cin >> a[0];
	for (t = 1; t < 1000000; ++t){
		a[t] = (a[t-1]%2 == 0) ? a[t-1]/2 : 3*a[t-1]+1;
		for (int i = 0; i < t; ++i){
			if (a[i] == a[t]){
				s = t;
				t = 1000000;
				break;
			}
		}
	}
	cout << s+1;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#define lli  long long int
using namespace std;
#define S second
#define F first
#define pb push_back
#define M1 1000000007
#define M2 998244353
#define plli pair<lli,lli>
#define setit set<lli>::iterator seti
#define mapit map<lli,lli> ::iterator mapi
#define MP make_pair
#define MT make_tuple
#define PI 3.14159265358979323846
// map      iterator->first  iterator.first
// map      mp[key]=value
// set      *s.begin()
// vector   v[j]=value
// pair     p.first p.second
// vector of pairs v[j].first v[j].second
// tuple    get<index>(tuple_name)
// vector of tuples get<index>(v[j])  sort(v.begin(),v.end())
//priority queue .top() .pop() .push()
// __gcd(x,y)
#define mini(x,y) (y + ((x - y) & ((x - y) >>(sizeof(int) * CHAR_BIT - 1))))
#define maxi(x,y) (x - ((x - y) & ((x - y) >> (sizeof(int) * CHAR_BIT - 1))))
#define fr(j,a,b) for(j=a;j<b;j++)

int power(int x, unsigned int y, int p)
{   int res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {   if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

int main()
{
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int x, n, i;
    cin >> x >> n;
    int a[n];
    map<lli, lli> mp;
    for (i = 0; i < n; i++) {
        cin >> a[i];
        mp[a[i]] = 1;
    }
    if (mp[x] != 1) {
        cout << x;
        return 0;
    }
    int l = 1;
    for (i = x;;) {

        if (mp[i - l] != 1) {
            cout << i - l;
            return 0;
        }
        if (mp[i + l] != 1) {
            cout << i + l;
            return 0;
        }
        l++;
    }
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

template<class key, class value, class cmp = std::less<key>>
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

template<class key, class value, class cmp = std::less_equal<key>>
using ordered_multimap = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;

vector <ll> s;
ll n;

void build(){
	for (int z=0;z<s.size();z++){
		s[z] = 0;
	}
}

void modify(ll x,ll pos,ll id = 1,ll l =0,ll r = n+1){
	if (r - l < 2){
		s[id] = x;
		return;
	}
	ll mid = (l+r)/2;
	if (pos < mid){
		modify(x,pos,id*2,l,mid);
	}
	else {
		modify(x,pos,id*2+1,mid,r);
	}
	s[id] = max(s[id*2],s[id*2+1]);
}

ll query(ll x,ll y,ll id = 1 ,ll l =0, ll r = n+1){
	if (y <= l || x >= r) return 0;
	if (x <= l && r <= y){
		return s[id];
	}
	ll mid = (l+r)/2;
	return max(query(x,y,id*2,l,mid),query(x,y,id*2+1,mid,r));
}

int main(){
	cin >> n;
	vector <pair<ll,ll>> arr(n);
	for (int z=0;z<n;z++){
		cin >> arr[z].first;
	}
	for (int z=0;z<n;z++){
		cin >> arr[z].second;
	}
	vector <ll> dp(n);
	s.resize((n+1)*4);
	build();
	for (int z=0;z<n;z++){
		dp[z] = query(0,arr[z].first)+arr[z].second;
		modify(dp[z],arr[z].first);
	}
	ll ans = 0;
	for (int z=0;z<n;z++){
		ans = max(ans,dp[z]);
	}
	cout << ans << endl;
	cin >> n;
}


Measured memory_bytes: 11136
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define testcase int t;cin>>t;while(t--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define pii pair<int, int>
#define pll pair<long long int,long long int>
#define ub upper_bound // '>'
#define lb lower_bound // '>='
//erase,count,find,make_unique
#define len(arr) (sizeof(arr)/sizeof(arr[0]))
#define make_unique(arr) arr.erase(unique(arr.begin(),arr.end()),arr.end()) //Makes a sorted array unique
#define rep(a,b) for(int i=a;i<b;i++)
#define updiv(a,b) (ceil)((a)*(1.0)/(b))
typedef long long int ll;
typedef unsigned long long int ull;
#define M 1000000007
using namespace std;
int main()
{
    fast
ll n;int k;
cin>>n>>k;
int h[n+1];
for(ll i=1;i<=n;i++)
{
    cin>>h[i];
}
ll dp[n+1];
dp[1]=0;
dp[2]=abs(h[2]-h[1]);
for(ll i=3;i<=n;i++)
{
  dp[i]=LLONG_MAX;
  for(ll m=1;m<=k;m++)
  {
     if((i-m)>=1)
        dp[i]=min(dp[i],(dp[i-m]+abs(h[i]-h[i-m])));
    }
//dp[i]=min((dp[i-1]+abs(h[i]-h[i-1])),(dp[i-2]+abs(h[i]-h[i-2])));
} cout<<dp[n]<<endl;
return 0;
}








Measured memory_bytes: 1408
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define looplt(i,x) for(i=0; i<x; ++i)
#define bsrch(v,x) binary_search(v.begin(), v.end(), x)
#define vecl vector <long long int>
#define pb(x) push_back(x)
const long long int MAX_INT =  10e+10;

typedef long long int ll;

void pvec(vector <ll> &inp)
{
    ll n;
    looplt(n, inp.size()) cout << inp[n] << " ";
    cout << endl;
}

void parr(ll inp[], ll size)
{
    ll n;
    looplt(n, size) cout << inp[n] << " ";
    cout << endl;

}

ll pw(ll a, ll b)
{
    if(b == 0)
        return (1);
    
    ll ans = 1;
    for(ll i=0; i<b; ++i) 
        ans *= a;

    return (ans);
}

bool arrsearch(ll arr[], ll size, ll val)
{
    for(ll i=0; i<size; ++i){
        if(arr[i] == val)
            return true;
    }
    return false;
}

int main()
{   

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    ll t=1, n, i, j, k, x;
    //cin >> t;
    looplt(i, t){
        double d, ti, s;
        cin >> d >> ti >> s;

        if(d/s <= ti)
            cout << "Yes\n";
        else 
            cout << "No\n";
    }
}   



Measured memory_bytes: 3716
import java.util.*;
 public class Main {
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);

      String S = sc.next();

      if(S.charAt(2) == S.charAt(3) && S.charAt(4) == S.charAt(5)){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }

   }
 }

Measured memory_bytes: 35692
from bisect import bisect_left, bisect_right; from collections import Counter, defaultdict, deque, OrderedDict; from copy import deepcopy; from fractions import gcd; from functools import lru_cache, reduce; from math import ceil, floor; from sys import stdin, setrecursionlimit
import heapq as hq; import itertools as its; import operator as op


# globals
inf = float('inf')
input = stdin.readline


def main():
    a, b, c = get_li()
    print(max(0, c - (a - b)))
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def gets(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input().strip()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().strip().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    setrecursionlimit(4100000)
    main()


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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

    int a,b; cin >> a >> b;

    if(a > b) swap(a,b);

    for (int i = 0;i < b;i++){
        cout << a;
    }
    cout << endl;

    return 0;

}

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)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

int main() {
    int n;
    cin >> n;
    set<int> s;
    rep(i,n){
        int a; cin >> a;
        s.insert(a);
    }

    int ans = s.size();

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



Measured memory_bytes: 7756
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <forward_list>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const ll MOD = 1E+09 + 7;
const ll INF = 1E18;
const int MAX_N = 100;
const ll MAX_W = 1E+05;

int N;
ll W;
ll dp[MAX_N][MAX_W + 1];

ll w[MAX_N], v[MAX_N];

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

    cin >> N >> W;

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

    for (int j = w[0]; j <= W; j++) {
        dp[0][j] = v[0];
    }

    for (int i = 1; i < N; i++) {
        for (int j = 0; j <= W; j++) {
            if (j >= w[i]) {
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i]);
            } else {
                dp[i][j] = dp[i - 1][j];
            }
        }
    }

    cout << dp[N - 1][W] << "\n";

    return 0;
}

Measured memory_bytes: 81656
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int n;
	while(scanf("%d",&n),n){
		int mem[10010] = {0};
		for(int i = 0; i < n; i++)scanf("%d",&mem[i]);
		sort(mem,mem+n);
		long long int ans = 0;
		
		for(int i = 0; i < n; i++){
			long long int x = 0;
			 for(int j = 0; j < i; j++){
			 	x += mem[j];
			 }
			 ans += x;
		}
		
		printf("%lld\n",ans);
	}
	return 0;
}

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector < string > S(n);
	for (int i = 0; i < n; i++) {
		cin >> S[i];
	}

	vector < vector < int >>cnt(26, vector < int >(n));
	for (int i = 0; i < n; i++) {
		for (size_t j = 0; j < S[i].size(); j++) {
			cnt[S[i][j] - 'a'][i]++;
		}
	}

	int ans[26];
	for (int i = 0; i < 26; i++) {
		ans[i] = INT_MAX;
	}
	for (int i = 0; i < 26; i++) {
		for (int j = 0; j < n; j++) {
			ans[i] = min(ans[i], cnt[i][j]);
		}
	}
	for (int i = 0; i < 26; i++) {
		for (int j = 0; j < ans[i]; j++) {
			char s = 'a' + i;
			cout << s;
		}
	}

	cout << "\n";
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

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

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;

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

ll gcd(ll a, ll b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}
//最大公約数
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
//最小公倍数
ll box(double a)
{
	ll b = a;
	return b;
}
//切り捨て
ll fff(double a)
{
	ll b = a + 0.5;
	return b;
}
//四捨五入
ll sum(ll n) {
	return (1 + n) * n / 2;
}
//1から整数nまでの合計を出す
bool prime(ll a)//素数判定、primeならtrue,違うならfalse
{
	if (a < 2) return false;
	else if (a == 2) return true;
	else if (a % 2 == 0) return false;
	double m = sqrt(a);
	for (int i = 3; i <= m; i += 2)
	{
		if (a % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}
//素数判定

ll modpow(ll a, ll n, ll mod) {
	ll hi = 1;
	while (n > 0) {
		if (n & 1) hi = hi * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return hi;
}
//いろいろやります（ただの前座）
ll mg(ll a, ll mod) {
	return modpow(a, mod - 2, mod);
}
//割り算の%INF対策で逆元を出します

//暇ですね(*'▽')

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

int main() {
	ll x, y; cin >> x >> y;
	ll n, m;
	ll ans = 1;
	ll cnt = 1;
	if ((x + y) % 3 != 0) cout << 0 << endl;
	else {
		m = (x * 2 - y) / 3;
		n = x - 2 * m;
		cnt = n + m;
		if (n < 0 || m < 0) {
			cout << 0 << endl;
		}
		else {
			for (int i = 1; i <= n; i++) {//Nならいけないかな
				ans *= cnt;
				ans %= 1000000007;
				ans *= mg(i, 1000000007);
				ans %= 1000000007;
				cnt--;
			}
			cout << ans << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 3696
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
ans=0
for i in range(N):
    A=list(map(int,input().split()))
    x=C
    for j in range(M):
        x+=A[j]*B[j]
    if x>0:
        ans+=1
print(ans)


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

#define Q int t; scanf("%d", &t); for(int q=1; q<=t; q++)
typedef long long int lli;
typedef pair<lli, lli> pi;

bool cmp(pi a, pi b)
{
    return a.second < b.second;
}

int main()
{
    int n;
    cin >> n;
    pi ar[n];

    for(auto &x: ar)cin >> x.first >> x.second;

    sort(ar, ar+n, cmp);

    lli k = 0;
    for(auto x: ar){
        k += x.first;
        if(k > x.second){
            printf("No\n");
            return 0;
        }
    }

    printf("Yes\n");
    return 0;
}


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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define ALL(a) a.begin(),a.end()
#define INIT(a,b) memset(a,b,sizeof(a))
using lint = long long int;

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

    vector<int> X(N), Y(N);
    for_(i,0,N) cin >> X[i] >> Y[i];

    two_sat ts(N);
    for_(i,0,N) for_(j,i+1,N) {
        if (abs(X[i] - X[j]) < D) ts.add_clause(i, false, j, false);
        if (abs(X[i] - Y[j]) < D) ts.add_clause(i, false, j, true);
        if (abs(Y[i] - X[j]) < D) ts.add_clause(i, true, j, false);
        if (abs(Y[i] - Y[j]) < D) ts.add_clause(i, true, j, true);
    }

    if (!ts.satisfiable()) {
        puts("No");
        return 0;
    }

    puts("Yes");
    auto ans = ts.answer();
    for_(i,0,N) cout << (ans[i] ? X[i] : Y[i]) << endl;
}

Measured memory_bytes: 3688
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

signed main(){
    string a,b,c; cin >> a >> b >> c;
    cout << a[0] << b[0] << c[0] << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define Int int32_t
#define all(c) c.begin(), c.end()
#define FAST ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define pii pair< int , int >
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define bitcnt(n) __builtin_popcountll(n)
#define setpre(n) cout << fixed << setprecision(n)
#define tr(c) for(auto x : c )cout << x << " ";
#define ol(c , s , e ) for(int pos=s; pos<e ; pos++) cout << c[pos] << " ";
#define PI acos(-1l)
const int M = 1000000007;
const int N=3e5+5;
const int INF = 2e18+5;
//#define rohit
#ifdef rohit
template<typename... T >
void bug(T... __VA_ARGS__) {
    ((cerr << __VA_ARGS__ << " ") , ...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", bug(__VA_ARGS__) , cerr << endl;
#endif

void solve(){
    string s;
    cin>> s;
    cout << s[0] << s[1] << s[2];
}

signed main(){
    FAST;
    //TODO: check test cases.
    int tc=1;
//    cin >> tc;
    for(int t = 1 ; t <= tc ; t++){
        solve();
    }
}
/* Extra Cares
 * 1)In graphs or dp problems sometimes long long creates MLE.
 * 2)Check whether int to long long typecasting is commented or not?
 * 3)Check overflows.
*/



Measured memory_bytes: 3588
N,K=list(map(int,input().split()))
s=[0]*N
src=list(map(int,input().split()))
x=0
y=0
z=-1
ind=1
for i in range(K):
  q=src[ind-1]
  s[ind-1]+=1
  if s[ind-1]==1:
    x+=1
    ind=q
  elif s[ind-1]==2:
    y+=1
    ind=q
  elif s[ind-1]==3:
    z+=1
    break
if z==-1 and y==0:
  print(ind)
  exit()
elif z==-1 and y!=0:
  print(ind)
  exit()
else:
  p=x-y
  K-=p
  K%=y
  if K==0:
    print(ind)
    exit()
  for k in range(K):
    q=src[ind-1]
    ind=q
  print(q)

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

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

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

    int s[2], t[2];
    cin >> s[0] >> s[1];
    cin >> t[0] >> t[1];

    string ans;

    for (int i = s[0]; i < t[0]; i++) {
        ans += 'R';
    }
    for (int i = s[1]; i < t[1]; i++) {
        ans += 'U';
    }
    for (int i = t[0]; i > s[0]; i--) {
        ans += 'L';
    }
    for (int i = t[1]; i > s[1]; i--) {
        ans += 'D';
    }

    ans += 'D';
    for (int i = s[0]; i < t[0] + 1; i++) {
        ans += 'R';
    }
    for (int i = s[1] - 1; i < t[1]; i++) {
        ans += 'U';
    }
    ans += 'L';
    ans += 'U';
    for (int i = t[0]; i > s[0] - 1; i--) {
        ans += 'L';
    }
    for (int i = t[1] + 1; i > s[1]; i--) {
        ans += 'D';
    }
    ans += 'R';

    cout << ans << endl;
}

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 M = sc.nextInt();

    if (N == 1) {
      System.out.println(M);
      return;
    }
    int maxDiv = 1;
    for (int i = M/2; i >= 2; i--) {
      if (M % i == 0) {
        if (N <= M/i) {
          maxDiv = i;
          break;
        }
      }
    }
    System.out.println(maxDiv);
  }
}

Measured memory_bytes: 24020
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S,T;cin>>S>>T;
  long ans=LONG_MAX;
  for(long i=0;i<S.length()-T.length()+1;i++){
    long c=0;
    for(long j=0;j<T.length();j++)if(S[i+j]!=T[j])c++;
    ans=min(ans,c);
    
    
  }
  cout<<ans;
}

/*





*/

Measured memory_bytes: 3628
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int, a: "List[int]", b: "List[int]", c: "List[int]", Q: int, K: int, x: "List[int]", y: "List[int]"):
    """graph.input.linkedlist_with_weight
        input: u[]:start, v[]:end, w[]:weight
        output:g[][]
    """
    INF = 1<<48
    g = [[] for i in range(N+1)]
    for i in range(N-1):
        g[a[i]].append([b[i], c[i]])
        g[b[i]].append([a[i], c[i]])

    from heapq import heapify, heappop, heappush
    hq = []
    heapify(hq)
    # start
    s = K
    colors = ['W'] * (N+1)
    d = [INF] * (N+1)
    d[s] = 0

    heappush(hq, [s, s])
    colors[s] = 'G'

    while hq:
        f = hq.pop()
        u = f[1]
        colors[u]= 'B'
        
        if d[u] < -f[0]:
            continue

        for adj_i in g[u]:
            v = adj_i[0]
            if colors[v] == 'B':
                continue
            if d[v] > d[u] + adj_i[1]:
                d[v] = d[u] + adj_i[1]
                heappush(hq, [-d[v], v])
                colors[v] = 'G'

    for i in range(Q):
        print(d[x[i]]+d[y[i]])

    # print(d)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    c = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    Q = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int()] * (Q)  # type: "List[int]"
    y = [int()] * (Q)  # type: "List[int]"
    for i in range(Q):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, a, b, c, Q, K, x, y)

if __name__ == '__main__':
    main()


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

int main() {
  string S;
  cin >> S;
  for (int i = 0; i < S.size(); i++) {
    if (i % 2 == 0) {
      if (S.at(i) != 'R' && S.at(i) != 'U' && S.at(i) != 'D') return cout << "No" << "\n", 0;
    } else {
      if (S.at(i) != 'L' && S.at(i) != 'U' && S.at(i) != 'D') return cout << "No" << "\n", 0;
    }
  }
  cout << "Yes" << "\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
 long long int a;
  cin >> a;
 long long int b = 100;
  int i = 0;
  while(a>b){
    b += b/100;
    i++;
  }
  cout << i << endl;
  return 0;
}


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

int main() {

  int N, t, c;
  cin >> N;
  t = N, c = 0;
  
  while (t > 0) c += t%10, t /= 10;
  if (N%c == 0) cout << "Yes";
  else cout << "No";
  
}

Measured memory_bytes: 256
#define ENABLE_DEBUG 1
// Kana's kitchen {{{
#include<bits/stdc++.h>
#define ALL(v) std::begin(v), std::end(v)
#define REP(i, k) for (decltype(k) i = 0; i < k; i++)
#define LOOP(k) REP (ngtkana_is_a_genius, k)

using i32 = std::int_least32_t;
using i64 = std::int_least64_t;
using u32 = std::uint_least32_t;
using u64 = std::uint_least64_t;
using usize = std::size_t;

template <class T, class U> using pair = std::pair<U, T>;
template <class T> using diag_pair = std::pair<T, T>;
template <class... Args> using tuple = std::tuple<Args...>;
template <class T> using vec = std::vector<T>;
template <class T> using numr = std::numeric_limits<T>;

#ifdef NGTKANA
#include<debug.hpp>
#else
#define DEBUG(...)(void)0
#endif
/*}}}*/

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15) << std::fixed;

    u32 n; std::cin >> n;
    vec<u32> a(n);
    for (u32& x: a) std::cin >> x;
    DEBUG(n, a);

    std::map<u32, u32> map;
    for (u32 x: a) map[x]++;
    u32 lim = 1'000'001;
    vec<u32> cnt(lim);
    for (auto[x, m]: map){
        for (usize i=x; i<lim; i+=x) cnt.at(i) += m;
    }

    u32 ans = 0;
    for (u32 i=0; i<n; i++) {
        if (cnt.at(a.at(i))==1) ans++;
    }
    std::cout << ans << '\n';
}



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

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

		if(a == b)
		{
		cout << "a == b"<< endl;
		}else{
			if(a > b)
			{
			cout << "a > b"<< endl;
			}else{
			cout << "a < b"<< endl;
			}
		}

}


Measured memory_bytes: 3076
def f():
  n = int(input())
  A = list(map(int, input().split()))
  S = list(map(int, list(input())))
  basis = []
  for i in range(n-1, -1, -1):
    a, s = A[i], S[i]
    l = len(basis)
    for b in basis:
      a = min(a, a^b)
    if a:
      basis.append(a)
    if s and len(basis) != l:
      print(1)
      return
  print(0)

t = int(input())
for _ in range(t):
  f()

Measured memory_bytes: 9116
n = int(raw_input()) 
c1 = map(int, raw_input().split())
c2 = map(int, raw_input().split())

c=[]
c.append(c1)
c.append(c2)

maxcandi=0

for i in range(len(c1)):
   w=0
   for j in range(i+1):
      w=w+c[0][j]
   #print w
   for j in range(i,len(c1)):
      w=w+c[1][j]
   #print w,maxcandi
   if (maxcandi<w) :maxcandi=w

print maxcandi



Measured memory_bytes: 2568
function p(d) {
  return (1 + d) * d / 2 / d
}

function main(input) {
  const inputs =input.split('\n')
  const [N, K] = inputs[0].split(' ').map(Number)
  const P = inputs[1].split(' ').map(Number)

  let accSum = []
  for(let i = 0 ; i < N; i++) {
    if (i === 0) {
      accSum[i] = p(P[i])
    } else {
      accSum[i] = p(P[i]) + accSum[i-1]
    }
  }

  let max = 0
  for (let i = K - 1; i < N; i++) {
    if (i === K - 1) {
      max = max < accSum[i] ? accSum[i] : max
    } else {
      const s = accSum[i] - accSum[i-K]
      max = max < s ? s : max
    }
  }
  console.log(max)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim())


Measured memory_bytes: 54232
import sys
a,b=(int(x) for x in input().split())
b//=1000
for i in range(a+1):
    for j in range(a-i+1):
        if 10*i+5*j+(a-i-j)==b:
            print(str(i)+" "+str(j)+" "+str(a-i-j))
            sys.exit()
print("-1 -1 -1")

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

int main(){
    string s;
    cin >> s;
    bool even=false, same=false;
    if(s.size()%2==0){even = true;}
    if(s[0]==s[s.size()-1]){same = true;}
    if(even^same){cout << "Second" << endl;}
    else{cout << "First" << endl;}

    return 0;

}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define P pair<ll, ll>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define pp pair<ll, pair<ll, ll>> 
#define fi first
#define se second

void print(Vl vec){
    rep(i, 0, sz(vec)){
        if(i) cout << " ";
        cout << vec[i];
    }
    coel;
}

////////////////////////////////////////////////////////

ll GCD(ll a, ll b){
    //便宜上
    if(a == 0) return b;
    if(b == 0) return a;
    //
    while(1){
        if(a < b) swap(a, b);
        if(!b) break;
        a %= b;
    }
    return a;
}

int main() {
    ll n; cin >> n;
    Vl a(n+1);
    Rep(i, 1, n) cin >> a[i];
    Vl l(n+2), r(n+2);
    // l(i):iまでの最大公約数
    // r(i):i~の最大公約数
    l[0] = 0; r[n+1] = 0;
    Rep(i, 1, n){
        l[i] = GCD(a[i], l[i-1]);
    }
    for(int i = n; i >= 1; i--){
        r[i] = GCD(a[i], r[i+1]);
    }
    ll ans = 1;
    Rep(i, 1, n){
        chmax(ans, GCD(l[i-1], r[i+1]));
    }
    co(ans);

    return 0;
}


Measured memory_bytes: 2560
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
#include <iomanip>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 2;
const int MOD = 1000000007;
typedef vector<ll> vl;
typedef vector<vl> vvl;

int main() {
	ll x;
	cin >> x;
	ll ans = x / 11 * 2;
	if (x % 11 == 0) {

	}
	else if (x % 11 <= 6) {
		ans++;
	}
	else {
		ans++;
		ans++;
	}

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

Measured memory_bytes: 256
/* C++14 (Clang 3.8.0) for AtCoder */

#include <iostream>
#include <vector>
#include <string>
// #include <cmath>
// #include <math.h>
// #include <algorithm>
// #include "./Debug.h"

namespace AtCoder {
	using Input = std::vector<std::string>;
	using Num = std::vector<int>;

	Input input(void) {
		Input result;
		{
			std::string buf = "", row = "";
			std::getline(std::cin, buf);
			for (unsigned int i = 0; i < buf.size(); i++) {
				if (' ' == buf[i]) {
					result.push_back(row);
					row = "";
				} else {
					row += buf[i];
				}
			}
			result.push_back(row);
		}
		return result;
	}

	Num replaceToInteger(Input original = { "" }) {
		Num result;
		for (unsigned int i = 0; i < original.size(); i++) {
			result.push_back(atoi(original[i].c_str()));
		}
		return result;
	}
}

int main(void) {

	AtCoder::Num s = AtCoder::replaceToInteger(AtCoder::input());

	const int n = s[0];

	int ans = 3 * n * n;

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

	return 0;
}


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

int main() {
  ll n,k;
  cin >> n >> k;
  ll cnt=0;
  rep(i,n){
    int h;
    cin >> h;
    if(h >= k){
      cnt++;
    }
  }
  
  cout << cnt << endl;
  
  return(0);
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
// atoi : atoi(変数名.c_str())
// to_string(数値)
// %0桁数d とすると表示桁数が「桁数」に満たない場合に0埋めされる
// find(): int i = 変数名.find(“文字列”) 何番目にあるかを得る
// cout << (条件 ? "Yes" : "No") << endl;
// printf("%02d:%02d:%02d",hour,minute,second);
// 降順 sort(a.begin(),a.end(),greater<int>());
// bitset<ビット数> 変数名;  // すべてのビットが0の状態で初期化される
// bitset<ビット数> 変数名("ビット列");  // 指定したビット列で初期化される
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define rep(i,n) for(int i=0; i<(int)(n);i++)

int main(){
  int n;
  cin >> n;
  rep(i,15){
    rep(j,26){
      if(7*i+4*j == n){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
 double r,menseki,syuui;

 scanf("%lf",&r);

 menseki = r*r*3.141592653589;
 syuui   = 2*r*3.141592653589;

 printf("%f %f\n",menseki,syuui);

 return 0;

}

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

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e8;

using namespace std;


//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用


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

	int a, b, c, d;
	cin >> a >> b >> c >> d;

	cout << min(a, b) + min(c, d) << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	string n;
	cin >> n;
	
	char a, b, c, d;
	a = n[0];
	b = n[1];
	c = n[2];
	d = n[3];
	
	if(a == b && b == c){
		cout << "Yes" << endl;
	}else if(b == c && c == d){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 384
c=[4,1,4,1,2,1,2,1]
while True:
    try:
        p=map(int,raw_input().split())
    except EOFError:
        break
    m,ans=100000000,"9"*10
    for i in range(len(c)):
        t=c[i:]+c[:i]
        s=sum([p[i]-t[i] for i in range(len(c)) if p[i]>t[i]])
        if (s<m) or (s==m and int(ans)>int("".join(map(str,t)))):
            m=s
            ans="".join(map(str,t))
    print " ".join(ans)

Measured memory_bytes: 4256