akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n =  Integer.parseInt(sc.next());
		String s[] =  sc.next().split("");
		
		int ans = 1;
		String a = s[0];
		for (int i = 1 ; i < n ; i++) {
			if(a.equals(s[i])) {
				continue;
			}
			
			ans++;
			a = s[i];
		}
				
		System.out.println(ans);
	}
}


Measured memory_bytes: 32316
#include<bits/stdc++.h>
#define ll long long int
#define IOS cin.tie(NULL);cout.tie(NULL)
#define F first
#define S second
#define pb push_back
//odd day , even month
using namespace std;
ll ans[3001][3001];
ll fun(ll n,ll i, ll j,ll arr[]){
	if(n==1){
		return arr[i];
	}
	if(ans[i][j]!=0){
		return ans[i][j]-1;
	}
	else if(j-i==1){
		ans[i][j]=abs(arr[i]-arr[j])+1;
		return ans[i][j]-1;
	}else {
		ans[i][j]=max(arr[i]-fun(n,i+1,j,arr),arr[j]-fun(n,i,j-1,arr))+1;
		return ans[i][j]-1;
	}
}
int main() {
	IOS;
	ll n,a=0,b=0,c=0,x;
	cin>>n;
	ll arr[n+1];
	for(int i=1; i<=n; i++) {
		cin>>arr[i];
	}
	cout<<fun(n,1,n,arr);

}			

Measured memory_bytes: 70400
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define FORD(i,j,k) for(i=j;i>=k;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 1000000000
#define ninf -1000000000
#define endl '\n' 
#define she_told_me_dont_worry ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// Use cout.flush() for interactive problems.
// Use this for increased stack size: g++ -o a.exe -Wl,--stack=256000000 -O2 source.cpp
inline long long  MAX2(long long  a, long long int b){return (a)>(b)?(a):(b);}
inline long long  MAX3(long long  a, long long  b,long long  c){return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long  MIN2(long long  a, long long  b){return (a)<(b)?(a):(b);}
inline long long  MIN3(long long  a, long long b,long long c){return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c));}
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;
int main()
{
    she_told_me_dont_worry
    ll n;
    cin>>n;
    ll ans = n*(n-1)/2;
    cout<<ans<<endl;
    cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
}

Measured memory_bytes: 256
#n ninzu
#k HP
#q seikai no kazu

n,k,q=map(int,input().split())
r={}

for _ in range(q):
  temp=int(input())
  if temp in r:
    r[temp]+=1
  else:
    r[temp]=1

for i in range(1,n+1):
  if i not in r:
    r[i]=0
  if k-q+r[i]>0:
    print("Yes")
  else:
    print("No")
  
#print(r)


  

Measured memory_bytes: 62680
#include <iostream>

int main()
{
    std::string s, t, u;
    int a = 0, b = 0;
    std::cin >> s >> t;
    std::cin >> a >> b;
    std::cin >> u;
    if (u == s) {
        a--;
    }
    else if (u == t) {
        b--;
    }
    std::cout << a << " " << b << std::endl;
}


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>
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)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;

int cnt[600][600];
int main(){
   int n,m,q;
   cin>>n>>m>>q;
   rep(i,m){
       int l,r;
       cin>>l>>r;
       cnt[l][r]++;
   }
   rep(i,n+1)rep(j,n+1)cnt[i][j+1]+=cnt[i][j];
   rep(i,n+1)rep(j,n+1)cnt[i+1][j]+=cnt[i][j];
   while(q--){
       int x,y;
       cin>>x>>y;
       cout<<cnt[y][y]-cnt[x-1][y]<<endl;
   }
   return 0;
}


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

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool b = true;
  if(n % 2 == 0){
    for(int i = 0; i < n/2; i++){
      if(s[i] != s[i + n/2]) b = false;
    }
  }
  else b = false;
  if(b) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 888
from collections import deque
from heapq import heappush, heappop
h, w = map(int, input().split())
grid = [input() for _ in range(h)]

def solve(grid, h, w):
    if h == 0 or w == 0:
        return 0
    color = grid[0][0]
    cnt = 0
    if color == '#':
        cnt += 1
    dist = [[-1] * w for _ in range(h)]
    dist[0][0] = cnt
    q = []
    q.append((0, 0))
    current_color_cluster = [(0, 0)]
    while q and dist[h - 1][w - 1] == -1:
        new_q = []
        for i, j in q:
            for ii, jj in ((i + 1, j), (i, j + 1)):
                if 0 <= ii < h and 0 <= jj < w and dist[ii][jj] == -1 and grid[ii][jj] == color:
                    dist[ii][jj] = cnt
                    new_q.append((ii, jj))
        if new_q:
            current_color_cluster.extend(new_q)
            q = new_q
        elif dist[h - 1][w - 1] == -1:
            if color == '.':
                cnt += 1
            color = '#' if color == '.' else '.'
            q = current_color_cluster
            current_color_cluster = []
    return dist[h - 1][w - 1]

print(solve(grid, h, w))



Measured memory_bytes: 40176
namespace global
  open System
  open System.Collections
  open System.Collections.Generic

  [<AutoOpen>]
  module Operators =
    let read f = Console.ReadLine().Split([|' '|]) |> Array.map f

  module Program =
    [<EntryPoint>]
    let main _ =
      match (read int, read int) with
      | [|N|], [|A|] ->
        printfn "%s" (if (N % 500) <= A then "Yes" else "No")
      | _ -> ()
      0


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

int main() {
    string s;
    cin>>s;
    int n = s.size(),N=0,E=0,W=0,S=0;
    for(int i=0; i<n; i++) {
        if(s[i] == 'N') N++;
        if(s[i] == 'E') E++;
        if(s[i] == 'W') W++;
        if(s[i] == 'S') S++;
    }
    if(N==0 && S==0 && E>0 && W>0) {
        cout<<"Yes";
    }
    else if(E==0 && W==0 && N>0 && S>0) {
        cout<<"Yes";
    }
    else if(N>0 && E>0 && W>0 && S>0) {
        cout<<"Yes";
    }
    else cout<<"No";
}

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

#define rep(i,n) for(int i = 0; i < n; i++)
#define Rep(i,n) for(int i = 1; i <= n; i++)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
template<class T> using V = vector<T>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
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(){
    int h, w, k;
    cin >> h >> w >> k;
    V<string> s(h);
    rep(i,h) cin >> s[i];
    V<V<int>> ans(h,V<int>(w));
    int idx = 0;
    int cnt = 0;
    rep(i,h) {
        int found = 0;
        rep(j,w) {
            if(s[i][j] == '#') found++;
        }
        if(found > 0) {
            int f = 0;
            cnt++;
            rep(j,w) {
                for(int k = idx; k <= i; k++) ans[k][j] = cnt;
                if(s[i][j] == '#') {
                    f++;
                    if(found != f && j < w-1) cnt++;
                }
            }
            idx = i+1;
        }
    }
    if(ans[h-1][0] == 0) {
        rep(j,w) {
            for(int i = idx; i < h; i++) ans[i][j] = ans[i-1][j];
        }
    }
    rep(i,h) {
        rep(j,w) cout << ans[i][j] << " ";
        cout << endl;
    }
}

Measured memory_bytes: 4148
#include <bits/stdc++.h>
#define repu(i,x,y) for (int i=x; i<=y; ++i)
using namespace std;
typedef long long LL;
const int p=998244353;
int n,m,cnt,f[10010][10010],fac[10010],inv[10010],ans;
char a[10100],b[10100];
int c(int n,int m) { return LL(fac[n])*inv[m]%p*inv[n-m]%p; }
int main() {
    scanf("%s%s",a+1,b+1),n=strlen(a+1);
    repu(i,1,n) if (a[i]=='1') cnt+=b[i]=='0',++m;
    fac[0]=fac[1]=inv[0]=inv[1]=1; repu(i,2,m) inv[i]=LL(p-p/i)*inv[p%i]%p;
    repu(i,2,m) fac[i]=LL(fac[i-1])*i%p,inv[i]=LL(inv[i-1])*inv[i]%p;
    f[0][cnt]=1;
    repu(i,0,m) {
        repu(j,1,m-i) if (f[i][j]) { f[i+1][j]=(f[i+1][j]+LL(m-i-j)*j*f[i][j])%p; f[i+1][j-1]=(f[i+1][j-1]+LL(j)*j*f[i][j])%p; }
        ans=(ans+LL(f[i][0])*c(m,i)%p*fac[m-i]%p*fac[m-i])%p;
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 389632
#include <bits/stdc++.h>
using namespace std;
#define fo(i,n)         for(int i=0;i<n;i++)
#define fod(i,n)        for(int i=n-1;i>=0;i--)
#define For(i,a,b)      for(int i=a;i<=b;i++)
#define all(x)          x.begin(),x.end()
#define SET(x)          memset(x,-1,sizeof(x))
#define clr(x)          memset(x,0,sizeof(x))
#define pie             3.1415926535897932384626
#define pb(i)           push_back(i)
#define mp              make_pair
#define sf(n)           scanf("%d",&n)
#define sfll(n)         scanf("%lld",&n)
#define sf2(a,b)        scanf("%d %d",&a,&b)
#define sf3(a,b,c)      scanf("%d %d %d",&a,&b,&c)
#define pf(n)           printf("%d\n",n)
#define pfll(n)         printf("%lld\n",n)
#define pf2(a,b)        printf("%d %d\n",a,b)
#define pf3(a,b,c)      printf("%d %d %d\n",a,b,c)
#define vi              vector<int>
#define vs              vector<string>
#define pii             pair<int,int>
#define vpii            vector<pair<int,int>>
#define vvi             vector<vi>
#define ll              long long int
#define vll             vector<ll>
#define mod             1000000007
#define tc(t)           int t; sf(t); while(t--)
#define sfarr(a,n)      int a[n]; fo(i,n) sf(a[i])
int main(){
    float d,t,s;
    cin>>d>>t>>s;
    cout<<((d/s<=t)?"Yes":"No")<<endl;;
return 0;
}


Measured memory_bytes: 3716
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
 
const ll inf = 1e9 + 7;
const ll Mod = 998244353;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

int main(){
  int N; cin >> N;
  string S[N], T;
  for (int i = 0; i < N; i++) cin >> S[i];
  cin >> T;

  string now[N + 1] = {};
  for (int i = 0; i < N; i++){
    for (int j = 0; j < S[i].length(); j++){
      if (S[i][j] == '?') now[i] += 'a';
      else now[i] += S[i][j];
    }
  }
  now[N] = T;
  sort(now, now + N + 1);

  int M = 1;
  for (int i = 0; i < N + 1; i++){
    if (now[i] == T){
      M = i + 1;
    }
  }

  for (int i = 0; i < N; i++){
    now[i] = "";
    for (int j = 0; j < S[i].length(); j++){
      if (S[i][j] == '?') now[i] += 'z';
      else now[i] += S[i][j];
    }
  }
  now[N] = T;
  sort(now, now + N + 1);

  int m = 1;
  for (int i = 0; i < N + 1; i++){
    if (now[i] == T){
      m = i + 1; break;
    }
  }

  for (int i = m; i <= M; i++){
    cout << i;
    if (i == M) cout << endl;
    else cout << " ";
  }
  
  return 0;
}


Measured memory_bytes: 1664
n, q = map(int, raw_input().split())
parent = range(n)
def root(x):
    if x == parent[x]:
        return x
    return root(parent[x])
def unite(x, y):
    rx = root(x); ry = root(y)
    if rx < ry:
        parent[ry] = rx
    elif ry < rx:
        parent[rx] = ry
def same(x, y):
    print (root(x) == root(y))*1

for i in xrange(q):
    com, x, y = map(int, raw_input().split())
    [unite,same][com](x, y)

Measured memory_bytes: 6640
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int,int>
#define pint_int 2000000003
using namespace std;

class BFS {
public:
    vector<vector<int>> Graph_as_list;

    void emplace_back(vector<int> list) {
        Graph_as_list.push_back(list);
    }
    vector<int> Search(int u) {// search from node u
        vector<int> dist_from_u(Graph_as_list.size(), pint_int);
        queue<int> que;

        que.push(u);
        dist_from_u[u] = 0;
        while (!que.empty()) {
            int u = que.front(); que.pop();
            for (int next_node : Graph_as_list[u]) {
                if (dist_from_u[u] + 1 < dist_from_u[next_node]) {
                    dist_from_u[next_node] = dist_from_u[u] + 1;
                    que.push(next_node);
                }
            }
        }
        for (int& elem : dist_from_u) {
            if (elem == pint_int) elem = -1;
        }
        return dist_from_u;
    }
};

int main() {
    int n; cin >> n;
    BFS bfs;
    for (int i = 0; i < n; i++) {
        int u, k; cin >> u >> k; u--;
        vi temp;
        for (int j = 0; j < k; j++) {
            int v; cin >> v; v--;
            temp.push_back(v);
        }
        bfs.emplace_back(temp);
    }
    vi ans = bfs.Search(0);
    for (int i = 0; i < ans.size(); i++) {
        cout << i + 1 << " " << ans[i] << endl;
    }

}



Measured memory_bytes: 3176
// https://atcoder.jp/contests/yahoo-procon2019-qual/tasks/yahoo_procon2019_qual_f
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn ctou(c: char) -> usize {
    match c {
        '0' => 0,
        '1' => 1,
        '2' => 2,
        _ => panic!("no"),
    }
}

const MOD: i64 = 998244353;

fn main() {
    input! {
        s: chars
    };

    let n = s.len();
    let mut dp = dvec![0; 2*n+1, 2*n+1];

    dp[0][0] = 1;
    let mut blue = 0;
    let mut red = 0;
    for i in 0..2*n {
        if i < n {
            blue += ctou(s[i]);
            red += 2-ctou(s[i]);
        }
        for j in 0..2*n+1 {
            let base = dp[i][j];
            if base == 0 {
                continue;
            }

            if j < blue {
                dp[i+1][j+1] += base;
                dp[i+1][j+1] %= MOD;
            }
            if (i-j) < red {
                dp[i+1][j] += base;
                dp[i+1][j] %= MOD;
            }
        }
    }

    println!("{}", dp[2*n][blue]);
}


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

int main() {
	// your code goes here
      long int a;
      scanf("%ld",&a);
	  long int temp=0;
	  temp=sqrt(a);
	  printf("%ld\n",temp*temp);
	return 0;
}


Measured memory_bytes: 256
#pragma comment(linker, "/stack:200000000")
                #pragma GCC optimize ("Ofast")
                #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
                #include <iostream>
                #include <iomanip>
                #include <sstream>
                #include <cstring>
                #include <vector>
                #include <deque>
                #include <queue>
                #include <set>
                #include <map>
                #include <valarray>
                #include <iterator>
                #include <functional>
                #include <limits>
                #include <algorithm>
                #include <numeric>
                #include <cmath>
                #include <cassert>
                #include <unordered_map>
                #include <unordered_set>
                #include <stack>
                using namespace std;
                #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
                 #define trace(x) cerr << #x << ": " << x << " " << endl;
             
                typedef int64_t ll;
             
                #define endl '\n'
                #define int ll
                ll mod=1e9+7;
                ll mod1=1e9+5;
                
                ll power(ll a,ll b)
                {
                    if(b==0) return 1;
                    else if(b%2==0)
                        return power((((a%mod)*(a%mod))%mod),b/2)%mod;
                    else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
                }
                bool check(string s,string s1)
                {
                    int j=0;
                    for(int i=0;i<s.length();++i)
                    {
                        if(j==3)
                            break;
                        if(s[i]==s1[j])
                        {
                            j++;
                        }
                    }
                    if(j==3)
                        return 1;
                    return 0;

                }
             int32_t main()
                {
                IOS
              
                
                int s;
                cin>>s;
                int p=s/100;
                s=s%100;
                
                    for(int j=0;j<=100;++j)
                        for(int k=0;k<=100;++k)
                            for(int l=0;l<=100;++l)
                                for(int m=0;m<=100;++m)
                                    for(int n=0;n<=100;++n)
                                    {
                                        int cos=j+2*k+3*l+4*m+5*n;
                                        if(cos==s and j+k+l+m+n<=p)
                                        {
                                            cout<<1;
                                            return 0;
                                        }

                                        if(cos>s or j+k+l+m+n>p)
                                            break;
                                    }
                                    cout<<0;
                
            }

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <map> 
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()

int const N = 200001; 
int n, v[N];
map<int, int> f;

int main(){
    scanf("%d", &n);
    for(int i = 1; i<=n; ++i){
        scanf("%d", v+i);
        ++f[i-v[i]];
    }
    ll an = 0;
    for(int i = 1; i<=n; ++i){
       int cur = i+v[i];
       an += f[cur];
    }
    printf("%lld\n", an);
}

Measured memory_bytes: 21060
#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 _GLIBCXX_DEBUG
#define V vector<int>
using namespace std;
using ll = long long;

int main(){
    string s; cin>>s;
    set<int> a;
    rep(i,0,s.size()){
        a.insert(s[i]);
    }
    if(a.size()==s.size()) cout<<"yes"<<"\n";
    else cout<<"no"<<"\n";
}


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

int main(){
  int N;
  int dmin=100;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    int A, d = 0;
  	cin >> A;
    
    while (A % 2 == 0) {
    	A/=2;
      	d++;
    }
    dmin = min (d, dmin);
  }
  cout << dmin << endl;
  
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

class Main {
    static Scanner scanner = new Scanner();

    public static void main(String[]$) {
        long n = scanner.nextInt();
        System.out.println((n - 1) * n / 2);
    }

    static class Scanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}

Measured memory_bytes: 22996
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>

using namespace std;
typedef long long ll;

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

int main() {

    ll N,M,C;
    cin >> N >> M >> C;
    ll B[M];
    rep(i,M) cin >> B[i];
    ll out = 0;
    rep(i,N){
        ll sum = 0;
        ll A = 0;
        rep(j,M){
            cin >> A;
            sum += A*B[j];
        }
        if(sum+C>0) out++;
    }
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 888
def calcAngle(h,m): 
		if (h == 12): 
			h = 0
		if (m == 60): 
			m = 0
		hour_angle = 0.500000000 * (h * 60 + m) 
		minute_angle = 6 * m 
		angle = abs(hour_angle - minute_angle) 
		angle = min(360 - angle, angle) 
		return angle 
import math as mt 
def cal_cos(n): 
    accuracy = 0.0000000001
    x1, denominator, cosx, cosval = 0, 0, 0, 0
    n = n * (mt.pi / 180.000000000) 
    x1 = 1
    cosx = x1 
    cosval = mt.cos(n) 
    i = 1
    while (accuracy <= abs(cosval - cosx)): 
        denominator = 2 * i * (2 * i - 1) 
        x1 = -x1 * n * n / denominator 
        cosx = cosx + x1 
        i = i + 1
    return cosx 
def third_side(a, b, c): 
    angle = cal_cos(c) 
    return mt.sqrt((a * a) + (b * b) - 2 * a * b * angle) 
a,b,h,m=map(int, input().split()) 
ang=calcAngle(h,m)
ts=third_side(a,b,ang)
print(ts)

Measured memory_bytes: 9520
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<deque>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef pair<ll,ll> pll;
const int INF=1e9;
const ll MOD=1e9+7;

ll gcd(ll x,ll y){
    if(y==0) return 0;
    return gcd(y,x%y);
}

int dis2(int x1,int y1,int x2,int y2){
    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}

int main(){
    string s;cin>>s;
    if(s.size()>=4&&s.substr(0,4)=="YAKI"){
        cout<<"Yes"<<endl;
    }else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define EPS      (double)1e-9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type_a,class Type_b> bool chmax(Type_a &a,const Type_b &b){if(a<b){a=b;return true;}return false;}
template<class Type_a,class Type_b> bool chmin(Type_a &a,const Type_b &b){if(a>b){a=b;return true;}return false;}
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

/*二項係数(mod付き)*/
struct Combination{
	const int max=51e4;//適宜変更.
	const int mod=1e9+7;
	vector<long long> fact,inv,finv;//階乗,逆元,逆元の階乗.
	
	Combination():fact(max),inv(max),finv(max){
		fact[0]=fact[1]=1;
		inv[1]=1;
		finv[0]=finv[1]=1;
		for(int i=2;i<max;++i){
			fact[i]=fact[i-1]*i%MOD;
			inv[i]=mod-inv[mod%i]*(mod/i)%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	
	int nCk(int n,int k){
		if(n<k) return 0;
		if(n<0 or k<0) return 0;
		return fact[n]*(finv[k]*finv[n-k]%mod)%mod;
	}
	int big_nCk(int n,int k){
		long long res=1LL;
		REP(i,k) res=res*(n-i)%MOD;
		res=res*finv[k]%MOD;
		return res;
	}
};

template<class Type_k,class Type_p>
Type_p mod_pow(long long n,Type_k k,Type_p p){//n^k(mod p).
	if(k==0) return 1;
	long long res=mod_pow(n*n%p,k/2,p);
	if(k&1) res=res*n%p;
	return res;
}

int main(){
	int n,a,b;
	cin>>n>>a>>b;
	
	Combination com;
	
	llong ans=mod_pow(2LL,n,MOD)-1;
	ans-=(llong)com.big_nCk(n,a)+com.big_nCk(n,b);
	while(ans<0) ans+=MOD;
	
	cout<<ans%MOD<<endl;
}

Measured memory_bytes: 12160
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define F first
#define S second
typedef vector<pli> vpli;
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end() 
#define tests int t; cin>>t; while(t--)
#define take(a,b,c) for(b=0;b<c;b++) cin>>a[b];
#define INF 1e18
// https://codeforces.com/problemset/page/3?tags=1500-1800
map <int,stack<int> > m;
int main()
{	
  ll a,b,n;
  cin>>a>>b>>n;
  ll x =min(b-1,n);
  cout<<(ll)(a*x)/b;
}


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

ll N;
ll M;
ll mat[Max];
set<ll> A;
ll ret = 0;

void input() {
    cin >> N;
    ll temp;
    for(ll i=0;i<N;i++){
        cin >> temp;
        A.insert(temp);
    }
    A.insert(0);
}

void solve() {
    while(true){
        auto itr = A.end();
        ll big1 = *(--itr);
        ll big2 = *(--itr);
        if(big2 == 0){
            ret = big1;
            break;
        }
        // cout << big1 << " " << big2 << endl;
        ll r = big1 % big2;
        
        itr = A.end();
        A.erase(--itr);
        A.insert(r);
    }
}

int main(void){
    input();
    solve();
    cout << ret << endl;
}


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

int main() {
  string S; cin >> S;
  int N = S.size();
  int d[N];
  for (int i = 0; i < N; i++) d[i] = -1;
  for (int i = 0; i < N-1; i++) {
    if (S[i] == 'R' && S[i+1] == 'L') d[i] = d[i+1] = 0;
  }
  for (int i = 0; i < N; i++) {
    if (d[i] == 0) {
      if (S[i] == 'R') {
        for (int j = i-1; j >= 0 && d[j] == -1 && S[j] == 'R'; j--) d[j] = i-j;
      } else {
        for (int j = i+1; j < N && d[j] == -1 && S[j] == 'L'; j++) d[j] = j-i;
      }
    }
  }
  int c[N]; for (int i = 0; i < N; i++) c[i] = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == 'R') {
      if (d[i] % 2 == 0) c[i+d[i]]++;
      else c[i+d[i]+1]++;
    } else {
      if (d[i] % 2 == 0) c[i-d[i]]++;
      else c[i-d[i]-1]++;
    }
  }
  for (int i = 0; i < N; i++) {
    if (i) cout << " ";
    cout << c[i];
  }
  cout << endl;
}

Measured memory_bytes: 4524
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define sz(i) (int)(i.size())
#define x first
#define y second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = (int)1e5 + 10;

#define double long double
int n;
char d[N];
P pt[N];

double f(double till){
   double x[2], y[2];
   x[0] = 1e20;//min
   x[1] = -1e20;//max
   y[0] = 1e20;
   y[1] = -1e20;

   for (int i = 0; i < n; ++i)
   {
      double ptx = pt[i].x, pty = pt[i].y;
      if (d[i] == 'R'){
         ptx += till;
      }
      else if (d[i] == 'L'){
         ptx -= till;
      }
      else if (d[i] == 'U'){
         pty += till;
      }
      else{
         pty -= till;
      }
      smax(x[1], ptx);
      smin(x[0], ptx);
      smax(y[1], pty);
      smin(y[0], pty);
   }

   return (x[1] - x[0]) * (y[1] - y[0]);
}

double binary_search(double A, double B){
   double ans = 0;

   for (int i = 0; i < 300; ++i)
   {
      double m1 = (A * 2 + B) / 3.0;
      double m2 = (A + 2 * B) / 3.0;
      if (f(m1) > f(m2)){
         ans = m2;
         A = m1;
      }
      else{
         B = m2;
      }
   }

   return f(ans);
}

int32_t main(){_

   cout << fixed << setprecision(15);
   cin>>n;

   for (int i = 0; i < n; ++i)
   {
      cin>>pt[i].x>>pt[i].y>>d[i];
   }   

   cout<<binary_search(0, 1e10);

   return 0;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
#define int long long
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pair
#define PB push_back
#define PF push_front
#define FILL(a,b) memset(a,b,sizeof(a))
using namespace std;
V<int> v[100005];int n,mod=1e9+7,k;
int dfs(int p,int de,int fa){
	int re=1;
	int s=0;
	for(int i=0;i<v[p].size();i++){
		if(fa!=v[p][i]){
			if(de==1){
				re=re*(k-s-1)%mod*dfs(v[p][i],de+1,p)%mod;
			}else{
				re=re*(k-s-2)%mod*dfs(v[p][i],de+1,p)%mod;
			}
			s++;
		} 
	}
	RE re;
}
signed main(){
	ios::sync_with_stdio(0);
    cin.tie(0);
	int x,y;
	cin>>n>>k;
	FOR(i,2,n){
		cin>>x>>y;
		v[x].PB(y);v[y].PB(x);
	}
	cout<<k*dfs(1,1,-1)%mod;
	RE 0;
}




Measured memory_bytes: 13952
package main

import (
	"fmt"
	"math"
	"sort"
	"strings"
)

func main() {
	var n int
	fmt.Scan(&n)
	m := map[string][]int{}
	for i := 0; i < n; i++ {
		var s string
		fmt.Scan(&s)
		tmp_m := map[rune]int{}
		for _, r := range s {
			tmp_m[r]++
		}
		for k_, v := range tmp_m {
			k := string(k_)
			m[k] = append(m[k], v)
		}
	}
	ans := ""
	mk := make([]string, len(m))
	i := 0
	for k := range m {
		mk[i] = k
		i++
	}
	sort.Strings(mk)
	for _, k := range mk {
		if len(m[k]) == n {
			ans = ans + strings.Repeat(k, min(m[k]))
		}
	}
	fmt.Println(ans)
}
func min(nums []int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}


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

using namespace std;
using ll = long long;

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

	for (int i = 0; i < 5; ++i) { 
		for (int j = i + 1; j < 5; ++j) {
			if (abs(a[j] - a[i]) > k) {
				cout << ":(" << endl;
				return 0;
			}
		}
	}

	cout << "Yay!" << endl;

	return 0;
}


Measured memory_bytes: 256
import std.stdio;

void main() {
    int n, m, q;
    readf(" %s %s %s", &n, &m, &q);

    auto ans = new int[][](n, n);
    foreach (_; 0..m) {
        int l, r;
        readf(" %s %s", &l, &r);
        r--;
        l--;
        foreach (i; r..n)
            ans[l][i]++;
    }
    foreach_reverse (i; 0..n - 1)
        foreach (j; 0..n)
            ans[i][j] += ans[i + 1][j];

    foreach (_; 0..q) {
        int pi, qi;
        readf(" %s %s", &pi, &qi);
        pi--;
        qi--;
        ans[pi][qi].writeln;
    }
}


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

using namespace std;

int main() {
  int A, B, C, D, E, F;
  cin >> A >> B >> C >> D >> E >> F;

  double water = A * 100;
  double sugar = 0;

  for (int a = 0; a <= F; a += A * 100) {
    for (int b = 0; b <= F - a; b += B * 100) {
      for (int c = 0; c <= F - (a + b); c += C) {
        for (int d = 0; d <= F - (a + b + c); d += D) {
          if (a + b + c + d == 0) {
            continue;
          }
          if ((c + d > (a + b) / 100 * E)) {
            break;
          }

          if ((double)(c + d) / (a + b + c + d) > sugar / (water + sugar)) {
            water = a + b;
            sugar = c + d;
          }
        }
      }
    }
  }

  cout << sugar + water << " " << sugar << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
const int inf = 1001001001;

int main(){
  int n;
  cin >> n;
  vector<int> a(n), b(n), aa(n+1,0), bb(n+1,0);
  rep(i,n) {
    cin >> a[i];
    aa[a[i]]++;
  }
  rep(i,n) {
    cin >> b[i];
    bb[b[i]]++;
  }

  rep(i,n){
    if(bb[i+1]+aa[i+1] > n){
      cout << "No" << endl;
      return 0;
    }
  }


  cout << "Yes" << endl;
  rep(i,n){
    aa[i+1] += aa[i];
    bb[i+1] += bb[i];
  }
  
  int x = 0;
  rep(i,n){
    x = max(x,aa[i+1]-bb[i]);
  }
  rep(i,n){
    cout << b[(i-x+n)%n] << " ";
  }
  cout << endl;


}


Measured memory_bytes: 6408
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;
constexpr ll INF=1LL<<60;

int main()
{
  ll n;
  cin>>n;
  ll max_plus=-INF,max_minus=-INF,min_plus=INF,min_minus=INF;
  for (int i = 0; i < n; ++i) {
    pair<ll,ll> e;
    cin>>e.first>>e.second;
    max_plus=max(max_plus,e.first+e.second);
    min_plus=min(min_plus,e.first+e.second);
    max_minus=max(max_minus,e.first-e.second);
    min_minus=min(min_minus,e.first-e.second);
  }
  cout<<max(max_plus-min_plus,max_minus-min_minus)<<endl;

}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define mme(i,j) memset(i,j,sizeof(i))
#define maxs 2020202
#define ll long long
using namespace std;
char s[maxs];
vector<int>vec[44];

int main()
{
    while(~scanf("%s",s))
    {
        int a=-1,b=-1;
        int len=strlen(s);
        for(int i=0;i<len-1;i++){
            if(s[i]==s[i+1]){
                a=i+1;
                b=i+2;
                break;
            }
            if(i<len-2){
                if(s[i] == s[i+2]){
                    a = i+1;
                    b = i+3;
                    break;
                }
            }
        }
        printf("%d %d\n",a,b);
    }
    return 0;
}


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

int main()
{
    //freopen("in.txt", "r", stdin);
    //fast;
    int n,x;
    cin>>n;
    vector<int> v;
    for(int i = 0; i<n; i++) {
       cin>>x;
       if(x%2 == 0) v.push_back(x);
    }
    bool l = 1;
    for(int i = 0; i< v.size(); i++){
        if(v[i]% 3 == 0 || v[i]%5 == 0) continue;
        else {
            l = 0;
        }
    }
    if(l) cout<<"APPROVED"<<endl;
    else cout<<"DENIED"<<endl;

    return 0;
}




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

// --------------------------------------------------------------------------------
#define fastio	ios_base::sync_with_stio(false),cin.tie(NULL),cout.tie(NULL)
#define ll long long 
#define mset(arr,val) memset(arr,val,sizeof(arr))
#define deb(name,value) cout <<"->>  "<<name<< "= " <<value<<" "
#define frepi(a,b,k) for(int i=a;i<=b;i+=k)
#define frepj(a,b,k) for(int j=a;j<=b;j+=k)
// --------------------------------------------------------------------------------


void solve_main()
{
    int n;cin>>n;
    int ans[n+1];mset(ans,0);
    frepi(2,n,1)
    {
    	int x;cin>>x;
    	ans[x]++;
    }
    frepi(1,n,1)cout<<ans[i]<<"\n";
}

int main()
{
	#ifndef ONLINE_JUDGE
    	freopen("/home/suryakant/input.txt","r",stdin);
        freopen("/home/suryakant/output.txt","w",stdout);
    #endif
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve_main();
    }
    
}

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

using namespace std;

int main() {

	int n,m;
	cin >> n >> m ;

	int a, b;
	int mina=2001;
	int counter = 0;
	for (int i = 0; i < m; i++) {
		cin >> a >> b;
		if (a < n) { counter += n - a; }
		mina = min(a, mina);
	}

	cout << counter+mina-n << endl;
}


Measured memory_bytes: 3104
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
// #define int ll
using namespace std;
const int INF (1 << 30);
const ll LLINF (1LL << 55LL);
const int MOD = 1000000007;
const int MAX = 510000;

ll gcd(ll a,ll b){
    if(b ==0) return a;
    return gcd(b,a%b);
}
map<ll,ll> res;
void prime_factor(ll n){
    for(ll i=2;i*i<=n;i++){
        while(n%i==0){
            res[i]++;
            n/=i;
        }
    }
    if(n!=1) res[n]++;
    return;
}



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll a,b,n,ans=1;
    cin>>a>>b;
    n=gcd(a,b);
    prime_factor(n);
    for(auto i:res){
        ans++;
    }
    cout<<ans<<endl;
    
    return 0;
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

ll a, b;

int n;

ll ans;

ll calc(int digit, ll t) {
  t += 1LL;
  ll window = 1LL << (digit + 1);

  ll div = t / window;
  ll mod = t % window;

  ll ret = 0LL;

  ret += div * window / 2;

  if (mod * 2 > window) {
    ret += mod - (window / 2);
  }

  return ret;
}

int main(void) {
  // Here your code !
  scanf("%lld %lld", &a, &b);

  n = int(ceil(log2(b))) + 1;

  ans = 0LL;

  for (int i = 0; i <= n; ++i) {
    ll base = 1LL << i;

    ll cnt = calc(i, b) - calc(i, a - 1);

    ans += base * (cnt % 2);
  }

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

  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ull = long long unsigned;
using P = pair<int,int>;
const int INF=1001001;
const int NMAX=8;

vector<int>d(10,0);
vector<int>t;

int dfs(int s,int n){
  string g=to_string(s);
  //cout<<g<<'g'<<g.size()<<'s'<<n<<'n'<<endl;
  if (g.size()==n and s!=0) {
  //  cout<<g<<endl;
    t.push_back(s);return 0;
  }

rep(i,10){
  if (d[i]==-1)continue;
  if (s==0 and i==0)continue;
  //cout<<s*10+i<<endl;
  dfs(s*10+i,n);

}
}

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


  rep(i,k){
    int temp;
    cin>>temp;
    d[temp]=-1;
  }

  for(int i=1;i<=5;i++){
    dfs(0,i);
  }
  sort(t.begin(),t.end());
  auto idx=lower_bound(t.begin(),t.end(),n);
  //rep(i,t.size())cout<<t[i]<<endl;
  cout<<*idx;


}


Measured memory_bytes: 892
#include<iostream>
#include<string>
using namespace std;
int main(){
    int s[6];
    string dt;
    int b;
    for (int i=0; i<6; i++) {
        cin >> s[i];
    }
 
    cin >> dt;
    
    for (int i =0; i<dt.size(); i++) {
        if(dt[i]=='E'){
            b=s[0];
            s[0]=s[3];
            s[3]=s[5];
            s[5]=s[2];
            s[2]=b;
        }
        if(dt[i]=='W'){
            b=s[0];
            s[0]=s[2];
            s[2]=s[5];
            s[5]=s[3];
            s[3]=b;
        }
        if(dt[i]=='N'){
            b=s[0];
            s[0]=s[1];
            s[1]=s[5];
            s[5]=s[4];
            s[4]=b;
        }
        if(dt[i]=='S'){
            b=s[0];
            s[0]=s[4];
            s[4]=s[5];
            s[5]=s[1];
            s[1]=b;
        }
    }
    
    
    cout << s[0] << endl;
    return 0;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define SP << " " 
#define LLi long long int

using namespace std;

int imax=2147483647;
long long int llimax=9223372036854775807;

//int型vectorを出力
void PV(vector<int> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

//LLi型vectorを出力
void PVL(vector<LLi> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

int main(){

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

	if(a<=b*c) cout<< "Yes" << endl;
	else cout<< "No" << endl;
 
	return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;
    cin >> s;
  	int y,m,d;
      m = ((int)s.at(5) -48) *10 + ((int)s.at(6) - 48);
	if(m >= 5){
      cout << "TBD" << endl;
    }else{
      cout << "Heisei" << endl;
    }
     return 0;
}

Measured memory_bytes: 256
##templete
include Math
n, k = gets.chomp.split(" ").map { |e| e.to_f }

res = 0

for i in 1..n do
    temp = 1.0 / n
    if i <= k-1
      hoge = (Math.log(k / i.to_f) / Math.log(2)).ceil
      temp1 = (1 / 2.0) ** hoge
      temp *= temp1
    end
    res += temp
end

puts res


Measured memory_bytes: 3836
import sys
input = sys.stdin.buffer.readline

N = int(input())
XY = [tuple(map(int, input().split())) for _ in range(N)]

def dist(xy1, xy2):
  x1, y1 = xy1
  x2, y2 = xy2
  return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5

answer = 0
for i in range(N):
  for j in range(i + 1, N):
    answer += dist(XY[i], XY[j]) / (N / 2)

print(answer)

Measured memory_bytes: 3188
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define LB(c, x) lower_bound(c.begin(), c.end(), x)
#define UB(c, x) upper_bound(c.begin(), c.end(), x)
#define LI(c, x) distance(c.begin(), LB(c, x))
#define UI(c, x) distance(c.begin(), UB(c, x))

// functions
template <class T> T ceil(T a, T b) {
    return (a + b - 1) / b;
}
template <class T> T round(T a, T b) {
    return (a + b / 2) / b;
}
template <class T> T gcd(T a, T b) {
    return b ? gcd(b, a % b) : a;
}
template <class T> T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}
template <class T> bool amax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    vector<ll> X(5);
    cin >> N;
    REP(i, 5) {
        cin >> X[i];
    }
    ll m = *min_element(X.begin(), X.end());
    cout << ceil(N, m) + 4 << endl;
    return 0;
}


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

int main(){
  string s, t;
  cin >> s >> t;
  int slen = s.length();
  int tlen = t.length();
  string ans = s;
  bool flag = false;
  for(int i=slen - tlen; i>=0 && !flag; --i){
    flag = true;
    for(int j=0; j<tlen; ++j){
      if(s[i+j] == t[j] || s[i+j] == '?'){
        ans[i+j] = t[j];
      }
      else flag = false;
    }
    if(!flag) ans = s;
  }

  if(flag){
    for(int i=0; i<slen; ++i){
      if(ans[i] == '?') ans[i] = 'a';
    }
    cout << ans << "\n";
  }
  else cout << "UNRESTORABLE" << "\n";
}

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

int main()
{
    int a, b;
    cin >> a >> b;
    if (a == b)
    {
        cout << 2 * a << endl;
    }
    else if (a > b)
    {
        cout << 2 * a - 1 << endl;
    }
    else
    {
        cout << 2 * b - 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
from collections import deque

n, m = map(int, input().split())
room = {i: set() for i in range(n)}
for _ in range(m):
    a, b = map(lambda x: int(x)-1, input().split())
    room[a].add(b)
    room[b].add(a)

ans = dict()
visited = [1] + [0] * (n - 1)
que = deque([0])
while que:
    now = que.popleft()
    for i in room[now]:
        if visited[i]:
            continue
        ans[i] = now
        visited[i] = 1
        que.append(i)

if sum(visited) == n:
    print('Yes')
    for i in range(1, n):
        print(ans[i]+1)
else:
    print('No')


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

int main(void)
{
    int l,r,d,ans=0;
    cin >> l>>r>>d;
    for(int i=l;i<=r;i++){
        if(i%d==0)ans++;
    }

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


Measured memory_bytes: 3584
N, C, K = [int(i) for i in input().split()]
T = []
for i in range(N):
    T.append(int(input()))
T.sort()
first_passenger = 0
bus_cnt = 1
for i in range(N):
    if T[i] <= T[first_passenger] + K and i - first_passenger + 1 <= C:
        pass
    else:
        bus_cnt += 1
        first_passenger = i
print(bus_cnt)


Measured memory_bytes: 7384
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>
#include<functional>
#include<stack>

using namespace std;

int main(){
	int n;
	vector<int> ans;
	stack<int> a;
	while (cin >> n) {
		if (n > 0)a.push(n);
		else if (n == 0) {
			int temp;
			temp = a.top();
			ans.push_back(temp);
			a.pop();
		}
	}
	for (int i = 0; i < ans.size(); i++)cout << ans[i] << endl;
	return 0;
}

Measured memory_bytes: 3148
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
struct UnionFind {
	vector<int> data;
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M;
	cin >> N >> M;
	vector<int> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	int res = 0;
	int a, b;
	UnionFind uf(N);
	for (int i = 0; i < M; i++) {
		cin >> a >> b;
		uf.unionSet(a, b);
	}
	map<int, int> mp;
	int p = 0;
	vector<vector<int> > X(N);
	for (int i = 0; i < N; i++) {
		int r = uf.root(i);
		if (mp.count(r) == 0) {
			mp[r] = p;
			//cerr << r <<  " "  << p << endl;
			p++;
		}
		X[mp[r]].push_back(A[i]);
	}
	if (p == 1) {
		cout << 0 << endl;
		return 0;
	}
	vector<int> Y;
	for (int i = 0; i < N; i++) {
		if ((int)X[i].size() > 0) {
			sort(X[i].begin(), X[i].end());
			res += X[i][0];
			for (int j = 1; j < (int)X[i].size(); j++) {
				Y.push_back(X[i][j]);
			}
		}
	}
	//cerr << res << endl;
	sort(Y.begin(), Y.end());
	if ((int)Y.size() < p - 2) {
		cout << "Impossible" << endl;
	}
	else {
		for (int i = 0; i < p - 2; i++) {
			res += Y[i];
		}
		cout << res << endl;
	}
}

Measured memory_bytes: 13568