akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#pragma GCC optimize("Ofast")

// Begin {{{
using namespace std;

#ifndef DEBUG
#define dump(...)
#endif

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>
inline vector<T> make_v(const T &initvalue, size_t sz) {
    return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initvalue, args...))>(sz, make_v<T>(initvalue, args...));
}

constexpr int INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;
// }}} End

inline intmax_t updiv(intmax_t n, intmax_t d) { return (n + d - 1) / d; }

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

    size_t N; cin >> N;

    vector<intmax_t> a(N + 1);
    for (size_t i = 1; i <= N; ++i) cin >> a[i];

    vector<intmax_t> upcum(N + 1), downcum(N + 2);
    for (size_t i = 1; i <= N; ++i) {
        upcum[i] = upcum[i - 1] + a[i];
    }

    for (size_t i = N; i >= 1; --i) {
        downcum[i] = downcum[i + 1] + a[i];
    }

    intmax_t minv = LINF;
    for (size_t i = 1; i <= N; ++i) {
        chmin(minv, min<intmax_t>(llabs(upcum[i] - downcum[i + 1]), llabs(downcum[i] - upcum[i - 1])));
    }

    cout << minv << "\n";

    return 0;
}


Measured memory_bytes: 4992
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

n,m = map(int,input().split())
edge = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    edge[a].append(b)
    edge[b].append(a)
for i in range(1,len(edge)):
    print(len(edge[i]))

Measured memory_bytes: 12504
from scipy.sparse.csgraph import floyd_warshall

N, M, L, *I = map(int, open(0).read().split())
ABC, ST = I[:3 * M], I[3 * M + 1:]

E = [[0] * N for _ in range(N)]
for a, b, c in zip(*[iter(ABC)] * 3):
    E[a - 1][b - 1] = E[b - 1][a - 1] = c

E = floyd_warshall(E)
E = [[(eij <= L) for j, eij in enumerate(ei)] for i, ei in enumerate(E)]
E = floyd_warshall(E)

INF = float("inf")

print("\n".join("-1" if E[s - 1][t - 1] == INF else str(int(E[s - 1][t - 1] - 1)) for s, t in zip(*[iter(ST)] * 2)))


Measured memory_bytes: 40856
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include<bits/stdc++.h>
#include <utility>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1<<29)

using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N,M;
  cin >> N >> M;
  vector<pair<int,int>> cities[1000001];
  for(int i=0;i<M;i++){
    int p,y;
    cin >> p >> y;
    cities[p].push_back({y,i});
  }
  pair<int,int> ans[100001];
  for(int i=1;i<=N;i++){
    sort(cities[i].begin(),cities[i].end());
    for(int j=0;j<cities[i].size();j++){
      ans[cities[i][j].second]={i,j+1};
    }
  }
  for(int i=0;i<M;i++){
    printf("%06d%06d\n", ans[i].first,ans[i].second);
  }
  return 0;
}

Measured memory_bytes: 28928
(defvar *n* (read))

(defvar *digits*
  (loop for n = *n* then (- (floor n 2))
        while (/= n 0)
        collect (mod n 2)))

(setf *digits* (nreverse *digits*))


(format t "~{~a~}~%" (if (zerop *n*)
                       '(0)
                       *digits*))


Measured memory_bytes: 12904
#include<bits/stdc++.h>
using namespace std;
template<typename T1, typename T2> istream& operator>>(istream& is, pair<T1,T2>& a){ return is >> a.first >> a.second; }
template<typename T1, typename T2> ostream& operator<<(ostream& os, pair<T1,T2>& a){ return os << a.first << " "<<a.second; }
template<typename T> istream& operator>>(istream& is, vector< T >& vc){ for(int i = 0; i < vc.size(); i++) is >> vc[i]; return is; }
template<typename T> ostream& operator<<(ostream& os, vector< T >& vc){ for(int i = 0; i < vc.size(); i++) os << vc[i] << endl; return os; }
 
#define ForEach(it,c) for(__typeof (c).begin() it = (c).begin(); it != (c).end(); it++)
#define ALL(v) (v).begin(), (v).end()
#define UNQ(s) { sort(ALL(s)); (s).erase( unique( ALL(s)), (s).end());}
#define fr first
#define sc second
 
typedef pair< int , int > Pi;
typedef pair< int , Pi > Pii;
 
typedef long long int64;
const int INF = 1 << 30;

class UnionFind {
private:
  vector< int > rank, p;
  void link(int x, int y) {
    if(rank[x] > rank[y]) swap( x, y);
    p[x] = y;
    if(rank[x] == rank[y]) rank[y]++;
  }
public:
  UnionFind(int n) : rank(n), p(n) {
    for(int i = 0; i < n; i++) p[i] = i, rank[i] = 0;
  }
  void Union(int x, int y) {
    if(Find(x) != Find(y)) link( Find(x), Find(y));
  }
  int Find(int x) {
    return(x != p[x] ? p[x] = Find(p[x]) : p[x]);
  }
  bool Same(int x, int y) {
    return(Find(x) == Find(y));
  }
};
template< class T >
class Graph{
public:
  struct edge {
    int to;
    T cost;
  };
  typedef vector< vector< edge > > graph;
  graph g;

  void add_edge( int u, int v, T cost, bool flag = true) {
    g[u].push_back((edge){ v, cost});
    if(flag) g[v].push_back((edge){ u, cost});
  }
  Graph(int n):g(n){};
};

template< class T >
class SGraph{
public:
  struct edge {
    int u, v;
    T cost;
    bool operator<(const edge& hoge) const {
      return cost < hoge.cost;
    }
  };
  typedef vector< edge > Edges;
  Edges edges;

  SGraph< T >(){};
  SGraph< T >(Graph< T > graph, bool flag = true){
    for(int i = 0; i < graph.g.size(); i++) {
      for(int j = 0; j < graph.g[i].size(); j++){
        if(!flag || i < graph.g[i][j].to){
          add_edge( i, graph.g[i][j].to, graph.g[i][j].cost);
        }
      }
    }
  }
  void add_edge( int u, int v, T cost) {
    edges.push_back((edge){ u, v, cost});
  }
};

template< class T >
class MinimumSpanningTree : public UnionFind, public SGraph< T >{
public:
  MinimumSpanningTree(int n):SGraph< T >(), UnionFind(n){};
  MinimumSpanningTree(Graph< T > g):SGraph< T >(g), UnionFind(g.g.size()){};
  T run(){
    sort( SGraph< T >::edges.begin(), SGraph< T >::edges.end());
    T ret = 0;
    ForEach(it, SGraph< T >::edges){
      if(!Same( it -> u, it -> v)){
        Union( it -> u, it -> v);
        ret += it -> cost;
      }
    }
    return ret;
  }
};

int main(){
  int V, E;
  cin >> V >> E;
  Graph< int > graph(V);
  for(int i = 0; i < E; i++){
    int a, b, c;
    cin >> a >> b >> c;
    graph.add_edge( a, b, c);
  }
  cout << MinimumSpanningTree< int >(graph).run() << endl;
}

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

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

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

  string s; cin >> s;
  int N = s.size();
  // 直前が 1 文字から成るか
  bool one = false;
  int ans = 0;
  rep(i, N) {
    if(one && s[i] == s[i-1]) {
      if(i == N-1) break;
      i++;
      one = false;
    } else {
      one = true;
    }
    ans++;
  }

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


Measured memory_bytes: 720
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <iomanip>
#include <map>
using namespace std;


void solve(){
  int n, k; string s; cin >> n >> k >> s;
  for(int i = 0; i < n; i++){
    if(i == k - 1) cout << (char)(s[i] + 32);
    else cout << s[i];
  }
  cout << endl;
  return;
}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rint register int 
#define ll long long
using namespace std;
char s[1010100];
int n;
int main(){	
	scanf("%s",s+1);n=strlen(s+1);
	int ans1=0,ans2=0;
	for(rint i=2;i<=n;++i) {
		if(s[i]!=s[i-1]) ans1++;
	}
	for(rint i=n-1;i;--i) if(s[i]!=s[i+1]) ans2++;
	cout<<min(ans1,ans2);
	return 0;
}

Measured memory_bytes: 3736
#include<bits/stdc++.h>
using namespace std;
#define F(i,L,R) for(int i=L;i<R;i++)
#define FE(i,L,R) for(int i=L;i<=R;i++)
#define RF(i,l,r) for(int i=r;i>l;i--)
#define RFE(i,l,r) for(int i=r;i>=l;i--)
#define getI(i) scanf("%d",&i)
#define getII(i,j) scanf("%d%d",&i,&j)
#define getIII(i,j,k) scanf("%d%d%d",&i,&j,&k)
#define VgetI(i) int (i);scanf("%d",&(i));
#define VgetII(i,j) int (i),(j);scanf("%d%d",&(i),&(j));
#define VgetIII(i,j,k) int (i),(j),(k);scanf("%d",&(i),&(j),&(k));
#define EoF(n) int(n);while(~getI(n))
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define abs(n) (n>0?n:(-n))
#define INF 2147483647
#define nINF -2147483648
int main(){
	int n,a,b;
	while(~getIII(n,a,b)) printf("%s\n",(b-a-1)%2==1?"Alice":"Borys");
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;

#define rep(i,x,y) for(int i=(x); i<(y); ++i)

template <typename T>
void vec_print(vector<T> VEC){
  rep(i, 0, VEC.size()){
    cout << VEC[i] << " ";
  }
  cout << "\n";
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  rep(i, 0, MAT.size()){
    rep(j, 0, MAT[i].size()){
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};

class HOGE{
  public:
    ll index;
    ll value;
    HOGE(ll index, ll value){
      this->index = index;
      this->value = value;
    };
    ~HOGE(void){
      return;
    };

    void print(void){
      cout << "index : " << index << ", value : " << value << "\n";
      return;
    };
    
    bool operator==(const HOGE &obj){
      return (this->value == obj.value);
    };
    bool operator<(const HOGE &obj){
      return (this->value < obj.value);
    };
    bool operator>(const HOGE &obj){
      return (this->value > obj.value);
    };
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;

ll min_search(int pos, const int last, const vector<ll>& h, vector<ll>& dp){
  if(pos>=last) return 0;
  if(dp[pos]>=0) return dp[pos];
  if(last-pos==1 || last-pos==2){
    dp[pos] = abs(h[pos]-h[last]);
  }else{
    ll dp2 = min_search(pos+2, last, h, dp);
    ll dp1 = min_search(pos+1, last, h, dp);
    dp[pos] = min(abs(h[pos]-h[pos+1]) + dp1, abs(h[pos]-h[pos+2]) + dp2);
  }
  return dp[pos];
}

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N;
  cin >> N;
  vector<ll> h(N);
  rep(i, 0, N){
    cin >> h[i];
  }

  vector<ll> dp(N, -1);

  ll ans = min_search(0, N-1, h, dp);

  cout << ans << "\n";

  return 0;
}

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

int N;
vector<long int> A;

int main(){
    cin >> N;
    A.resize(N);
    int A_i = 0;
    for(int i = 0; i < N; i++){
        cin >> A_i;
        A[i] = A_i;
    }

    int A_i_1 = 0;
    long long int ans = 0;
    for(int i = 0; i < N; i++){
        if(A[i-1] > A[i] && i > 0){
            ans += A[i-1] - A[i];
            A[i] += A[i-1] - A[i];
        }
        //cout << A_i << endl;
    }

    /*for(int i = 0; i < N; i++){
        cout << A[i] << endl;
    }*/

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

Measured memory_bytes: 4720
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pi 3.14159265359
#define all(i) i.begin(),i.end()
using namespace std;
const long long INF=1e9+7;
const string alp="abcdefghijklmnopqrstuvwxyz"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;


int main() {
  ll N;cin>>N;
  ll T[N];
  ll sum=0;
  rep(i,N){
    cin>>T[i];
    sum+=T[i];
  }
  ll M;cin>>M;
  ll P[M],X[M];
  rep(i,M) cin>>P[i]>>X[i];
  
  for(int i=0;i<M;i++){
    ll ans=sum;
    ans-=T[P[i]-1];
    ans+=X[i];
    cout<<ans<<endl;
  }
}


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

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define rep(i,n) for(int i=0; i<(int)(n); i++)
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; }

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

//constexpr ll mod = 998244353;
constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

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

  int n; cin >> n;
  if (n==1) {
    cout << 0 << endl;
    return 0;
  }

  ll yma, ymi;
  ll xma, xmi;
  yma = xma = INT_MIN;
  ymi = xmi = INT_MAX;

  ll uma, umi;
  ll dma, dmi;
  ll rma, rmi;
  ll lma, lmi;

  uma = dma = rma = lma = INT_MIN;
  umi = dmi = rmi = lmi = INT_MAX;

  rep(i, n) {
    ll x, y; cin >> x >> y;
    x*=2; y*=2;
    char d; cin >> d;
    if (d=='U') {
      chmax(xma, x);
      chmin(xmi, x);
      chmax(uma, y);
      chmin(umi, y);
    } else if (d=='D') {
      chmax(xma,x);
      chmin(xmi,x);
      chmax(dma,y);
      chmin(dmi,y);
    } else if (d=='R') {
      chmax(rma,x);
      chmin(rmi,x);
      chmax(yma,y);
      chmin(ymi,y);
    } else {
      chmax(lma,x);
      chmin(lmi,x);
      chmax(yma,y);
      chmin(ymi,y);
    }
  }

  ll ans = LLONG_MAX;
  rep(i, 4e+8) {
    ll x1 = INT_MAX;
    if (xmi != INT_MAX) {
      chmin(x1, xmi);
    }
    if (rmi != INT_MAX) {
      chmin(x1, rmi+i);
    }
    if (lmi != INT_MAX) {
      chmin(x1, lmi-i);
    }
    ll x2 = INT_MIN;
    if (xma != INT_MIN) {
      chmax(x2, xma);
    }
    if (rma != INT_MAX) {
      chmax(x2, rma+i);
    }
    if (lma != INT_MAX) {
      chmax(x2, lma-i);
    }
    ll y1 = INT_MAX;
    if (ymi != INT_MAX) {
      chmin(y1, ymi);
    }
    if (umi != INT_MAX) {
      chmin(y1, umi+i);
    }
    if (dmi != INT_MAX) {
      chmin(y1, dmi-i);
    }
    ll y2 = INT_MIN;
    if (yma != INT_MIN) {
      chmax(y2, yma);
    }
    if (uma != INT_MAX) {
      chmax(y2, uma+i);
    }
    if (dma != INT_MAX) {
      chmax(y2, dma-i);
    }
    auto x = abs(x2-x1);
    auto y = abs(y2-y1);
    chmin(ans, x*y);
  }
  cout << setprecision(15) << (double)ans/4 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n == 0) return 1;

    ll res = modpow(x, n/2);
    if(n%2 == 0) return res*res%mod;
    else return res*res%mod*x%mod;
}


ll power(ll x, ll n){
    if(n == 0) return 1;

    ll res = power(x, n/2);
    if(n%2 == 0) return res*res;
    else return res*res*x;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };

/* <--------------------------------------------> */

typedef tuple<ll, ll, ll> T;
// get<K>(tuple型の変数)


const long double pi = acos(-1);
const long double eps = 0.0000000001;

long double a, b, x;

void input(){
    cin >> a >> b >> x;
}

long double f(long double a, long double b, long double theta){
    //if(theta > pi / 2.0 - eps) return 0.0;
    long double ret;
    if(a * tan(theta) <= b){
        ret = a * a * b - a * a * a * tan(theta) / 2.0;
    }
    else{
        ret = b * b * a / tan(theta) / 2.0;
    }
    return ret;
}

void solve(){
    input();
    long double ok = pi / 2.0;
    long double ng = 0.0;
    for(int _=0; _<100000; ++_){
        long double mid = (ok + ng) / 2.0;
        if(f(a, b, mid) < x) ok = mid;
        else ng = mid;
    }
    cout << setprecision(12) << ok * 180 / pi << endl;
}


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

    solve();
    
    return 0;
}



Measured memory_bytes: 384
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    N = int(input())
    A = list(map(int, input().split()))

    X = [0]*N
    Y = [0]*N
    for i in range(N):
        X[i] = i + A[i]
        Y[i] = i - A[i]
    Y.sort()

    res = 0
    for x in X:
        res += bisect.bisect_right(Y, x) - bisect.bisect_left(Y, x)
    
    print(res)


if __name__ == '__main__':
    main()

Measured memory_bytes: 97776
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
const ll MOD = 1e9+7; ll LLINF = 1LL << 60; int INF = INT_MAX;

//

int main(){
    string a,b,c; cin>>a>>b>>c;
    if(a[a.size()-1]==b[0]&&b[b.size()-1]==c[0]) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <unordered_map>
#include <random>
#include <queue>
#include <iomanip>

#define BIG 1000000007
#define LLMAX 9223372036854775807
#define LLMIN (-9223372036854775808)
#define long long long

using namespace std;



int main() {
    string s;
    cin >> s;
    int c = 0;
    for(auto a = s.begin();a != s.end();++a){
        if((*a) == 'x')++c;
        if(c >= 8){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;

}







Measured memory_bytes: 760
package main

import "fmt"
	
func main() {
    var a,b,c int
    
    fmt.Scanf("%d %d %d",&a, &b, &c)
    
    if a+b+c == 17 && a*b*c == 175 {
        fmt.Printf("YES\n")
    } else {
        fmt.Printf("NO\n")
    }
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
void read(int &x)
{
    int f=1;
    x=0;
    char s=getchar();
    while(s<'0'||s>'9')
    {
        if(s=='-')
            f=-1;
        s=getchar();
    }
    while(s>='0'&&s<='9')
    {
        x=x*10+s-'0';
        s=getchar();
    }
    x*=f;
}


int main(){
    int n,m;
    cin>>n>>m;
    cout<<n*m;
    
    return 0;
}

Measured memory_bytes: 3636
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] args) {
	
		FastScanner fs = new FastScanner();
		int d = fs.nextInt();
		int t = fs.nextInt();
		int s = fs.nextInt();
		if(t*s>=d) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

	void sort(int[] a) {
		ArrayList<Integer> list=new ArrayList<>();
		for (int i:a) list.add(i);
		Collections.sort(list);
		for (int i=0; i<a.length; i++) a[i]=list.get(i);
	}
	
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		public String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
			
		}
		
		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}
		
		public long[] readLongArray(int n) {
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
	}
 
}





Measured memory_bytes: 32664
#include<stdio.h>
#define MAX 10000
#define NOT_FOUND -1

int linear(int *A, int key, int n){
  int i = 0;
  A[n] = key;

  while(A[i] != key){
    //printf("A[i](%d) and key(%d) is different!\n", A[i], key);
    i++;
    if(i == n) return NOT_FOUND;
  }
  return A[i];
}

int main(){
  int i, n_S, n_T, cnt=0, find;
  int S[MAX], T[MAX];

  scanf("%d", &n_S);
  for(i=0; i<n_S; i++){
    scanf("%d", &S[i]);
  }
  scanf("%d", &n_T);
  for(i=0; i<n_T; i++){
    scanf("%d", &T[i]);
  }
  for(i=0; i<n_T; i++){
    if(linear(S, T[i], n_S-1) != NOT_FOUND){
      //printf("find!____%d\n", linear(S, T[i], n_S));
      cnt++;
    }
  }

  printf("%d\n", cnt);
  return 0;
}



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

typedef long long ll;
using namespace std;

int main(){
	ios_base::sync_with_stdio(0);
	//	srand(time(NULL));
	int n; cin >> n;
	map<int,int>cnt;
	while(n--){
		int tmp; cin >> tmp;
		cnt[tmp]++;
	}

	int res = 0;
	for(map<int,int>::iterator it = cnt.begin(); it != cnt.end(); it++){
		res += it->second;
		if(it->second >= it->first)
			res -= it->first;
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 4736
from sys import stdin, stdout
import math,sys,heapq
from itertools import permutations, combinations
from collections import defaultdict,deque,OrderedDict
from os import path
import bisect as bi
def yes():print('YES')
def no():print('NO')
if (path.exists('input.txt')): 
    #------------------Sublime--------------------------------------#
    sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w');
    def I():return (int(input()))
    def In():return(map(int,input().split()))
else:
    #------------------PYPY FAst I/o--------------------------------#
    def I():return (int(stdin.readline()))
    def In():return(map(int,stdin.readline().split()))
#sys.setrecursionlimit(1500)
def dict(a):
    d={} 
    for x in a:
        if d.get(x,-1)!=-1:
            d[x]+=1
        else:
            d[x]=1
    return d


def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bi.bisect_right(a, x)
    if i != len(a):
        return i
    else:            
        return -1

def main():
    try:
        n=I()
        l=list(In())
        l.sort()
        ans=0
        for i in range(n):
            for j in range(i+1,n):
                for k in range(j+1,n):
                    q=0
                    if l[i]+l[j]>l[k]:
                        q+=1
                    if l[j]+l[k]>l[i]:
                        q+=1
                    if l[i]+l[k]>l[j]:
                        q+=1
                    if q==3 and (l[i]!=l[j]) and(l[j]!=l[k]) and (l[i]!=l[k]):
                        #print(i+1,j+1,k+1)
                        ans+=1
        print(ans)
    except: 
        pass
        
M = 998244353
P = 1000000007
Inf=1000000000000000000
if __name__ == '__main__':
    #for _ in range(I()):main()
    for _ in range(1):main()




Measured memory_bytes: 9416
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
using namespace std;
const long long int mod=1e9+7;
pair<long long int,long long int> dfs(int node,bool vi[],vector<vector<int> > &v){
	vi[node]=true;
	int n=v[node].size();long long int w=1,b=1;
	pair<long long int,long long int> p;
	for(int i=0;i<n;i++){
		if(!vi[v[node][i]]){
			p=dfs(v[node][i],vi,v);
			w=((p.first+p.second)%mod*w)%mod;
			b=(p.first*b)%mod;
		}
	}
	return make_pair(w,b);
}
int main(){
	int n;cin>>n;
	vector<vector<int> > v(n+1);
	for(int i=0;i<n-1;i++){
		int u1,u2;cin>>u1>>u2;
		v[u1].push_back(u2);
		v[u2].push_back(u1);
	}
	pair<long long int,long long int> p;
	bool vi[n+1];vi[0]=true;
	for(int i=1;i<n+1;i++)
	vi[i]=false;
	p=dfs(1,vi,v);
	cout<<(p.first+p.second)%mod<<endl;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef vector< pair<int, int> > vpii;

#define MOD 1000000007
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define all(v) v.begin(), v.end()
#define FOR(i, n) for (int i = 0; i < n; i++)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define input_arr(a, n)         \
    for (int i = 0; i < n; i++) \
        cin >> a[i];
#define print_arr(a, n)         \
    for (int i = 0; i < n; i++) \
        cout << a[i] << " ";
#define deb(n) cerr << #n << "=" << n << "\n";

void fst()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	int n, ans = 0, cout_r = 0, cout_w = 0;
    string s;
    cin >> n;
    cin >> s;
    FOR(i,n) {
        if(s[i] == 'R')
            cout_r++;
        else
            cout_w++;
    }
    FOR(i,cout_r)
        if(s[i]!='R')
            ans++;
    rep(i, cout_r, n) if (s[i] != 'W')
        ans++;
    cout << ans /2 << endl;
    return 0;
}


Measured memory_bytes: 3728
#include<bits/stdc++.h>
#define REP(i,n) for(long long i = 0;i < n;++i)
#define FOR(i,a,b) for(long long i = a;i < b;++i)
using namespace std;
using ll = long long;
using point = pair< int,int >;

int n;
int dp[100001];
const int atm[] = {1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049};
const int INF = INT_MAX;

//int solve(int p, int cnt);

int main(){
    scanf("%d", &n);
    fill(dp, dp + 100001, INF);
    dp[0] = 0;
    FOR(i,1,n + 1) {
        FOR(j,0,12) {
            if (atm[j] > i) continue;
            dp[i] = min(dp[i], dp[i - atm[j]] + 1);
        }
    }
    printf("%d\n", dp[n]);
    return 0;
}



Measured memory_bytes: 640
#include <stdio.h>

char scanValidChar(void){
	char c;
	do {
		scanf("%c", &c);
	} while (c <= 32 || c > 127);
	return c;
}

int main(void){
	char table[256];
	int n;
	char s, d;
	
	while (scanf("%d\n",&n), n){
		// reset table
		for (int i=0; i<256; i++) table[i] = i;
		// load table
		for (int i=0; i<n; i++){
			s = scanValidChar();
			d = scanValidChar();
			table[s] = d;
	//		printf("%c(%d) -> %c(%d)\n", s, s, d, d);
		}
		scanf("%d", &n);
		for (int i=0; i<n; i++){
			printf("%c", table[scanValidChar()]);
		}
		puts("");
	}
	
	return 0;
}

Measured memory_bytes: 1020
#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)n;i++)
#define REP1(j,n) for(int j=0;j<(int)n;j++)
#define REPD(i,n) for(int i=n;i>=0;i--)
#define REPD1(j,n) for(int j=n;j=>0;j--)
#define REPS(i,n) for(int i=1;i<=(int)n;i++)
#define REPS1(j,n) for(int j=1;j<=(int)n;j++)
#define rep(i,a,n) for(int i=a;i<=(int)n;i++)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())

using namespace std;
typedef long long ll;

int main(void) {
	int n;
	cin >> n;
	cout << "ABC" << n << endl;
	return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include<math.h>
int main ()
{
    int a,b,c,d,e,f;
    scanf("%d%d",&a,&b);
    c=a+b;
    d=a*b;
    e=a-b;
    if(c>d&&c>e)
    f=c;
    else if(d>c&&d>e)
    f=d;
    else if(e>c&&e>d)
    f=e;
    printf("%d\n",f);
    return 0;
}

Measured memory_bytes: 2148
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
ll dp[3001][3001][2];
int main()
{
	int num, kai;
	scanf("%d%d", &num, &kai);
	for (int i = 0; i <= num; i++)dp[0][i][i == 0] = 1;
	for (int i = 0; i < kai; i++)
	{
		for (int j = 0; j <= num; j++)
		{
			for (int k = 0; k < 2; k++)
			{
				if (j != 0)dp[i + 1][j - 1][k || (j - 1 == 0)] = (dp[i + 1][j - 1][k || (j - 1 == 0)] + dp[i][j][k]) % mod;
				if (j != 0)dp[i + 1][j][k || (j - 1 == 0)] = (dp[i + 1][j][k || (j - 1 == 0)] + dp[i][j][k]) % mod;
				if (j != num)dp[i + 1][j + 1][k] = (dp[i + 1][j + 1][k] + dp[i][j][k]) % mod;
				if (j != num)dp[i + 1][j][k] = (dp[i + 1][j][k] + dp[i][j][k]) % mod;
			}
		}
	}
	ll ans = 0;
	for (int i = 0; i <= num; i++)ans = (ans + dp[kai][i][1]) % mod;
	printf("%lld\n", ans);
}

Measured memory_bytes: 140928
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
typedef long long ll;

using namespace std;

int main()
{
	int n;
	bool c[4];
	char s[100];
	int ans=0;
	
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>s[i];
	}
	for(int i=0;i<4;i++)
	{
		c[i]=false;
	}
	for(int i=0;i<n;i++)
	{
		if(s[i]=='P')
		{
			c[0]=true;
		}else if(s[i]=='W'){
			c[1]=true;
		}else if(s[i]=='G'){
			c[2]=true;
		}else if(s[i]=='Y'){
			c[3]=true;
		}
	}
	for(int i=0;i<4;i++)
	{
		if(c[i]==true)
		{
			ans++;
		}
	}
	if(ans==3)
	{
		cout<<"Three"<<endl;
	}else if(ans==4){
		cout<<"Four"<<endl;
	}
	return 0;
}

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

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

    int ans = 0;
    while (n / k > 0)
    {
        n /= k;
        ans++;
    }
    if (n != 0)
        ans++;

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

Measured memory_bytes: 256
#include<iostream>
#include<cstdlib>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<cmath>

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


Measured memory_bytes: 256
using System;

namespace _0014
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string ml = Console.ReadLine();
                if (ml == null) { break; }
                int a = int.Parse(ml);
                int a1 = 600 / a;
                int y=0;
                for(int i = 1; i <= a1; i++)
                {
                    y += a *a* (a * (i-1)*(i-1)); 
                }
                Console.WriteLine(y);
            }
        }
    }
}

Measured memory_bytes: 8940
#include <bits/stdc++.h> //STL include
typedef long long ll;// long long int
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;//namespace

#define dump(x)  cout << #x << " = " << (x) << endl;// debug cout
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define SANKOU(n,a,b) cout << ((n) ? (a) : (b) ) << endl;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)// for macro
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);// warshall-floyd

#define CIN(x) int x;cin>>x;
#define CIN2(x,y) int x,y;cin>>x>>y;
#define CIN3(x,y,z) int x,y,z;cin>>x>>y>>z;
#define SCIN(x) string x;cin>>x;
#define SCIN2(x,y) string x,y;cin>>x>>y;
#define COUT(x) cout<<(x)<<endl;
#define SCOUT(x) cout<<(x)<<" ";
#define ENDL cout<<endl;

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_;
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i];
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl;

#define ALL(obj) (obj).begin(),(obj).end()// iterator

#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())


#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define L list<int>

#define pb(a) push_back(a)//push_back
#define mp make_pair// make_pair


int main(){

    SCIN(s);
    V vec;
    FOREACH(x,s)vec.pb(x);
    int cou=0;
    int sin=0;
    bool flag=true;
    while(flag){
        if(vec.size()==2)break;
        REP(i,vec.size()-2){
            if(vec[i]!=vec[i+2]){
                vec.erase(vec.begin()+1+i);
                cou++;
                break;
            }
            if(i==vec.size()-3)flag=false;
        }
    }
    SANKOU((cou%2==0),"Second","First");

    return 0;
}


Measured memory_bytes: 1020
/*
██╗  ██╗ █████╗ ██████╗ ███████╗███████╗███╗   ███╗        ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝██╔══██╗██╔══██╗██╔════╝██╔════╝████╗ ████║        ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝ ███████║██████╔╝█████╗  █████╗  ██╔████╔██║        █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗ ██╔══██║██╔══██╗██╔══╝  ██╔══╝  ██║╚██╔╝██║        ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██║  ██║██║  ██║███████╗███████╗██║ ╚═╝ ██║███████╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═╝     ╚═╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
Believe in yourself ,( try and try and then try ), You can do it  
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define clr(arr, x) memset(arr, x, sizeof arr)
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
#define OO 0x3f3f3f3f3f3f3f3fLL
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
void K_K(){
 	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int n, m;
vector<vector<char>>arr;
bool valid(int i, int j){
	return i > -1 && j > -1 && i < n&&j < m&&arr[i][j] == '.';
}
int dp[1001][1001];
int sol(int i, int j){
	if (i == n - 1 && j == m - 1)
		return 1;
	if (!valid(i, j))
		return 0;
	int &ret = dp[i][j];
	if (~ret)
		return ret;
	int ch1 = sol(i + 1, j) % mod;
	int ch2 = sol(i, j + 1) % mod;
	return ret = (ch1 + ch2) % mod;
}
int main(){
	K_K();
	cin >> n >> m;
	arr.resize(n, vector<char>(m));
 	for (int i = 0; i < n; i++){
		for (int j = 0; j < m; j++)
			cin >> arr[i][j];
	}
	clr(dp, -1);
	cout << sol(0, 0);
}

Measured memory_bytes: 5248
#include <iostream>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b;
  char ch;
  cin >> a >> ch >> b;
  if (ch == '+')
    cout << a + b << "\n";
  else
    cout << a - b << "\n";
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long int
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;

struct edge { int to, cost; };

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

signed main()
{
   int n, W; cin >> n >> W;
   V<int> w(n), v(n);
   for (int i = 0; i < n; i++) {
      cin >> w[i] >> v[i];
   }

   int vsum = accumulate(v.begin(), v.end(), 0LL);

   V<int> dp(vsum+1, INF);
   dp[0] = 0;
   for (int i = 0; i < n; i++) {
      for (int j = vsum; j >= 0; j--) {
         if (j + v[i] <= vsum) {
            chmin(dp[j + v[i]], dp[j] + w[i]);
         }
      }
   }

   for (int i = vsum; i >= 0; i--) {
      if (dp[i] <= W) {
         cout << i << endl;
         return 0;
      }
   }

   return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int fact(int n){
    int ret =1;
    for(int i =0; i<2; i++){
        ret *=n;
        n--;
    }
    return ret;
}
int main(int argc, char* argv[]) {
    int n, m;
    cin >> n >> m;
    cout << (fact(n)+fact(m))/2 << endl;
    return 0;
}


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

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

void inseSort(int A[],int n, int g)
{
  for(int i=g; i<n; i++)
  {
    int v = A[i];
    int j = i-g;
    while(j>=0 && A[j] > v)
    {
      A[j+g] = A[j];
      j -= g;
      cnt++;
    }
    A[j+g] = v;
  }
}

void shell(int A[], int n)
{
  for(int h=1; ;)
  {
    if(h>n) break;
    G.push_back(h);
    h = 3*h + 1;
  }
  for(int i=G.size()-1; i>=0; i--)
  {
    inseSort(A, n, G[i]);
  }
}

int main()
{
  scanf("%d", &n);
  for(int i=0; i<n; i++)
  {
    scanf("%d", &A[i]);
  }
  cnt = 0;
  shell(A, n);
  printf("%d\n", G.size());
  for(int i=G.size()-1; i>=0; i--)
  {
    printf("%d", G[i]);
    if(i) printf(" ");
  }
  printf("\n");
  printf("%d\n", cnt);
  for(int i=0; i<n; i++)
  {
    printf("%d\n", A[i]);
  }

  return 0;
}



Measured memory_bytes: 7124
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>
#include <cstring>

using namespace std;

#define mp make_pair
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define FFOR(i, a, b) for(int (i)=a;(i)>(b);--(i))
#define rrep(i,n) FFOR(i,0,n)
#define vsort(v) sort((v).begin(), (v).end());					//小さい順
#define rvsort(v) sort(v.begin(), v.end(),greater<>());		//大きい順
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define lb long double
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define F first
#define S second
#define pb push_back
#define ll long long
#define mod 1000000007LL
#define INF 123456789012345
typedef pair<int, int> P;
typedef pair<int, P> PP;

const int maxn =2e5 + 10;
int a[maxn];
int check[maxn];
int yoko[5] = {0,9,7,5,3};
int tate[11] = {0,8,5,2,10,7,4,1,9,6,3};

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

	int total = 9*9;
	total %=11;
	ll ans = 0;
	ll sum = 0;
	rep(i,11)rep(j,5)
	{
		int check = total + yoko[j] + tate[i];
		check %= 11;
		if(check == k) sum++;
	}

	int kittiri = (n-2) / 11;

	ans += sum * kittiri;

	int amari = (n-2) % 11;

	rep(i,amari)rep(j,5)
	{
		int check = total + yoko[j] + tate[i];
		check %= 11;
		if(check == k) ans++;
	}



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

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include <stack>
using namespace std;
#define ll long long
int main()
{
	//int t;
	//cin>>t;
	//for(int i=0;i<t;i++)
	//{
	  int n,k,sum=0;
	 cin>>n>>k;
	 vector<int> a(n);
	 for(int i=0;i<n;i++) cin>>a[i];
	 sort(a.begin(),a.end());
	 for(int i=0;i<k;i++) sum=sum+a[i];
	cout<<sum;
}
	
	
	
	

		



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

using ll = long long;

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

	ll c = 0LL;
	for (ll i = n; i >= 1; i--) {
		if (b[i - 1] > a[i]) {
			b[i - 1] -= a[i]; c += a[i];
			a[i] = 0LL;
			if (b[i - 1] > a[i - 1]) {
				b[i - 1] = 0LL; c += a[i - 1];
				a[i - 1] = 0LL;
			}
			else {
				a[i - 1] -= b[i - 1]; c += b[i - 1];
				b[i - 1] = 0LL;
			}
		}
		else {
			a[i] -= b[i - 1]; c += b[i - 1];
			b[i - 1] = 0LL;
		}
	}

	cout << c << endl;
}


Measured memory_bytes: 1792
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

const int N = 1010;
const int INF = 1e9;

int n, m;
int dd[N][N];

queue<pair<int, int>> qu;

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

int nm(int x, int y) {
	return x >= 0 && y >= 0 && x < n && y < m;
}

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> m;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < m; ++j)
			dd[i][j] = INF;
	}
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < m; ++j) {
			char c;
			cin >> c;
			if (c == '#') {
				dd[i][j] = 0;
				qu.emplace(i, j);
			}
		}
	}
	while (!qu.empty()) {
		int x, y;
		tie(x, y) = qu.front();
		qu.pop();
		for (int i = 0; i < 4; ++i) {
			int nx = x + dx[i];
			int ny = y + dy[i];
			if (nm(nx, ny) && dd[nx][ny] > dd[x][y] + 1)
				dd[nx][ny] = dd[x][y] + 1, qu.emplace(nx, ny);
		}
	}
	int ans = 0;
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < m; ++j)
			ans = max(ans, dd[i][j]);
	cout << ans << "\n";
	return 0;
}




Measured memory_bytes: 12432
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_STR_MAX		105										// 最大文字列長
#define D_CHAR_CNT		26										// 文字種類数

// 内部変数
static FILE *szpFpI;											// 入力
static char sc1Str[D_STR_MAX];									// 文字列
static int siLen;												// 文字列長

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
	static int siTNo;
#endif

// １行出力
int
fOutLine(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// 回数 - 取得
int
fGetCnt(
	char pcChar					// <I> 対象文字
)
{
	int i, j;
	char lc1Buf[D_STR_MAX], lc1Buf2[D_STR_MAX];

	memcpy(lc1Buf, sc1Str, siLen);
	int liCnt = 0;
	for (i = siLen; ; i--) {
		
		// 終了チェック
		for (j = 0; j < i; j++) {
			if (lc1Buf[j] != pcChar) {
				break;
			}
		}
		if (j == i) {
			return liCnt;
		}

		// 変換
		liCnt++;
		for (j = 0; j < i - 1; j++) {
			if (lc1Buf[j] == pcChar || lc1Buf[j + 1] == pcChar) {
				lc1Buf2[j] = pcChar;
			}
			else {
				lc1Buf2[j] = lc1Buf[j];
			}
		}
		memcpy(lc1Buf, lc1Buf2, i - 1);
	}

	return 0;
}

// 実行メイン
int
fMain(
)
{
	int i;

	// 文字列 - 取得
	fgets(sc1Str, sizeof(sc1Str), szpFpI);

	// 文字数 - 取得
	int li1Cnt[D_CHAR_CNT];
	memset(li1Cnt, 0, sizeof(li1Cnt));
	for (siLen = 0; ; siLen++) {
		int liNo = sc1Str[siLen] - 'a';
		if (liNo < 0 || D_CHAR_CNT <= liNo) {
			break;
		}
		else {
			li1Cnt[liNo]++;
		}
	}

	// 最小回数 - 取得
	int liMin = INT_MAX;
	for (i = 0; i < D_CHAR_CNT; i++) {
		if (li1Cnt[i] > 0) {
			int liCnt = fGetCnt('a' + i);
			if (liMin > liCnt) {
				liMin = liCnt;
			}
		}
	}

	return liMin;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 実行メイン
	liRet = fMain();

	// １行出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOutLine(lc1Buf);

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		siTNo = i;
		fOne();
	}
#else
	fOne();
#endif

	return 0;
}



Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>

using namespace std;

const int MAXN = 200000 + 1000;
const int MOD = 1000000000 + 7;

int fpow(int x, int p)
{
	int ret = 1;
	for(; p; p >>= 1, x = (long long)x * x % MOD)
		if(p & 1)
			ret = (long long)ret * x % MOD;
	return ret;
}
int inv(int x)
{
	return fpow(x, MOD - 2);
}

int n, X, Y;
int c[MAXN], w[MAXN], mn[MAXN];
vector<int> edg[MAXN];
bool vis[MAXN];

void add_edge(int x, int y)
{
	edg[x].push_back(y);
	edg[y].push_back(x);
}

vector<int> vec;
int cnt[MAXN];
void dfs(int x)
{
	vis[x] = true, vec.push_back(x);
	for(int i = 0; i < edg[x].size(); i++)
		if(!vis[edg[x][i]])
			dfs(edg[x][i]);
}

void solve()
{
	for(int i = 1; i <= n; i++)
		mn[c[i]] = i;
	for(int i = 1; i <= n; i++)
		if(!mn[c[i]] || w[i] < w[mn[c[i]]])
			mn[c[i]] = i;
	for(int i = 1; i <= n; i++)
		if(i != mn[c[i]] && w[i] + w[mn[c[i]]] <= X)
			add_edge(i, mn[c[i]]);
	int mn1 = 0, mn2 = 0;
	for(int i = 1; i <= n; i++)
		if(mn[i])
		{
			if(!mn1 || w[mn[i]] < w[mn1])
				mn2 = mn1, mn1 = mn[i];
			else if(!mn2 || w[mn[i]] < w[mn2])
				mn2 = mn[i];
		}
	if(mn1 && mn2)
	{
		for(int i = 1; i <= n; i++)
			if(c[i] != c[mn1] && w[i] + w[mn1] <= Y)
				add_edge(i, mn1);
		for(int i = 1; i <= n; i++)
			if(c[i] != c[mn2] && w[i] + w[mn2] <= Y)
				add_edge(i, mn2);
	}
	int ans = 1, tmp = 1;
	for(int i = 1; i <= n; i++)
		if(!vis[i])
		{
			vec.clear();
			dfs(i);
			// cerr << vec.size() << endl;
			for(int j = 1; j <= vec.size(); j++)
				ans = (long long)ans * j % MOD;
			for(int j = 0; j < vec.size(); j++)
				cnt[c[vec[j]]]++, tmp = (long long)tmp * cnt[c[vec[j]]] % MOD;
			for(int j = 0; j < vec.size(); j++)
				cnt[c[vec[j]]]--;
		}
	ans = (long long)ans * inv(tmp) % MOD;
	cout << ans << endl;
}

int main()
{
	ios::sync_with_stdio(false);
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);

	cin >> n >> X >> Y;
	for(int i = 1; i <= n; i++)
		cin >> c[i] >> w[i];

	solve();



	return 0;
}


Measured memory_bytes: 16244
#include "bits/stdc++.h"
#pragma optimize("unroll-loops");
#pragma optimize("Ofast");
//#include "pch.h"    
using namespace std;
unordered_map<int, bool> here;
 
using ll = long long;
const int nax = 1e5 + 10;
vector<int> edges[nax];

int main() {
    
    ll x;
    cin >> x;
    
    for(ll a = -1000; a <= 1000; ++a) {
        for(ll b = -1000; b <= 1000; ++b) {
            ll aa = a*a*a*a*a;
            ll bb = b*b*b*b*b;
            if(aa - bb == x) {
                cout << a << " " << b << "\n";
                return 0;
            }
        }
    }
}


Measured memory_bytes: 5944