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

// types
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<pll> vpl;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n;
  cin >> n;

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

  sort(a.begin(), a.end());
  deque<ll> deq1, deq2;
  REP(i, n){
    deq1.push_back(a[i]);
    deq2.push_back(a[i]);
  }

  ll l = 0;
  ll r = n-1;
  bool fc = false;
  vll pre(2);
  pre[0] = pre[1] = a[l];
  l++;
  ll ans1 = 0;
  while(l <= r){
    if(!fc){
      ans1 += a[r] - pre[1];
      pre[1] = a[r];
      r--;
      if(l > r)
        break;
      ans1 += a[r] - pre[0];
      pre[0] = a[r];
      r--;
      fc = true;
    }
    else{
      ans1 += pre[1]-a[l];
      pre[1] = a[l];
      l++;
      if(l > r)
        break;
      ans1 += pre[0]-a[l];
      pre[0] = a[l];
      l++;
      fc = false;
    }
  }



  l = 0;
  r = n-1;
  fc = true;
  pre[0] = pre[1] = a[r];
  r--;
  ll ans2 = 0;
  while(l <= r){
    if(!fc){
      ans2 += a[r] - pre[1];
      pre[1] = a[r];
      r--;
      if(l > r)
        break;
      ans2 += a[r] - pre[0];
      pre[0] = a[r];
      r--;
      fc = true;
    }
    else{
      ans2 += pre[1]-a[l];
      pre[1] = a[l];
      l++;
      if(l > r)
        break;
      ans2 += pre[0]-a[l];
      pre[0] = a[l];
      l++;
      fc = false;
    }
  }

  cout << max(ans1, ans2) << endl;



}


Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,m;cin>>n>>m;
    ll s=0;
    map<ll,ll> rem;
    rem[0]++;
    rep(i,n){
        ll a;cin>>a;
        s=(s+a)%m;
        rem[s]++;
    }
    ll ans=0;
    for(P r:rem){
        ans+=r.second*(r.second-1)/2;
    }
    cout<<ans<<endl;
    return 0;
}

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

#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

#define INF 1e9


int main(){ 
  int N;
  string s, t;
  cin >> N >> s >> t;
  REP(i, N+1){
    bool flag = true;
    REP(j, N-i){
      if(s[i+j] != t[j]){
        flag = false;
        break;
      }
    }
    if(flag){
      cout << N+i << endl;
      return 0;
    }
  }

  return 0;
}



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


#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

using namespace std;

inline bool isvowel (char c) {
	c = tolower(c);
    if (c == 'a' || c == 'e' || c == 'i' || c == 'y' || c == 'o' || c == 'u') return 1;
    return 0;
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 
int n, m, k;
string s;
int a[N];
vector < int > g[N];
int u[N];
int ans, res;
int cur;
map < int, int > cnt;

int main () {
	cin >> n >> k;
	For (i, 1, n) {
	    cin >> a[i];
	}
	
	sort(a + 1, a + n + 1);
	while (res + 1 <= n && k >= a[res + 1]) {
	    res ++;
	    k -= a[res];
	    cnt[a[res]] = 1; 
	    //cout << res << ' '  << k << '\n';
	}
	
	if(k > 0 && res == n)
    	res --;
	
	cout << res << '\n';
	return Accepted;
}

// Coded By OB

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

typedef long long ll;
#define int ll

using namespace std;

signed main(){
  int N;
  int n=1;

  scanf("%lld", &N);
  
  while(0.5*n*(n+1) <= N) n++;
  ll gap = n*(n+1)*0.5-N;
  
  for(ll i = 1 ; i <= n ; i++){
    if(i == gap) continue;
    printf("%lld\n", i);
  }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define req(i,n) for(int i = 1;i <=n;i++)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
using Graph = vector<vector<int>>;
vector<vector<int>> field;
vector<bool> seen;

const int MOD = 1000000007;
typedef pair<int,int> P;

//最大公約数
ll gcd(ll a,ll b){
	if (a%b == 0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}

}

//最小公倍数
ll lcm(ll a,ll b){
	return a /gcd(a,b) * b;
}

//素数判定
bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

// 素因数分解
vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

// 10進数から2進数
int binary(int bina){
    int ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}









int main() {
 ll k;
 cin >> k;
ll cnt = 1,a = 7; 

rep (i,k){
  if (a % k == 0) break;
  cnt++;
  a = (a * 10 + 7) % k;

}
if (a % k == 0) cout << cnt << endl;
else cout << -1 << endl;

}


Measured memory_bytes: 3668
#include <iostream>
#include <algorithm>
#include <string>
#include  <queue>
#include <vector>
#include  <cstdio>
#include <cstring>
#include<map>
#include<set>
//#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d",a)
#define PL(a) printf("%lld",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())-1
#define f(i,a,b) for(int i=a;i<=b; i++)
#define fr(i,a,b) for(int i=a;i<=b; i++)
#define frr(i,a,b) for(int i=a;i>=b; i--)
#define frv(i,a)  for(int i=0;i<a.size();i++)
#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define Endl "\n"
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T mul(T p, T e, T M)
{
    ll ret = 0;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret + p) ;
        p = (p + p) ;
        if(ret>=M)ret-=M;
        if(p>=M)p-=M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b)
{
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M)
{
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}
 
 
template <class T>bool ISLEFT(T a, T b, T c)
{
    if(((a.xx - b.xx) * (b.yy - c.yy) - (b.xx - c.xx) * (a.yy - b.yy)) < 0.0)return 1;  //Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}
 

#define  mx 200004
#define base 193ll
 
typedef pair<int,int >P;
//////////////////////////
////////////////////////
#define F(i,a,b) for(int i=a;i<b; i++)
#define LL long long
#define MX  200007
#define md 998244353ll
///////////////////////////
///////////////////////////
///

int main(){


    ll a, b, c;
    cin>>a>>b>>c;

   for(int i =b ;i<=c;i++){
       if( i % a == 0){
           cout<<"OK"<<endl;
           return 0;
       }
   }

   cout<<"NG"<<endl;
    return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <map>
using namespace std;
typedef long long ll;

int main(int argc, char const *argv[])
{
    ll n,m;
    ll a,b;
    cin>>n>>m;
    map<ll,ll> p;
    for(ll i=0;i<n;++i){
        cin>>a>>b;
        p.find(a)==p.end() ? p[a]=b : p[a]+=b;
    }
    ll num = 0; ll cost=0;
    for(auto x:p){
        if(num + x.second < m){
            num += x.second;
            cost += x.second*x.first;
        }
        else{
            cost += x.first*(m-num);
            break;
        }
    }
    cout << cost << endl;
    return 0;
}


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

int main(){
  int n,count=1;
  cin>>n;
  
  vector<int> lis;
  int cnt=0;
  rep(i,0,n){
    int tmp;
    cin>>tmp;
    if(tmp<400){lis.emplace_back(1);}
    if(tmp>=400&&tmp<800){lis.emplace_back(2);}
    if(tmp>=800&&tmp<1200){lis.emplace_back(3);}
    if(tmp>=1200&&tmp<1600){lis.emplace_back(4);}
    if(tmp>=1600&&tmp<2000){lis.emplace_back(5);}
    if(tmp>=2000&&tmp<2400){lis.emplace_back(6);}
    if(tmp>=2400&&tmp<2800){lis.emplace_back(7);}
    if(tmp>=2800&&tmp<3200){lis.emplace_back(8);}
    if(tmp>=3200){cnt++;}
  }
  
  int len;
  len=lis.size();
  sort(lis.begin(),lis.end());
  
  rep(i,0,len-1){
    if(lis[i]!=lis[i+1]){count++;}
  }
  
  if(cnt!=0){
    if(count+cnt>n){cout<<count<<" "<<n<<endl;}
    else{cout<<count<<" "<<count+cnt<<endl;}
  }
  else{cout<<count<<" "<<count<<endl;}
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,s,n) for (int i = (s); i < (n); ++i)
#define rrep(i,n,g) for (int i = (n)-1; i >= (g); --i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define len(x) (int)(x).size()
#define dup(x,y) (((x)+(y)-1)/(y))
#define pb push_back
#define Field(T) vector<vector<T>>
using namespace std;
using ll = long long;
using P = pair<int,int>;

vector<int> dx = {1,0,-1,0}, dy = {0,1,0,-1};

int main() {
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  rep(i,0,h) cin >> s[i];
  bool f = true;
  rep(i,0,h) rep(j,0,w) {
    if (s[i][j] == '.') continue;
    bool g = true;
    rep(k,0,4) {
      int ni = i + dx[k], nj = j + dy[k];
      if (ni < 0 || ni >= h || nj < 0 || nj >= w) continue;
      if (s[ni][nj] == '#') g = false;
    }
    if (g) f = false;
  }
  if (f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int n; cin>>n;
	map<string,vi> mp;
	vector<pair<string,int>> vec(n);
	rep(i,0,n){
		string a;
		int b; cin>>a>>b;
		mp[a].push_back(b);
		vec[i]=make_pair(a,b);
	}
	int cnt=0;
	vi ans(n);
	for(auto c:mp){
		string s=c.first;
		vi k=c.second;
		sort(all(k));
		reverse(all(k));
		int l=k.size();
		for(int d:k){
			rep(j,0,n){
				if(vec[j]==pair<string,int>(s,d)){
					ans[cnt]=j;
					cnt++;
				}
			}
		}
	}
 	rep(i,0,n) cout<<ans[i]+1<<endl;
		
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
void READ() {
 #ifndef ONLINE_JUDGE
   freopen("IO/Input.in", "r", stdin);
  #endif
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
//    READ();
       long long x;
    cin >> x;
    long long m = x % 500;
    long long a = x / 500;
    m = m / 5;
    cout << m * 5 + a * 1000 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

using namespace std;
typedef long long ll;

int main(){
    ll x;
    cin >> x;
    ll t = 1;

    while (true){
        if ((t*(t+1))/2 >= x){
            cout << t<< endl;
            return 0;
        }
        t++;
    }


}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define inf 1000000007
#define mod 1000000007
//#pragma GCC optimize(2)
//#define int long long
using namespace std;
template <typename T> void read(T &x){
	x=0;char ch=getchar();int fh=1;
	while (ch<'0'||ch>'9'){if (ch=='-')fh=-1;ch=getchar();}
	while (ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
	x*=fh;
}
template <typename T> void write(T x) {
	if (x<0) x=-x,putchar('-');
	if (x>9) write(x/10);
	putchar(x%10+'0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}
signed main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	string x;
	cin>>x;
	if(x[0]=='7'||x[1]=='7'||x[2]=='7') cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 3648
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)

# from collections import defaultdict
# d = defaultdict(list)

# from itertools import combinations
# comb = combinations(range(N), 2)

# 累積和
# from itertools import accumulate
# _list = list(accumulate(a_list)


def resolve():
    # S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    # N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    N, R = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))

    if N >= 10:
        print(R)
    else:
        print(R + 100 * (10 - N))


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2 2919"""
        output = """3719"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """22 3051"""
        output = """3051"""
        self.assertIO(input, output)

Measured memory_bytes: 5696
def mergesort(l):
    n = len(l)
    if(n == 1):
        return l
    elif(n <= 2):
        if(l[0] > l[1]):
            return [l[1],l[0]]
        else:
            return l
    else:
        tmp1 = mergesort(l[:n//2])
        tmp2 = mergesort(l[n//2:])
        x = n//2
        y = n-x
        l = []
        for i in range(n):
            if(tmp1[-x] < tmp2[-y]):
                l.append(tmp1[-x])
                x -= 1
            else:
                l.append(tmp2[-y])
                y -= 1
            if(x*y == 0):
                if(x == 0):
                    l += tmp2[-y:]
                else:
                    l += tmp1[-x:]
                break
        return l
n = int(input())
a = list(map(int,input().split()))
p = 0
a = mergesort(a)
if(n%2 == 0):
    for i in range(1,n//2+1):
        p += 2*a[-i]
    p -= a[-1]
else:
    for i in range(1,n//2+2):
        p += 2*a[-i]
    p -= a[-1]+a[-n//2]
print(p)

Measured memory_bytes: 128084
/*#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include<bits/stdc++.h>
#define ll long long
#define inf 1000000000000000000
#define mod 1000000007
#define put putchar('\n')
#define F(i,a,b) for (int i=(a);i<=(b);i++)
#define D(i,a,b) for (int i=(a);i>=(b);i--)
#define go(i,t) for (int i=head[t];i;i=Next[i])
#define sqr(x) ((x)*(x))
#define re register
#define mp make_pair
#define fi first
#define se second
#define pa pair<int,int>
#define pb push_back
#define be begin()
#define en end()
#define ret return puts("-1"),0;
#define N 500055
#define int ll
using namespace std;
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline int read(){char c=getchar();int tot=1;while ((c<'0'|| c>'9')&&c!='-') c=getchar();if (c=='-'){tot=-1;c=getchar();}
int sum=0;while (c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}return sum*tot;}
inline void wr(int x){if (x<0) {putchar('-');wr(-x);return;}if(x>=10)wr(x/10);putchar(x%10+'0');}
inline void wrn(int x){wr(x);put;}inline void wri(int x){wr(x);putchar(' ');}
inline void wrn(int x,int y){wri(x);wrn(y);}inline void wrn(int a,int b,int c){wri(a);wrn(b,c);}
int a[N],n,m,x1,ans;
int check(int x){
	int num=0,d=1,sum=0;
	D(i,n,1){
		num++;
		if (d==1) sum+=5*a[i]+x1;
		else sum+=a[i]*((d+1)*(d+1)-d*d);
		if (num==x) num=0,d++;
	}
	return sum;
}
signed main(){
	n=read();x1=read();
	F(i,1,n) a[i]=read();
	int l=1,r=n;
	while (r-l>3){
		int mid1=l+(r-l)/3,mid2=r-(r-l)/3;
		if (check(mid1)>check(mid2)) l=mid1;
		else r=mid2;
	}
	ans=inf;
	F(i,max(1LL,l-4),min(n,l+4)){
		ans=min(ans,check(i));
	}
	wrn(ans+n*x1);
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long
#define pii_ pair<int,int>
#define mp_ make_pair
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define show1(a) cout<<#a<<" = "<<a<<endl
#define show2(a,b) cout<<#a<<" = "<<a<<"; "<<#b<<" = "<<b<<endl
using namespace std;
const ll INF = 1LL<<60;
const int inf = 1<<30;
const int maxn = 2e5+5;
inline void fastio() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
int n,m,x,c[20],a[20][20],has[20];
int main()
{
    fastio();
    cin>>n>>m>>x;
    rep(i,0,n-1){
        cin>>c[i];
        rep(j,0,m-1) cin>>a[i][j];
    }
    int ans = inf;
    rep(s,0,(1<<n)-1){
        int now = 0;
        memset(has,0,sizeof(has));
        rep(j,0,n-1){
            if((s>>j)&1){
                now+=c[j];
                rep(k,0,m-1) has[k] += a[j][k];
            }
        }
        int flag = 1;
        rep(j,0,m-1) if(has[j]<x) flag=0;
        if(flag) ans = min(ans,now);
    }
    if(ans!=inf) cout<<ans<<endl;
    else cout<<-1<<endl;
    return 0;
}


Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define gc getchar
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define x1 uvuvwevwevwe
#define y1 onyetenyevwe
#define x2 ugwemubwem
#define y2 ossas
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
template <typename T> void scan(T &angka){
	angka=0;char input=gc();T kali=1;
	while(!(48<=input&&input<=57)){	if(input=='-')	kali=-1;input=gc();}
	while(48<=input&&input<=57)	angka=(angka<<3)+(angka<<1)+input-48,input=gc();angka*=kali;
}
template <typename T1,typename T2> void scan(T1 &angka1,T2 &angka2){
	scan(angka1);scan(angka2);
}
const int INF=10000000;
int n,par[1005],x[1005],dp[1005][2][5005]={};
int main()
{
	scan(n);
	for(int i=2;i<=n;i++)
		scan(par[i]);
	for(int i=1;i<=n;i++)
		scan(x[i]);
	for(int now=n;now>=1;now--)
	{
		/*cout<<"untuk "<<now<<endl;
		for(int target=0;target<=1;target++)
		{
			cout<<"untuk target "<<target<<endl;
			for(int sisa=0;sisa<=x[1];sisa++)
				cout<<dp[1][target][sisa]<<" ";
			cout<<endl;
			}*/
		if(now==1)
			break;
		for(int sisa=x[par[now]];sisa>=0;sisa--)
		{
			for(int target=0;target<=1;target++)
			{
				int temp=dp[par[now]][target][sisa];
				temp=INF;
				
				if(sisa>=dp[now][target][x[now]])
					temp=min(temp,dp[par[now]][target][sisa-dp[now][target][x[now]]]+x[now]);
					
				if(sisa>=x[now])
					temp=min(temp,dp[par[now]][target][sisa-x[now]]+dp[now][target^1][x[now]]);
					
				dp[par[now]][target][sisa]=temp;
			}
		}
	}
	
	cout<<((dp[1][0][x[1]]!=INF||dp[1][1][x[1]]!=INF)?"POSSIBLE":"IMPOSSIBLE")<<endl;
}

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

using namespace std;
using ll = long long;
#define int ll

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

int len[30];
signed main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  int s;
  cin >> s;

  int sum = 0;
  auto check = [&](int m) -> bool {
    sum = 0;
    int i, l;
    for(i=1, l=1; i<=m; i*=10, ++l) {
      // [i, 10*i)
      int a = (10*i-1)/3 - (i-1)/3;
      int b = (10*i-1)/5 - (i-1)/5;
      int c = (10*i-1)/15 - (i-1)/15;
      a -= c, b -= c;
      sum += (a + b + 2*c) * 4 + (10*i-i-a-b-c) * l;
    }
    // (m, i) を引く
    if(m < i) {
      int a = (i-1)/3 - m/3;
      int b = (i-1)/5 - m/5;
      int c = (i-1)/15 - m/15;
      a -= c, b -= c;
      sum -= (a + b + 2*c) * 4 + (i-1-m-a-b-c) * (l-1);
    }
    return sum < s;
  };

  int lb = 0, ub = 1e18;
  while(ub-lb>1) {
    int mid = (lb+ub)/2;
    if(check(mid)) {
      lb = mid;
    } else {
      ub = mid;
    }
  }
  // lb+1 の s - sum番目からのFizzBuzz string
  check(lb);

  int idx = lb+1;
  string ans = "";
  if(idx%15 == 0) {
    string tmp = "FizzBuzz";
    ans += tmp.substr(s-sum-1);
  } else if(idx%3==0) {
    string tmp = "Fizz";
    ans += tmp.substr(s-sum-1);
  } else if(idx%5==0) {
    string tmp = "Buzz";
    ans += tmp.substr(s-sum-1);
  } else {
    string tmp = to_string(idx);
    ans += tmp.substr(s-sum-1);
  }
  idx++;
  // cout << ans << endl;
  while(ans.size() < 20) {
    if(idx%15 == 0) {
      string tmp = "FizzBuzz";
      if(ans.size() + 8 <= 20) {
        ans += tmp;
      } else {
        ans += tmp.substr(0, 20-ans.size());
      }
    } else if(idx%3==0) {
      string tmp = "Fizz";
      if(ans.size() + 4 <= 20) {
        ans += tmp;
      } else {
        ans += tmp.substr(0, 20-ans.size());
      }
    } else if(idx%5==0) {
      string tmp = "Buzz";
      if(ans.size() + 4 <= 20) {
        ans += tmp;
      } else {
        ans += tmp.substr(0, 20-ans.size());
      }
    } else {
      string tmp = to_string(idx);
      if(ans.size() + tmp.size() <= 20) {
        ans += tmp;
      } else {
        ans += tmp.substr(0, 20-ans.size());
      }
    }
    idx++;
  }
  cout << ans.substr(0, 20) << endl;

  return 0;
}



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

int main() {
    int n;
    cin>>n;
    vector<int> s(n);


    for(int i=0;i<n;i++){
        cin>>s.at(i);
    }

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


    int sum=0;

    for(int i=0;i<n;i++){
        sum += s.at(i);
    }

    if(sum%10==0){
        for(int i=0;i<n;i++){
            if(s.at(i)%10!=0){
                sum -= s.at(i);
                break;
            }
            if(i==(n-1)&&sum%10==0){
                sum = 0;
            }
        }
    }

    cout<<sum<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s,t;
  cin>>s>>t;
  int x,y;
  y=0;
  x= s.size();
  for(int i=0;i<x;i++){
    if(s.at(i)!=t.at(i)){
      y++;
    }
  }
  cout<<y<<endl;
}

Measured memory_bytes: 3860
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(begin, i, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    int X, A, B;
    cin >> X >> A >> B;
    cout << (X - A) % B << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector> 
#include <algorithm>
#include <functional>
#include <map>
#include <queue>
#include <cmath>
#include <limits>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using P = pair<int,int>;

int main() {
  //input
  int a,b,c,k;
  cin >> a >> b >> c >> k;
  
  int ans = 0;
  
  if(a >= k) {
    ans = k;
    cout << ans << endl;
    return 0;
  } else {
    k -= a;
    ans = a;
  }
  
  if(b > k) {
    cout << ans << endl;
    return 0;
  } else {
    k -= b;
  }
  
  ans -= k;
  cout << ans << endl;
  
}

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

int main(void)
{
    vector<vector<int>> a(3, vector<int>(3));
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
            cin >> a[i][j];
    }
    int n; cin >> n;
    vector<int> b(n);
    for (int i = 0; i < n; i++)
        cin >> b[i];
    
    vector<vector<bool>> c(3, vector<bool>(3, false));
    for (int t:b)
    {
        for (int i = 0; i < 3; i++)
        {
            for (int j = 0; j < 3; j++)
            {
                if (a[i][j] == t) c[i][j] = true;
            }
        }
    }
    for (int i = 0; i < 3; i++)
    {
        if (c[i][0] && c[i][1] && c[i][2])
        {
            cout << "Yes" << endl;
            return 0;
        }
        if (c[0][i] && c[1][i] && c[2][i])
        {
            cout << "Yes" << endl;
            return 0;
        }
    }
    if (c[0][0] && c[1][1] && c[2][2])
    {
        cout << "Yes" << endl;
        return 0;
    }
    if (c[0][2] && c[1][1] && c[2][0])
    {
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}

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

#define int long long

using namespace std;

const int N = 1e5+2;

int t, n, m, k, L, R, d;

int32_t main()
{
    cin>>L>>R>>d;
    int cnt = 0;
    for(int i = L; i<=R; i++)
        if(i%d==0)
            cnt++;
    cout<<cnt<<endl;
}


Measured memory_bytes: 3592
N = int(input())
P = list(map(int, input().split()))
ans = 0

for i in range(N-1):
  if P[i] == i+1:
    P[i], P[i+1] = P[i+1], P[i]
    ans += 1

if P[-1] == N:
  ans += 1

print(ans)

Measured memory_bytes: 20456
#include<bits/stdc++.h>
#define N 800
using namespace std;
typedef pair<int,int> P;
int n,p[N],d,a,b,c,maxc;
bool used[N];
vector<P> e[N];

void delnode(int x,int sum){
  used[x]=true;
  for(int i=0;i<e[x].size();i++){
    int nx=e[x][i].first;
    if(used[nx])continue;
    if(e[nx].size()==1){
      maxc=max(maxc,sum);
      continue;
    }
    delnode(nx,sum+e[x][i].second);
  }
}

int main(){
  while(1){
    cin>>n;
    if(!n)break;
    for(int i=1;i<n;i++)cin>>p[i];
    a=b=c=0;
    for(int i=1;i<n;i++){
      cin>>d;
      a+=d;
      e[i].push_back(P(p[i]-1,d));
      e[p[i]-1].push_back(P(i,d));
    }
    for(int i=0;i<n;i++)
      if(e[i].size()==1)
	b+=e[i][0].second;
    for(int i=0;i<n;i++)
      if(e[i].size()!=1){
	memset(used,0,sizeof(used));
	maxc=0;
	delnode(i,0);
	c=max(c,maxc);
      }
    cout<<3*a-2*b-c<<endl;
    for(int i=0;i<n;i++)e[i].clear();
  }
  return 0;
}

Measured memory_bytes: 1320
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

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

#[allow(unused_imports)]
use std::cmp::{min, max};
use std::collections::VecDeque;

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

    let mut q = VecDeque::new();
    for i in 0..n {
        if i % 2 == 0 {
            q.push_back(aa[i]);
        } else {
            q.push_front(aa[i]);
        }
    }
    if n%2 == 1 {
        println!("{}", q.iter().rev().map(|v| v.to_string()).collect::<Vec<_>>().join(" "));
    } else {
        println!("{}", q.iter().map(|v| v.to_string()).collect::<Vec<_>>().join(" "));
    }
}


Measured memory_bytes: 20604
import sys
# input関係の定義
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def fi(): return float(input())
def mfi(): return map(float, input().rstrip().split())
def lmfi(): return list(map(float, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template

# BEGIN CUT HERE
class RollingHash():
    BASE1 = 1007
    BASE2 = 2009
    MOD1 = 1000000007
    MOD2 = 1000000009

    def __init__(self, s, opt=2):
        self.n = len(s)
        self.opt = opt
        self.hash1 = [0] * (self.n + 1)
        self.power1 = [1] * (self.n + 1)
        if opt == 2:
            self.hash2 = [0] * (self.n + 1)
            self.power2 = [1] * (self.n + 1)
        for i, e in enumerate(s):
            self.hash1[i + 1] = (self.hash1[i] * self.__class__.BASE1 + ord(e)) % self.__class__.MOD1
            self.power1[i + 1] = (self.power1[i] * self.__class__.BASE1) % self.__class__.MOD1
            if opt == 2:
                self.hash2[i + 1] = (self.hash2[i] * self.__class__.BASE2 + ord(e)) % self.__class__.MOD2
                self.power2[i + 1] = (self.power2[i] * self.__class__.BASE2) % self.__class__.MOD2

    def get(self, l: int, r: int):
        res1 = self.hash1[r] - self.hash1[l] * self.power1[r - l] % self.__class__.MOD1
        if(res1 < 0):
            res1 += self.__class__.MOD1
        if self.opt == 2:
            res2 = self.hash2[r] - self.hash2[l] * self.power2[r - l] % self.__class__.MOD2
            if(res2 < 0):
                res2 += self.__class__.MOD2
        return (res1, res2) if self.opt == 2 else res1
# END CUT HERE

# notypehinting
def ABC131E():
    N = ii()
    S = li()
    rh = RollingHash(S, opt=1)
    def check(n: int):
        d = dict()
        for i in range(N - n + 1):
            p = rh.get(i, i + n)
            if p in d.keys():
                if(i - d[p] >= n):
                    return True
            else:
                d[p] = i
        return False
    ok, ng = 0, N // 2 + 1
    while ng - ok > 1:
        mid = (ok + ng) // 2
        if check(mid):
            ok = mid
        else:
            ng = mid
    print(ok)



if __name__ == '__main__':
    ABC131E()


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

const int MAXN = 1000005;

int n;
char a[MAXN];

int main(){
	scanf("%d %s", &n, a);
	
	int num1 = 0, num2 = 0;
	bool foundone = false;
	
	for(int i = 0; i < n; i++){
		a[i]--;
		int c = ((n - 1) & i) == i;
		
		if(a[i] == '0'){
			continue;
		}else if(a[i] == '1'){
			foundone = true;
			num1 ^= c;
		}else{
			num2 ^= c;
		}
	}
	
	if(foundone){
		printf("%d\n", num1);
	}else{
		printf("%d\n", 2 * num2);
	}
	
	
	return 0;
}


Measured memory_bytes: 1280
function Main (input) {
  input = input.split("\n")[0].split(" ").map(Number);
  var A = input[0];
  var B = input[1];
  var ans;
  
  if (A%3 == 0 || B%3 == 0 || (A+B)%3 == 0) {
    ans = "Possible";
  }
  else {
    ans = "Impossible"
  }
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21064
N = gets.chomp
aryodd = []
aryeven = []
i  = 0

N.length.times do
  if i.odd?
    aryodd.push(N[i])
  else
    aryeven.push(N[i])
  end
  i += 1
end

if !aryodd.include?("R") && !aryeven.include?("L")
  puts "Yes"
else
  puts "No"
end


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

public class Prime{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        //Console.WriteLine("{0}: {1}", n, string.Join(" ", PrimeFactors(n)));
		Console.WriteLine("{0}: {1}", n, string.Join(" ", PrimeFactors(n).Select (x => x.ToString()).ToArray())); //AOJ??¨
    }
     
    public static IEnumerable<int> PrimeFactors(int n)
    {
        int i = 2;
        int tmp = n;
         
        while (i * i <= n)
        {
            if(tmp % i == 0){
                tmp /= i;
                yield return i;
            }else{
                i++;
            }
        }
		if(tmp != 1) yield return tmp;
    }
}

Measured memory_bytes: 16144
#include <stdio.h>
#define swap(type,m,n) do{type t=m; m=n; n=t;}while(0)

int main(void) {

int a[3];
	scanf("%d %d %d", &a[0], &a[1], &a[2]);
	if (a[0] > a[1])swap(int, a[0], a[1]);
	if (a[1] > a[2])swap(int, a[1], a[2]);
	if (a[0] > a[1])swap(int, a[0], a[1]);

printf("%d %d %d\n", a[0], a[1], a[2]);
	return 0;
}

Measured memory_bytes: 1816
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int64_t> count(N);
  vector<int> A(N);
  for(int i = 0; i < N; i++) {
    int a;
    cin >> a;
    A.at(i) = a - 1;
    count.at(a - 1)++;
  }
  int64_t total = 0;
  for(int i = 0; i < N; i++) {
    total += count.at(i) * (count.at(i) - 1) / 2;
  }
  for(int i = 0; i < N; i++) {
    if(count.at(A.at(i)) <= 1) {
      cout << total << endl;
    }
    else {
      cout << total - (count.at(A.at(i)) - 1) << endl;
    }
  }
}

Measured memory_bytes: 4992
#include<stdio.h>

#define max(_x, _y) _y^((_x^_y)&-(_x>_y))
#define min(_x, _y) _y^((_x^_y)&-(_x<_y))

using namespace std;

int main(){
	int A, B, K, i;
	scanf("%d %d %d", &A, &B, &K);
	int n = min(A+K,B);
	for (i = A; i < n; i++)
		printf("%d\n", i);
	for (i = max(B-K+1, i); i <= B; i++)
		printf("%d\n", i);
}

Measured memory_bytes: 128
#include <iostream>
#include <cmath>
#include <string>
#include <utility>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long int ll;

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if (A == B && B != C) {
    cout << "Yes" << endl;
    return 0;
  }
  if (B == C && C != A) {
    cout << "Yes" << endl;
    return 0;
  }
  if (C == A && A != B) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
#include <cstring>
using namespace std;

using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

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

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

    ll N;
    cin >> N;
    vector<vector<ll>> X(2, vector<ll>(3));
    for(int i = 0; i < 2; ++i){
        for(int j = 0; j < 3; ++j){
            cin >> X[i][j];
        }
    }
    int sell_idx = 0, buy_idx = 1;
    for(int loop = 0; loop < 2; ++loop){
        vector<ll> dp(N + 1);
        iota(dp.begin(), dp.end(), 0LL);
        for(int i = 0; i <= N; ++i){
            for(int j = 0; j < 3; ++j){
                if(i - X[sell_idx][j] >= 0){
                    chmax(dp[i], dp[i - X[sell_idx][j]] + X[buy_idx][j]);
                }
            }
        }
        N = dp[N];
        swap(sell_idx, buy_idx);
    }
    cout << N << endl;
}

Measured memory_bytes: 198532
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define re(x) {cout<<x<<endl;return 0;}

using namespace std;
int a,b;
int main()
{
	cin>>a>>b;
	rep(i,100000) if(i*8/100==a&&i/10==b) re(i);
	re(-1)}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
mod = pow(10,9)+7
A.sort()

if N%2 == 0:
    for i in range(N//2):
        if A[2*i] != A[2*i+1] or A[2*i] != 2*i+1:
            print(0)
            exit()
    ans = pow(2,N//2)
    print(ans%mod)
else:
    if A[0] != 0:
        print(0)
        exit()
    for i in range(N//2):
        if A[2*i+1] != A[2*(i+1)] or A[2*i+1] != 2*(i+1):
            print(0)
            exit()
    ans = pow(2,N//2)
    print(ans%mod)


Measured memory_bytes: 20436
A, B = map(int, input().split())
S = input()
flag = True
if(len(S) != A + B + 1 or S[A] != '-'):
    print('No')
    flag = False
if(flag):
    for i in range(len(S)):
        if(i == A):
            continue
        if(S[i] < '0' or S[i] > '9'):
            print('No')
            flag = False
            break
if(flag):
    print('Yes')

Measured memory_bytes: 3064
//AOJ 3-4
#include<stdio.h>

int main(void) {

	int a = 0;	scanf("%d", &a);
	int b = 0;	scanf("%d", &b);
	int c = 0;	scanf("%d", &c);
	//printf("%d %d %d\n", a, b, c);	//デバック用

	int counter = 0;
	//printf("%d", counter);	//デバック用

	for (int i = 1; i <= c; i++) {

		//printf("%d\n", i);	//デバック用

		if (c % i == 0) {

			if (((c / i) >= a) && ((c / i) <= b)) {
				counter++;
			}
		}
	}

	printf("%d\n", counter);

	return 0;
}


Measured memory_bytes: 2108
fun main(args: Array<String>) {
    val packList = readLine()?.split(" ").orEmpty()

    val candyA = packList[0].toInt()
    val candyB = packList[1].toInt()
    val candyC = packList[2].toInt()
    var result = ""

    if(candyA == candyB + candyC || candyB == candyA + candyC || candyC == candyA + candyB){
        result = "Yes"
    }else{
        result = "No"
    }

    println(result)
}

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



int main(){
	int N; cin >> N;
	int64_t a = 1;
	for(int64_t i = 1; i <= N ; i++){
		a = a * i % (1000000000+7);
		
	}
	cout << a << endl;
}

Measured memory_bytes: 256
long long n,m,i,j,k,dp[305][305][305],M=1000000007;
main(){scanf("%llu%llu",&n,&m);for(dp[0][1][0]=1;i<m;i++)for(j=1;j<=n;j++)for(k=0;k<=n-j;k++){dp[i][j][k] %= M;dp[i+1][j+k][0]+=dp[i][j][k]*j%M;dp[i+1][j][k]+=dp[i][j][k]*k%M;dp[i+1][j][k+1]+=dp[i][j][k]*(n-j-k)%M;}printf("%lld\n", dp[m][n][0]%M);}


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

int main(void) {
  llong A, B, K, ansA, ansB;
  cin >> A >> B >> K;

  if(A<=K) {
    ansA = 0;
    ansB = B-(K-A);
  }
  else {
    ansA = A -K;
    ansB = B;
  }

  if (ansA<0) ansA = 0;
  if (ansB<0) ansB = 0;

  cout << ansA << " " << ansB << endl;

  return (0);
}


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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll K, N; cin >> K >> N;
	vi arr (N); F0R(i,N) cin >> arr[i];
	vi dist;
	F0R(i, N-1) {
		dist.push_back(arr[i+1] - arr[i]);
	}
	dist.push_back(arr[0] + K - arr[N-1]);
	sort(dist.begin(), dist.end());
	ll ans = 0;
	F0R(i, N-1) ans += dist[i];
	print(ans);
}

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

vector<bool> furui_bool(ll n) {
  vector<bool> fu(n + 1, 1);
  fu.at(0) = 0; fu.at(1) = 0;
  for (ll i=2; i <= n/2 + 1; i++) {
    if (fu.at(i) == 1) {
      ll j = 2 * i;
      while (j <= n) {
        fu.at(j) = 0;
        j += i;
      }
    }
  }
  return fu;
}

vector<ll> prime_fac(ll n, ll &mx) {
  ll sq = sqrt(n);
  vector<ll> pr(sq + 1, 0);
  vector<bool> fu = furui_bool(sq + 2);
  for (ll i=2; i <= sq; i++) {
    if (fu.at(i)) {
      while (n % i == 0) {
        n /= i;
        mx = i;
        pr.at(i)++;
      }
    }
  }
  if (n > 1) {
    mx = n;
  }
  return pr;
}

int main(){
  ll n,ans=(ll)1e18;
  cin>>n;
  if(n%2==0)n*=2;
  ll mx=1;
  vector<ll> facpow(0);
  vector<ll> out = prime_fac(n,mx);
  for(ll i=2; i <= sqrt(n); i++){
    if(out.at(i) >= 1)facpow.push_back((ll)pow(i,out.at(i)));
  }
  if(mx>sqrt(n))facpow.push_back(mx);
  for(ll i=0;i<(1<<facpow.size());i++){
    ll d1=1;
    for(ll j=0;j<(ll)facpow.size();j++){
      if((i&(1<<j)))d1*=facpow[j];
    }
    ll d2=n/d1;
    vector<ll> rem={0,-1},div={d1,d2};
    pair<ll,ll> preans=atcoder::crt(rem,div);
    if(preans.first==0)preans.first=preans.second;
    ans=min(ans,preans.first);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 356860
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin >> a >> b >>c;
    string ans;
 
    if (a == b && b != c) {
        ans = "Yes";
    } else if(a == c && c != b) {
        ans = "Yes";
    } else if(b == c && b != a) {
        ans = "Yes";
    } else {
        ans = "No";
    }
 
    cout << ans << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0; i<(n); ++i)
#define REPR(i,n,m) for (int i=(n); i>=(m); --i)
using namespace std;
using LL = long long;
using LD = long double;
using PLL = pair<long long, long long>;
using PLD = pair<long double, long double>;
using VLL = vector<long long>;
using VLD = vector<long double>;
using VPLD = vector<PLD>;

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

    string str; cin >> str;

    LL n = (LL)str.size();
    VLL v(n+1,0);

    for (LL i=0; i<n; i++) {
        if (str[i]=='<') {
            v[i+1] = v[i] + 1;
        }
    }

    for (LL i=n-1; i>=0; i--) {
        if (str[i]=='>') {
            v[i] = max(v[i], v[i+1] + 1);
        }
    }
    
    LL ans = 0;
    for (LL i=0; i<n+1; i++) {
        ans += v[i];
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 7692