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

#define rep(i, n) REP(i, 0, n)
#define REP(i, k, n) for(auto i = k; i != n; i++)
#define rrep(i, n) RREP(i, n, 0)
#define RREP(i, n, k) for(auto i = n; i != k; i--)

#define debug(x) cerr << #x << " " << x << endl
#define print(x) cout << x;
#define println(x) cout << x << endl;
#define spc << " " <<

#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define ppf pop_front
#define ppb pop_back
#define eb emplace_back
#define np next_permutation

using ll = long long;
using Pii = pair<int, int>;
using Tiii = tuple<int, int, int>;
template<class T>using V = vector<T>;
template<class T>using VV = vector<vector<T>>;
using Vi = vector<int>;
using VVi = vector<vector<int>>;

bool isPrime(int x) {
   if (x < 2) return false;
   int limit = (int)sqrt(x);
   REP(i, 2, limit+1) {
      if (x % i == 0) return false;
   }
   return true;
}

int main() {
   int n; cin >> n;
   Vi a = Vi(n); rep(i, n) cin >> a[i];
   int ans = 0;
   for_each(a.cbegin(), a.cend(), [&ans](int x) {
      if (isPrime(x)) ans++;
   });
   cout << ans << endl;
   return 0;
}



Measured memory_bytes: 3092
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
#define pb push_back
#define fi first
#define se second
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p){os<<"("<<p.first<<","<< p.second<<")";return os;}
template <class T> ostream &operator<<(ostream &os, const vector<T> &v){os<<"{";REP(i,(int)v.size()){if(i)os<<",";os<<v[i];}os<<"}";return os;}
template <typename T, size_t S> void printArray(const T (&array)[S]){for(auto val : array)std::cout << val << ", ";std::cout << "\n";}
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
const double PI=acos(-1);
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;
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;}
const ll INF = 1LL<<60;
//const int dy[4] = {0, 1, 0, -1};
//const int dx[4] = {1, 0, -1, 0};
//const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
//const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};

vector<ll> seen, ini;
void dfs(Graph& g, ll v, ll p, vector<ll>& ini){
    if(p != -1) ini[v] += ini[p];
    for(auto nv : g[v]){
        if(nv == p) continue;
        dfs(g, nv, v, ini);
    }
}

void solve(){
    ll n, q; cin >> n >> q;
    Graph g(n);
    vector<ll> ini(n, 0);
    REP(i, n-1){
        ll a, b; cin >> a >> b;
        g[a-1].pb(b-1);
        g[b-1].pb(a-1);
    }
    REP(i, q){
        ll p, x; cin >> p >> x;
        ini[p-1] += x;
    }
    dfs(g, 0, -1, ini);
    REP(i, n) cout << ini[i] << ' ';
    cout << endl;
}

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

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

using namespace std;

using _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)

#define INF 1000000007
#define INFL (1LL << 60)
#define MOD 998244353
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

ll min(ll a, ll b){return (a<b?a:b);}
ll max(ll a, ll b){return (a>b?a:b);}

int main(){
	ll n, a, b;
	cin >> n >> a >> b;
	ll ans = INFL;
	if(a%2 == b%2) ans = min(ans, (b-a)/2);
	ans = min(ans, a+(b-a-1)/2);
	ans = min(ans, n-b+1+(b-a-1)/2);
	cout << ans << endl;
	return 0;
} 


Measured memory_bytes: 256
def right_triangle(a, b, c)
  return a * a + b * b == c * c
end

r, l = 0, 0

while gets
  arr = $_.split(",").map(&:to_i)
  l += 1 if arr[0] == arr[1]
  r += 1 if right_triangle(arr[0], arr[1], arr[2])
end

puts r, l

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

#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;
 
const ll INF = 1LL<<60;
const int MINF = 1e9;
const int MOD = 1e9+7;

using vi = vector<int>;
using vii = vector<vi>;

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>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

template<typename T>//文字列の置換/Boost:replace_all()
T replace_str(T str, string target, string str_to) {
    string::size_type pos = 0;
    while (pos = str.find(target, pos), pos != string::npos) {
        str.replace(pos, target.length(), str_to);
        pos += str_to.length();
    }
    return str;
}

int main(){
    int x;cin >> x;
    int tmp = x / 100;
    if(x >= tmp * 100 && x <= tmp*105)cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 256
using System;

class ABCMuriTurai{
  static void Main(){
    decimal[] Ar = Array.ConvertAll(Console.ReadLine().Split(' '), decimal.Parse);
    decimal N = Ar[0];
    decimal K = Ar[1];
    
    Console.WriteLine(Math.Min(N % K, K - (N % K)));
  }
}

Measured memory_bytes: 13268
#include <stdio.h>
int H,W,i,j;
int main(){
  for(;;){
    scanf(" %d %d",&H,&W);
    if(H==0&&W==0){
      return 0;
    }
    for(i=0;i<H;i++){
      for(j=0;j<W;j++){
        printf("#");
      }
      printf("\n");
    }
    printf("\n");
  }
}

Measured memory_bytes: 2596
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)


def main():
    n,a,b,c,d = LI_()
    n += 1
    s = S()
    if d < c:
        f = 0
        for i in range(max(0,b-1), min(min(n-1,d), c-1)):
            if s[i:i+3] == '...':
                f = 1
                break
        if f == 0:
            return 'No'

    for i in range(a+1,c-1):
        if s[i:i+2] == '##':
            return 'No'
    for i in range(b+1,d-1):
        if s[i:i+2] == '##':
            return 'No'


    return 'Yes'


print(main())



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

int main() {
    size_t n;
    cin >> n;
    map<string, int> ss;
    for (size_t i = 0; i < n; i++) {
        string s;
        cin >> s;
        ss[s]++;
    }
    int maxCount = -1;
    for (const auto& p : ss) {
        maxCount = max(maxCount, p.second);
    }
    for (const auto& p : ss) {
        if (p.second == maxCount) {
            cout << p.first << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 25216
import java.util.Scanner;

//Who Are The Student Yet To Submit
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		boolean[] s = new boolean[31];
		for(int i=0;i<28;i++)s[sc.nextInt()]=true;
		for(int i=1;i<31;i++)if(!s[i])System.out.println(i);
	}

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

Measured memory_bytes: 12000
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <bitset> 

using namespace std;

const int INF=1e9+7,mod=1e9+7;
const double eps=1e-8;
const int MAXN=110000;

int main()
{
   // freopen("input.txt","r",stdin);
   // freopen("output.txt","w",stdout);
    int cas=0,T;
  //  cin>>T;
    //while(++cas<=T)
  // 	while(scanf("%d%d",&nn,&mm)!=EOF)
    {
    	int l,r;
    	cin>>l>>r;
    	if(l<=0 && r>=0)
    		cout<<"Zero"<<endl;
    	else if(r<0)
			cout<<(((r-l+1)%2==0)?"Positive":"Negative")<<endl;
		else
			cout<<"Positive"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
a, b, h, m = gets.split.map(&:to_i)

akaku = (h * (360 / 12) + m / 2.0 ) * Math::PI / 180
bkaku = m * 360 / 60 * Math::PI / 180

ax = Math.sin(akaku) * a
ay = Math.cos(akaku) * a

bx = Math.sin(bkaku) * b
by = Math.cos(bkaku) * b

nijo = (bx - ax)**2 + (by - ay) **2
puts Math.sqrt nijo

Measured memory_bytes: 14736
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define req(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define qer(i,a,n) for (int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=10000000000000000;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int main(){
    int x;cin>>x;cout<<1-x;
    return 0;
}

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

using namespace std;

// typedef long long lol;
const int N = 1e3 + 5;
int _w;

int A , B , X , Y , C;

void exgcd( int a , int b , lol & x , lol & y ) {
  if( !b ) {
    x = 1, y = 0;
    return;
  } exgcd( b , a % b , y , x );
  y -= a / b * x;
}

int inv( int a , int m ) {
  lol x , y;
  exgcd( a , m , x , y );
  x = ( x % m + m ) % m;
  return x;
}

inline void solve( void ) {
  _w = scanf("%lld%lld%lld%lld%lld",&A,&X,&B,&Y,&C);
  int g = __gcd( A , B );
  A /= g , B /= g , C /= __gcd( g , C );
  for( int _ = 0 , t ; _ < 2 ; ++_ ) {
    g = __gcd( A , C );
    A /= g , C /= g;
    t = __gcd( g , B );
    B /= t , Y /= g / t;
    swap( A , B ) , swap( X , Y );
  }
  if( C == 1 ) {
    printf("%lld\n",X+Y);
    return;
  }
  int D = (lol)A * inv( B , C ) % C , ID = inv( D , C );
  vector<int> x , y , n;
  int W = C , H = D;
  lol now = 0;
  while( W ) {
    int d = W / H;
    x.push_back( (now%C) * ID % C );
    if( now == 0 ) y.push_back( C );
    else y.push_back( ( C - now ) % C );
    n.push_back( d );
    now += d * H;
    W %= H;
    if( !W ) break;
    H %= W;
    if( !H ) H = W;
  }
  x.push_back( C ) , y.push_back( 0 );
  int ans = 0;
  function<lol(lol,lol)> Div = []( lol a , lol b ) {
    return a / b - ( a % b && (a^b) < 0 );
  };
  for( int i = 1 , lx , ly , rx , ry , ct , l , r , mid , res , dx , dy ; i < (int)(x.size()) ; ++i ) {
    lx = x[i - 1] , rx = x[i] , ly = y[i - 1] , ry = y[i] , ct = n[i - 1];
    l = 0 , r = X + Y + 1 , res = -1 , dx = ( rx - lx ) / ct , dy = ( ly - ry ) / ct;
    while( l <= r ) {
      mid = ( l + r ) >> 1;
      lol p = Div( X - (lol)mid * lx , dx );
      lol q = Div( Y - (lol)mid * ry , dy );
      if( p >= 0 && q >= 0 && p + q >= (lol)ct * mid ) 
        res = mid , l = mid + 1;
      else r = mid - 1;
    }
    ans = max( ans , res );
  }
  printf("%lld\n",ans);
}

signed main( void ) {
  int T;
  _w = scanf("%lld",&T);
  while( T-- ) solve();
  return 0;
}


Measured memory_bytes: 3780
m=998244353
M=1000001
f=[0]*M
g=[0]*M
h=[0]*M
f[0]=g[0]=f[1]=g[1]=h[1]=1
for i in range(2,M):
	f[i]=f[i-1]*i%m
	h[i]=m-h[m%i]*(m//i)%m
	g[i]=g[i-1]*h[i]%m
A,B=map(int,input().split())
if A<B:
	A,B=B,A
b=1
ans=0
for j in range(1,B+1):
	ans+=b*f[A+B-j]*g[B-j]*g[A]%m
	b=b*2%m
ans=ans*f[A]*f[B]*g[A+B]+A
print(ans%m)

Measured memory_bytes: 63852
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

const ll INF=1e18;

ll mult(ll a,ll b){
  if(b==0) return 0;
  if((a*b)/b!=a) return INF;
  return (a*b);
}

int main(){
  int N;
  ll X;
  cin>>N>>X;
  vector<ll> A(N);
  rep(i,N) cin>>A[i];

  vector<ll> sum(N+1,0);
  for(int i=0;i<N;i++) sum[i+1]=sum[i]+A[i];

  ll ans=INF;
  for(int k=1;k<=N;k++){
    ll coef=5;
    ll res=mult(coef,sum[N]-sum[N-k]);
    res+=mult(k,X);
    for(int i=N-k;i>=0;i-=k){
      res+=mult(coef,sum[i]-sum[max(0,i-k)]);
      res=min(res,INF);
      coef+=2;
    }
    ans=min(ans,res);
  }

  cout<<ans+N*X<<endl;

  return 0;
}


Measured memory_bytes: 3328
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        String[] s = new String[n];
        Arrays.setAll(s, i -> scanner.next());
        int m = scanner.nextInt();
        String[] t = new String[m];
        Arrays.setAll(t, i -> scanner.next());

        int max = 0;
        for (int i = 0; i < n; i++) {
            int money = 0;
            for (int j = 0; j < n; j++) {
                if (s[i].equals(s[j])) {
                    money++;
                }
            }
            for (int j = 0; j < m; j++) {
                if (s[i].equals(t[j])) {
                    money--;
                }
            }
            max = Math.max(max, money);
        }
        System.out.println(max);
    }
}

Measured memory_bytes: 26964
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  ll n,a,b;
  cin >> n >> a >> b;
  vl p(n);
  ll cnt1=0,cnt2=0,cnt3=0;
  rep(i,n){
    cin >> p[i];
    if(p[i]<=a){
      cnt1++;
    }
    else if(p[i]>=b+1){
      cnt3++;
    }
    else
      cnt2++;
  }
  cout << min(cnt1,min(cnt2,cnt3)) << endl;
}

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

int main() {
  int H,M;
  while(1) {
    cin >> H >> M;
    for ( int i = 0; i < H; i++ ){
    for ( int j = 0; j < M; j++ ){
        if(i*j>=1&&i<=(H-2)&&j<=(M-2)){
           cout<<".";
        }
        else {
          cout<<"#";
        }
}
    cout<<endl;
    if(H==0&&M==0) {
      break;
    }
}
    if(H==0&&M==0) {
      break;
    }
    cout<<endl;
}
           }
            



Measured memory_bytes: 3116
#include<cstdio>
#include<iostream>
using namespace std;
int n, adj[101][101], d[101], f[101];
int visited[101]; int  tt=0;

void dfs_visit(int i)
{
  if(visited[i]) return ;
  visited[i] = 1;
  d[i] = ++tt;
  for(int v=1; v<=n; v++)
  {
    if(visited[v]==0 && adj[i][v]==1)
      dfs_visit(v);
  }
  f[i] = ++tt;
}
void dfs(int s)
{
  for(int i=1; i<=n; i++)
  {
    dfs_visit(i);
  }
}

int main()
{
  scanf("%d", &n);
  int u, k, v;
  for(int i=0; i<=n; i++)
  {
    for(int j=0; j<=n; j++)
      adj[i][j] = 0;
  }
  for(int i=0; i<n; i++)
  {
    scanf("%d%d", &u, &k);
    for(int j=0; j<k; j++)
    {
      scanf("%d", &v);
      adj[u][v] = 1;
    }
  }
  for(int i=0; i<=n; i++) visited[i] = 0;
  dfs(1);
  for(int i=1; i<=n; i++)
  {
    printf("%d %d %d\n", i, d[i], f[i]);
  }


  return 0;
}



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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

//--------------------------------------------

int main(){
  int n;
  int a;
  vector <int> v;

  scanf("%d",&n);
  REP (i, n) { 
    scanf("%d",&a);
    v.push_back(a);
  }

  sort(v.begin(), v.end());

  printf("%d\n",v.back() - v.front());
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
using namespace std;
int main(){
	int n, m, co = 0;
	string a[50], b[50];
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int j = 0; j < m; j++) {
		cin >> b[j];
	}
	for (int l1 = 0; l1 < n - m + 1; l1++) {
		for (int k = 0; k < n - m + 1; k++) {
			for (int l = 0; l < m; l++) {
				if (b[l] == a[k + l].substr(l1, m)) {
					co++;
				}
			}
			if (co == m) {
				cout << "Yes" << endl;
				return 0;
			}
			co = 0;
		}
	}
	cout << "No" << endl;
	return 0;

}

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

#define INF 1000000001


using namespace std;

long rec(long n, long x) {
  long length = pow(2, n + 2) - 3;
  if (n == 0 && x == 1) return 1;
  else {
    if (x == 1) {
      return 0;
    } else if (1 < x && x < (length / 2) + 1) {
      return rec(n - 1, x - 1);
    } else if (x == (length / 2) + 1) {
      return rec(n - 1, (length - 3) / 2) + 1;
    } else if ((length / 2) + 1 < x && x < length) {
      return rec(n - 1, (length - 3) / 2) + 1 + rec(n - 1, x - ((length / 2) + 1));
    } else {
      return 2 * rec(n - 1, (length - 3) / 2) + 1;
    }
  }
  cout << n << x << endl;
}

int main() {

  long n, x;
  cin >> n >> x;

  cout << rec(n, x) << endl;
  return 0;

}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int s;
	int a, b, c, d;
	scanf("%d", &s);
	
	a = s / 1000;
	b = s / 100 % 10;
	c = s / 10 % 10;
	d = s % 10;
	
	if(a == b)
		puts("Bad");
	else if(b == c)
		puts("Bad");
	else if(c == d)
		puts("Bad");
	else
		puts("Good");
	return 0;
}

Measured memory_bytes: 128
n,k = map(int,input().split())
a = list(map(int,input().split()))
mod = 1000000007
## dp[i][j] i番目までの子供にj個の飴を分け与える通り数の""jについての累積和""

dp = [[0]*(k+2) for i in range(n)]
for j in range(1,k+2):
  if j-1 <= a[0] : 
    dp[0][j] = dp[0][j-1] + 1
  else:
    dp[0][j] = dp[0][j-1] + 0

for i in range(1,n):
  for j in range(k+2):
      dp[i][j] = (dp[i][j-1] + dp[i-1][j]-dp[i-1][max(j-a[i]-1,0)])%mod

print((dp[n-1][k+1]-dp[n-1][k])%mod)

## 累積和を使わない

#dp = [[0]*(k+1) for i in range(n)]
#
#for j in range(k+1):
#  if j <= a[0] : 
#    dp[0][j] = 1
#  else:
#    dp[0][j] = 0
#for i in range(1,n):
#  for j in range(k+1):
#    for jj in range(max(0,j-a[i]),j+1): 
#      dp[i][j] += dp[i-1][jj]
#print(dp[n-1][k]%1000000007)

Measured memory_bytes: 119404
open System

[<EntryPoint>]
let main argv =
    
    let line1 = stdin.ReadLine().Split(' ') |> Array.map int
    let dayCount = line1.[0]

    let works = stdin.ReadLine().Split(' ') |> Array.map int

    let allworksCount = Array.sum works

    let ans = dayCount - allworksCount
    
    let adjust = if ans >= 0 then ans 
                 else -1
    
    printfn "%A" adjust

    0

Measured memory_bytes: 33836
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<55;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int n,q;
ll m;
vvi g;
vi b;
vp a;

void dfs(int v,int t){
	b[v]=t;
	for(auto u:g[v]) if(b[u]<0) dfs(u,t);
}

int main(){
	cin>>n>>m>>q;
	b=vi(n,-1);
	g=vvi(n);
	for(int i=0;i<q;i++){
		int t,u,v;
		cin>>u>>v>>t;
		if(t==0){
			g[u].push_back(v);
			g[v].push_back(u);
		}
		else a.push_back({u,v});
	}
	ll t=0;
	bool res=1;
	for(int i=0;i<n;i++) if(b[i]<0) dfs(i,t++);
	for(auto p:a) if(b[p.first]==b[p.second]) res=0;
	t=t*(t-1)/2+n-t;
	if(t<m) res=0;
	if(!a.empty()&&m==n-1) res=0; 
	cout<<(res?"Yes":"No")<<endl;
}

Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=3e5+5,mod=1e9+7;
vector<ll> adj[N];
bool vis[N];
deque<ll> dq;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,m;cin>>n>>m;
    for(ll i=1;i<=m;i++){
        ll u,v;cin>>u>>v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    dq.push_back(1);
    vis[1]=1;
    while(1){
        ll node=-1;
        for(auto &v:adj[dq.front()])if(!vis[v])node=v;
        if(node!=-1){
            dq.push_front(node);
            vis[node]=1;
            continue;
        }
        for(auto &v:adj[dq.back()])if(!vis[v])node=v;
        if(node!=-1){
            dq.push_back(node);
            vis[node]=1;
            continue;
        }
        break;
    }
    cout<<dq.size()<<"\n";
    for(auto &ele:dq)cout<<ele<<" ";
}

Measured memory_bytes: 11776
unittest
{
	assert( [ "pot", "top" ].parse.expand.solve == "YES" );
	assert( [ "tab", "bet" ].parse.expand.solve == "NO" );
	assert( [ "eye", "eel" ].parse.expand.solve == "NO" );
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto css = new string[ 2 ];
	foreach( ref cs; css )
	{
		cs = input.front.strip;
		input.popFront;
	}
	return tuple( css );
}

auto solve( string[] css )
{
	return ( css[ 0 ][ 0 ] == css[ 1 ][ 2 ] &&
	         css[ 0 ][ 1 ] == css[ 1 ][ 1 ] &&
	         css[ 0 ][ 2 ] == css[ 1 ][ 0 ] ) ? "YES" : "NO";
}


Measured memory_bytes: 256
n=int(input())
arr=list(map(int,input().split()))

arr.sort()
ans=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if arr[i]!=arr[j]!=arr[k] and arr[i]+arr[j]>arr[k]:
                ans+=1
print(ans)

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

using namespace std;
using ll = long long;
#define int ll
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define PB push_back

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'[';
  REP(i, a.size()) {out<<a[i];if(i!=a.size()-1)out<<',';}
  out<<']';
  return out;
}

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

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

  int n;
  cin >> n;
  VI a(n);
  REP(i, n) cin >> a[i];


  VI bit(20, 0);
  auto check = [&](int x) {
    bool flag = true;
    REP(i, 20) {
      if(bit[i] > 1) flag = false;
    }
    return flag;
  };

  int r = 0;
  int ret = 0;
  REP(i, 20) {
    if(a[0]&1<<i) bit[i]++;
  }
  REP(l, n) {
    // lに対して条件を満たすr
    while(r < n && check(a[r])) {
      ++r;
      REP(i, 20) {
        if(a[r]&1<<i) bit[i]++;
      }
      // cout << bit << endl;
    }
    // cout << l << " " << r << endl;
    ret += r-l;
    REP(i, 20) {
      if(a[l]&1<<i) bit[i]--;
    }
  }

  cout << ret << endl;
  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
#define ep emplace_back
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,1,0,-1},dy={-1,0,1,0};
bool inside(int y,int x,int h,int w){ if(y<h && y>=0 && x<w && x>=0) return true; return false; }
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true; } return false; }






int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;cin >> s;
	int n = s.size();
	bool ok = true;
	rep(i,n / 2){
		if(s.at(i) != s.at(n - 1 - i)){
			ok = false;
			break;
		}
	}
	if(ok){
		cout << 0 << endl;
		return 0;
	}
	string t = "";
	rep(i,n){
		if(s.at(i) != 'x') t += s.at(i);
	}
	int m = t.size();
	ok = true;
	rep(i,m / 2){
		if(t.at(i) != t.at(m - 1 - i)){
			ok = false;
			break;
		}
	}
	if(!ok){
		cout << -1 << endl;
		return 0;
	}
	int ans = 0;
	int i = 0, j = n - 1;
	while(i < j){
		int cnt1 = 0, cnt2 = 0;
		while(s.at(i) == 'x'){
			i++;
			cnt1++;
		}
		while(s.at(j) == 'x'){
			j--;
			cnt2++;
		}
		if(i > j) break;
		ans += abs(cnt1 - cnt2);
		i++;
		j--;
	}
	cout << ans << endl;
}


Measured memory_bytes: 592
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

using namespace std;

#define rip(i, n, s) for (long long i = (s);i < ( long long )( n ); i++)
#define all(a) (a).begin(), (a).end()
typedef long long ll;

int main(){
	ll h,w,n;
	cin >> h >> w >> n;
	map<ll,int> mp;
	ll a,b;
	rip(k,n,0){
		cin >> a >> b;
		a--;b--;
		ll now = w*a + b;
		rip(i,3,0){
			rip(j,3,0){
				if(a+i-1 > 0 && a+i-1 < h-1 && b+j-1 > 0 && b+j-1 < w-1){
					ll pre = now+(i-1)*w+j-1;
					//cout << pre << endl;
					if(mp.count(pre)){
						mp[pre]++;
					}
					else{
						mp[pre]=1;
					}
				}
			}
		}
	}
	vector<ll> ans(10,0);
	ans[0]=(h-2)*(w-2);
	for(auto i:mp){
		ans[0]--;
		ans[i.second]++;
	}
	rip(i,10,0){
		cout << ans[i] << endl;
	}
}


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

int main(){
  int N;
  cin>>N;
  
  vector<long long>B(N);
  
  for(int i=0;i<N;i++){
    long long a;
    cin>>a;
    B.at(i)=a-i-1;
  }
  
  
  sort(B.begin(),B.end());
  long long b;
  
  if(N%2==0){
    b=(B.at(N/2)+B.at(N/2-1))/2;
    
    long long res1=0;
  
    for(int i=0;i<N;i++)
      res1+=abs(B.at(i)-b);
    
    b++;
    
    long long res2=0;
    
  
    for(int i=0;i<N;i++)
      res2+=abs(B.at(i)-b);
  
    cout<<min(res1,res2);
  }
  
  else{
    b=B.at(N/2);
    long long res=0;
  
    for(int i=0;i<N;i++)
      res+=abs(B.at(i)-b);
  
    cout<<res;
  }
  
  
}



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

using namespace std;
using ll = long long;
using P = pair<int,int>;
#define all(c) (c).begin(),(c).end()
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;
const ll MOD = 1e9+7;

template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"[";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"]";return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&p)
{o<<"{"<<p.first<<", "<<p.second<<"}";return o;}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj)
{o<<"{";for(auto itr=obj.begin();itr!=obj.end();++itr)o<<(itr!=obj.begin()?", ":"")<<*itr;o<<"}";return o;}
void print() {}
template <class H, class... T>void print(H&& head, T&&... tail)
{cout << head << (sizeof...(tail)==0 ? "\n" : " "); print(forward<T>(tail)...);}


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll ans=0, n;
  cin >> n;
  vector<P> p;
  for(int i=0; i<n; i++){
    int v;
    cin >> v;
    p.push_back(P(v,i));
  }
  sort(all(p));
  reverse(all(p));

  set<int> st;
  st.insert(p[0].second);
  for(int i=1; i<n; i++){
    ll l, r, l2, r2;
    ll v = p[i].first;
    ll idx = p[i].second;
    auto ir = st.upper_bound(idx);
    if(ir == st.end()){
      r = n; r2 = n;
    }else{
      r = *ir;
      ir++;
      if(ir == st.end()){
        r2 = n;
      }else{
        r2 = *ir;
      }
    }
    
    ir = st.lower_bound(idx);
    if(ir == st.begin()){
      l = -1; l2 = -1;
    }else{
      ir--;
      l = *ir;
      if(ir == st.begin()){
        l2 = -1;
      }else{
        ir--;
        l2 = *ir;
      }
    }
    
    ans += ((r2-r) * (idx-l) + (l-l2) * (r-idx)) * v;
    //print(ans, v, idx, l, r, l2, r2);
    st.insert(idx);
  }
  
  cout << ans << endl;
  return 0;
}


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

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int count = 0;
    for(int i = 0; i < n-2; i++){
        if(s.at(i) == 'A'){
            if(s.at(i+1) == 'B' && s.at(i+2) == 'C'){
                count++;
            }
        }
    }
    cout << count << endl;
}

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

int main() {
  // input
    int n;cin >> n;
    vector<long> a(n + 1);
    for(int i = 1; i < n + 1; i++) cin >> a[i];

  // compute
    int counter = 1;
    int sum = 0;
    int ans = 0;
  	sort(a.rbegin(),a.rend());

    for(int i = 1; i < n + 1; i++) {
        if( a[i - 1] == a[i]){
           counter += 1;
        }else{
           sum += counter % 2;
           counter = 1;
        }
    }

    ans = sum;

  // output  
    cout << ans << endl;
}

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

int main() {
  int N;
  bool can = true;
  cin >> N;
  for (int i=0; i < N; ++i) {
    int t, x, y;
    cin >> t >> x >> y;
    if (!can) {
      continue;
    }
    if (t % 2 != (x+y)%2) {
      can = false;
      continue;
    }
    if ((x+y) <= t) {
      can = true;
    } else {
      can = false;
      continue;
    }
  }

  if (can) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        int mod = 1_000_000_007;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long k = sc.nextLong();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        long ans = 0L;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if(a[i] > a[j]){
                    if(i < j){
                        ans = (ans + k * (k+1) /2) % mod;
                    }else if(j < i){
                        ans = (ans + k * (k-1) /2) % mod;
                    }
                }
            }
        }
        System.out.println(ans);
        sc.close();

    }

}


Measured memory_bytes: 27964
#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
typedef pair<int, int>P;
typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)
//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
map<ll, ll>ins;
void facterize(ll n) {
	ll a = 2;
	while (n >= a * a) {
		if (n % a == 0) {
			ins[a]++;
			ins[a] = ins[a] % 1000000007;
			n /= a;
		}
		else {
			a++;
		}
	}
	ins[n]++;
}

int keta(int x) {
	int y = 0;
	while (x > 0) {
		y++;
		x /= 10;
	}
	return y;
}

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

//long longしか使わない
int main() {
	string s;
	cin >> s;
	ll k;
	cin >> k;
	ll n = s.length();
	if (s[0] != s[n - 1]) {
		ll res = 0;
		rep(i, n - 1) {
			if (s[i] == s[i + 1]) {
				res++;
				i++;
			}
		}
		res *= k;
		cout << res << endl;
	}
	else {
		ll res = 0;
		bool flag = true;
		rep(i, n - 1) {
			if (s[i] == s[i + 1]) {
				res++;
				i++;
			}
			else {
				flag = false;
			}
		}
		res *= k;
		ll a = 0, b = 0;
		rep(i, n) {
			if (s[0] == s[i])a++;
			else {
				break;
			}
		}
		for (ll i = n - 1;i >= 0;--i) {
			if (s[n - 1] == s[i])b++;
			else {
				break;
			}
		}
		if (a % 2 != 0 && b % 2 != 0) {
			res += (k - 1);
		}
		if (flag) {
			res = n * k / 2;
		}
		cout << res << endl;
	}
	return 0;
}


Measured memory_bytes: 256
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

H, W = nl()

pixels = []
for i in range(H):
    pixels.append(s())

print('#' * (W+2))
for i in range(H):
    print('#' + pixels[i] + '#')
print('#' * (W+2))


Measured memory_bytes: 3188
#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  string s;
  int out=0,b=0,p= 0;
  while(n){

    while(1){
      cin >> s;
      if(s == "OUT" && out == 2){
	out = 0; b = 0;
	cout << p << endl;
	p = 0;
	break;
      } 
      if(s == "OUT") out++;
      if(s == "HIT"){
	if(b == 3 ) p++;
	else b++;
      }
      if(s == "HOMERUN"){
	p += b + 1;
	b = 0;
      }
    }
    n--;
  }

  return 0;
}

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

int main(void)
{
    double a, b, x, tilt_rad;
    cin >> a >> b >> x;

    if (x < a * a * b / 2) {  // if there is no water on one side.
        tilt_rad = atan(b * b * a / x / 2);
    } else {
        tilt_rad = atan(b / a * 2 - x / (a * a * a) * 2);
    }
    cout << setprecision(10) << tilt_rad * 360 / 2 / M_PI << endl;
}



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

#define x first
#define y second
#define y1 Y1
#define y2 Y2
#define mp make_pair
#define pb push_back

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

template <typename T> inline int Chkmax (T &a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> inline int Chkmin (T &a, T b) { return a > b ? a = b, 1 : 0; }
template <typename T> T read ()
{
	T sum = 0, fl = 1; char ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') fl = -1;
	for (; isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + ch - '0';
	return sum * fl;
}

inline void proc_status()
{
	ifstream t ("/proc/self/status");
	cerr << string (istreambuf_iterator <char> (t), istreambuf_iterator <char> ()) <<endl;
}

const int Maxn = 2e5 + 100;

int N, M;
struct info
{
	int l, r, w;
} A[Maxn];

inline int cmp (info a, info b) { return a.r < b.r; }

namespace SEG
{
#define mid ((l + r) >> 1)
#define ls node[root << 1]
#define rs node[root << 1 | 1]
#define lson root << 1, l, mid
#define rson root << 1 | 1, mid + 1, r
	struct tree
	{
		LL max, tag;
	}node[Maxn << 2];

	inline void push_up (int root) { node[root].max = max(ls.max, rs.max); }

	inline void push_down (int root, int l, int r)
	{
		if (!node[root].tag) return ;
		ls.tag += node[root].tag; ls.max += node[root].tag;
		rs.tag += node[root].tag; rs.max += node[root].tag;
		node[root].tag = 0;
	}

	inline void update (int root, int l, int r, int x, int y, LL z)
	{
		if (x <= l && r <= y) node[root].max += z, node[root].tag += z;
		else
		{
			push_down(root, l, r);
			if (x <= mid) update (lson, x, y, z);
			if (y > mid) update (rson, x, y, z);
			push_up (root);
		}
	}

	inline LL query (int root, int l, int r, int x, int y)
	{
		if (x <= l && r <= y) return node[root].max;
		else
		{
			push_down(root, l, r);
			LL ans = 0;
			if (x <= mid) ans = max(ans, query (lson, x, y));
			if (y > mid) ans = max(ans, query (rson, x, y));
			return ans;
		}
	}

#undef mid
#undef ls
#undef rs
#undef lson
#undef rson
}

inline void Solve ()
{
	sort(A + 1, A + M + 1, cmp);
	
	int j = 1;
	for (int i = 1; i <= N; ++i)
	{
		SEG :: update (1, 1, N, i, i, SEG :: query (1, 1, N, 1, i));

		while (A[j].r == i)
		{
			SEG :: update (1, 1, N, A[j].l, A[j].r, A[j].w);
			++j;
		}
	}

	cout<<max(0ll, SEG :: node[1].max)<<endl;
}

inline void Input ()
{
	N = read<int>(), M = read<int>();
	for (int i = 1; i <= M; ++i)
		A[i].l = read<int>(), A[i].r = read<int>(), A[i].w = read<int>();
}

int main()
{
#ifdef hk_cnyali
	freopen("W.in", "r", stdin);
	freopen("W.out", "w", stdout);
#endif
	Input();
	Solve();
	return 0;
}


Measured memory_bytes: 13056
#include<bits/stdc++.h>
using namespace std;
long long h, n, w, k;
int main(){
	scanf("%lld", &k);
	for(int i = 1; i <= 3500; i++) for(int j = 1; j <= 3500; j++){
		if(4*i*j > k*(i+j) && k*i*j % (4*i*j - k*(i+j)) == 0){
			printf("%lld %d %d\n", k*i*j / (4*i*j - k*(i+j)), i, j);
			return 0;
		}
	}
}

Measured memory_bytes: 256
A, B = map(int, input().split())
def calcgcd(a, b):
  if a > b:
    a, b = b, a
  while a > 0:
    a, b = b%a, a
  return b
N = calcgcd(A, B)
n = N
fs = []
f = 2
while n > 1:
  if f*f > n:
    fs.append(n)
    n = 1
  elif n%f == 0:
    fs.append(f)
    n = n//f
  else:
    f += 1
#print(N, fs)
r = len(set(fs))+1
print(r)


Measured memory_bytes: 3064
#include<stdio.h>
 
int main(int argc,char* argv)
{
	int a, b, seki;
	scanf("%d",&a);
	scanf("%d",&b);
	seki = a*b;
	if(seki%2 == 0){
		printf("Even\n");
	}
	else{
		printf("Odd\n");
	}
	return(0);
}

Measured memory_bytes: 128
import sys

INF = 10**9+7

stdin = sys.stdin
def na(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().strip()
def nsl(): return list(stdin.readline().strip())
def ni(): return int(stdin.readline())
def nil(): return list(map(int, stdin.readline().split()))

a, b = nil()

print((a+b)%24)



Measured memory_bytes: 3060
#!/usr/bin/env python3

import sys

def solve(n, k):
    ans = k
    for i in range(2,n+1):
        ans *= (k-1)
    print(ans)


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    n = int(ws[0])
    k = int(ws[1])
    return (n, k,)

def main():
    solve(*readQuestion())

# Uncomment before submission
main()


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

int main(void) {
  int a[3], c5 = 0, c7 = 0;
  cin >> a[0] >> a[1] >> a[2];
  for (int i : a) {
    if (i == 5)
      c5++;
    if (i == 7)
      c7++;
  }
  
  cout << (c5 == 2 && c7 == 1 ? "YES" : "NO") <<endl;
}


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

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int n;
    cin >> n;
    bool ok = false;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        if (a == b) {
            cnt++;
            if (cnt >= 3)
                ok = true;
        } else {
            cnt = 0;
        }
    }
    cout << (ok ? "Yes\n" : "No\n");
    return 0;
}

Measured memory_bytes: 3636
n,m = map(int,input().split())

k_lst = []
a_lst = []
for _ in range(n):
    lst = list(map(int,input().split()))
    k_lst.append(lst[0])
    a_lst.append(lst[1:])

temp = a_lst[0]

for i in range(1,n):
    lstwa = temp + a_lst[i]
    tyofuku = [x for x in set(lstwa) if lstwa.count(x) > 1]
    temp = tyofuku

print(len(temp))

Measured memory_bytes: 9200
require 'prime'
$M = 10**9+7
n,m = gets.chomp.split.map(&:to_i)
f = m.prime_division

r = [1]
for i in 1..200000 do
    r[i] = r[i-1] * i % $M
end

##p r.size
def my_pow(x,n)
    ans = 1
    while n > 0
        if n % 2 == 1
            ans = ans * x % $M
        end
        x = x * x % $M
        n /= 2
    end
    return ans
end

rr = [1]
for i in 1..200000 do
    rr[i] = my_pow(r[i], $M - 2)
#    puts rr[i]
end

def combi(n,k,r, rr)
    k=n-k if 2*k > n
    return 1 if k == 0
    return r[n] * rr[n-k] * rr[k]
end

ans = 1
f.each do |v|
    ans *= (combi(n-1+v[1], v[1],r,rr) % $M)
end
puts ans % $M

Measured memory_bytes: 7240
#include <bits/stdc++.h>
#define MEM 100001
#define sanic ios_base::sync_with_stdio(0)
using namespace std;
typedef long long ll;
const ll INF = 1e9+9;
long double l;
int main() {
    cin >> l;
    l /= 3.0;
    cout.precision(11);
    cout << fixed << l*l*l;
}


Measured memory_bytes: 256
import itertools
import math
s1 = input()
s1 = list(s1)
s1.sort()
s1 ="".join(s1)
s2 = input()
s2 = list(s2)
s2.sort(reverse=True)
s2 ="".join(s2)
if s1 < s2:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 38256
let dbg = Printf.printf "[debug]%s"

let max_num = 1_000_000_000

let id = fun x -> x
let tuple2 x y = (x,y)
let succ x = x + 1
let pred x = x - 1

let (++) n m =
  let rec aux i =
    if i = m then [m]
    else i :: aux (i+1) in
  if n > m then [] else aux n

let (++^) n m = n ++ (m-1)

let scan fmt f = Scanf.sscanf (read_line ()) fmt f

let scan_line n =
  let b = Scanf.Scanning.from_string (read_line ()) in
  List.map (fun _ -> Scanf.bscanf b " %d" id) (0++^n)

let scan_lines n fmt f =
  List.map (fun _ -> scan fmt f) (0++^n)

let scan_matrix n m e conv =
  let arr = Array.make_matrix n m e in
  Array.iteri (fun i line ->
      let s = Scanf.Scanning.from_string @@ read_line () in
      Array.iteri (fun j _ ->
          arr.(i).(j) <- Scanf.bscanf s " %s" conv;
        ) line) arr; arr

let between n x m = n <= x && x < m

let string_to_list s =
  List.map (String.get s) (0 ++^ String.length s)

let solve arr =
  let len = Array.length arr  in
  let memo = Array.make_matrix len len None in
  let rec aux n m =
    if n >= m then 0
    else
      match memo.(n).(m) with
      | Some v -> v
      | None ->
        let v =
          (let x = aux (succ n) (pred m) in
           (if x + 2 = m - n +1
            then x + (if abs @@ arr.(n) - arr.(m) <= 1 then 2 else 0)
            else x))
          :: List.map (fun i ->
              aux n i + aux (succ i) m)
            (n ++^ m) |> List.fold_left max 0 in
        memo.(n).(m) <- Some v; v
  in
  aux 0 @@ pred len

let () =
  let rec aux () =
    let n = scan "%d" id in
    if n = 0 then ()
    else
      let arr = Array.of_list @@ scan_line n in
      solve arr |> Printf.printf "%d\n";
      aux () in
  aux ()



Measured memory_bytes: 12012
package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)

	if c > a+b && 4*a*b < (c-a-b)*(c-a-b) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

int main()
{
    int no_of_elements, max_operations;
    cin >> no_of_elements >> max_operations;

    vector <int> A(no_of_elements + 2, 0);
    for(int i = 1; i <= no_of_elements; i++)
        cin >> A[i];

    vector <int> sum(no_of_elements + 1, 0);
    for(int i = 1; i <= no_of_elements; i++)
        sum[i] += A[i];

    int max_sum = 0;
    for(int left = 0; left <= no_of_elements; left++)
    {
        for(int right = left; right <= no_of_elements; right++)
        {
            int removed_elements =  max(0, left - 1) + (no_of_elements - right); //cout << "L = " << left << " R = " << right << " Rem = " << removed_elements << endl;

            if(removed_elements > max_operations)
            {
                continue;
            }

            int sum_now = 0;
            priority_queue <int, vector <int>, greater <int> > Q;
            for(int i = 1; i < left; i++)
            {
                sum_now += A[i];
                Q.push(A[i]);
            }

            for(int i = right + 1; i <= no_of_elements; i++)
            {
                sum_now += A[i];
                Q.push(A[i]);
            }
           // cout << "Before Removal Sum = " << sum_now << endl;
            int remaining_operations = max_operations - removed_elements;// cout << " RO = " << remaining_operations << endl;

            while(remaining_operations > 0 && Q.size() > 0 && Q.top() < 0)
            {
                sum_now -= Q.top(); //cout << "Top = " << Q.top() << " S = " << sum_now << endl;
                Q.pop();

                remaining_operations--;
            }
            //cout << "L = " << left << " R = " << right << " S = " << sum_now << endl;
            max_sum = max(max_sum, sum_now);
        }
    }

    cout << max_sum;
    return 0;
}


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

#define ll long long
#define ld long double
#define IOS; ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;


int main() {
    IOS;
    ll k;
    cin >> k;
    string s;
    cin >> s;
    ll n=s.size();
    if(k>=n)
        cout << s;
    else
    {
        for(ll i=0;i<k;i++)
            cout << s[i];
        cout << "...";
    }
    return 0;
}

Measured memory_bytes: 3648
c = [0] * 6
data = [0] * 6
for i in range(6):
    data[i] = input()

n, a, b, C, d, e = list(map(int, data))

if n % min(a,b,C,d,e) != 0:
    score = (n // min(a,b,C,d,e)) + 1
else:
    score = n / min(a,b,C,d,e)
ans =int( score +4)
print(ans)

"""
c[0] = n
count = 0
print(n,a,b,C,d,e)
tem = [0] * 6
while c[5] != n:
    count += 1
    print(c)
    if c[0] == 0:
        pass
    elif c[0] <= a:
        tem[1] += c[0]
        c[0] = 0
    else:
        c[0] -= a
        tem[1] += a

    if c[1] == 0:
        pass
    elif c[1] <= b:
        tem[2] += c[1]

    else:
        c[1] -= b
        tem[2] += b

    if c[2] == 0:
        pass
    elif c[2] <= C:
        tem[3] += c[2]
        c[2] = 0
    else:
        c[2] -= C
        tem[3] += C
    
    if c[3] == 0:
        pass
    elif c[3] <= d:
        tem[4] += c[3]
        c[3] = 0
    else:
        c[3] -= d
        tem[4] += d

    if c[4] == 0:
        pass
    elif c[4] <= e:
        tem[5] += c[4]
        c[4] = 0
    else:
        c[4] -= e
        tem[5] += e
    for i in range(1,6):
        c[i] += tem[i]
        tem[i] = 0
    
print(count)
"""

Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define MOD 1000000007ll
#define LL long long
#define MAXN 10005
using namespace std;
LL n,k,dp[MAXN];
LL rd(){
	LL x=0,tp=1;char c;
	c=getchar();
	while(c<'0' || c>'9'){if(c=='-')tp=-1;c=getchar();}
	while(c>='0' && c<='9'){
		x=x*10+c-'0';
		c=getchar();
	}
	return x*tp;
}
LL quick_mod(LL a,LL x){
	if(x<0)return 1;
	LL res=1;
	while(x){
		if(x&1)(res*=a)%=MOD;
		(a*=a)%=MOD;
		x>>=1;
	}
	return res;
}
int main(){
	n=rd(),k=rd();
	dp[0]=1ll;
	for(int i=1;i<n;i++){
		for(int j=i;j;j--){
			dp[j]=(dp[j+1]+dp[j-1])%MOD;
		}
		dp[0]=dp[1];
	}
	printf("%lld\n",dp[n-k]*quick_mod(2ll,n-k-1)%MOD);
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
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; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    if (n == 0) {
        cout << 0 << '\n';
        return 0;
    }
    ll tmp = 1;
    string ans;
    while (n != 0) {
        tmp *= -2;
        if (n % tmp == 0) {
            ans.push_back('0');
        } else {
            ans.push_back('1');
            n -= tmp / (-2);
        }
    }
    reverse(ALL(ans));
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256