akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <math.h>

int main(void)
{
    int n, i;

    scanf("%d", &n);
    for (i = 0; i < n; ++i) {
        double x1, y1, x2, y2, x3, y3;
        double z1, z2, z3;
        double xp, yp, r;

        scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);

        z1 = x1 * x1 + y1 * y1;
        z2 = x2 * x2 + y2 * y2;
        z3 = x3 * x3 + y3 * y3;
        xp = (z1 * (y2 - y3) + z2 * (y3 - y1) + z3 * (y1 - y2)) /
            (2 * (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)));
        yp = (z1 * (x2 - x3) + z2 * (x3 - x1) + z3 * (x1 - x2)) /
            (2 * (y1 * (x2 - x3) + y2 * (x3 - x1) + y3 * (x1 - x2)));
        r = sqrt((x1 - xp) * (x1 - xp) + (y1 - yp) * (y1 - yp));

        printf("%.3f %.3f %.3f\n", xp, yp, r);
    }

    return 0;
}

// refered to #513632 by ytetsuwo

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

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

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

int main(void){

    string str;
    cin >> str;

    if(str.back()-'0' == 2 || str.back()-'0' == 4 || str.back()-'0' == 5 || str.back()-'0' == 7 || str.back()-'0' ==  9) cout << "hon" << endl;
    else if(str.back()-'0' == 0 || str.back()-'0' == 1 || str.back()-'0' == 6 || str.back()-'0' == 8) cout << "pon" << endl;
    else cout << "bon" << endl;

    return 0;
}


Measured memory_bytes: 3628
main = do
    [n,_] <- map read . words <$> getLine :: IO [Int]
    ds <- map head . words <$> getLine
    print $ head $ filter (\x -> not $ contain (show x) ds) [n..]
    where
        contain [] _ = False
        contain (x:xs) ss = (x `elem` ss) || contain xs ss


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

int n, m, c;
vector<int> b;
int res;

int main(void){
    cin >> n >> m >> c;
    b = vector<int>(m);
    for(int i = 0; i < m; i++) cin >> b[i];
    res = 0;
    for(int i = 0; i < n; i++){
        int sum = 0;
        for(int j = 0; j < m; j++){
            int a;
            cin >> a;
            sum += a*b[j];
        }
        if(sum + c > 0) res++;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 3492
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint(), M = getint();

	int A[100000];
	int B[30] = {};
	rep(i, N) {
		A[i] = getint();
		B[31 - __builtin_clz(A[i])]++;
	}
	int k = 29;
	while (k >= 1 && M - B[k] >= 0) {
		M -= B[k];
		B[k - 1] += B[k];
		k--;
	}
	rep(i, N) {
		int kari = 31 - __builtin_clz(A[i]);
		if (kari > k) A[i] >>= kari - k;
	}

	//なるほど？

	nth_element(A, A + max(0, N - M), A + N);

	ll kotae = 0;
	rep(i, N - M) kotae += A[i];
	for (int i = max(0, N - M); i < N; i++) kotae += A[i] >> 1;
	printf("%lld", kotae);

	Would you please return 0;
}

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

public class Main {
    int n, m;

    public static void main(String args[]) {
        new Main().run();
    }

    void run() {
        FastReader sc = new FastReader();
        n = sc.nextInt();
        m = sc.nextInt();
        solve();
    }

    void solve() {
        int ans = n * 100 + 1800 * m;
        System.out.println(ans * pow(2, m));
    }

    long pow(long x, int n) {
        long ans = 1;
        while (n > 0) {
            if ((n & 1) == 1) {
                ans = ans * x;
            }
            x = x * x;
            n >>= 1;
        }
        return ans;
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


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

bool check(int x, int y, int *a) {
    bool X = false, Y = false;
    for (int i = 0; i < 7; i++) {
        if (x == a[i]) X = true;
        if (y == a[i]) Y = true;
    }
    return (X & Y);
}

int main() {
    int x, y; cin >> x >> y;
    int a[7] = {1, 3, 5, 7, 8, 10, 12};
    int b[7] = {4, 6, 9, 11};
    int c[7] = {2};
    if (check(x, y, a) || check(x, y, b) || check(x, y, c)) printf("Yes");
    else printf("No");
}


Measured memory_bytes: 256
from itertools import permutations
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
cnt=0
a=0
b=0
for i in permutations(range(1,n+1)):
    cnt+=1
    if list(i) == p:
        a=cnt
    if list(i) == q:
        b=cnt
print(abs(a-b))

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

using namespace std;

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

  char ans = s[0];
  for(long long i = 0; i < k; i++){
    if(s[i] != '1'){
      ans = s[i];
      break;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define mo 1000000007
int main(){   int d,t,s,ok=0;   cin>>d>>t>>s;  if(d<=(s*t))  ok=1;  if(ok==0)  cout<<"No";  else  cout<<"Yes";   return 0;   }

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

const int MAX = 200000;

ll b[MAX + 10];

int main() {
    int n;
    cin >> n;
    int a[n - 1];
    for (int i = 0; i < n - 1; i++) {
        cin >> a[i];
        a[i]--;
        b[a[i]]++;
    }
    for (int i = 0; i < n; i++) {
        cout << b[i] << endl;
    }
}

Measured memory_bytes: 5968
#include <stdio.h>
int main(){
  int n,x,i,j,k,count;
  while(1){
    count=0;
    scanf("%d%d",&n,&x);
  if(n==0 && x==0)break;
  else {
    for(i=1;i<=n;i++){
      for(j=1;j<=n;j++){
    if(i>=j)continue;
    for(k=1;k<=n;k++){
      if(j>=k)continue;
      if(x==i+j+k)count++;
    }
      }
    }
  }
  printf("%d\n",count);
}
 
 
  return 0;
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> ii;
typedef map<int, int> MPII;
typedef set<int> SETI;

const int mxN = 2e5;
const ld pi = 4.0 * atanl(1.0);
const int iinf = 1e9 + 10;
const int inf = 1e18 + iinf + 10;
const int mod = 1000000007;
const ld prec = .000001;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define all(c) c.begin(), c.end()
#define rall(c) c.end(), c.begin()

int n, m, t, a[mxN];
vi v;

void fast() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }

int main() {
  fast();
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n, greater<int>());
  int b = 0, al = 0;
  for (int i = 0; i < n; ++i) {
    if (i % 2 == 0)
      al += a[i];
    else
      b += a[i];
  }
  cout << al - b;

  return 0;
}



Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }

typedef long long ll;

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

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

const int INF = 1e9;
const ll INFLL = 1e18;
const ll MOD = 1e9+7;

const double PI = acos(-1.0);

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int N;
    cin>>N;
    vector<double> x(N),y(N),r(N);
    rep(i,N)r[i] = i;
    rep(i,N)cin>>x[i]>>y[i];
    /*
    昇順にソート済みのvector（またはstring）を入れると
    辞書順で次の並びのvectorに置き換えてくれる
    辞書順最後になったら -1 を返し止まる
    */
    double ans = 0;
    double cnt = 0;
    do{
        cnt++;
        rep(i,N-1){
            double x1 = x[r[i]];
            double y1 = y[r[i]];
            double x2 = x[r[i+1]];
            double y2 = y[r[i+1]];
            double d2 = (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
            double d  = sqrt(d2);
            ans += d;
        }
    }while(next_permutation(all(r)));
    cout<<ans/cnt<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
using vs = vector<string>; using tll = tuple<ll, ll, ll>; using vtll = vector<tll>;
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define rep1(n) for(ll i=0;i<n;++i)
#define rep2(i,n) for(ll i=0;i<n;++i)
#define rep3(i,a,b) for(ll i=a;i<b;++i)
#define rep4(i,a,b,c) for(ll i=a;i<b;i+=c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop, bitSearch, bitList, nod//
//gcdlcm, isPrime, eratos, primeFactorize, Npow, combination, divisor, modinv,  digitDP//
//dfs, bfs, dijkstra, WarshallFloyd, BellmanFord, UnionFind, Kruskal ,RMQ, LCA//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q;
ll MOD = 1000000007; ll INF = 1LL << 60; ll ans = 0; ll z = 0, o = 1;
vl flag; vll path; vl D;
//***********//
map<ll, ll> primeFactorize(ll n, map<ll, ll>& PF) {
	while (n % 2 == 0) {
		PF[2]++;
		n /= 2;
	}
	for (ll p = 3; p * p <= n; p += 2) {
		while (n % p == 0) {
			PF[p]++;
			n /= p;
		}
	}
	if (n != 1) {
		PF[n]++;
	}
	return PF;
}
int main() {
	cin >> N;
	map<ll, ll> PF;
	primeFactorize(N, PF);
	for (auto x : PF) {
		ll B = x.second;
		ll C = 1;
		//debug(B);
		while (true) {
			if (B >= C) {
				B -= C;
				ans++;
			}
			else {
				break;
			}
			C++;
		}
	}
	cout << ans;
}

Measured memory_bytes: 3636
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    Queue<Long> lnlns = new ArrayDeque<>();
    int k = scan.nextInt();
    
    for(long i = 1;i < 10;i++){
      lnlns.add(i);
    }
    
    for(int i = 1;i < k;i++){
      addLnln(lnlns);
    }
    System.out.println(lnlns.poll());
  }
  
  static void addLnln(Queue<Long> lnlns){
    
    long lnlns_initial = lnlns.poll();
    int ones_place = (int)lnlns_initial % 10;
    
    if(ones_place == 0){
      lnlns.add(lnlns_initial * 10 + ones_place);
      lnlns.add(lnlns_initial * 10 + 1 + ones_place);
      }
    else if(ones_place == 9){
      lnlns.add(lnlns_initial * 10 - 1 + ones_place);
      lnlns.add(lnlns_initial * 10 + ones_place);
    }
    else{
      lnlns.add(lnlns_initial * 10 - 1 + ones_place);
      lnlns.add(lnlns_initial * 10 + ones_place);
      lnlns.add(lnlns_initial * 10 + 1 + ones_place);
    }
  }
}

Measured memory_bytes: 31136
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n,k = map(int, input().split())
    h = list(map(int, input().split()))
    print(sum([1 for i in h if i >= k ]))

if __name__ == '__main__':
    main()

Measured memory_bytes: 12256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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(b<a){a=b;return true;}return false;}

ll n,x;
vector<ll> s;

ll ababa(){
    vector<ll> v=s;
    sort(ALL(v));
    ll res=0;
    do{
        ll num=x;
        rep(i,n) num%=v[i];
        debug(v);cout<<num<<endl;
        res+=num;
    }while(next_permutation(ALL(v)));
    return res;
}

ll dp[210][100010];

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


    cin>>n>>x;
    s.resize(n);
    rep(i,n) cin>>s[i];
    sort(ALL(s));reverse(ALL(s));
    // cout<<ababa()<<endl;
    dp[0][x]=1;

    rep(i,n){
        for(int j=0;j<=x;j++){
            dp[i+1][j%s[i]]+=dp[i][j];          dp[i+1][j%s[i]]%=mod;
            dp[i+1][j]+=dp[i][j]*(n-i-1)%mod;   dp[i+1][j]%=mod;
        }
    }
    ll ans=0;
    for(ll i=1;i<=x;i++) ans=(ans+i*dp[n][i])%mod;
    cout<<ans<<endl;
    return 0;
}

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

template<typename T>
T get_value(std::istream& is);

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

  deque<int> v {};
  for (auto i {get_value<size_t>(cin) * 3}; i != 0; --i)
    v.push_back(get_value<int>(cin));
  sort(v.begin(), v.end());

  auto res {0ul};
  do {
    v.pop_front();
    v.pop_back();
    res += v.back();
    v.pop_back();
  } while(!v.empty());

  cout << res << '\n';
  return 0;
}

template<typename T>
inline T get_value(std::istream& is)
{
  T v;
  is >> v;
  return v;
}


Measured memory_bytes: 1536
#include<bits/stdc++.h>
#define io ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
typedef long long int ll;
using namespace std;
int main(){
	io;
	int a,b,c;
	cin >> a >> b >> c;
	cout << c << " "<< a << " " << b;
	return 0;
}

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

#define ipair pair<int,int>
#define rep(i,n) for(i=0;i<n;i++)
#define repj(i,j,n) for(i=j;i<n;i++)

#define PB(a,i) (a).push_back(i)
#define ALL(a) (a).begin(),(a).end()
#define SIZE(a,n) (a).resize(n)
#define SORT(a) sort(ALL(a))
#define VSORT(a, type) sort(ALL(a),greater<type>())
#define MAPIN(a,i,j) (a).insert(make_pair(i,j))

#define OK(i) cout<<"OK "<<i<<endl
#define Yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define NO cout<<"NO"<<endl

using namespace std;

typedef long long int lli;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< vi > Matrix;

int main() {
	int n, i, j;
	vll h,k;
	

	cin >> n;
	SIZE(h, n);
	SIZE(k, n);
	rep(i, n) {
		cin >> h[i];
	}
	repj(i, 1, n) {
		k[i] = h[i] - h[i - 1];
	}
	repj(i, 1, n) {
		k[i] += k[i - 1];
	}
	repj(i, 1, n-1) {
		if (k[i] > k[i + 1]) {
			k[i + 1]++;
		}
	}
	j = k[0];
	repj(i, 1, n) {
		if (j > k[i]) {
			No;
			return 0;
		}
		j = k[i];
	}
	Yes;

	return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <queue>
#include <vector>
#include <functional>
using namespace std;

using ll = long long;

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

    const int MAXN = 200000;
    static ll a[MAXN * 3];

    for (int i = 0; i < 3 * N; i++) {
        cin >> a[i];
    }

    static ll sum1[MAXN * 3],   // 前半部分 [0, i)
              sum2[MAXN * 3];   // 後半部分 [i, 3N)
    priority_queue<ll, vector<ll>, greater<ll>> que1;
    priority_queue<ll> que2;
    for (int i = 0; i < 3 * N - 1; i++) {
        sum1[i + 1] = sum1[i];

        if (que1.size() < N) {
            que1.push(a[i]);
            sum1[i + 1] += a[i];
            continue;
        }

        if (que1.top() < a[i]) {
            sum1[i + 1] += a[i] - que1.top();
            que1.pop();
            que1.push(a[i]);
        }
    }

    for (int i = 3 * N - 1; i >= 0; i--) {
        sum2[i] = sum2[i + 1];

        if (que2.size() < N) {
            que2.push(a[i]);
            sum2[i] += a[i];
            continue;
        }

        if (que2.top() > a[i]) {
            sum2[i] += a[i] - que2.top();
            que2.pop();
            que2.push(a[i]);
        }
    }

    ll ans = -(1LL << 50);
    for (int i = N; i <= 2 * N; i++) {
        ans = max(ans, sum1[i] - sum2[i]);
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 14196
# -*- coding: utf-8 -*-

n = int(input())
A = {}

for i in range(n):
    x = input()
    A.update({x: A.setdefault(x, 0) + 1})

B = []
m = 0
for j in A:
    y = A.get(j)
    if y > m:
        m = y

for k in A:
    h = A.get(k)
    if h == m:
        B.append(k)

B.sort()

for t in B:
    print(t)

Measured memory_bytes: 95704
#include<stdio.h>
#include<math.h>
int main(){
  long long n;
  scanf("%lld",&n);
  long long i=(int)sqrt(n)+1;
  for(;i;i--){
    if(n%i==0)break;
  }
  n/=i;
  int ans=0;
  while(n){
    n/=10;
    ans++;
  }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 128
// This is the start of  template//
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long int
#define ll int 
#define vll vector<int>
#define pb push_back
#define pll pair<int,int>
#define mp(a,b) make_pair(a,b)
#define ff first
#define ss second
void input(){
#ifndef ONLINE_JUDGE 
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout); 
#endif
}
#define INF LONG_LONG_MAX
#define mod 1000000007
#define array(a,n) vll a(n); rep(i,0,n) cin>>a[i];
#define all(x) x.begin(),x.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define cases int t; cin>>t; while(t--)
#define printall(a) rep(i,0,a.size()) cout<<a[i]<<" "; cout<<endl;
ll power(ll a,ll n)
{
	if(n==0)
		return 1;
	if(n%2)
	{
		return a*power(a*a,n/2);
	}
	return power(a*a,n/2);
}

int32_t main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  //input();
  double d,t,s;
  cin>>d>>t>>s;
  if(d/s<=t)
  	cout<<"Yes";
  else
  	cout<<"No\n";
}



Measured memory_bytes: 3728
#include <bits/stdc++.h>
#define COUT(x) cout << #x << " = " << (x) << ", "
typedef long long ll;
using namespace std;
static const ll MOD = 1000000007;

bool kaibun(string s){
  bool flag = true;
  int len = s.size();
  for(int i = 0; i < len; i++){
    if(s[i] != s[len-1-i]){
      flag = false;
    }
  }
  return flag;
}

int main(){
  string S; cin >> S;
  bool flag = true;
  flag = kaibun(S);
  int len = S.size();
  string s1 = S.substr(0, len/2);
  string s2 = S.substr(len/2 + 1, len/2);
  flag = flag & kaibun(s1);
  flag = flag & kaibun(s2);
  if(flag){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


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

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

typedef long long ll;
using namespace std;

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

  int X;
  cin >> X;
  if (X == 3 || X == 5 || X == 7) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
import sys
import collections
from collections import Counter
from collections import deque
from collections import defaultdict
import itertools
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from itertools import takewhile
from itertools import compress
import functools
from functools import reduce
import math
####from math import gcd
####from math import inf
from math import ceil
from math import floor
##from math import log10
##from math import log2
##from math import log
from math import factorial
import re
from functools import lru_cache

# @lru_cache(maxsize=1000)

# MOD = 10 ** 9 + 7

# N = int(input())
# A = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]



from decimal import Decimal

N, K = [int(x) for x in input().split()]

ans = Decimal("0")
for i in range(1, N + 1):
    score = i
    rate = Decimal("1") / Decimal(str(N))
    while score < K:
        score *= 2
        rate /= 2
    ans += rate

print(ans)





Measured memory_bytes: 97748
n = int(input())
h = [int(x) for x in input().split()]

max_h = 0
possible = True
for x in h:
    if max_h - 1 > x:
        possible = False
        break
    elif max_h <= x - 1:
        max_h = x


if possible:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 14396
n = int(input())
if(n%10==2 or n%10 == 4 or n%10 == 5 or n%10== 7 or n%10==9):
    print('hon')
elif(n%10==0 or n%10 ==1 or n%10== 6 or n%10==8):
    print('pon')
else:
    print('bon')


Measured memory_bytes: 61636
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]
## math ##
def to_bin(x: int) -> str: return format(x, 'b') # rev => int(res, 2)
def to_oct(x: int) -> str: return format(x, 'o') # rev => int(res, 8)
def to_hex(x: int) -> str: return format(x, 'x') # rev => int(res, 16)
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i): is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]
def prime_factor(n):
    """Return a list of prime factorization numbers of n"""
    res = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0: res.append(i); n //= i
    if n != 1: res.append(n)
    return res
## libs ##
from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left
#======================================================#

def main():
    n = II()
    aa = MII()
    x = {i: 0 for i in range(-1, 10**5+2)}
    for a in aa:
        x[a-1] += 1
        x[a] += 1
        x[a+1] += 1
    print(max(x.values()))

if __name__ == '__main__':
    main()

Measured memory_bytes: 21088
#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
using namespace std;
int main(void){
	char buff[256];
	int a,b;
	map<int,int> d[2];
	map<int,int> s;
	for(int i=0;i<2;i++){
		while(fgets(buff,sizeof(buff),stdin)&&buff[0]!='\n'){
			sscanf(buff,"%d,%d",&a,&b);
			d[i][a]++;
		}
	}
	for(map<int,int>::iterator itr=d[0].begin();itr!=d[0].end();itr++){
		if(itr->second&&d[1][itr->first]){
			s[itr->first]=itr->second+d[1][itr->first];
		}
	}
	for(map<int,int>::iterator itr=s.begin();itr!=s.end();itr++){
		cout<<itr->first<<" "<<itr->second<<endl;
	}
	return 0;
}

Measured memory_bytes: 1220
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <bitset> 
#include <vector>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
                
#define int long long
#define ll long long 
bool FLAG = 0;
#define debug(x) if (FLAG) { 	cerr << #x << " = " << x << endl;}
#define debug_vec(x) if (FLAG) {cerr << #x << " = {"; for (auto to x) cout << to << ", "; cout << "}" << endl}
#define F first
#define S second                               
#define sqr(x) ((x) * (x))
#define make make_pair
#define pb push_back
#define sz(x) (int)(x.size()) 
#define all(x) x.begin (), x.end ()

using namespace std;
                        
typedef unsigned long long ull;
typedef long double ld;

const int MOD = 998244353, N = (int)1e6+ 222;
const int INF = (int)1e18;
const ld eps = (ld)1e-6;

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

int n, a[N], b[N];
string s = "codeforces";

inline void solve () {    
	char a;
	cin >> a;
	if (a >= 'A' && a <= 'Z') cout << 'A';
	else cout << 'a';		
}	
	    

signed main () {
	#ifdef Maga
		freopen("input", "r", stdin);
	#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}

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

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    {                                                                          \
        FOREACH(x, v) { cout << x << " "; }                                    \
        cout << "\n";                                                          \
    }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *)array, (T *)(array + N), val);
}

typedef long long ll;
typedef unsigned long long ul;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, VL, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18;
const ll dx[] = {1, -1, 0, 0};
const ll dy[] = {0, 0, 1, -1};

ll N;

VL divisor(ll n) {
    VL res;
    for(ll i = 1; i * i <= n; i++) {
        if(n % i == 0) {
            res.push_back(i);
        }
    }
    return res;
}

signed main() {
    cin >> N;
    VL di = divisor(N);
    ll A = di[di.size() - 1], B = N / A;
    cout << max((ll)log10(A) + 1LL, (ll)log10(B) + 1LL);
}

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

ll a[401];
ll dp[401][401];

ll get(int i,int j) {
  return a[j]-(i>0 ? a[i-1] : 0);
}

ll solve(int i,int j){
	if(i==j) return 0;
	if(dp[i][j]!=-1) return dp[i][j];
	dp[i][j]=1e17;
	for(int k=i;k<j;k++)
	dp[i][j]=min(dp[i][j],solve(i,k)+solve(k+1,j)+get(i,k)+get(k+1,j));
	return dp[i][j];
}

int main(){
	int n;
	cin>>n;
	memset(dp,-1,sizeof(dp));
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=1;i<n;i++) a[i]+=a[i-1];
	cout<<solve(0,n-1)<<endl;
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    EACH(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
    REP(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
    REP(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int n; cin >> n;
    vector<int> a(n); cin >> a;
    sort(ALL(a));
    vector<bool> f(n, false);
    // REP(i, n) {
    //     f[i] = (a[i] - (n-i-1)%2)%2 == 0;
    // }
    int l = 0;
    FOR(i, 1, n+1) {
        if (i == n || a[i] != a[l]) {
            FOR(j, l, i) {
                f[j] = ((i-l)+a[l]+(n-i))%2 == 1;
            }
            l = i;
        }
    }
    // cout << f << endl;
    bool ans = false;
    REP(i, n) {
        if (a[i] > (n-i-1)-f[i]) {
            ans = f[i];
            break;
        }
    }
    if (!ans) {
        cout << "Second" << endl;
    }
    else {
        cout << "First" << endl;
    }
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
using namespace std;
void comb(vector<vector <long long int> > &v){
  for(int i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(int k = 1;k <v.size();k++){
    for(int j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j])%1000000007;
    }
  }
}
int main()
{
    int ball, k, i;
    long long ans=0, ans2=0, ans3=0;
    cin >> ball >> k;
    vector < vector<long long int> > v(k, vector<long long int>(k, 0));
    vector < vector<long long int> > a(ball-k+2,
                                       vector<long long int>(ball-k+2, 0));
    for(i=1;i<=k;i++){
        ans=0;
        ans2=0;
        ans3=0;
        if(i==1) cout << ball-k+1 <<endl;
        else if(i>ball-k+1) cout << 0 <<endl;
        else {
            comb(v);
            ans=v[k-1][i-1]%1000000007;
            comb(a);
            ans2=a[ball-k+1][i]%1000000007;
            ans3=(ans*ans2)%1000000007;
            cout << ans3 <<endl;
        }
    }

    return 0;
}

Measured memory_bytes: 31616
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

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

  ll A, B, C;
  std::cin >> A >> B >> C;

  std::string judge = "No";
  if (A == B && B == C) judge = "Yes";

  std::cout << judge << std::endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi        first
#define se        second
#define PI        acos(-1)
#define LC(a)     ((a<<1))
#define RC(a)     ((a<<1)+1)
#define MID(a,b)  ((a+b)>>1)
#define mem(a, b) memset(a, b, sizeof(a))
#define IOS()     std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<ll,ll>   PLL;
typedef pair<ll,int>  PLI;
const int INF = 0X3F3F3F3F;
const int MIN = -(1<<30);
const ll N = 1e8+7;
int a[N];
int main()
{
	IOS();

	string s,t;
	int a,b;
	cin>>s>>t>>a>>b;
	map<string,int> mp;
	mp[s] = a;
	mp[t] = b;
	string u;
	cin>>u;
	mp[u]--;
	cout<<mp[s]<<" "<<mp[t]<<endl;	
	
	
	
	
	
	
	

	
	
	return 0;
}



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

using i64 = long long;
using P = pair<i64, i64>;

#define overload3(_1, _2, _3, name, ...) name
#define rep1(i, n) for(i64 i = 0LL; i < (n); ++i)
#define rep2(i, a, b) for(i64 i = (a); i < (b); ++i)
#define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
#define all(v) v.begin(), v.end()


void solve(long long K){
    vector<i64> run;
    vector<vector<vector<i64>>> r(20, vector<vector<i64>>(10));
    rep(i, 1, 10){
        run.push_back(i);
        r[0][i].push_back(i);
    }
    i64 base = 10;
    rep(i, 1, 20){ //keta
        if(run.size() >= K) break;
        rep(j, 1, 10){ //num
            if(run.size() >= K) break;
            rep(k, 1, 10){
                if(abs(j - k) >= 2) continue;
                rep(s, r[i - 1][k].size()){
                    r[i][j].push_back(base * j + r[i - 1][k][s]);
                    run.push_back(base * j + r[i - 1][k][s]);
                }
            }
            if(j == 1){
                r[i][1].push_back(base);
                run.push_back(base);
            }
            if(j == 1 && i >= 2){
                rep(k, i - 1){ //keta2
                    rep(s, r[k][1].size()){
                        r[i][1].push_back(base + r[k][1][s]);
                        run.push_back(base + r[k][1][s]);
                    }
                }
            }
        }
        base *= 10;
    }
    sort(all(run));
    cout << run[K - 1] << endl;
}

struct IoSetup {
    IoSetup() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
} iosetup;

int main(){
    long long K;
    scanf("%lld",&K);
    solve(K);
    return 0;
}


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

int main()
{
ll n ;
cin >> n ;
string s ;
cin >> s ;
rep(i,n-2){
  if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')ans++;
}
cout << ans << endl;
return 0;
}

Measured memory_bytes: 256
S = input()
ans = "Yes"
if S.__len__() % 2 != 0:
    ans = "No"
else:
    for i in range( len(S) ):
        if i % 2 == 0 and S[i] == "h":
            continue
        elif i % 2 == 1 and S[i] == "i":
            continue
        else:
            ans = "No"
print(ans)

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

using namespace std;
using ll = long long;

const int table[10] = { 0, 2, 5, 5, 4, 5, 6, 3, 7, 6 };

string chmax(string a, string b) {
	if (a.size() > b.size()) { return a; }
	if (b.size() > a.size()) { return b; }
	sort(a.rbegin(), a.rend());
	sort(b.rbegin(), b.rend());
	if (a > b) { return a; }
	else { return b; }
}

int main() {
	int N, M;
	cin >> N >> M;
	vector<int> A(M);
	for (int i = 0; i < M; ++i) { cin >> A[i]; }

	vector<string> dp(N + 1, "");
	for (int i = 0; i < M; ++i) {
		int cost = table[A[i]];
		if (cost <= N) {
			string tmp = to_string(A[i]);
			dp[cost] = chmax(dp[cost], tmp);
		}
		for (int j = 1; j <= N; ++j) {
			if (dp[j] == "") { continue; }
			if (j + cost > N) { break; }

			string tmp = dp[j] + to_string(A[i]);
			dp[j + cost] = chmax(dp[j + cost], tmp);
		}
	}

	sort(dp[N].rbegin(), dp[N].rend());
	cout << dp[N] << endl;

	return 0;
}


Measured memory_bytes: 32896
#include<stdio.h>
void fill(int a)
{
	for(int i=0;i<a;i++)
		printf("#");
	printf("\n");
}

int main()
{
	int h,w,i,j;
	char a[111][111];

	scanf("%d%d",&h,&w);
	for(i=0;i<h;i++)
		scanf("%s",a[i]);

	fill(w+2);
	for(i=0;i<h;i++){
		printf("#");	
		printf("%s",a[i]);
		printf("#\n");
	}
	fill(w+2);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
typedef long long ll;

using namespace std;

int main() {
    int n;
    cin >> n;
    
    vector<int> v(n);
    for(int i = 0; i < n; i++) {
        cin >> v[i];
    }
    
    sort(v.begin(), v.end(), [](const int &x, const int &y){return x > y;});
    
    ll ans = 0;
    for(int i = 0; i < n; i++) {
        for(int j = i + 1; j < n; j++) {
            if(v[i] >= v[j] * 2) {
                break;
            }
            for(int k = j + 1; k < n; k++) {
                if(v[i] < v[j] + v[k] && v[j] < v[i] + v[k] && v[k] < v[i] + v[j]) {
                    ans++;
                }
                else {
                    break;
                }
            }
        }
    }
    
    
    cout << ans << endl;
    return 0;
}



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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end())
#define vdelete(v) (v).erase(unique(all(v)), (v).end())
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF 9223372036854775807

struct UnionFind {
#define MAX 100001
    int Adress[MAX],weight[MAX];
    void Init() {rep(i,MAX) Adress[i] = i;}
    void relate(int a ,int b, int c) {
        int a_root = find(a),b_root = find(b);
        if (a_root != b_root) {
            weight[b_root] = weight[a] + c - weight[b];
            Adress[b_root] = a_root;
        }
    }
    int find(int a) {
        if (a == Adress[a]) return Adress[a];
        else {
            int tmp = Adress[a];
            Adress[a] = find(Adress[a]);
            weight[a] += weight[tmp];
            return Adress[a];
        }
    }
    int diff(int a, int b) {
        find(a),find(b);
        return weight[b] - weight[a];
    }
    /*
     * Adress : rootの番号
     * weight : rootに対する差
     * relate : 併合
     * find : aのweightを更新しつつrootを返す
     * diff :　異なる2要素の差を返す(繋がっていないとバグる
     * */
};

int n,m,l,r,d;
string ans = "Yes";
UnionFind UF;

signed main() {
    UF.Init();
    cin >> n >> m;
    rep(i,m) {
        cin >> l >> r >> d;
        if (UF.find(l) == UF.find(r)) {
            if (UF.diff(l,r) != d) ans = "No";
        } else UF.relate(l,r,d);
    }
    cout << ans << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <utility>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long int ll;
typedef vector<long long int> VL;
typedef vector<VL> VVL;

int main() {
    int n, m, l;
    VVL a, b;
    VVL c;
    cin >> n >> m >> l;
    
    for(int i=0; i<n; i++) {
        VL row;
        for(int j=0; j<m; j++) {
            ll temp;
            cin >> temp;
            row.push_back(temp);
        }
        a.push_back(row);
    }
    for(int i=0; i<m; i++) {
        VL row;
        for(int j=0; j<l; j++) {
            ll temp;
            cin >> temp;
            row.push_back(temp);
        }
        b.push_back(row);
    }
    
    for(int i=0; i<n; i++) {
        VL row;
        for(int j=0; j<l; j++) {
            ll temp = 0;
            for(int k=0; k<m; k++) {
                temp += a[i][k] * b[k][j];
            }
            row.push_back(temp);
        }
        c.push_back(row);
    }
    
    for(int i=0; i<n; i++) {
        for(int j=0; j<l; j++) {
            cout << c[i][j];
            if(j != l-1) cout << " ";
        }
        cout << endl;
    }
    
    return 0;
}



Measured memory_bytes: 3280
# coding: utf-8

line1 = [int(x) for x in input().rstrip().split(" ")]
num_refrigeratores, num_microwaves, num_discount_tickets = line1[0], line1[1], line1[2]

ls_price_refrigeratores = [int(x) for x in input().rstrip().split(" ")]
ls_price_microwaves = [int(x) for x in input().rstrip().split(" ")]

price_min = min(ls_price_refrigeratores) + min(ls_price_microwaves)

for _ in range(num_discount_tickets):
    linen = [int(x) for x in input().rstrip().split(" ")]
    total_price = ls_price_refrigeratores[linen[0] - 1] + ls_price_microwaves[linen[1] - 1] - linen[2]
    if price_min > total_price:
        price_min = total_price

print(price_min)

Measured memory_bytes: 18148
//************************
//*  Date: 2018.11.30    *
//*  Problem:            *
//*  Author: xuziyuan    * 
//************************
 
#include <bits/stdc++.h>
 
#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++)
#define LL long long
#define pii pair<int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))
 
using namespace std;
 
const LL MOD=1e9+7;
 
int n,m,q;
vector <int> g[100010];
int colo[100010],most[100010];
vector <pair<pii,int> > pa;
bool vis[100010];
 
int main()
{
	memset(most,-1,sizeof(most));
	cin>>n>>m;
	rep(i,m)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		g[x].pb(y);
		g[y].pb(x);
	}
	cin>>q;
	rep(i,q)
	{
		int x,y,z;
		scanf("%d%d%d",&x,&y,&z);
		pa.pb({{x,y},z});
	}
	for(int i=pa.size()-1;i>=0;i--)
	{
		int x=pa[i].fi.fi,y=pa[i].fi.se,z=pa[i].se;
		queue <pii> q;
		q.push({x,0});
		memset(vis,0,sizeof(vis));
		while(!q.empty())
		{
			int pos=q.front().fi,all=q.front().se;
			q.pop();
			if(y-all<=most[pos]) continue;
			most[pos]=y-all;
			if(all>y) continue;
			if(vis[pos]) continue;
			//if(x==1) cout<<pos<<endl;
			vis[pos]=true;
			if(colo[pos]==0) colo[pos]=z;
			rep(i,g[pos].size()) q.push({g[pos][i],all+1});
		}
	}
	repn(i,n) printf("%d\n",colo[i]);
	rt0;
}

Measured memory_bytes: 9456
#include <cstdio>
#include <vector>
#include <algorithm>

int main() {
    int N, X, Y;
    scanf("%d %d %d", &N, &X, &Y);
    std::vector <int> count;
    for (int i = 0; i < N; i++) {
        count.push_back(0);
    }
    for (int i = 1; i < N; i++) {
        for (int j = i + 1; j < N + 1; j++) {
            count[std::min({abs(i - j),
                            abs(X - i) + 1 + abs(j - Y),
                            abs(Y - i) + 1 + abs(j - X)})] += 1;
        }
    }
    for (int i = 1; i < N; i++) {
        printf("%d\n", count[i]);
    }
}

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

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

  int m1, d1, m2, d2;
  cin >> m1 >> d1 >> m2 >> d2;

  cout << (m1 != m2) << endl;

  return (0);
}


Measured memory_bytes: 3588
#include<bits/stdc++.h>
   
using namespace std;
  
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define Fixed fixed << setprecision(14)
#define int int64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9+7; 
constexpr int mod2 = 998244353;
 
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
 
template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A,class B> using umap = unordered_map<A,B>;
   
int gcd(int a,int b){ return b ? gcd(b,a % b) : a;}
int lcm(int a,int b){ return a / gcd(a,b) * b;}

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

  int r,g,b;
  cin >> r >> g >> b;

  int tmp = r * 100  + g * 10 + b;

  cout << (tmp % 4 == 0 ? "YES\n" : "NO\n");

  return 0;
}

Measured memory_bytes: 256
import sys
input=sys.stdin.readline
n=int(input())
s=input().rstrip()
if n%2==0:
    m=n//2
    a=s[0:m]
    b=s[m:n]
    if a==b:
        print('Yes')
    else:
        print('No')
else:
    print('No')


    



Measured memory_bytes: 38256
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    h1,m1,h2,m2,k=MI()
    ans=h2*60+m2-(h1*60+m1)-k
    print(ans)

main()

Measured memory_bytes: 9180
#include <bits/stdc++.h>
using namespace std;
int INF = 10000000;
int main(){
  int N;
  cin >> N;
  vector<int> dp(N + 1, INF);
  dp[0] = 0;
  for (int i = 1; i <= N; i++){
    for (int j = 1; j <= i; j *= 6){
      dp[i] = min(dp[i], dp[i - j] + 1);
    }
    for (int j = 1; j <= i; j *= 9){
      dp[i] = min(dp[i], dp[i - j] + 1);
    }
  }  
  cout << dp[N] << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long

using namespace std;

int dp[105][100005];

signed main(){
	int n , w;
	cin>>n>>w;
	vector<int> inn(n + 1) , inw(n + 1);
	for(int i = 1 ; i <= n ; i++) cin>>inw[i]>>inn[i];
	for(int k = 1 ; k <= n ; k++)
		for(int i = 0 ; i <= w ; i++){
			dp[k][i] = max(dp[k - 1][i] , (i >= inw[k] ? dp[k - 1][i - inw[k]] + inn[k] : 0));
			// cout<<dp[k][i]<<endl;
		}
	cout<<dp[n][w]<<endl;
}

Measured memory_bytes: 81600
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
constexpr int MOD=1000000007;
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};
const int MAX_N=2e5+5;

int main(void){
    lint K,A,B;
    cin >> K >> A >> B;
    if(B-A<=2) cout << 1+K << endl;
    else{
        lint minus=A-1;
        lint s=K;
        K-=minus;
        lint ans=A+(B-A)*(K/2);
        if(K%2) ans++;
        cout << max(s+1,ans) << endl;
    }
}

Measured memory_bytes: 256