akhauriyash/Code-Regression huggingface dataset:
N, M = map(int, input().split(' '))
H_ls = list(map(int, input().split(' ')))
edge, rst = [ [] for i in range(N) ], 0
for i in range(M):
    a, b = map(int, input().split(' '))
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)
for i in range(N):
    is_peak = True
    for j in edge[i]:
        if H_ls[i] <= H_ls[j]:
            is_peak = False
            break
    if is_peak:
        rst += 1
print(rst)

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

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

#define REP(i,a,b) for(int i=(a); i<(b);++i)
#define rep(i,n) REP(i,0,n)
#define INF (1<<29)
#define INFLL (1L<<62)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

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

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int N;
  while (cin >> N, N) {
    vector<int> A(N);
    rep(i, N) cin >> A[i];

    int min_abs = INF;
    rep(i, N) rep(j, N) {
      if (i == j) continue;
      min_abs = min(abs(A[i] - A[j]), min_abs);
    }

    cout << min_abs << endl;
  }
  return 0; 
}

Measured memory_bytes: 3088
/* ****devACE**** */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define    endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
using namespace std;

#define N  100005

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int TESTS=1;
//    cin>>TESTS;
    while(TESTS--)
    {
        priority_queue<ll>pq;
        ll n,i,j,k;
        cin>>n>>k;
        for(i=0;i<n;i++){
            ll num;
            cin>>num;
            pq.push(num);
        }
        while(k--){
            ll num = pq.top();
            pq.pop();
            pq.push(num/2);
        }

        ll sum=0;
        while(!pq.empty()){
            sum+=pq.top();
            pq.pop();
        }

        cout<<sum;
    }
    return 0;
}

Measured memory_bytes: 1400
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

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

  long dif = n % k;
  if (dif < k - dif) {
    cout << dif << endl;
  } else {
    cout << k - dif << endl;
  }
}


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

int n;
char s[1010];
bool p1, p2, p3, p4;

int main() {
	scanf("%s", s);
	n = strlen(s);
	for(int i = 0; i < n; i++) {
		if(s[i] == 'N') p1 = true;
		else if(s[i] == 'S') p2 = true;
		else if(s[i] == 'W') p3 = true;
		else p4 = true;
	}
	if(!(p1 ^ p2) && !(p3 ^ p4)) printf("Yes\n");
	else printf("No\n");
	return 0;
}


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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;
template <class T> using vec = vector<T>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  ll n;
  cin >> n;
  vec<ll> p(n);
  scan(p);

  ll ans = 0;
  rep(i, 0, n - 1) {
    if (i + 1 != p[i]) continue;
    swap(p[i], p[i + 1]);
    ans++;
  }

  if (n == p[n - 1]) {
    ans++;
    swap(p[n - 2], p[n - 1]);
  }

  put(ans);
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

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

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) { return (a * b) / gcd(a, b); }

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


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

const int N = 1001;
const int M = 6;
const int INF = 1 << 29;

struct edge{
  int n,c;
};

struct data{
  int s,t;
};

struct state{
  int n,bit,c;
  bool operator < (const state &s) const{
    return c > s.c;
  }
};


int n,m,m2,p;
vector<edge> G[N];
data v[M];
int d[N][1<<(M+M)];
int vs[N];
int vt[N];

void solve(){
  priority_queue<state> Q;
  state u,u2;

  fill(d[0],d[n],INF);
  d[p][0] = 0;

  for(Q.push((state){p,0,0}); !Q.empty();){
    u = Q.top();
    Q.pop();

    if(u.bit == ((1 << m2) - 1) << m2){
      cout << u.c << endl;
      return;
    }

    for(int i=0;i<G[u.n].size();i++){
      edge &e = G[u.n][i];
      u2 = (state){e.n, u.bit, u.c+e.c};
      if(vs[u2.n] >= 0 && (u2.bit & (1 << vs[u2.n])) == 0 && (u2.bit & (1 << (vs[u2.n] + m2))) == 0) {
        u2.bit |= 1 << vs[u2.n];
      }
      if(vt[u2.n] >= 0 && (u2.bit & (1 << (vt[u2.n]))) != 0){
        u2.bit ^= 1 << vt[u2.n];
        u2.bit |= 1 << (vt[u2.n] + m2);
      }
      if(d[u2.n][u2.bit] > u2.c){
        d[u2.n][u2.bit] = u2.c;
        Q.push(u2);
      }
    }
  }

  cout << "Cannot deliver" << endl;
}

int main(){
  while(cin >> n >> m >> m2 >> p){
    fill(vs,vs+n,-1);
    fill(vt,vt+n,-1);
    for(int i=0;i<n;i++) G[i].clear();
    p--;
    for(int i=0;i<m;i++){
      int a,b,c;
      cin >> a >> b >> c;
      a--;
      b--;
      G[a].push_back((edge){b,c});
      G[b].push_back((edge){a,c});
    }
    for(int i=0;i<m2;i++){
      cin >> v[i].s >> v[i].t;
      v[i].s--;
      v[i].t--;
      vs[v[i].s] = i;
      vt[v[i].t] = i;
    }
    solve();
  }
}

Measured memory_bytes: 18108
use proconio::input;

fn main() {
    input! {
        n: usize,
        s: [String; n],
    }

    let ac = s.iter().filter(|x| x.to_string() == "AC").count();
    let wa = s.iter().filter(|x| x.to_string() == "WA").count();
    let tle = s.iter().filter(|x| x.to_string() == "TLE").count();
    let re = s.iter().filter(|x| x.to_string() == "RE").count();

    println!("AC x {}", ac);
    println!("WA x {}", wa);
    println!("TLE x {}", tle);
    println!("RE x {}", re);
}


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

char str[500003]; int N;

bool check(int mid){
	int minus = 0;
	for(int i = 1 ; i <= N ; ++i){
		int t = str[i] - '0' - minus; if(t > mid) return 0;
		minus = (mid - t) / 10; mid = t + 10 * minus;
	}
	return 1;
}

int main(){
	scanf("%s" , str + 1); N = strlen(str + 1); reverse(str + 1 , str + N + 1); int L = 1 , R = 10 * N;
	while(L < R){int mid = (L + R) >> 1; check(mid) ? R = mid : L = mid + 1;}
	cout << (L + 8) / 9; return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vb=vector<bool>;
using vvb=vector<vb>;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pll = pair<ll,ll>;
using vpii = vector<pii>;
using vpli = vector<pli>;
using vpll = vector<pll>;

#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++)
int INF=1e9+7;

int main() {
  int T1,T2;
  ll A1,A2,B1,B2;
  cin >> T1>>T2>>A1>>A2>>B1>>B2;
  ll X1=(A1-B1)*T1,X2=(A2-B2)*T2;
  
  if(X1+X2==0) cout << "infinity" << endl;
  else if(X1>0&&X1+X2>0||X1<0&&X1+X2<0) cout << 0 << endl;
  else {
    if(X1<0) {
      X1*=-1;
      X2*=-1;
    }
    ll ans;
    if(X1%-(X1+X2)) ans=X1/-(X1+X2)*2+1;
    else ans=X1/-(X1+X2)*2;
    cout << ans << endl;
  }
}

Measured memory_bytes: 3632
def main():
    n = int(input())
    # n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    s = input()

    ans = ""

    for i in s:
        ans += chr((ord(i) - ord("A") + n)% 26 + ord("A"))

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 73332
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static int N;
        static int X;
        static int Y;

        static void Main(string[] args)
        {
            //[summary]D - Line++
            var line = ReadLine();
            N = line[0];
            X = line[1];
            Y = line[2];

            var distances = new Dictionary<int, int>();
            
            for(int i = 1; i < N; i++)
            {
                distances.Add(i, 0);
            }

            for (int i = 2; i <= N; i++)
            {
                for (int j = 1; j < i; j++)
                {
                    var d = CalcDistance(j, i);
                    distances[d]++;
                }
            }
            
            foreach(var d in distances)
            {
                Console.WriteLine(d.Value);
            }
        }

        static int CalcDistance(int start, int end)
        {
            var route1 = end - start;
            var route2 = Math.Abs(X - start) + 1 + Math.Abs(end - Y); 
            
            return Math.Min(route1, route2);
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine();
            var arr = line.Split(' ');

            return arr.Select(x => int.Parse(x)).ToList();
        }
    }
}

Measured memory_bytes: 13408
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

ok = True
color = [-1]*N
q = [0]
color[0] = 0
c = 0
while q:
    qq = []
    c ^= 1
    for p in q:
        for np in graph[p]:
            if color[np] == -1:
                color[np] = c
                qq.append(np)
            elif color[np] != c:
                ok = False
                break
    if not ok: break
    q = qq

if not ok:
    ans = N*(N-1)//2 - M
else:
    s = sum(color)
    ans = s*(N-s) - M
print(ans)

Measured memory_bytes: 22064
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S, T;
    cin >> S >> T;
    rep(i, 26) {
        char t = '0';
        rep(j, S.length()) {
            if (S[j] == 'a' + i) {
                if(t == '0') t = T[j];
                else if(t != T[j]) {
                    cout << "No" << endl;
                    return 0;
                }
            }
            if (T[j] == t) {
                if (S[j] != 'a' + i) {
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }
    cout << "Yes" << endl;


    return 0;
}


Measured memory_bytes: 916
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
//#define INF 810114514
//#define PI 3.141592653589
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << "No" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl

std::vector<long long> primearray(long long N){
    std::vector<long long> R;
    std::vector<bool> prime;
    for(int i=0;i<=N;i++){
        prime.push_back(true);
    }
    if(N<2){
        return R;
    }
    prime[0]=false;
    prime[1]=false;
    for(long long i=2;i*i<=N;i++){
        if(!prime[i])continue;
        for(int j=2*i;j<=N;j+=i){
            prime[j]=false;
        }
    }
    for(long long i=0;i<prime.size();i++){
        if(prime[i]){
            R.push_back(i);
        }
    }
    return R;
}

long long inverse(long long b){
    long long r=1,e=MOD-2;
    while(e){
        if(e&1){
            r=(r*b)%MOD;
        }
        b=(b*b)%MOD;
        e >>=1;
    }
    return r;
}

signed main(void){
    int N;
    int A[14514];
    int Amax=0;
    cin >> N;
    REP(i,N){
        cin >> A[i];
        Amax=max(Amax,A[i]);
    }
    vector<int> F = primearray(Amax+1);
    map<int,int> mp;
    REP(i,F.size()){
        mp[F[i]]=i;
    }
    vector<int> M;
    
    REP(j,N){
        vector<int> P;
        int k = A[j];
        while(k>1){
            bool c=false;
            for(int i=2;i*i<=k;i++){
                if(k%i==0){
                    P.push_back(i);
                    k/=i;
                    c=true;
                    break;
                }
            }
            if(c==false){
                P.push_back(k);
                k=1;
            }
        }
        /*REP(i,P.size()){
            cout << P[i] << " ";
        }cout << endl;*/
        vector<int> m = M;
        M.clear();
        int mi=0,pi=0;
        while(mi<m.size() && pi<P.size()){
            if(m[mi]==P[pi]){
                M.push_back(m[mi]);
                mi++;pi++;
            }else if(m[mi]<P[pi]){
                M.push_back(m[mi]);
                mi++;
            }else{
                M.push_back(P[pi]);
                pi++;
            }
        }
        while(mi<m.size()){
            M.push_back(m[mi]);
            mi++;
        }
        while(pi<P.size()){
            M.push_back(P[pi]);
            pi++;
        }
    }
    
    /*REP(i,M.size()){
        cout << M[i] << " ";
    }cout << endl;*/
    
    int LCM=1;
    REP(i,M.size()){
        LCM*=M[i];
        LCM%=MOD;
    }
    //cout << LCM << endl;
    int Ans=0;
    REP(i,N){
        int Ainv = inverse(A[i]);
        int R = Ainv * LCM;
        R%=MOD;
        Ans+=R;
        Ans%=MOD;
    }
    cout << Ans << endl;
    return 0;
}



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

int main(){
int a,b,n,c;
  cin >>a >>b;
  for(int i=1;i<10;i++){
  	for(int j=0;j<10;j++){
    	for(int k=0;k<10;k++){
        	n =10001*i+1010*j+100*k ;
          	if (a <= n && n <= b) c++;
        }}}
  cout << c <<endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

static class Program
{
    static void Main(string[] args)
    {
        //入力
        var input = Console.ReadLine().Split(' ').Select(int.Parse).ToList();

        //処理
        var y1 = Math.Abs(input[3] - input[1]);
        var x1 = Math.Abs(input[2] - input[0]);

        //出力
        for(var u = 0; u < y1 ; u++){
            Console.Write("U");
        }
        for(var r = 0; r < x1; r++){
            Console.Write("R");
        }
        for(var u = 0; u < y1 ; u++){
            Console.Write("D");
        }
         for(var r = 0; r < x1; r++){
            Console.Write("L");
        }

        Console.Write("L");
        for(var u = 0; u < y1 + 1 ; u++){
            Console.Write("U");
        }
        for(var r = 0; r < x1 + 1; r++){
            Console.Write("R");
        }
        Console.Write("D");

        Console.Write("R");
        for(var u = 0; u < y1 + 1; u++){
            Console.Write("D");
        }
        for(var r = 0; r < x1 + 1; r++){
            Console.Write("L");
        }
        Console.Write("U");
        Console.WriteLine("");
    }
}


Measured memory_bytes: 11348
from collections import defaultdict

n = int(input())
a = list(map(int,input().split()))
q = int(input())
d = defaultdict(int)

for aa in a:#initialize
  d[aa]+=1

ans=sum(a)
for i in range(q):
  b,c = list(map(int,input().split()))
  d[c]+=d[b]
  ans+=(c-b)*d[b] 
  d[b]=0
  print(ans)

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


#define ll long long
#define ull unsigned ll
#define vi vector <int>
#define ii pair <int, int>
#define vii vector <ii>
#define vll vector <ll>
#define vull vector <ull>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define INF (int)1e9
#define EPS 1e-9
#define pb push_back
#define PI acos(-1.0)
#define DEBUG 0

int main ()

{
    fast;
    
    int a, b, c, t1, t2, t3;
    cin >> a >> b >> c;
    t1 = a;
    t2 = b;
    t3 = c;
    
    a = t3;
    b = t1;
    c = t2;
    
    cout << a << " " << b << " " << c << endl;


    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
using namespace std;
int main()
{
	char c;
  	int sum=0;
 	for(int i=0; i<3; i++){
		cin >> c;
      	sum += c;
    }
  	sum -= 'a';
    sum -= 'b';
    sum -= 'c';
    if(sum==0){
		cout << "Yes" << endl;
    }else{
		cout << "No" << endl;
    }
	return 0;
}


Measured memory_bytes: 256
/*
  Author: Alokit Kumar
  */
  #include<bits/stdc++.h>
  using namespace std;
  #define int long long
  int32_t main()
  {
    int t,n,i,j,k,l=0,l1,r,d;
    cin>>n;
    int a[n+1];
    for(i=1;i<=n;i++) cin>>a[i];
    for(i=1;i<=n;i+=2)
    {
      if(a[i]&1) l++;
    }
    cout<<l;
  }

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define Rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef int64_t intl;


int main(){
  int K,A,B;
  cin >> K >> A >>B;
  for(int i = A ; i <= B ; i ++ ){
    if ( i % K == 0) { cout << "OK"; return 0;}
  }
  cout << "NG";
}

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

using namespace std;

typedef double Real;
constexpr Real EPS = 1e-8;

//???????????£
int sign(Real d) {
    if (d>EPS) { return 1; }
    if (d<-EPS) { return -1; }
    return 0;
}

/*
 * ???????§?????????????
 */
struct Point {
    Real x,y;

    //Point p(2,3)????¨±???
    explicit Point(Real x_=0, Real y_=0): x(x_), y(y_) {} //explicit?????£??\Point p = x;????¨±????????????????????????

    Point operator+(const Point &p) const {
        return Point(x+p.x,y+p.y);
    }
    Point operator-(const Point &p) const {
        return Point(x-p.x,y-p.y);
    }
    Point operator*(Real s) const {
        return Point(x*s,y*s);
    }
    Point operator/(Real s) const {
        return Point(x/s,y/s);
    }
    bool operator<(const Point &p) const {
        return sign(x - p.x) == -1 || (sign(x - p.x)==0 && sign(y - p.y)==-1);
    }
    bool operator==(const Point &p) const { return sign(x-p.x) == 0 && sign(y - p.y)==0; }

};

//Point??????????????°????????¬??????
istream &operator>>(istream &is, Point &p) {
    return is >> p.x >> p.y;
}
ostream &operator<<(ostream &os, const Point &p) {
    //return os << '(' << p.x << ", " << p.y << ')';
    return os << p.x << " " << p.y;
}

struct Line : public array<Point, 2> { //??????
    Line(const Point &a, const Point &b) { at(0) = a; at(1) = b; }
};

struct Segment : public array<Point, 2> { //??´???
    Segment(const Point &a, const Point &b) { at(0) = a; at(1) = b; }
};


/*
 * Calc
 */
//???????¨??????????90??????
Point rotate90(const Point &p) { return Point(-p.y,p.x); }

//???????¨???????????????±???
Point rotate(const Point &p, Real theta) {
    const Real s = sin(theta), c = cos(theta);
    return Point(c*p.x - s*p.y, s*p.x + c*p.y);
}

Real angle(const Point &p) { return atan2(p.y, p.x); } //[X???]??¨[???????????????P??????]????§????
Real norm(const Point &p) { return p.x * p.x + p.y * p.y; } //??????0????????????P?????§????????¢?????????
Real abs(const Point &p) { return sqrt(norm(p)); } //??????0????????????P?????§????????¢

Real dot(const Point &a, const Point &b) { return a.x * b.x + a.y * b.y; } //??????(?????????????????£?????????)
Real cross(const Point &a, const Point &b) { return a.x * b.y - a.y * b.x; } //??????

/*
 * ?°???±
 * http://mathtrain.jp/projection
 */
inline Point project(Line &l, Point &p) {
    const Point a = p - l[0];
    const Point b = l[1] - l[0];
    return l[0] + b * (dot(a,b) / norm(b));
}

/*
 * ????°?
 */
inline Point reflect(Line &l, Point &p) {
    const Point t = project(l,p);
    return t + (t - p);
}


int main() {
    cout.setf(ios::fixed);
    cout.precision(10); //?°???°???10?????¨???
    int x0, x1, y0, y1;
    int q;
    int x,y;

    cin >> x0 >> y0 >> x1 >> y1;
    Point p0(x0,y0), p1(x1,y1);
    Line l(p0, p1);
    cin >> q;
    for(int i=0; i<q; i++) {
        cin >> x >> y;
        Point p(x,y);
        Point v = reflect(l, p);
        cout << v << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3284
def main():
    n = int(input())
    ans = 0
    e = 1

    def facs():
        yield 2
        for x in range(10 ** 6):
            yield x * 2 + 3

    for fac in facs():
        while n % (div := pow(fac, e)) == 0:
            n //= div
            ans += 1
            e += 1
        while n % fac == 0:
            n //= fac
        if fac * fac > n:
            break
        e = 1

    if n != 1:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9160
def main():
    import sys
    input = sys.stdin.readline
    N,X,Y = map(int,input().split())

    cnt_dict={}
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            if i==j:
                continue
            tmp1 = j-i
            tmp2 = abs(X-i)+abs(Y-j)+1
            cnt_dict[min(tmp1,tmp2)] = cnt_dict.get(min(tmp1,tmp2),0)+1

    for i in range(1,N):
        if i not in cnt_dict:
            print(0)
        else:
            print(cnt_dict[i])
            
if __name__=='__main__':
    main()

Measured memory_bytes: 9344
#define KAKUSUKO
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <complex>
#include <valarray>
#include <fstream>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <random>

#define _overload(a, b, c, d, ...) d
#define _rep1(X, A, Y) for (int (X) = (A);(X) <= (Y);++(X))
#define _rep2(X, Y) for (int (X) = 0;(X) < (Y);++(X))
#define rep(...) _overload(__VA_ARGS__, _rep1, _rep2)(__VA_ARGS__)
#define rrep(X,Y) for (int (X) = Y-1;(X) >= 0;--(X))
#define all(X) (X).begin(),(X).end()
#define len(X) ((int)(X).size())
#define mod(n, m) (((n)%(m)+(m))%m)
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
const int INFINT = 1 << 30;                          // 1.07x10^ 9
const ll INFLL = 1LL << 60;                          // 1.15x10^18
const double EPS = 1e-10;
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int N, A, B;

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

  cin >> N >> A >> B;

  cout << min(A*N, B) << endl;

  return 0;
}


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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def dfs(N, nodes, src):
    """ DFS(木、スタック、重みあり) """

    stack = [(src, -1, 0)]
    dist = [INF] * N
    while stack:
        u, prev, c1 = stack.pop()
        dist[u] = c1
        for v, c2 in nodes[u]:
            if v != prev:
                stack.append((v, u, c1+c2))
    return dist

N = INT()
nodes = [[] for i in range(N)]
for i in range(N-1):
    a, b, c = MAP()
    a -= 1; b -= 1
    nodes[a].append((b, c))
    nodes[b].append((a, c))

Q, K = MAP()
K -= 1
res = dfs(N, nodes, K)
ans = []
for i in range(Q):
    x, y = MAP()
    x -= 1; y -= 1
    ans.append(str(res[x] + res[y]))
print('\n'.join(ans))


Measured memory_bytes: 53700
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;

const ll mod = 1000000007;
ll fact[200200];
ll invfact[200200];

inline ll take_mod(ll a) { return (a % mod + mod) % mod; }

inline ll add(ll a, ll b) { return take_mod(a + b); }

inline ll sub(ll a, ll b) { return take_mod(a - b); }

inline ll mul(ll a, ll b) { return take_mod(a * b); }

inline ll pow(ll x, ll n) {
  ll res = 1LL;
  while (n > 0) {
    if (n & 1) res = mul(res, x);
    x = mul(x, x);
    n >>= 1;
  }
  return res;
}

ll mod_inv(ll x) { return pow(x, mod - 2); }

void make_fact(ll n) {
  fact[0] = 1;
  ll res = 1;
  for (int i = 1; i <= n; i++) {
    fact[i] = res;
    res = mul(res, i + 1);
  }
}

void make_invfact(ll n) {
  invfact[0] = 1;
  invfact[n] = mod_inv(fact[n]);
  for (int i = n - 1; i >= 1; i--) {
    invfact[i] = mul(invfact[i + 1], i + 1);
  }
}

ll perm(ll n, ll k) { return mul(fact[n], invfact[n - k]); }

ll comb(ll n, ll k) { return mul(mul(fact[n], invfact[n - k]), invfact[k]); }

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

  ll c1 = 0;
  ll c2 = 0;
  ll c3 = 0;
  ll ans = 1;
  for (ll i = 0; i < N; i++) {
    ll tmp;
     cin >> tmp;
    if (tmp != c1 && tmp != c2 && tmp != c3) {
      cout << 0 << endl;
      return 0;
    }

    if (tmp == c1) {
      if (c1 == c2) {
        if (c2 == c3) {
          ans = mul(ans, 3);
        } else {
          ans = mul(ans, 2);
        }
      }
    } else if (tmp == c2) {
      if (c2 == c3) {
        ans = mul(ans, 2);
      }
    }

    if (tmp == c1)
      c1++;
    else if (tmp == c2)
      c2++;
    else
      c3++;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a = 0,b=0;
  cin >> a >> b;
  
  int t[3]={0}; 
  int m = a+b; 
  t[0] = a+b;
  t[1] = a-b;
  t[2] = a*b;
  for(int i=0;i<3;i++){
    m=max(m,t[i]); 
  }
  cout << m << endl;
}



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


Measured memory_bytes: 3060
# solution
import io

nim,mike = map(int,input().split())

sets={int(input()) for _ in range(mike)}

modulous=10**9+7

array=[0]*(nim+1)
array[0]=1
array[1]=1
if 1 in sets:
  array[1]=0

for i in range(2,nim+1):
  if i in sets:
    continue
  array[i]=(array[i-1]+array[i-2])%modulous
print(array[nim])

Measured memory_bytes: 11884
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#define REP(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 20)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね

//ここから編集する


int main() {
    string s,t;
    cin >> s >> t;
    bool flag2 = false;
    for(int i = s.size(); i >= 0; i--){
        if(i + t.size() > s.size()) continue;
        bool flag = true;
        REP(j,0,t.size()){
            if(!(s[i+j] == '?' || s[i+j] == t[j])) flag = false;
        }
        if(flag){
            REP(j,0,t.size()){
                s[i+j] = t[j];
            }
            flag2 = true;
            break;
        }
    }

    if(!flag2){
        cout << "UNRESTORABLE" << endl;
        return 0;
    }
    REP(i,0,s.size()){
        if(s[i] == '?') s[i] = 'a';
    }
    cout << s << endl;

    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define max0(a,b,c) max(max(a,b),c)
#define min0(a,b,c) min(min(a,b),c)
#define ft first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(v) (v).begin(),(v).end()
#define mod 1000000007
using namespace std;
using Graph = vector<vector<int>>;
typedef long long lint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldouble;
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<ull> ulvec;
typedef vector<double> dvec;
typedef vector<pair<int,int>> pvec;
typedef vector<pair<ll,ll>> plvec;
typedef vector<tuple<ll,ll,ll>> tvec;
typedef vector<string> svec;

int m,n;
string A[50],B[50];
void solve(){
    int cnt=0;
    for(int i=0;i+m<=n;i++){
        for(int j=0;j+m<=n;j++){
            bool ok=true;
            for(int k=i;k<i+m;k++){
                for(int l=j;l<j+m;l++){
                    if(A[k][l]!=B[k-i][l-j]) ok=false;
                }
            }
            if(ok){
                cnt++;
                break;
            }
        }
        if(cnt>0) break;
    }
    if(cnt>0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

int main(){
    cin>>n>>m;
    rep(i,n) cin>>A[i];
    rep(i,m) cin>>B[i];
    solve();
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
n = int(input())
h = [int(i) for i in input().split()]

"""
dp = [0] * n
dp[0] = 0
dp[1] = abs(h[1] - h[0])
for i in range(2, n):
    dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))
print(dp[n - 1])
"""

dp = [0] * n
dp[0] = 0
#dp[1] = abs(h[1] - h[0])
for i in range(1, n):
    if i == 1:
        dp[i] = dp[i - 1] + abs(h[i] - h[i - 1])
    if i > 1:
        dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))
print(dp[n - 1])


Measured memory_bytes: 13980
def main():
    D, G = (int(i) for i in input().split())
    pc = [[int(i) for i in input().split()] for j in range(D)]
    ans = 10**6
    for bit in range(1<<D):
        completed = []
        for i in range(D):
            if bit & (1<<i):
                completed.append(i)
        score = 0
        solve = 0
        for c in completed:
            score += 100*(c+1)*pc[c][0] + pc[c][1]
            solve += pc[c][0]
        for i in range(D)[::-1]:
            if i in completed:
                continue
            less = max(G - score,0)
            if 100*(i+1)*pc[i][0] < less:
                break
            from math import ceil
            solve += ceil(less / (100*(i+1)))
            score += 100*(i+1)*solve
        else:
            ans = min(ans, solve)
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 42480
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << x << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010


int main(){
  int n;
  ll a[SIZE];
  ll sum = 0;

  scanf("%d",&n);

  for(int i=0;i<n;i++){
    scanf("%lld",a+i);
    sum += a[i];
  }
  a[n] = a[0];

  if(sum%((ll)n*(n+1)/2) != 0){
    puts("NO");
    return 0;
  }
  
  ll m = sum / ( (ll)n*(n+1)/2 );
  ll p = m;
  
  for(int i=0;i<n;i++){
    ll d = (a[i] + m) - a[i+1];

    debug(d);

    p -= d/n;
    
    if(d < 0 || d%n != 0){
      puts("NO");
      return 0;
    }
    
  }
  
  if(p != 0) puts("NO");
  else puts("YES");
  
  return 0;
}


Measured memory_bytes: 1152
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();

    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: String = read();
    let mut a = String::new();
    
    for _i in 0..s.len(){
        a.push('x');
    }

    println!("{}", a);
}


Measured memory_bytes: 4476
program main_b
   implicit none
   integer(8) :: H, W

   read(*,*) H, W
   if (H==1 .or. W==1)  then
      print *, 1
      stop
   end if

   if (mod(H,2)==0) then
      print *, H/2*W
   else if (mod(W,2)==0) then
      print *, (H-1)/2*W + W/2
   else
      print *, (H-1)/2*W + (W/2)+1
   end if

end program main_b


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*  Writen by : AS7
 *  "JUST KEEP GOING..."
 */
#define endl			'\n'
#define ll				long long
#define all(v)			((v).begin()), ((v).end())
#define allr(v)			((v).rbegin()), ((v).rend())
#define sz(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define rep(i, v)		for(int i=0;i<sz(v);++i)
#define For(i,s)        for(auto i:s)
#define Forr(i,s)        for(auto &i:s)
#define lp(i, n)		for(int i=0;i<(int)(n);++i)
#define lpi(i, j, n)	for(int i=(j);i<(int)(n);++i)
#define lpd(i, j, n)	for(int i=(j);i>=(int)(n);--i)
#define vi				vector <int>
#define vl				vector <ll>
#define ii				pair <int,int>
#define vii				vector <ii>
#define vll				vector <pair<ll,ll>>
#define PI				double PPPPPP = 3.14159265358979323846;
#define bit(mask,i) ((mask>>i)&1)
const int N = 2e5+5;
int n,m,k;
char grid[10][10],arr[10][10];
map<vector<int>,bool> vis;
ll ans;
int get_ans(ll x,ll y,ll z){
    vi v(3);
    v[0]=x;
    v[1]=y;
    v[2]=z;
    sort(all(v));
    if(vis[v])return 0;
    vis[v]=1;
    if(v[0]==v[2])
        return 1;
    if(v[1]==v[2])
        return 3;
    if (v[0]==v[1])
        return 3;
    return 6;
}
void solve(){
    ll n;
    cin>>n;
    for(ll i=1;i<=n;++i){
        int ans=0;
        for (ll x = 1; x <=100 ; ++x) {
            if(x*x+x+x+1+1+1>i)
                break;
            for (ll y = 1; y<=100 ; ++y) {
                if (x*x+y*y+x*y+x+y>i)
                    break;
                for (ll z = 1; z<=100 ; ++z) {
                    if (x*x+y*y+z*z+x*y+x*z+z*y<i)
                        continue;
                    if(x*x+y*y+z*z+x*y+x*z+z*y==i)
                        ans+=get_ans(x,y,z);
                    break;
                }
            }
        }
        cout<<ans<<endl;
    }
}
int main() {
    int t = 1;
  //  cin>>t;
    while (t--)solve();
}

Measured memory_bytes: 8156
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int d[101][101];
	for(int i=1;i<=100;i++)for(int j=1;j<=100;j++)d[i][j]=10000000;
	int n;
		int a,b,c;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>c;
		for(cin>>a;a>0;a--){
			cin>>b;
			d[c][b]=1;
		}
	}
	/*
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(d[i][j]<1000)cout<<d[i][j]<<" ";
			else cout<<"+ ";
		}
		cout<<endl;
	}
	cout<<endl;
	*/
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			for(int k=1;k<=n;k++){
				if(j!=k)if(d[j][k]>d[j][i]+d[i][k])d[j][k]=d[j][i]+d[i][k];
			}
		}
	}
	/*
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			
			if(d[i][j]<1000)cout<<d[i][j]<<" ";
			else cout<<"+ ";
		}
		cout<<endl;
	}
	cout<<endl;
	*/
	for(cin>>n;n>0;n--){
		cin>>a>>b>>c;
		if(d[a][b]<c)cout<<d[a][b]+1<<endl;
		else cout<<"NA"<<endl;
		
	}
	
	return 0;
}


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

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> P;
typedef pair<int, P> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int N, M, K;
vector<P> G[4096];
int d[4096];


int main(){
  scanf("%d%d%d",&N,&M,&K);
  int a, b, l;
  rep(i,M){
    scanf("%d%d%d",&a,&b,&l); a--; b--;
    G[a].push_back(P(b, l));
    G[b].push_back(P(a, l));
  }

  priority_queue<P, vector<P>, greater<P> >q;
  int s;
  fill(d, d+N, INF);
  rep(i,K){
    scanf("%d", &s); s--;
    d[s] = 0;
    q.push(P(0, s));
  }
  
  /*  rep(i, N){
    rep(j, G[i].size()) printf("%d %d ", G[i][j].first, G[i][j].second);
    cout << endl;
    }*/
  
  while(!q.empty()){
    int cur = q.top().second, v = q.top().first;
    q.pop();
    //    cout << "cur " << cur << "v " << v << endl;
    if(v > d[cur]) continue;
    rep(i, G[cur].size()){
      P next = G[cur][i];
      //      cout << next.first << " " << d[next.first] << endl;
      if(d[next.first] > next.second + v){
	d[next.first] = next.second + v;
	q.push(P(d[next.first], next.first));
      }
    }
  }

  int res = 0;
  rep(i, N) if(d[i]!=INF) res = max(res, d[i]);
  //  rep(i, N) printf("%d ", d[i]); puts("");
  //  printf("%d\n", res);

  rep(i, N){
    rep(j, G[i].size()){
      P p = G[i][j];
      res = max(res, (int)((p.second+d[i]+d[p.first])/2.0 + 0.5));
      //      cout << i << " " << j << " " << res << endl;
    }
  }
  printf("%d\n", res);
  return 0;
}

Measured memory_bytes: 4196
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

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

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//

int main() {
    init();
    ll a, b, c;
    cin >> a >> b >> c;
    
    if(a<b and b<c)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}


Measured memory_bytes: 3160
// May this submission get accepted!

#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define STEP(i, is, ie, step) for (long long i=(is), i##_end=(ie), i##_step = (step); i<=i##_end; i+=i##_step)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T &b) {if (a > b) {a = b; return true;} return false; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) do { cerr << "[DEBUG] " #q ": ["; REP(i, (q).size()) { cerr << (q)[i] << (i == i_len-1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl; } while (false)
template<class T> T gcd(T a, T b) { if (a < b) std::swap(a, b); while (b) std::swap(a %= b, b); return a; }
template<class T> T lcm(const T a, const T b) { return a / gcd(a, b) * b; }

// gcc拡張マクロ
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
#define DANCE_ long
#define ROBOT_ unsigned
#define HUMAN_ signed
#define CHOKUDAI_ const
using  ll = DANCE_ HUMAN_ DANCE_;
using ull = DANCE_ ROBOT_ DANCE_;
using cll = DANCE_ DANCE_ CHOKUDAI_;
using  ld = long double;
using namespace std;

// モジュール


// 処理内容
int main() {
    
    // インタラクティブ問題では除去した方がいいかも
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    ll n; cin >> n;
    vector<ll> a(n+1, 0);
    REP(i, n) cin >> a[i];

    ll ans = 0;
    for (ll p = 1, i = 0; i < n; i++) {
        ll op = (a[i] - 1) / p;
        if (a[i] % p == 0) {
            if (p == 1) {
                ans += a[i]-1;
                a[i] = 1;
            } else if (p != a[i]) {
                ans += op;
                a[i] -= op * p + 1;
            }
        } else {
            ll op = (a[i] - 1) / p;
            ans += op;
            a[i] -= op * p;
        }
        chmax(p, a[i] + 1);
        // DUMPALL(a);
    }
    
    cout << ans << endl;
    
}

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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    int a, b;
    cin >> a >> b;
    if (a + b < 24) {
        cout << a + b << endl;
    } else {
        cout << a+b-24 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A=[list(map(int,input().split())) for _ in range(N)]
judge = 0
count=0
for i in range(N): #N=2
  for j in range(M): #M=3
    judge += A[i][j]*B[j]
  else:
    judge += C
    if judge>0:
      count += 1
    judge=0
      
print(count)      

Measured memory_bytes: 3064
#include<cstdio>
#include<algorithm>
#include<cmath>

using namespace std;

int main(){
    int n;
    scanf("%d", &n);
    double x[n], y[n];
    for(int i = 0; i < n; i++){
        scanf("%lf %lf", &x[i], &y[i]);
    }
    int a[n];
    for(int i = 0; i < n; i++){
        a[i] = i;
    }
    double d[n][n];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            double dx = x[i] - x[j];
            double dy = y[i] - y[j];
            d[i][j] = sqrt(dx * dx + dy * dy);
            d[j][i] = d[i][j];
        }
    }
    
    // for(int i = 0; i < n; i++){
    //     for(int j = 0; j < n; j++){
    //         printf("%lf ", d[i][j]);
    //     }
    //     puts("");
    // }   

    double ans = 0;
    do{
        for(int i = 0; i < n - 1; i++){
            ans += d[a[i]][a[i+1]];
        }
        
    }while(next_permutation(a, a + n));
    int mul = 1;
    for(int i = 1; i <= n; i++){
        mul *= i;
    }
    ans /= mul;
    printf("%.16f\n", ans);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
        using namespace std;
        int main(){
        	long long n,a;
        	cin>>n>>a;
        	if(n<=a){
        		cout<<"unsafe"<<endl;
        	}
        	else{
        		cout<<"safe"<<endl;
        	}
          return(0);
        }

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

int bit[20];
bool make_bit(int n){
    for(int i=0; i<20; i++){
        bit[i]=n%2;
        n /=2;
    }
}

int main(){
    int M, K; cin >> M >> K;
    if(pow(2,M)-1 < K){
        cout << -1 << endl;
        return 0;
    }
    if(M==1){ //M=1も例外ありそう
        if(K>=1){
            cout << -1 << endl; return 0;
        }
        cout << 0 << " " << 0 << " " << 1 << " " << 1 << endl;
        return 0;
    }
    if(K==0){
        for(int i=0; i<pow(2,M)-1;i++){
            cout << i << " " << i << " ";
        }
        cout << pow(2,M)-1 << " " << pow(2,M) -1 << endl;
        return 0;
    }
    cout << 0 << " " << K << " " << 0 << " ";
    int a = pow(2,M)-1;
    for(int i=1; i<=a; i++){
        if(i==K) continue;
        cout << i << " ";
    }
    cout << K;
    for(int i=a; i>=1; i--){
        if(i==K) continue;
        cout << " " << i;
    }
    cout << endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
using namespace std;
using ll=long long;
#ifdef ONLINE_JUDGE
#define D(...)
#else
#define D(...)cerr<<__LINE__<<":"<<"["<<#__VA_ARGS__<<"]->",P(__VA_ARGS__)
#endif
void P(){cerr<<endl;} 
template<typename H,typename...T>void P(H h,T...t){cerr<<h<<" ";P(t...);}
int main()
{
    ios::sync_with_stdio(false);cin.tie(0);
    int n,k;cin>>n>>k;
    vector<int>v(n);
    for(auto &x:v)
        cin>>x;
    sort(all(v));
    int minm=INT_MAX;
    for(int i=0;i+k-1<n;++i){
        minm=min(minm,v[i+k-1]-v[i]);
    }
    cout<<minm;



}

Measured memory_bytes: 3732
#include <iostream>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;

int w, h;
int cell[100][100][2];

int main(){
	while(cin >> w >> h, w||h){
		rep(u,2) rep(i,100) rep(j,100) cell[i][j][u] = 0;
		cell[0][1][0] = 1; cell[1][0][1] = 1;
		rep(i,h) rep(j,w) rep(k,2){
			if(i == 0 && j == 0) continue;
			if(k == 0){
				if(j+1 < w){
					cell[i][j+1][0] += cell[i][j][k];
					cell[i][j+1][0] %= 100000;
				}
				if(i+2 < h){
					cell[i+2][j][1] += cell[i][j][k];
					cell[i+2][j][0] %= 100000;
				}
			} else{
				if(i+1 < h){
					cell[i+1][j][1] += cell[i][j][k];
					cell[i+1][j][0] %= 100000;
				}
				if(j+2 < w){
					cell[i][j+2][0] += cell[i][j][k];
					cell[i][j+2][0] %= 100000;
				}
			}
		}
		int ans = 0;
		rep(i,2) ans += cell[h-1][w-1][i];
		if(h-2 >= 0) ans += cell[h-2][w-1][0];
		if(w-2 >= 0) ans += cell[h-1][w-2][1];
		ans %= 100000;
		cout << ans << endl;
	}
}

Measured memory_bytes: 1236