akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
// #include "ane.cpp"

const int INF  = 1e9;
const long long INFLL = 1e18;
const int NMAX = 100005;
const int MMAX = 100005;
const int KMAX = 1005;
const int MOD  = 1e9 + 7;
using namespace std;

// comment to disable debug functions
#define DEBUG

// frequently used macros

#if __cplusplus >= 201103L
#define ALL(v) begin(v),end(v)
#define SORT(v) sort(begin(v), end(v))
#define FIND(v,x) find(begin(v), end(v), (x))
#else
#define ALL(v) (v).begin(),(v).end()
#define SORT(v) sort(v.begin(), v.end())
#define FIND(v,x) find(v.begin(), v.end(), (x))
#endif

#define MEMNEXT(from, to) do{ memmove((to), (from), sizeof(from)); \
memset((from), 0, sizeof(from)); } while(0)
#ifdef DEBUG
#define DUMP(x) do{ std::cerr << (#x) << ": " << x << std::endl; }while(0)
#else
#define DUMP(x) do{}while(0)
#endif

// frequent used aliases
typedef long long ll;
typedef pair<int, int> p;
typedef pair<ll, int> lp;
typedef pair<ll, ll> llp;
typedef vector<int> vec;
typedef vector<ll> vecll;
typedef vector<vec> mat;
typedef vector<vecll> matll;

// frequently used constants
static const int di[] = {-1, 0, 1, -1, 1, -1, 0, 1};
static const int dj[] = {-1, -1, -1, 0, 0, 1, 1, 1};

// frequently used structs
struct edge{
  int to,cost;
};

// printf for debug
#ifndef DEBUG
void debug(const char* format, ...){}
#else
void debug(const char* format, ...){
  va_list arg;
  va_start(arg, format);
  vprintf(format, arg);
  va_end(arg);
}
#endif

// dump vector
#ifdef DEBUG
#define DUMPV(v, c) do{       \
  printf("%s: ", #v);         \
  for (int i = 0; i < (c); ++i) \
  {                           \
  cout << (v)[i] << " ";      \
  }                           \
  cout << endl;               \
} while(0)
#else
#define DUMPV(v,c)
#endif

// std::fill of multi dimensions
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
  std::fill( (T*)array, (T*)(array+N), val );
}

// binary search
ll BSearch(ll _begin, ll _end, bool (*f)(int)){
  ll mid;
  while(_end - _begin > 1LL) {
  mid = (_begin + _end) / 2LL;
  if(f(mid)) {
    debug("BSearch: f(%d) == true\n", mid);
    _end = mid;
  }
  else
  {
    debug("BSearch: f(%d) == false\n", mid);
    _begin = mid;
  }
  }
  return _end;
}


ll N,M,K,A,B,C,D,E;
int dp[NMAX] = {};

string S;
vec v;

bool ans;

void solve(){
  // main algorithm
  ans = !((M * 10 + K) % 4);
}
void debug(){
  // output debug information

}
void answer(){
  // output answer
  if(ans) {
    cout << "YES\n";
  }
  else {
    cout << "NO\n";
  }
}
int main(int argc, char const *argv[])
{
  // operate inputs

  // Fill(dp, -1);
  cin >> N >> M >> K;
  solve();
  #ifdef DEBUG
  debug();
  #endif
  answer();

  return 0;
}

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

def main():

    inputLine = list(input())

    orderLine = int(input())

    for i in range(orderLine):
        tokens = list(input().split())

        a = int(tokens[1])
        b = int(tokens[2])

        if(tokens[0] == 'print'):
            print( ''.join(inputLine[a:b+1]) )
        elif(tokens[0] == 'reverse'):
            reverseList = inputLine[a:b+1]
            inputLine[a:b+1] = reverseList[::-1]
        elif(tokens[0] == 'replace'):
            replaceList = list(tokens[3])
            inputLine[a:b+1] = replaceList

if __name__ == '__main__':
    main()

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

class line
{
public:
    long long a;
    long long b;

    line()
    {
        ;
    }

    line(long long A, long long B)
    {
        a = A;
        b = B;
    }

    long long eval(long long x)
    {
        return a*x + b;
    }
};

vector<line> L;

void insert(line k)
{
    if(L.size() <= 1) L.push_back(k);
    else
    {
        line l1 = L[L.size()-2];
        line l2 = L[L.size()-1];
        if((l2.b - l1.b)/(l1.a - l2.a) >= (l2.b - k.b)/(k.a - l2.a))
        {
            L.pop_back();
            insert(k);
        }
        else L.push_back(k);
    }
}

long long b_search(long long x, long long a, long long b)
{
    if(a == b) return L[a].eval(x);
    long long m = (a+b)/2;
    if((L[m+1].b - L[m].b) < x*(L[m].a - L[m+1].a)) return b_search(x, m+1, b);
    else return b_search(x, a, m);
}

int main()
{
    long long N, C;
    cin >> N >> C;

    long long h[N+1];
    for(long long i = 1; i <= N; i++) cin >> h[i];

    long long DP[N+1];
    DP[1] = 0;
    insert(line(-2*h[1], h[1]*h[1]));
    for(long long i = 2; i <= N; i++)
    {
        DP[i] = C + h[i]*h[i] + b_search(h[i], 0, L.size()-1);
        insert(line(-2*h[i], DP[i] + h[i]*h[i]));
    }
    cout << DP[N] << '\n';
    return 0;

    //DP[1] = 0;
    //DP[i] = C + h[i]^2 + min{1 <= j < i; (-2*h[j])*h[i] + (DP[j] + h[j]^2)}
}

Measured memory_bytes: 9200
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#define rep(i, n) for(i = 0; i < n; i++)
#define int long long
using namespace std;

int h, w;

signed main() {
	cin >> h >> w;
	if (h == 1 || w == 1) { cout << 1 << endl; return 0; }
	cout << (h * w + 1) / 2 << endl;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
#ディスカバリーチャンネルコードコンテスト2020 A

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))


x,y = LI()
if x == 3 and y == 3:
    print(200000)
elif x == 2 and y == 2:
    print(400000)
elif (x == 1 and y == 2) or (x == 2 and y == 1):
    print(500000)
elif (x == 3 and y == 2) or (x == 2 and y == 3):
    print(300000)
elif (x == 3 and y == 1) or (x == 1 and y == 3):
    print(400000)
elif x == 1 and y == 1:
    print(600000+400000)
elif x == 3 or y == 3:
    print(100000)
elif x == 2 or y == 2:
    print(200000)
elif x == 1 or y == 1:
    print(300000)
else:
    print(0)

Measured memory_bytes: 38256
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<stack>
using namespace std;

#define REP(i,n) for(int i=0;(i)<(n);(i)++)
#define ll long long

int main() {
	int N, M, K;
	cin >> N >> M >> K;
	
	REP(i, N+1) {
		REP(j, M+1) {
			if (i*M + j*N - 2*i*j == K) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define fs first
#define sc second
using namespace std;
typedef double D;
typedef complex<D> P;
typedef pair<P,P> L;
typedef vector<P> Poly;

const D PI = acos(-1);
const int MAX_X = 5000;
const int MAX_N = 100, SQRT_MAX_N = ceil( sqrt(MAX_N) - 1e-8 );
const int B_SIZE = 2*MAX_X / SQRT_MAX_N;

inline D cross(P x, P y){return imag(conj(x)*y);}

inline P rotate(P v, D s){
  return P(real(v)*cos(s) - imag(v)*sin(s), real(v)*sin(s) + imag(v)*cos(s));
}

inline P line_cp(L a, L b){
  return a.fs+(a.sc-a.fs)*cross(b.sc-b.fs,b.fs-a.fs)/cross(b.sc-b.fs,a.sc-a.fs);
}

inline D area(Poly p){
  D res = 0;
  rep(i,p.size()){
    res += cross(p[i],p[(i+1)%p.size()]);
  }
  return res/2;
}

inline Poly make_reg_k_polygon(int k, D r){
  Poly res;
  P p = P(0,r); res.push_back(p);
  rep(i,k-1){
    p = rotate(p,2*PI/k);
    res.push_back(p);
  }
  return res;
}

inline Poly make_star(Poly p){
  Poly res;
  rep(i,p.size()){
    int p1 = i, p2 = (i+1)%p.size(), p3 = (i+2)%p.size(), p4 = (i+3)%p.size();
    P cp = line_cp(L(p[p1],p[p2]),L(p[p3],p[p4]));
    res.push_back(cp);
    res.push_back(p[p3]);
  }
  return res;
}

inline P get_cnetar(int i){
  int h = i/SQRT_MAX_N, w = i%SQRT_MAX_N;
  return P(B_SIZE*w + B_SIZE/2 - MAX_X, B_SIZE*h + B_SIZE/2 - MAX_X);
}

int main(){
  int n;
  cin >> n;
  vector<int> s(n);
  rep(i,n)cin >> s[i];
  Poly penta = make_reg_k_polygon(5,1);
  Poly unit_star = make_star(penta);
  D unit_area = area(unit_star);

  rep(i,n){
    P c = get_cnetar(i);
    D ratio = sqrt((D)(s[i]+0.5) / unit_area);

    cout << i+1 << endl;
    rep(i,unit_star.size()){
      cout << fixed << setprecision(9)
	   << unit_star[i].real()*ratio + c.real() << " "
	   << unit_star[i].imag()*ratio + c.imag() << endl;
    }
  }
}

Measured memory_bytes: 3492
import java.util.Scanner

import scala.collection.mutable.ListBuffer

object Main {
  def main(args : Array[String]) = {
    val scanner = new Scanner(System.in)
    val inputs = ListBuffer.empty[Int]
    while(scanner.hasNextLine) {
      inputs += scanner.nextLine().toInt
    }

    def count(curNum:Int, curCnt:Int, targetN:Int):Int = {
      if(curCnt == 4) {
        if(curNum == targetN) {
          return 1
        }else{
          return 0
        }
      }

      var totalCount = 0
      (0 to 9).foreach{num =>
        totalCount += count(curNum + num, curCnt + 1, targetN)
      }

      totalCount
    }

    inputs.foreach { n =>
      val result = count(0, 0, n)
      println(result)
    }
  }
}

Measured memory_bytes: 53104
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T> bool maxi(T &a, const T &b) {
    if (a < b) { a = b; return 1;} return 0;}
template <class T> bool mini(T &a, const T &b) {
    if (b < a) { a = b; return 1;} return 0;}
#define dame {cout<< "NO" <<"\n"; return;}
#define INF2 1000000000000000037
#define INF  1000000007
#define MOD  1000000007
using namespace std;
using ll = long long;
using ld = long double;
using P  = pair<ld,ll>;
//--GLOBAL---------------------------------
const ll MAX = 202020;
ll fac[MAX], finv[MAX], inv[MAX];
void cinit() { // O(nlogn)
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    reps(i, 2, MAX){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
ll c(int n, int k){ // 二項係数計算
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll modpow(ll a, ll n=MOD-2, ll mod=MOD){ // a^n % MOD の計算
    ll res = 1;
    while (n > 0){
        if(n & 1) res = res * a % mod;
        a = a * a  % mod;
        n >>= 1;
    }
    return res;
}
//--MAIN-----------------------------------
void Main() {

    ll N,A,B,C,D; cin>>N>>A>>B>>C>>D;
    cinit();
    ll dp[N+1][N+1]={}; //j人使ってi人までのグループ作る
    dp[A-1][0]=1;
    reps(i,A-1,B){
        rep(j,N+1){
            ll x=i+1;
            // i+1人を0グループ作る
            dp[x][j]+=dp[i][j];
            dp[x][j]%=MOD;
            // i+1人をkグループ作る
            //if(j+x*C>N) continue;
            ll now=1;
            reps(k,1,C){
                now*=c(N-j-x*(k-1),x);
                now%=MOD;
            }
            for(ll k=C; j+x*k<=N and k<=D; ++k){
                now*=c(N-j-x*(k-1),x);
                now%=MOD;
                dp[x][j+x*k]+=(dp[i][j]*now%MOD)*finv[k];
                dp[x][j+x*k]%=MOD;
            }
        }
    }
    cout<< dp[B][N] <<"\n";

}
 
//--START----------------------------------
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
}
//-----------------------------------------

Measured memory_bytes: 12800
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
    int a,b,c;
    cin >> a >> b >> c;
    if(a > c){
        if(c > b){
            cout << "Yes\n";
            return 0;
        }
    }
    if(a < c){
        if(c < b){
            cout << "Yes\n";
            return 0;
        }
    }
    cout << "No\n";
    return 0;
}

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

int main() {
  string s, t; cin >> s >> t;
  if (s.length() > t.length()) {
    cout << "GREATER" << endl;
  } else if (s.length() < t.length()) {
    cout << "LESS" << endl;
  } else {
    for (int i = 0; i < s.length(); i++) {
      if (s[i] > t[i]) {
        cout << "GREATER" << endl;
        return 0;
      } else if (s[i] < t[i]) {
        cout << "LESS" << endl;
        return 0;
      }
    }
    cout << "EQUAL" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.lang.Math;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

  		int ar[] = new int[26];
      	int br[] = new int[26];
      	int a_count;
      	int b_count;
      	int ans=0;
      	int count=0;
      	int ar_last[] = new int[26];
        int stack;
      	int num = sc.nextInt();
      	String str = sc.next();
      
      	for(int i = 0; i < 26;i++){
          ar[i] = 0;
          br[i] = 0;
        }
      	for(int i = 0; i < num;i++){
          stack = (int)str.charAt(i) - 97;
          ar[stack]++;
          ar_last[stack] = i;
        }     	
      
      	for(int i = 0; i < str.length();i++){
          stack = (int)str.charAt(i) - 97;
          if(br[stack] == 0){
          	if(ar[stack] > 1) {
              count++;
              if(count > ans) ans = count;
            } 
          }
          br[stack]++;
          ar[stack]--;
          if(ar[stack] == 0 && br[stack] != 1) count--;
        }
      	
      	System.out.println(ans);
        
	}
}


Measured memory_bytes: 35912
from math import gcd

def gcd_3(a, b, c):
    return gcd(gcd(a, b), c)
sum_gcd = 0
K = int(input())
for i in range(1, K + 1):
    for j in range(1, K + 1):
        for l in range(1, K + 1):
            sum_gcd += gcd_3(i, j, l)

print(sum_gcd)


Measured memory_bytes: 67924
using System;

namespace B___Break_Number
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int max = 0;
            int ans = 1;
            for (int i = 1; i <= n; i++)
            {
                int a = i;
                int count = 0;
                while (true)
                {
                    if (a % 2 == 0)
                    {
                        count++;
                        a /= 2;
                    }
                    else
                    {
                        if (max < count)
                        {
                            max = count;
                            ans = i;
                        }
                        break;
                    }
                }
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
using namespace std;
int main()
{
    int x,y;
    cin>>x>>y;
    if(x>0)
        cout<<"Positive";
    else 
        if(y>=0)
            cout<<"Zero";
        else 
            if((x&1)^(y&1))
                cout<<"Positive";
            else 
                cout<<"Negative";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma region
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << (#x) << "] = [", _print(x)
#else
#define debug(x...)
#endif
#pragma endregion
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
//#define int ll
#define f first
#define s second
#define mp make_pair
#define mt make_tuple
#define pb push_back

int n;
vector<int> frt;
vector<int> bk;
void solve()
{
    cin>>n;
    frt.resize(n);
    bk.resize(n);
    forn(i, n) cin>>frt[i] >> bk[i];
    sort(frt.begin(), frt.end());
    sort(bk.rbegin(), bk.rend());

    if (n%2)
    {
        cout << bk[n/2] - frt[n/2] + 1;
    }
    else
    {
        cout << bk[n/2] - frt[n/2] + bk[(n-1)/2] - frt[(n-1)/2] + 1 << '\n';
    }
    cout << '\n';
}



signed main()
{
    int T = 1;
    ios_base::sync_with_stdio(0); cin.tie(0);
    //cin >> T;
    for(int i=1;i<=T;++i)
    {
        //cout << "Case #" << i << ": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 4696
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    string s;
  cin >> s;
  if(s == "Sunny"){
    cout << "Cloudy" << endl;
  }
  else if(s == "Cloudy"){
    cout << "Rainy" << endl;
  }
  else {
    cout << "Sunny" << endl;
  }
    return 0;
    
}

Measured memory_bytes: 256
N,M=map(int,input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]
arr=[]
for i in range(N-M+1):
	for j in range(N-M+1):
		l=list(map(lambda x:x[j:j+M],A[i:i+M]))
		arr.append(all([l[j]==B[j] for j in range(M)]))
print("Yes" if any(arr) else "No")

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

int main() {
    bool isIncluded9 = false;
    for (int i = 0; i < 2; i++) {
        char n; cin >> n;
        if (n == '9') {
            isIncluded9 = true;
        }
    }
    if (isIncluded9) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
import itertools

N = int(input())
A = []
B = tuple(map(int,input().split()))
C = tuple(map(int,input().split()))
cnt1 = 0
cnt2 = 0

for i in range (N+1):
    A.append(i)
A.remove(0)

sum = list(itertools.permutations(A))

for i in sum:
    if tuple(i) == B:
      break
    else:
      cnt1 += 1

for i in sum:
    if tuple(i) == C:
      break
    else:
      cnt2 += 1

print(abs(cnt1 - cnt2))

Measured memory_bytes: 8052
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INF = 1<<29;
const int MOD = 1000000007;
 
void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
 
const int MAX_V = 110;
const int MAX_E = 1100;
 
int N, M;
int a[MAX_E], b[MAX_E], c[MAX_E]; // 各辺
int dist[MAX_V][MAX_V]; // Floyd-Warshall 用
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> M;
 
    rep(i,N){
      rep(j,N){
        dist[i][j] = INF;
      }
      dist[i][i] = 0;
    }
 
    rep(i,M){
      cin >> a[i] >> b[i] >> c[i];
      --a[i], --b[i];
      dist[a[i]][b[i]] = c[i];
      dist[b[i]][a[i]] = c[i];
    }
 
    rep(k, N)
      rep(i,N)
        rep(j,N)
          dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
 
      int ans = 0;
      rep(i,M) if(c[i] > dist[a[i]][b[i]]) ++ans;
      cout << ans << endl;
}

Measured memory_bytes: 384
#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")
#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;

struct Timer {

    double CYCLE_PER_SEC = 2400000000.0;
    unsigned long long BEGIN_CYCLE = 0;

    Timer() {}
    Timer(double cycle) : CYCLE_PER_SEC(cycle) {}

    unsigned long long int getCycle() {
        unsigned int low, high;
        __asm__ volatile ("rdtsc" : "=a" (low), "=d" (high));
        return ((unsigned long long int)low) | ((unsigned long long int)high << 32);
    }

    void start(void) {
        BEGIN_CYCLE = getCycle();
    }

    double get_time(void) {
        return (double)(getCycle() - BEGIN_CYCLE) / CYCLE_PER_SEC;
    }

} timer;

int N;
char flag[512];
char S[512][512];
char str[512];

int main() {

    scanf("%d", &N);
    for (int i = 0; i < N; i++) scanf("%s", S[i]);

    fill(flag, flag + N, 1);
    str[N] = '\0'; 

	// timer.start();

    for (int j = 0; j < N; ++j) {
        for (int i = 0; i < N; i++) {
            str[i] = S[i][j];
        }
        for (int i = 0; i < N; ++i) {
            int row = (i + j) % N;
            if (strcmp(S[row], str)) flag[i] = 0;
            std::rotate(str, str + 1, str + N);
        }
    }

    int res = 0;
    for (int i = 0; i < N; i++) {
        if (flag[i]) {
            res += (i + 1);
            if (i + N <= (N - 1) * 2) {
                res += (N - 1) * 2 + 1 - (i + N);
            }
        }
    }

    // cerr << timer.get_time() << endl;

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

    return 0;
}



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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

const int N = 1e5 + 5;
ll n, k, cnt;
ll ans;
ii a[N]; // {d, t}

// max -> remove min redundant
int main() {
    cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        cin >> a[i].second >> a[i].first;
    }
    unordered_set<int> seen;
    priority_queue<int, vector<int>, greater<int>> que;
    ll sum = 0;
    sort(a, a + n, greater<ii>());
    for (int i = 0; i < k; ++i) {
        auto &[d, t] = a[i];
        sum += d;
        if (seen.count(t)) {
            que.push(d);
        } else {
            ++cnt;
            seen.insert(t);
        }
    }
    sum += cnt * cnt;
    ans = sum;
    for (int i = k; i < n; ++i) {
        if (que.empty()) break;
        auto &[d, t] = a[i];
        if (seen.count(t)) continue;
        seen.insert(t);
        sum += d;
        sum -= que.top();
        que.pop();
        sum += cnt * 2 + 1;
        ++cnt;
        ans = max(ans, sum);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 7628
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(long long i=(a);i<(b);++i)
#define per(i,a,b) for(long long i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

vector<int> uf, usz;
int nc;

void init(int n){
  vector<int> uf_(n);
  vector<int> usz_(n, 1);
  uf = uf_;
  usz = usz_;
  nc = n;

  for(int i = 0; i < uf.size(); i++){
    uf[i] = i;
  }
}

int find(int a){
  return (uf[a] == a) ? a : uf[a] = find(uf[a]);
}

void union_(int a, int b){
  a = find(a);
  b = find(b);

  if(a != b){
    if(usz[a] >= usz[b]){
      swap(a, b);
    }
    uf[a] = b;
    usz[b] += usz[a];
    nc--;
  }
}

int check(int a, int b){
  return (find(a) == find(b)) ? 1 : 0;
}

int get_size(int a){
  return usz[find(a)];
}

int main() {
  ll n,m;
  cin>>n>>m;
  init(n);
  rep(i,0,m){
    ll a,b,c;
    cin>>a>>b>>c;
    a--;b--;
    union_(a,b);
  }
  cout << nc << endl;
  return 0;
}

Measured memory_bytes: 1792
// F.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <cmath>

using namespace std;

typedef long double LD;
const LD EPS = 1e-8;

struct Point {
	long double x;
	long double y;
	long double z;
	int i;
	bool operator < (const Point& p) const {
		return x < p.x || (x == p.x && y < p.y);
	}
};

long double cross(const Point& O, const Point& A, const Point& B) {
	return (A.x - O.x) * (B.y - O.y) - (A.y - O.y) * (B.x - O.x);
}

vector<Point> convex_hull(vector<Point>& P)
{
	int n = (int)P.size(), k = 0;
	if (n <= 2) {
		return P;
	}
	vector<Point> H(2 * n);
	sort(P.begin(), P.end());
	for (int i = 0; i < n; ++i) {
		while (k >= 2 && cross(H[k - 2], H[k - 1], P[i]) <= 0) k--;
		H[k++] = P[i];
	}
	for (int i = n - 2, t = k + 1; i >= 0; i--) {
		while (k >= t && cross(H[k - 2], H[k - 1], P[i]) <= 0) k--;
		H[k++] = P[i];
	}
	return vector<Point>(H.begin(), H.begin() + k - 1);
}

bool circumscribed_circle(LD x1, LD y1, LD x2, LD y2, LD x3, LD y3, LD& cx, LD& cy, LD& r)
{
	LD ea = x3 - x1;
	LD ca = x2 - x1;
	cy = (ea * (x1 * x1 + y1 * y1 - x2 * x2 - y2 * y2) - ca * (x1 * x1 + y1 * y1 - x3 * x3 - y3 * y3)) /
		(2 * ea * (y1 - y2) - 2 * ca * (y1 - y3));
	if (fabs(ca) <= EPS) {
		cx = (2 * (y1 - y3) * cy - x1 * x1 - y1 * y1 + x3 * x3 + y3 * y3) / (2 * (x3 - x1));
	} else {
		cx = (2 * (y1 - y2) * cy - x1 * x1 - y1 * y1 + x2 * x2 + y2 * y2) / (2 * ca);
	}
	r = sqrt((x1 - cx) * (x1 - cx) + (y1 - cy) * (y1 - cy));
	return true;
}

int main(int argc, char* argv[]) {
	cout.precision(20);
#ifdef _MSC_VER
	while (true)
#endif
	{
		int n = -1;
		cin >> n;
		if (n <= 0) return 0;
		vector<Point> xy(n);
		for (int i = 0; i < n; ++i) {
			cin >> xy[i].x >> xy[i].y;
			xy[i].i = i;
		}
		LD ans = 1e10;
		for (int i = 0; i < n; ++i) {
			for (int j = i + 1; j < n; ++j) {
				LD cx = (xy[i].x + xy[j].x) * 0.5, cy = (xy[i].y + xy[j].y) * 0.5;
				LD dx = xy[i].x - xy[j].x, dy = xy[i].y - xy[j].y;
				LD rr = sqrt(dx * dx + dy * dy) * 0.5;
				bool ok = true;
				for (int l = 0; l < n; ++l) {
					LD dx = xy[l].x - cx;
					LD dy = xy[l].y - cy;
					if (sqrt(dx * dx + dy * dy) > rr + 0.0001) {
						ok = false;
						break;
					}
				}
				if (ok) {
					ans = min(ans, rr);
				}
			}
		}
		vector<Point> ch = xy;
		int sz = ch.size();
		for (int i = 0; i < sz; ++i) {
			for (int j = i + 1; j < sz; ++j) {
				for (int k = j + 1; k < sz; ++k) {
					LD cx, cy, rr;
					if (!circumscribed_circle(ch[i].x, ch[i].y, ch[j].x, ch[j].y, ch[k].x, ch[k].y, cx, cy, rr)) {
						continue;
					}

					bool ok = true;
					for (int l = 0; l < sz; ++l) {
						LD dx = ch[l].x - cx;
						LD dy = ch[l].y - cy;
						if (sqrt(dx * dx + dy * dy) > rr + 0.0001) {
							ok = false;
							break;
						}
					}
					if (ok) {
						ans = min(ans, rr);
					}
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}


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

signed main(){
    int N,L;cin>>N>>L;
    vector<int> a(N);
    REP(i, N) cin >> a[i];
    bool ok=false;
    int num=0;
    REP(i,N-1) if(a[i]+a[i+1]>=L) ok=true,num=i;
    if(ok) cout<<"Possible"<<endl;
    else {
        cout<<"Impossible"<<endl;
        return 0;
    }
    REP(i,num) cout<<i+1<<endl;
    for(int i=N-1;i>num;--i) cout<<i<<endl;
}

Measured memory_bytes: 1664
#include <algorithm>
#include <bitset>
#include <cmath>
#include <ctime>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(a) begin(a),end(a)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1e+9;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};
ll gcd(ll a, ll b){
  if (b==0) return a;
  else return gcd(b,a%b);
}
int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


int fac(int num) {
  if(num==1) return 1;
  else return num*fac(num-1);
}

map<string,int> mp;

int main() {
  int N;cin >> N;
  rep(i,N) {
    string s;
    cin >> s;
    mp[s]++;
  }
  int cnt = 0;
  for(auto itr : mp) {
    cnt ++;
  }

  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 18816
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
double x,y,xx,yy,xxx,yyy,xxxx,yyyy;
int q;
int main(){
	cin>>q;
	while(q--){
		cin>>x>>y>>xx>>yy>>xxx>>yyy>>xxxx>>yyyy;
		double X=xxxx+(x-xxx),Y=yyyy+(y-yyy);
		double ans1=fabs((xxxx-xxx)*(y-yyy)-(x-xxx)*(yyyy-yyy));
		double ans2=fabs((xx-x)*(Y-y)-(X-x)*(yy-y));
		double ans=ans1/ans2;
		double XX=x+ans*(xx-x);
		double YY=y+ans*(yy-y);
		printf("%.10lf %.10lf\n",XX,YY);
	}
	return 0;
}


Measured memory_bytes: 3288
function Main(input) {
  input = input.split("\n");
  const n = input[0];
  const foodArray = input[1].split(" ");
  const satisfactionArray = input[2].split(" ");
  const additionalArray = input[3].split(" ");

  var sum = 0;
  for(var i = 0; i < n; i ++) {
    sum = sum + Number(satisfactionArray[i]);
  }

  var finalSum = sum;
  for(var i = 0; i < n - 1; i ++) {
    if (Number(foodArray[i + 1]) - Number(foodArray[i]) === 1) {
      finalSum = finalSum + Number(additionalArray[Number(foodArray[i]) - 1]);
    }
  }
  console.log(finalSum);

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


Measured memory_bytes: 21064
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;


void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto A = N.iota.map!(_ => readln.split.map!(to!int).array).array;

    auto C = new int[](M+1);
    foreach (i; 0..N) C[A[i][0]] += 1;

    auto ans = C.reduce!max;

    auto p = new int[](N);
    auto used = new bool[](M+1);
    auto pq = BinaryHeap!(Array!(Tuple!(int, int)), "a[1] < b[1]")();
    foreach (i; 1..M+1) pq.insert(tuple(i, C[i]));

    for (int cnt = 0; cnt < M - 1; ) {
        auto x = pq.front;
        auto n = x[0];
        auto c = x[1];
        pq.removeFront;
        if (used[n]) continue;
        cnt++;
        used[n] = true;

        fill(C, 0);
        foreach (j; 0..N) while (p[j] < M && used[ A[j][p[j]] ]) p[j]++;
        foreach (j; 0..N) C[A[j][p[j]]] += 1;
        foreach (j; 1..M+1) if (C[j] != 0) pq.insert(tuple(j, C[j]));
        ans = min(ans, C.reduce!max);
    }

    ans.writeln;
}


Measured memory_bytes: 7036
#include "bits/stdc++.h"
using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)

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

const int INTINF = 1e9;
const LL LLINF   = 1e18;
#define pow10(n) int(1e##n + n)

void solve()
{
    int N;
    cin >> N;
    map<string, int> poll;
    int n_max = 0;
    REP0 (i, N)
    {
        string S;
        cin >> S;
        poll[S]++;
        n_max = max(n_max, poll[S]);
    }

    for (auto p : poll)
    {
        if (p.second == n_max)
        {
            cout << p.first << endl;
        }
    }
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(10);
    solve();
    return 0;
}


Measured memory_bytes: 23808
#include <stdio.h>
#include <limits.h>
#define MAXN 200010
int t[MAXN], N, T;
int min(int a, int b) { return a < b ? a : b; }
int solve(void) {
    int s = 0;
    for(int i = 0; i < N; i++) s += min(t[i + 1] - t[i], T);
    return s;
}
int main(void) {
    scanf("%d%d", &N, &T);
    for(int i = 0; i < N; i++) scanf("%d", &t[i]);
    t[N] = INT_MAX;
    printf("%d", solve());
    return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll a,b,c,d=0,e=0;
 cin>>a;
    for(ll i=1;i<=a;i++)
    {
    cin>>b;e+=b;d=max(d,b);
    
  }
  e=e-d;
 if(e>d){cout<<"Yes\n";}
    else cout<<"No\n";

}

Measured memory_bytes: 256
#include<cstdio> 
#include<cstring> 
#include<algorithm> 
#define gc getchar() 
#define pc putchar 
inline int read() {
    int x = 0,f = 1; 
    char c = gc; 
    while(c < '0' || c > '9') {if(c == '-')f = -1; char c = getchar();} 
    while(c <= '9' && c >= '0') x = x * 10 + c - '0',c = getchar(); 
    return x * f; 
} 
void print(int x) { 
    if(x < 0) { 
        pc('-'); 
        x = -x; 
    } 
    if(x >= 10) print(x / 10); 
    pc(x % 10 + '0'); 
} 
const int maxn = 100007; 
int a[maxn]; 
int main() {
    int n = read(),k = read();      
    for(int i = 1;i <= n;++ i)  a[i] = read(); 
    std::sort(a + 1, a + n + 1); 
    int ans = 0; 
    for(int i = 1;i <= n;++ i) { 
        if(i < n) { if(a[i] <= k ) k -= a[i],ans ++;} 
        else if(i == n && a[i] == k) ans ++;     
        else break; 
    } 
    print(ans); 
    pc('\n'); 
}//????

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define mx 100011
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define mod 1000000009
#define ff first
#define ss second
#define int long long
#define inf 1000000000000000
using namespace std;
#define N 300010
#define A 300010
#define BLOCK 320 // ~sqrt(N)
int n,arr[mx];
main(){
 //   freopen("inn.txt","r",stdin);
 //   freopen("inn.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(false);
//    cout<<"100000"<<endl;
//    for(int i=0;i<100000;i++){
//        cout<<10000000000-i<<" ";
//    }
//    cout<<endl;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    int ans=inf;
    int val=0;
    int total=0;
    for(int i=0;i<n;i++){
        val+=arr[i];
        if(i%2){///pos
            if(val<=0){
                total+=1-val;
                val=1;
            }
        }
        else{
            if(val>=0){
                total+=val+1;
                val=-1;
            }
        }
    }
    ans = min(ans,total);
    total=0;
    val=0;
    for(int i=0;i<n;i++){
        val+=arr[i];
        if(i%2){///neg
            if(val>=0){
                total+=val+1;
                val=-1;
            }
        }
        else{
            if(val<=0){
                total+=1-val;
                val=1;
            }
        }
    }
    cout<<min(ans,total)<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <deque>
using namespace std;
int n,q;
string s;
deque<char> str;
int main()
{
    //freopen("main.inp","r",stdin);
    //freopen("main.out","w",stdout);
    cin>>s;
    for(int i=0;i<s.size();++i) str.push_back(s[i]);
    cin>>q;
    int dem=0;
     while(q--)
    {
        int t;
        cin>>t;
        if(t==1)
        {
            ++dem;
        }
        else
        {
            int r;
            char c;
            cin>>r>>c;
            if(dem%2==0)
            {
                if(r==1)
                    str.push_front(c);
                else
                    str.push_back(c);
            }
            else
            {
                if(r==2)
                    str.push_front(c);
                else
                    str.push_back(c);
            }
        }
    }
    if(dem%2==0)
        for(int i=0;i<str.size();++i)
            cout<<str[i];
    else
    {
        reverse(str.begin(),str.end());
        for(int i=0;i<str.size();++i)
            cout<<str[i];
    }
    return 0;
}


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

#define ll long long
#define pb push_back
#define F first
#define S second

using namespace std;

const int N = 100005;

int arr[N];
pair <int, int> brr[N];
int main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
    }
    for (int i = 1; i <= m; i++) {
        cin >> brr[i].S >> brr[i].F;
    }
    sort(brr + 1, brr + m + 1);
    sort(arr + 1, arr + n + 1);
    int j = 1;
    for (int i = m; i >= 1; i--) {
        while(j <= n && brr[i].S > 0 && brr[i].F > arr[j]) {
            arr[j++] = brr[i].F, brr[i].S--;
        }
    }
    ll res = 0;
    for (int i = 1; i <= n; i++) {
        res += arr[i];
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define For(i,n) for(long long i=0;i<n;i++)
#define Fre(i,a,b) for(long long i = a; i < b; i++)
#define sf(n) scanf("%d", &n)
#define sff(a,b) scanf("%d %d", &a, &b)
#define sfff(a,b,c) scanf("%d %d %d", &a, &b, &c)
#define pfn(n) prlong longf("%d\n", n)
#define pfs(n) prlong longf("%d ", n)
#define ff first
#define ss second
#define mem(a,b) memset(a,b,sizeof(a))
#define READ freopen("in.txt", "r", stdin)
#define WRITE freopen("out.txt", "w", stdout)
#define sz size()
#define number_of_digit(n) __builtin_ffs(n);
#define ll long long
#define T long long
int a[100005],b[100005];
int main()
{
	ios_base::sync_with_stdio(false);
  	cin.tie(NULL);
  	cout.tie(NULL);

  	int n,k;
  	cin>>n>>k;
  	For(i,n)cin>>a[i];
  	b[0]=0;
  	for(int i=1;i<=k;i++)
  	{
  		int g=1;
  		for(int j=0;j<n;j++)
  		{
  			if(i>=a[j])
  			{
  				g=min(g,b[i-a[j]]);
			}
		}
		b[i]=1-g;
		//cout<<b[i]<<" ";
	}
//	cout<<endl;
	if(b[k]==1)cout<<"First\n";
	else cout<<"Second\n";
	return 0;
}

Measured memory_bytes: 640
//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
#define fast_io() ios_base::sync_with_stdio(false); cin.tie(0);

int main()
{

    long long n;
    cin >> n;
    cout << 1LL * n * n;
    return 0;
}

// g++ -std=c++11


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int DP[50][500][500];

int main() {
  for(int i=0;i<50;++i) {
    for(int j=0;j<500;++j) {
      for(int k=0;k<500;++k) {
        DP[i][j][k] = inf;
      }
    }
  }
  int N, Ma, Mb;
  cin>>N>>Ma>>Mb;
  int a[N], b[N], c[N];
  for(int i=0;i<N;++i) cin>>a[i]>>b[i]>>c[i];
  DP[0][0][0] = 0;
  DP[0][a[0]][b[0]] = c[0];
  for(int i=0;i<N-1;++i) {
    for(int j=0;j<500;++j) {
      for(int k=0;k<500;++k) {
        DP[i+1][j][k] = min(DP[i+1][j][k], DP[i][j][k]);
        if(j+a[i+1]<500 && k+b[i+1]<500) {
          DP[i+1][j+a[i+1]][k+b[i+1]] = min(DP[i+1][j+a[i+1]][k+b[i+1]], DP[i][j][k]+c[i+1]);
        }
      }
    }
  }
  int ans = inf;
  for(int i=1;i*Ma<500 && i*Mb<500;++i) {
    ans = min(ans, DP[N-1][i*Ma][i*Mb]);
  }
  if(ans==inf) cout<<-1<<endl;
  else cout<<ans<<endl;
}



Measured memory_bytes: 52432
'use strict';
 
process.stdin.resume();
process.stdin.setEncoding('utf-8');
 
let inputString = '';
let currentLine = 0;
 
process.stdin.on('data', function(inputStdin) {
    inputString += inputStdin;
});
 
process.stdin.on('end', function() {
    inputString = inputString.split('\n');
    main();
});
 
function readline() {
    return inputString[currentLine++];
}
 
// main funtion .. code start ..... ///
function main() {
 
    var T = parseInt(readline());
    var str = readline();
    
    var res1 = str.slice(0, Math.floor(T/2));
    var res2 = str.slice(T/2);
    
    if(str.length === 1 ) console.log('No');
    else console.log(res1 === res2 ? 'Yes': 'No');
 
}

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

int main()
{
  int H,W ;
  cin>>H>>W ;
  vector<vector<char>>a(H,vector<char>(W)) ;
  for(int i=0;i<H;i++) for(int j=0;j<W;j++) cin>>a.at(i).at(j) ;
  
  int flag1=0 ;  //一列が白のみのとき、flag1=0
  int flag2=0 ;  //一行が白のみのとき、flag2=0
  /*i(0<=i<H)列を固定して、j行が白のみか判定*/
  for(int i=0;i<H;i++){
    
    for(int j=0;j<W;j++){
      if(a.at(i).at(j)=='#'){
        flag1=1 ;
        break ;
      }
    }
    
    if(flag1==0){
      H-- ;
      for(int k=0;k<W;k++){
        for(int l=i;l<H;l++) a.at(l).at(k)=a.at(l+1).at(k) ;
      }
      i=-1 ;
    }
    flag1=0 ;
  }
  
  /*i(0<=i<W-1)行を固定して、j列を白のみか判定*/
  for(int i=0;i<W;i++){
    for(int j=0;j<H;j++){
      if(a.at(j).at(i)=='#'){
        flag2=1 ;
        break ;
      }
    }

    
    if(flag2==0){
      W-- ;
      for(int k=0;k<H;k++){
        for(int l=i;l<W;l++) a.at(k).at(l)=a.at(k).at(l+1) ;
      }
      i=-1 ;
    }
    flag2=0 ;
  }
  
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cout<<a.at(i).at(j) ;
      if(j==W-1) cout<<endl ;
    }
  }

  return 0 ;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cmath>
#include<stack>
using namespace std;

bool digit(char c){
  return (c>='0') && (c<='9');
}

double stoi(string s){
  int pos = -1;
  double k,res;
  for(int i=0;i<(int)s.size();i++){
    if(s[i] == '.')pos = i;
  }
  if(pos < 0){
    k = 1.0;
    res = 0.0;
    for(int i = (int)s.size()-1;i>=0;i--){
      res += (s[i]-'0') * k;
      k *= 10;
    }
  }else{
    k = 1.0;
    res = 0.0;
    for(int i = pos-1;i>=0;i--){
      res += (s[i]-'0') * k;
      k *= 10;
    }
    k = 1.0 / 10;
    for(int i=pos+1;i<(int)s.size();i++){
      res += (s[i]-'0') * k;
      k /= 10;
    }
  }
  return res;
}

double cal(double x, double y, char z){
  if(z == '-')return x-y;
  if(z == '*')return x*y;
  if(z == '/')return x/y;
  else return x+y;
}  

int main(){
  stack<double> a;
  char str[100];

  while(fgets(str,100,stdin)!=NULL){
    int pos = 0;
    while(1){
      if(str[pos] == '\n')break;
      if(digit(str[pos])){
	char tmp[100];
	int n = 0;
	tmp[n] = str[pos];
	while(1){
	  n++;
	  pos++;
	  if(str[pos] == ' ' || str[pos] == '\n')break;
	  tmp[n] = str[pos];
	}
	tmp[n] = '\0';
	a.push(atof(tmp));
      }else if(str[pos] == ' '){
	pos++;
      }else if(str[pos] == '-' && digit(str[pos+1])){
	char tmp[100];
	int n = 0;
	tmp[n] = str[pos];
	while(1){
	  n++;
	  pos++;
	  if(str[pos] == ' ' || str[pos] == '\n')break;
	  tmp[n] = str[pos];
	}
	tmp[n] = '\0';
	a.push(atof(tmp));
      }else{
	double x,y;
	y = a.top();
	a.pop();
	x = a.top();
	a.pop();
	a.push(cal(x,y,str[pos]));
	pos++;
      }
    }
    
    printf("%lf\n",a.top());
    
  }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int>cards(N);
  for(int i=0;i<N;i++){
    cin>>cards.at(i);
  }
  sort(cards.begin(),cards.end());
  reverse(cards.begin(),cards.end());
  int sum;
  if(N%2==0){
    for(int i=0;i<N-1;i=i+2){
      sum=sum+cards.at(i)-cards.at(i+1);
    }
  }
  else{
    for(int i=0;i<N-2;i=i+2){
      sum=sum+cards.at(i)-cards.at(i+1);
    }
    sum=sum+cards.at(N-1);
  }
  cout<<sum<<endl;
}
    

Measured memory_bytes: 256
// 161-C Replacing Integer

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>

// qsortで用いる比較用関数．*a<*bならaが先になる．
int compare(const void* a, const void* b) {
    return -1 * (*(int*)a - *(int*)b);
}


int main() {
    int n,i,cnt=1,diff;
    int* a;
    int isReset = 1;

    scanf("%d", &n);

    a = (int*)malloc(sizeof(int) * n);
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }

    if (n == 1) {
        printf("%d", 1);
        return 0;
    }

    for (i = 0; i < n - 1; i++) {
        if (isReset) {
            diff = a[i] - a[i + 1];
            isReset = 0; // false
        }
        else {
            if (diff == 0) {
                diff = a[i] - a[i + 1];
            }
            else if (diff < 0) {
                if (a[i] - a[i + 1] > 0) {
                    cnt++;
                    diff = a[i] - a[i + 1];
                    isReset = 1; //true
                }
            }
            else if (diff > 0) {
                if (a[i] - a[i + 1] < 0) {
                    cnt++;
                    diff = a[i] - a[i + 1];
                    isReset = 1; //true
                }
            }
        }
    }

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

Measured memory_bytes: 512
def CheckDisit(a) :
    tmp = 0
    for i in range(11) :
        if i <= 4 :
            tmp += int(a[i]) * (6-i)
        else :
            tmp += int(a[i]) * (12-i)
    tmp = tmp % 11
    if tmp <= 1 :
        return 0
    else :
        return (11 - tmp)
        
        
m = list(input())
if m[11] == '?' :
    print(CheckDisit(m))
else :
    ans = []
    x = m.index('?')
    for i in range(10) :
        m[x] = str(i)
        if int(m[11]) == CheckDisit(m) :
            ans.append(i)
    if len(ans) == 1 :
        print(ans[0])
    else :
        print("MULTIPLE")
        



Measured memory_bytes: 5600