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

using namespace std;

typedef long long ll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

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

int main(){
    string A,B;
    cin>>A>>B;
    map<char,string> mp1;
    map<char,string> mp2;
    int L=A.length();
    bool ok=true;
    for(int i=0;i<L;i++){
        string a=A.substr(i,1),b=B.substr(i,1);
        if(mp1[A[i]]==""){
            mp1[A[i]]=b;
        }else if(mp1[A[i]]!=b){
            ok=false;
        }
        if(mp2[B[i]]==""){
            mp2[B[i]]=a;
        }else if(mp2[B[i]]!=a){
            ok=false;
        }
    }
    if(ok)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

//a=97,z=122

Measured memory_bytes: 776
object Scanner {
  private val buf = new Array[Byte](1024); private var ptr = 0; private var len = 0
  @inline private def isPrintableChar(c: Int): Boolean = 33 <= c && c <= 126
  @inline private def hasNextByte(): Boolean =
    if (ptr >= len) { ptr = 0; len = System.in.read(buf); len > 0 } else { true }
  @inline private def hasNext(): Boolean = {
    while (hasNextByte() && !isPrintableChar(buf(ptr))) ptr += 1
    hasNextByte()
  }
  @inline private def readByte(): Byte =
    if (hasNextByte()) { val res = buf(ptr); ptr += 1; res } else { -1 }
  def next(): String = {
    if(!hasNext()) ???
    val sb = new StringBuilder; var b = readByte()
    while (isPrintableChar(b)) { sb.append(b.toChar); b = readByte() }
    sb.toString
  }
  def nextInt(): Int = {
    val n = nextLong()
    if (n < Int.MinValue || Int.MaxValue < n) ???
    n.toInt
  }
  def nextLong(): Long = {
    if(!hasNext()) ???
    var minus = false; var b = readByte()
    if (b == '-') { minus = true; b = readByte() }
    def go (b: Byte, n: Long = 0): Long =
      if ('0' <= b && b <= '9') { go(readByte(), n * 10 + b - '0') }
      else if (minus) { -n } else { n }
    go(b)
  }
  def nextDouble(): Double = next.toDouble
}

object Main extends App {
  def devidablity(x:Int) = {
    var num = x
    var count = 0
    while (num%100==0){
      count = count + 1
      num = num / 100
    }
    count
  }
  val d,n = Scanner.nextInt()
  var i = 0
  var count = 0
  while (count < n){
    i = i + 1
    if (devidablity(i)==d){
      count = count + 1
    }
  }
  println(i)
}

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

using namespace std;

typedef long long ll;

int main(){
  ll N,K;
  ll L[222222],R[222222];
  cin >> N >> K;
  ll i,k;
  for(i=0;i<=K-1;i++)
    cin >> L[i] >> R[i];
  ll dp[222222] = {0};
  dp[1] = 1;
  ll sum[222222] = {0};
  sum[1] = 1;
  for(i=2;i<=N;i++)
    for(k=0;k<=K-1;k++){
      dp[i] = (dp[i] + sum[i-L[k]] - sum[i-R[k]-1]) % 998244353;
      sum[i] = (sum[i-1] + dp[i]) % 998244353;
    }
  if(dp[N] < 0) dp[N] += 998244353;
  cout << dp[N] << endl;
}

Measured memory_bytes: 7032
#include<stdio.h>
#include<string.h>

int main(void){
  char str[200002];
  char *a,*z;
  scanf("%s",str);
  a=strchr(str,'A');
  z=strrchr(str,'Z');
  printf("%d\n",(int)(z-a)+1);
  return 0;
}

  


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

int main() {
	int N;
	string S;
	cin >> N >> S;
	int open = 0, plusopen = 0;
	for (char c : S) {
		open += (c == '(' ? 1 : -1);
		if (open == -1) {
			plusopen++;
			open = 0;
		}
	}
	for (int i = 0; i < plusopen; i++) cout << "(";
	cout << S;
	for (int i = 0; i < open; i++) cout << ")";
	cout << endl;
}

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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////

ll A,B,K;
ll i, j, k, ans;
int main(){
    scanf("%lld%lld%lld", &A, &B,&K);
    printf("%lld", max(A - K, 0ll));
    K = max(K - A, 0ll);
    printf(" %lld", max(B - K, 0ll));
    return 0;
}

Measured memory_bytes: 256
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    P = [input().strip("\n").split() for _ in range(N)]
    X = input().strip("\n")
    sec = 0
    lastId = 0
    for i in range(N):
        if P[i][0] == X: 
            lastId = i
            break
    for i in range(lastId + 1, N):
        sec += int(P[i][1])
    print(sec)
    
    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 3064
#include<iostream>
#include<cstring>
using namespace std;
string str;
int main(){
	cin>>str;
	int ans=0;
	for (int i=0,j=str.size()-1;i<j;i++,j--)
		if (str[i]!=str[j])
			if (str[i]=='x'){
				ans++;
				j++;
			}
			else if (str[j]=='x'){
				ans++;
				i--;
			}
			else{
				cout<<-1;
				return 0;
			}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <map>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;
 
typedef long long ll;
typedef pair<double, int> P;
typedef tuple<int, int, int> T;
 
const ll MOD=1e9+7;
const ll INF=1e18;
 
int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};

int ans;
int w,h;
void solve(int n,int y,int x,int ban[22][22]){

    if(n > 10 || n >= ans) return;

    for(int k = 0;k < 4;k++){
        int ni = y + dy[k],nj = x + dx[k];
        if(ban[ni][nj] == -1 || ban[ni][nj] == 1)continue;
        if(ban[ni][nj] == 3){
            ans = min(ans,n);
            return;
        }
        while(true){
            ni += dy[k]; nj += dx[k];
            int state = ban[ni][nj];
            if(state == 3){
                ans = min(ans,n);
                return;
            }else if(state == 1){
                ban[ni][nj] = 0;
                solve(n+1,ni-dy[k],nj-dx[k],ban);
                ban[ni][nj] = 1;
                break;
            }else if(state == -1){
                break;
            }
        }
    }
}

int main(){
    int ban[22][22];
    
    while(1){
        cin >> w >> h;
        if(w + h == 0)break;
        ans = 11;
        int x,y;
        for(int i = 1;i <= h;i++){
            for(int j = 1;j <= w;j++){
                cin >> ban[i][j];
                if(ban[i][j] == 2){
                    y = i; x = j; ban[i][j] = 0;
                }
            }
        }
        for(int i = 0;i <= h+1;i++){
            ban[i][0] = -1;
            ban[i][w+1] = -1;
        }
        for(int j = 0;j <= w+1;j++){
            ban[0][j] = -1;
            ban[h+1][j] = -1;
        }
        solve(1,y,x,ban);
        if(ans == 11) ans = -1;
        cout << ans << endl;
    }
}


Measured memory_bytes: 3068
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{

	ios_base::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);

// #ifndef ONLINE_JUDGE
// 	freopen("input.txt" , "r" , stdin);
// 	freopen("output.txt" , "w" , stdout);
// #endif

	ll n, m, n1 = 0, ans = 0;
	cin >> n >> m;
	map<ll, ll, greater<ll> >m1;
	for (ll i = 0; i < n; i++)
	{
		ll a;
		cin >> a;
		m1[a]++;
	}
	for (ll i = 1; i <= m; i++)
	{
		ll a, b;
		cin >> a >> b;
		m1[b] += a;
	}
	for (auto i : m1)
	{
		if (n1 + i.second >= n)
		{
			ans += (n - n1) * i.first;
			break;
		}
		else
		{
			ans += i. first * i.second;
			n1 += i.second;
		}
	}
	cout << ans << endl;




}


Measured memory_bytes: 12800
/* Ahmed Maher ( Acro_14 ) */
#include <bits/stdc++.h>
typedef long long ll;
const ll oo = 0x3f3f3f3f;
int const N = 1e7;
using namespace std;
//string alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//string BN(ll x){bool f=0;string Bn;int i=62;while(i--){if ((ll)x & (1LL << i)){Bn+='1';f=1;}else{if(f)Bn+='0';}}return Bn;}//Decimal to Binary converter
int main()
{
    ll n,i,sum=0,cur;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cur=n/i;
        sum+=i*(cur*(cur+1));
    }
    cout<<sum/2;
}

//       int anss[t+1];
//            anss[j]=ans;
//     for(int j=1;j<=t;j++) printf("Case %d: %d\n",j,anss[j]);


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

vector<int> to[200005];
vector<int> ans;

void dfs(int v, int p = -1){
    for (int u : to[v])
    {
        if (u == p)
        {
            continue;
        }
        ans[u] += ans[v];
        dfs(u, v);
    }
}


int main(){
    int n, q;
    cin >> n >> q;
    for (int i = 0; i < n-1; i++)
    {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    ans.resize(n);
    for (int i = 0; i < q; i++)
    {
        int p, x;
        cin >> p >> x;
        p--;
        ans[p] += x;
    }
    dfs(0);
    for (int i = 0; i < n; i++)
    {
        cout << ans[i] << " ";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 23552
import java.util.Scanner;

public class Main{
  static int n, m;
  static int[] a, b;

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

    n = sc.nextInt();
    m = sc.nextInt();
    a = new int[m];
    b = new int[m];
    for(int i = 0; i < m; i++){
      a[i] = sc.nextInt() - 1;
      b[i] = sc.nextInt() - 1;
    }

    int[] d = new int[n];
    for(int i = 0; i < m; i++){
      d[a[i]]++;
      d[b[i]]++;
    }

    StringBuilder sb = new StringBuilder();
    for(int i = 0; i < n; i++){
      sb.append(d[i] + System.lineSeparator());
    }

    System.out.print(sb);
  }
}


Measured memory_bytes: 21844
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections


def solve(N: int, a: "List[int]"):
    a.sort()
    c = collections.Counter(a)
    cc = dict(c.items())
    mx = 0
    for i in range(a[0], a[-1]+1):
        counter = 0
        for j in range(i-1, i+2):
            if j in c.keys():
                counter += c[j]
        mx = max(counter, mx)
    print(mx)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()


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

int take_min(int i,int k,int n,int* dp,int* arr)
{
  int ans = INT_MAX;
  int c = k;
  int c1 = i;
  i--;
  while(i >= 0 && c > 0)
  {
  	c--;
    ans = min(dp[i] + abs(arr[c1]-arr[i]),ans);
    i--;
  }
  return ans;
}

int main()
{
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  // #endif
  int n,k;
  cin>>n>>k;
  int arr[n];
  for(int i = 0; i < n ; i++)
  	cin>>arr[i];
  int dp[n];
  for(int i = 0 ; i < n ; i++)
  	dp[i] =  0;
  dp[0] = 0;
  dp[1] = abs(arr[1] - arr[0]);
  for(int i = 2 ; i < n ; i++)
  {
    // dp[i] = min(dp[i-1] + abs(arr[i]-arr[i-1]) ,  abs(arr[i]-arr[i-2]) + dp[i-2]);
    dp[i] = take_min(i,k,n,dp,arr);
    // cout<<take_min(i,k,n,dp,arr)<<endl;
  }
  cout<<dp[n-1]<<endl;
  return 0;
}

Measured memory_bytes: 1024
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
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)*}
    };
}

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)*}
    };
}

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")
    };
}

fn main(){
    input!{
        n: i64,
        d: i64,
    }
    let mut ans = 0;
    ans = (n + d * 2) / (d * 2 + 1);

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

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

using namespace std;

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//==================================

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

    vector<Vi> A(3, Vi(3));
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> A[i][j];
        }
    }
    int N;
    cin >> N;
    Vi B(N);
    for (int i = 0; i < N; i++) {
        cin >> B[i];
    }

    vector<Vi> ok(3, Vi(3));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 3; k++) {
                if (A[j][k] == B[i]) ok[j][k] = 1;
            }
        }
    }


    bool bingo = false;

    for (int i = 0; i < 3; i++) {
        bool b_tmp = true;
        for (int j = 0; j < 3; j++) {
            if (ok[i][j] == 0) {
                b_tmp = false;
                break;
            }
        }
        if (b_tmp) {
            bingo = true;
            break;
        }
    }

    for (int i = 0; i < 3; i++) {
        bool b_tmp = true;
        for (int j = 0; j < 3; j++) {
            if (ok[j][i] == 0) {
                b_tmp = false;
                break;
            }
        }
        if (b_tmp) {
            bingo = true;
            break;
        }
    }

    bool b_tmp = true;
    for (int i = 0; i < 3; i++) {
        if (ok[i][i] == 0) {
            b_tmp = false;
            break;
        }
    }
    if (b_tmp) bingo = true;

    b_tmp = true;
    for (int i = 0; i < 3; i++) {
        if (ok[i][2 - i] == 0) {
            b_tmp = false;
            break;
        }
    }
    if (b_tmp) bingo = true;

    cout << (bingo ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1000000007; 
const int INF = 1000000000; //1e9
const int NIL = -1;
const long long LINF = 1000000000000000000; // 1e18
const double EPS = 1E-10;

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

int A, B, C;
int dfs(int cur, int a, int b, int c, std::vector<int>& l){
    int lim(l.size());
    if(cur == lim)
        return ((std::min({a, b, c})) ? 
                 std::abs(a-A)+std::abs(b-B)+std::abs(c-C)-30 : INF);

    int ret0(dfs(cur+1, a,        b,        c,        l));
    int ret1(dfs(cur+1, a+l[cur], b,        c,        l) + 10);
    int ret2(dfs(cur+1, a,        b+l[cur], c,        l) + 10);
    int ret3(dfs(cur+1, a,        b,        c+l[cur], l) + 10);
    return std::min({ret0, ret1, ret2, ret3});
}
 
 
int main(){
    int N; std::cin >> N >> A >> B >> C;
    std::vector<int> l(N);
    for(int i(0); i < N; ++i) std::cin >> l[i];
    std::cout << dfs(0, 0, 0, 0, l) << std::endl;
    return 0;
}


Measured memory_bytes: 256
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, *a = map(int, read().split())

MOD = 10 ** 9 + 7
total = 0
s = sum(a)

for i in range(n):
    total += a[i] * (s - a[i])

print((total // 2) % MOD)


Measured memory_bytes: 27880
// #pragma GCC target("avx2")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3121000;
long long fact[C_SIZE];
long long finv[C_SIZE];
long long inv[C_SIZE];
long long Comb(int a,int b){
 	if(a<b||b<0)return 0;
 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
}
void init_C(int n){
	fact[0]=finv[0]=inv[1]=1;
	for(int i=2;i<n;i++){
		inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
	}
	for(int i=1;i<n;i++){
		fact[i]=fact[i-1]*i%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
}
long long pw(long long a,long long b){
	if(a<0LL)return 0;
	if(b<0LL)return 0;
	long long ret=1;
	while(b){
		if(b%2)ret=ret*a%mod;
		a=a*a%mod;
		b/=2;
	}
	return ret;
}
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
// ここから編集しろ
int p[110];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d",p+i);std::sort(p,p+a);
	for(int i=0;i<a-1;i++)p[a-1]-=p[i];
	if(p[a-1]<0)printf("Yes\n");else printf("No\n");
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const ll mod=(int)1e9+7;

int main()
{
	ios;
	int x,ans;
	for(int i=0;i<5;i++)
	{
		cin>>x; 
		if(x!=i+1) ans=i+1;
	}
	cout<<ans;
	return 0;
}


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

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

    long long a, b, c, k;
    cin >> a >> b >> c >> k;

    if(k % 2) cout << b - a << endl;
    else cout << a - b << endl;

    return 0;
}

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

#define x first
#define y second

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;

const int mod=1000000000+7;

int addm(int& a,int b) {return (a+=b)<mod?a:a-=mod;}

template<class T,class U> bool smin(T& a,U b) {return a>b?(a=b,1):0;}
template<class T,class U> bool smax(T& a,U b) {return a<b?(a=b,1):0;}

string s,t;
int q,a,b,c,d,cs[2][100001];

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

	cin >> s >> t;
	for (int i=1;i<=s.size();i++) cs[0][i]=cs[0][i-1]+(s[i-1]=='A'?1:-1);
	for (int i=1;i<=t.size();i++) cs[1][i]=cs[1][i-1]+(t[i-1]=='A'?1:-1);

	cin >> q;
	while (q--) {
		cin >> a >> b;
		c=cs[0][b]-cs[0][a-1];
		cin >> a >> b;
		d=cs[1][b]-cs[1][a-1];
		//cerr << c << ' ' << d << endl;
		if ((d-c)%3) cout << "NO\n";
		else cout << "YES\n";
	}
}

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

int main(){
  int n,m,f;
  cin>>n>>m;
  string a[n],b[n];
  for(int i=0;i<n;++i){
    cin>>a[i];
  }
  for(int i=0;i<m;++i){
    cin>>b[i];
  }

  for(int i=0;i<n-m+1;++i){
    for(int j=0;j<n-m+1;++j){
      int flag = 0;
      for(int k=0;k<m;++k){
        string tmp = a[i+k].substr(j,m);
        if(tmp.compare(b[k])!=0){
          flag = 1;
          break;
        }
      }
      if(flag==0){
          cout<<"Yes"<<endl;
          return 0;
      }
    }
  }
  cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 256
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n, = get_nums_l()

print((n+1)//2)

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

int main() {
  long long X;
  cin >> X;

  for (int i = 0; i < 10000; i++) {
    for (int j = -5000; j < 5000; j++) {
      if (pow(i, 5) - pow(j, 5) == X) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }
}


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

int main(){
  string s;
 cin >> s;
 string t = s;
 int n = s.size();
 reverse(s.begin(), s.end());
 int cnt = 0;
 for(int i = 0; i< n; i++){
    if(s[i] != t[i]) cnt++;
 }
 int ans = cnt / 2;
 cout <<  ans  << endl;
return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <set>
#include <map>
#include <iterator>
#include <stack>
#include <string.h>
#include <cstdlib>
#include <queue>
#include <list>
#include <string>
#include <iterator>
#include <iomanip>
#define rep(i,n) for(int i = 0; i < (n); i++) 
using namespace std;

int main() {
    string str;
    int count = 0;
    cin >> str;
    
    rep(i,str.size()/2) {
        if (str[i] != str[str.size() - (i+1)]) {
            count += 1;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    
    for (int i=1; i<10; i++) {
      if(n%i == 0 && n/i < 10) {
        System.out.println("Yes");
        return;
      }
    }
    
    System.out.println("No");
  }
}


Measured memory_bytes: 23764
<?php
$haveCardNum = trim(fgets(STDIN));
$cardCheckList = createCardCheckList();
$nullCards = '';
 
for ($i = 0; $i < $haveCardNum; $i++) {
    list($mark, $num) = getInputExplodeBySpaces();
    $cardCheckList[$mark][$num] = 'check';
}
 
foreach ($cardCheckList as $mark => $value) {
    for ($cardNum = 1; $cardNum <= 13; $cardNum++) {
        if (! isset($cardCheckList[$mark][$cardNum])) {
            $nullCards .= sprintf('%s %d', $mark, $cardNum).PHP_EOL;
        }
    }
}

echo $nullCards;
 
function getInputExplodeBySpaces()
{
    return explode(' ', trim(fgets(STDIN)));
}
 
function createCardCheckList()
{
    foreach(array('S', 'H', 'C', 'D') as $mark) {
        $checkList["$mark"] = array_fill(1, 13, null);
    }
    return $checkList;
}

Measured memory_bytes: 15408
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>

using namespace std;

typedef long int lint;
typedef long long int llint;

#define INF 1073741824
#define LINF 4611686018000000000
#define MOD 1000000007

int a[110];
int main() {
    int x, n;
    set<int> s;
    cin >> x >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        s.insert(a[i]);
    }
    int ans = x;
    for (int i = 0; i < 101; i++) {
        if (s.find(x-i) == s.end()) {
            ans = x - i;
            break;
        } else if (s.find(x+i) == s.end()) {
            ans = x + i;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3196
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 100001;
static const ll 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; }
template<class T> inline T int_ceil(T a, T b) { T res = a / b; if(a % b != 0) res++; return res; }
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

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

	sort(ALL(ab), greater<ll>());
	ll ans = 0;
	rep(i, n){
		if(i % 2 == 1) continue;
		ans += ab[i];
	}
	rep(i, n){
		ans -= b[i];
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 5568
fn main(){
  let mxv: usize = 50000;
  let mxi: usize = 224;
  let mut tbl: Vec<bool> = vec![true; mxv];

  tbl[0] = false;
  tbl[1] = false;

  for i in 2 .. mxi {
    if tbl[i] {
      let mut j = i * i;
      while j < mxv {
        tbl[j] = false;
        j += i;
      }
    }
  }

  loop {
    let mut cnt: u32 = 0;
    let n: usize = read();

    if n == 0 { break; }

    for i in 2 .. n / 2 + 1 {
      if tbl[i] && tbl[n-i] {cnt += 1;}
    }

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

fn read<T>() -> T
  where T: std::str::FromStr,
        T::Err: std::fmt::Debug
{
  let mut buf = String::new();
  std::io::stdin().read_line(&mut buf).expect("failed to read");
  buf.trim().parse().unwrap()
}



Measured memory_bytes: 5048
use std::io;
use std::str;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let split: Vec<&str> = input.as_str().split_whitespace().collect();
    // println!("{:?}", split);

    let a: i64 = split[0].parse().unwrap();
    let b: i64 = split[1].parse().unwrap();
    // println!("{} {}", a, b);

    let sum: i64 = a + b;

    if sum > 24 {
        println!("{}", sum - 24);
    } else if sum == 24 {
        println!("0");
    } else {
        println!("{}", sum);
    }
}

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

int main () {
  string S;
  cin >> S;

  int count = 0;
  for (int i = 0; i < 3; i++) {
    if (S.at(i) == '1') {
      count++;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(i = 0; i < n; i++)
//2D::rep(i,j)rep(j,j)cin>>bin[i][j];
//vector<int> a(n)
#define A1 cout<<"No"<<endl
#define A2 cout<<"Yes"<<endl
#define A3 cout<<ans<<endl
#define AA(i) cout<<i<<endl
const int U=2e5+5;
const ll MOD=1000000007;
const int INF = 1001001001;

int main(){
  int a,B; cin >> a >> B;
  AA(a*B);
  return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main(){
	ll i,j,h,w;
	cin>>h>>w;
	vector<vector<char>> a(h+1,vector<char>(w+1));
	for(i=1; i<=h; ++i)
		for(j=1; j<=w; ++j)
			cin>>a[i][j];
	vector<vector<ll>> dp(h+1, vector<ll>(w+1,0));
	dp[1][1]=1;
	for(i=1; i<=h; ++i){
		for(j=1; j<=w; ++j){
			if(a[i][j]=='#')
				dp[i][j]=0;
			else{
				if(i==1 && j==1) continue;
				ll sum=0;
				if(j>0 && a[i][j-1]=='.')
					sum+=dp[i][j-1];
				if(i>0 && a[i-1][j]=='.')
					sum+=dp[i-1][j];
				if(sum>=(ll)(1e9+7))
					sum-=(ll)(1e9+7);
				dp[i][j]=sum;
			}
		}
	}
	//cout<<(ll)(10e9+7)<<"\n";
	cout<<dp[h][w]<<"\n";
}


Measured memory_bytes: 9088
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=1e9,dx[]={-1,0,1,0},dy[]={0,-1,0,1};
const long long llinf=1e18;
const int A=100005,B=200005,C=305,D=105,E=1005;
int n,m,x,y,p,ans,pos,ps,maxv;
pair<int,int> a[A];
int main(){
	cin>>n>>m;
	for(int i=1;i<=m;i++)
		cin>>x>>y,a[i]=make_pair(x,y);
	sort(a+1,a+1+m);
	pos=1;
	while(pos<=m)
	{
		maxv=0;
		for(int i=a[pos].first+1;i<=a[pos].second;i++)
		{
			ps=pos;
			while(a[ps].first<i&&a[ps].second>=i)
				ps++;
			if(ps-pos>maxv)
				maxv=ps-pos,p=i;
		}
		while(a[pos].first<p&&p<=a[pos].second)
			pos++;
		ans++;
	}
	cout<<ans;
	return 0;
}

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

int main() {
  	int min, max, multi;
  	int cnt = 0;
	cin >> multi >> min >> max;
  
  	for(int i = min; i <= max; i++)
    {
    	if(i % multi == 0)
        {
        	cnt++;
        }
    }
  if(cnt != 0)
  {
	cout << "OK" << endl;  
  }
  else
  {
  	cout << "NG" << endl;  
  }
}

Measured memory_bytes: 3636
#include<iostream>
using namespace std;
#define MAX 100005
#define NIL -1

struct Node{int p, l, r;};

Node T[MAX];
int n, D[MAX];

void print(int u){
  int i, c;
  cout << "node " << u << ": ";
  cout << "parent = " << T[u].p << ", ";
  cout << "depth = " << D[u] << ", ";

  if(T[u].p == NIL) cout << "root, ";
  else if(T[u].l == NIL) cout << "leaf, ";
  else cout << "internal node, ";

  cout << "[";

  for(i=0, c=T[u].l; c!=NIL; i++, c=T[c].r){
    if(i) cout << ", ";
    cout << c;
  }
  cout << "]" << endl;
}

int rec(int u, int p){
  D[u] = p;
  if(T[u].r != NIL) rec(T[u].r, p);
  if(T[u].l != NIL) rec(T[u].l, p+1);
}

int main(){
  int i, j, d, v, c, l, r;
  cin >> n;
  for(i=0; i<n; i++) T[i].p = T[i].l = T[i].r = NIL;

  for(i=0; i<n; i++){
    cin >> v >> d;
    for(j=0; j<d; j++){
      cin >> c;
      if(j == 0) T[v].l = c;
      else T[l].r = c;
      l = c;
      T[c].p = v;
    }
  }

  for(i=0; i<n; i++){
    if(T[i].p == NIL) r=i;
  }

  rec(r, 0);

  for(i=0; i<n; i++) print(i);

  return 0;
}


Measured memory_bytes: 7668
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef pair<int,int> P;
double const PI=3.141592653589793;
int const INF=1001001001;
ll const LINF=1001001001001001001;
ll const MOD=1000000007;

int N,T;
int A[1000000];

int main(){
    cin>>N>>T;
    rep(i,N) cin>>A[i];

    int cost=0;
    int mini=A[0];
    rep(i,N){
        mini=min(mini,A[i]);
        cost=max(cost,A[i]-mini);
    }

    int ans=0;
    map<int,int> cnt;
    mini=A[0];
    rep(i,N){
        mini=min(mini,A[i]);
        cnt[A[i]]++;
        if(A[i]-mini==cost){
            ans+=cnt[mini];
            cnt[mini+1]+=cnt[mini];
            cnt[mini]=0;
        }
    }

    cout<<ans<<endl;
}

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

using namespace std;

const int maxN = 1000009;
int N, A, B, C, D;
char sir[maxN];

bool canGo (int i, int j)
{
    if (i == j)
        return 1;
    if (i > j || sir[i] == '#')
        return 0;
    if (sir[i + 1] == '.')
        return canGo (i + 1, j);
    return canGo (i + 2, j);
}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d %d %d %d %d\n", &N, &A, &B, &C, &D);
scanf ("%s", sir + 1);
bool jumpOption = 0;
for (int i=B; i<=D; i++)
    if (sir[i] == '.' && sir[i - 1] == '.' && sir[i + 1] == '.')
        jumpOption = 1;
if (!canGo (A, C) || !canGo (B, D) || (D < C && !jumpOption))
    printf ("No\n");
else printf ("Yes\n");
return 0;
}


Measured memory_bytes: 3948
import sys
input=sys.stdin.readline
a,b=map(int,input().split())
import math
for i in range(2000):
    x=math.floor(i*0.08)
    y=math.floor(i*0.1)
    if x==a and y==b:
        print(i)
        sys.exit()
print(-1)





Measured memory_bytes: 39152
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = long long;
using ull = unsigned long long;

int main() {
    string s;
    cin >> s;
    int l = 0;
    int r = (int)s.size() - 1;
    int cnt = 0;
    while (true) {
        if (s[l] != s[r]) {
            if (s[l] == 'x' && s[r] != 'x') {
                cnt++;
                l++;
            } else if (s[l] != 'x' && s[r] == 'x') {
                cnt++;
                r--;
            } else {
                cout << -1 << endl;
                return 0;
            }
        } else {
            l++;
            r--;
        }
        if (l > r) {
            cout << cnt << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;

int main(){ 
  ll n, k;
  cin >> n >> k;
  ll res = 1;
  for (int i = 0; i < n; i++) {
    if (i == 0) res *= k;
    else res *= (k - 1);
  }
  cout << res << endl;
  return 0;  
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
const int MAXN = 1e4 + 10;
const int MAXD = 1e2 + 10;
const int MOD = 1e9 + 7;
 
vector<int> digitos;
string s;
int N,D;
ll dp[MAXN][2][MAXD];
 
ll solve(int pos,int flag,int resto){
 
	if(pos == N) return (resto == 0);
	if(dp[pos][flag][resto] != -1) return dp[pos][flag][resto];
 
	ll tot = 0;
	int limit = (flag) ? (digitos[pos]) : (9);
	for(int i = 0;i<=limit;i++){
		tot += solve(pos+1,flag && (i == limit), (resto + i) % D );
	}
 
	return dp[pos][flag][resto] = tot % MOD;
 
}
 
int main(){
 
	cin >> s;
	cin >> D;
	N = (int)s.size();
	for(int i = 0;i<N;i++){
		digitos.push_back(s[i] - '0');
	}
	memset(dp,-1,sizeof(dp));
 
	ll ans = solve(0,1,0) - 1;
	if(ans < 0) ans += MOD;
	cout << ans << endl;
 
 
	return 0;
 
}

Measured memory_bytes: 21752
#include<bits/stdc++.h>
using namespace std;
int c[10],a;
int main(){
  for(int i=0;i!=3;++i){
    cin>>a;
    ++c[a];
  }
  if(c[7]==1&&c[5]==2){
    cout<<"YES"<<endl;
  }
  else{
    cout<<"NO"<<endl;
  }
}

Measured memory_bytes: 256
H, W = map(int, input().split())
grid = [input() for _ in range(H)]
Hs = set()
Ws = set()
for h in range(H):
  for w in range(W):
    if grid[h][w] == "#":
      Hs.add(h)
      Ws.add(w)
Hs = sorted(list(Hs))
Ws = sorted(list(Ws))
for h in Hs:
  for w in Ws:
    print(grid[h][w], end="")
  print()


Measured memory_bytes: 9200
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
#include <numeric>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<ll, ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<P> vp;
typedef vector<bool> vb;
#define rep(i, a, n) for (ll i = (a); i < (n); ++i)
#define rrep(i, a, n) for (ll i = (a); i > (n); --i)
#define erep(i, a, n) for (ll i = (a); i <= (n); ++i)
#define rerep(i, a, n) for (ll i = (a); i >= (n); --i)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define sz(x) ((int)x.size())
#define print(X) cout << (X) << "\n"
#define _ << " " <<
static const int INF = 1e+9+7;

int main(){
    double r;
    cin >> r;
    printf("%f %f\n", r*r*M_PI, r*2*M_PI);


  return 0;
}





Measured memory_bytes: 3204
import java.util.*;
import java.io.*;

class Main{		//?????£??????

	int a;
	int b;

	public Main(){
		Scanner scan = new Scanner(System.in);
		a = scan.nextInt();
		b = scan.nextInt();

		int x = a / b;
		int y = a % b;
		double z = (double)a / (double)b;

		System.out.printf("%d %d %.5f", x, y, z);
		System.out.println("");
	}
	public static void main(String[] args){
		new Main();
	}
}

Measured memory_bytes: 26272
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

ll mod=1e9+7;

int main()
{
    fast();
    ll n;
    cin>>n;
    ll s[n],b[n],h[n];

    for(ll i=0;i<n;i++)
        cin>>s[i]>>b[i]>>h[i];

    ll dp[n][3]={0};

    dp[0][0]=s[0];
    dp[0][1]=b[0];
    dp[0][2]=h[0];

    for(ll i=1;i<n;i++)
    {
        dp[i][0] = max(dp[i-1][1],dp[i-1][2]) + s[i];
        dp[i][1] = max(dp[i-1][0],dp[i-1][2]) + b[i];
        dp[i][2] = max(dp[i-1][1],dp[i-1][0]) + h[i];
    }

    cout<<max(dp[n-1][0] , max(dp[n-1][1],dp[n-1][2]) );
}



Measured memory_bytes: 4992
import math

A,B,C = map(int,input().split())

if ((max([A, B, C]) * 3) - (A + B + C)) % 2 == 0:
  ans = ((max([A, B, C]) * 3) - (A + B + C)) / 2
else:
  X = max([A, B, C]) + 1
  ans = (X * 3 - (A + B + C)) / 2

print(math.floor(ans))

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <sstream>
#include <deque>

std::vector<std::vector<long int> > table;

void outtable(std::vector<std::vector<long int> > t){
    for(int i = 0; i < t.size(); ++i){
        for(int j = 0; j < t[i].size(); ++j){
            std::cout << t[i][j] << " ";
        }
        std::cout << std::endl;
    }
    std::cout << std::endl;
}

int calc(std::deque<int> num, int input_data_num){
    for(int i = 0; i < input_data_num - 1; ++i){
        for(int j = 0; j < 21; ++j){
            if(table[i][j] != 0){
                //std::cout << i << " " << j << std::endl;
                if(j + num.front() <= 20){
                    table[i+1][j + num.front()] += table[i][j];
                }
                if(j - num.front() >= 0){
                    table[i+1][j - num.front()] += table[i][j];
                }
                //outtable(table);
            }
        }
        num.pop_front();
    }
}

int main(){

    std::deque<int> num;
    int input_data;
    int input_data_num;
    std::string str;

    std::cin >> input_data_num;
    std::cin.ignore();

    std::getline(std::cin, str);
    std::istringstream iss(str);
    while(!iss.eof()){
        iss >> input_data;
        num.push_back(input_data);
    }

    table = std::vector<std::vector<long int> >(input_data_num, std::vector<long int>(21, 0));
    ++table[0][num.front()];

    //outtable(table);
    
    num.pop_front();

    calc(num, input_data_num);

    //outtable(table);

    std::cout << table[input_data_num-1][0] << std::endl;
    return 0;
}

Measured memory_bytes: 3184
#include <stdio.h>
using namespace std;
const int MAXN = 2e5 + 1;
int n, m, i, j, k, z;
long long a[MAXN], b[MAXN];
int main()
{
    scanf("%d %d %d", &n, &m, &k);
	for (i = 1; i <= n; ++i)
		scanf("%d", &a[i]), a[i] += a[i - 1];
	for (i = 1; i <= m; ++i)
		scanf("%d", &b[i]), b[i] += b[i - 1];
	z = 0, i = 0, j = m;
	while (a[i] <= k && i <= n)
	{
		while (b[j] > k - a[i])
			--j;
		if (i + j > z)
			z = i + j;
		++i;
	}
	printf("%d", z);
    return 0;
}

Measured memory_bytes: 4772
#include <bits/stdc++.h>
#define cout16 cout << setprecision(16) 
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define MAX(A) *max_element(A.begin(),A.end())
#define MIN(A) *min_element(A.begin(),A.end())
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using P = std::pair<int,int>;
using vp = std::vector<P>;
using namespace std;
#define fi first
#define se second
#define INF 1001001001
#define LL_INF 1001001001001001001

int main(void) {
	int n; cin >> n;
	vector<vp> to(n);
	vll dist(n,-1);
	rep(i,n-1){
		int u,v,w;
		cin >> u >> v >> w;
		u--; v--;
		to[u].emplace_back(v,w);
		to[v].emplace_back(u,w);
	}
	queue<int> q;
	q.push(0);
	dist[0] = 0;
	while(q.size()){
		int now = q.front(); q.pop();
		for(P v:to[now]){
			if(dist[v.fi]!=-1) continue;
			dist[v.fi] = dist[now]+v.se;
			q.push(v.fi);
		}
	}
//	rep(i,n) cout << dist[i] << endl;

	vi ans(n);
	rep(i,n) ans[i] = dist[i]%2;
	rep(i,n) cout << ans[i] << endl;
}




Measured memory_bytes: 7552
#include<iostream>
#include<string>
using namespace std;
int main() {
	int x, kazu, w, l, d, ten[11], dai, kazu2, ans[55][11],kaisuu[55];
	string kuni[55][11], taihi[11];
	kazu = 0;
	while (1) {
		dai = 0;
		cin >> x;
		if (x == 0) {
			goto a;
		}
		kazu = kazu + 1;
		for (int i = 1; i <= x; i++) {
			cin >> taihi[i] >> w >> l >> d;
			ten[i] = w * 3 + d;
			if (dai < ten[i]) {
				dai = ten[i];
			}
		}
		kazu2 = 0;
		for (int z = dai; z >= 0; z--) {
			kaisuu[kazu] = x;
			for (int i = 1; i <= x; i++) {
				if (ten[i] == z) {
					kazu2 = kazu2 + 1;
					kuni[kazu][kazu2] = taihi[i];
					ans[kazu][kazu2] = ten[i];
				}
			}
		}
	}
a:;
	for (int i = 1; i <= kazu; i++) {
		for (int z = 1; z <= kaisuu[i]; z++) {
			cout << kuni[i][z] << "," << ans[i][z] << endl;
		}
		if (i != kazu) {
			cout << endl;
		}
	}
}


Measured memory_bytes: 3132
#include<bits/stdc++.h>                                                                                               
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
#define mk_p(a,b)   make_pair((a),(b))
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;

int gcd(int a,int b){return b ? gcd(b,a%b) : a;} 
int lcm(int a,int b){return a/gcd(a,b)*b;}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s,k;
    cin >> s;
    k = s;
    reverse(all(k));
    int n = s.size();
    cout << ((n == 2) ? s : k) << '\n';
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int r, c, a[150][150] = {}, i, j,N=0,S=0,M=0;
	cin >> r >> c;
	for (i = 1; i <=r ; i++){
		for (j = 1; j <= c; j++){
			cin >> a[i][j];
		}
	}
	for (i = 1; i <= r; i++){
		N = 0;
		for (j = 1; j <= c; j++){
			cout << a[i][j] << " ";
			N = N + a[i][j];
		}
		cout << N << endl;
	}
	for (j = 1; j <= c+1; j++){
		S = 0;
		for (i = 1; i <= r; i++){
			S = S + a[i][j];
		}
		if (j == c + 1){
			cout << M << endl;
			break;
		}
		cout << S << " ";
		M = M + S;
	}

	return 0;
}

Measured memory_bytes: 3164
statusList = input().split(" ")
health1=int(statusList[0])
strength1=int(statusList[1])
health2=int(statusList[2])
strength2=int(statusList[3])
while True:
    health2 = health2 - strength1
    if (health2 <= 0):
        print("Yes")
        break
    health1 = health1 - strength2
    if (health1 <= 0):
        print("No")
        break


Measured memory_bytes: 9176
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    r,d,x=INTM()
    for i in range(10):
        x=r*x-d
        print(x)
if __name__ == '__main__':
    do()

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
const int INF = 1<<15;
const ll MOD = 1e9+7;
const double EPS = 1e-9;


int main(int argc, const char * argv[]) {
  int N; cin >> N;
  vector<int> H(N);
  for (int i=0; i<N; i++){
    cin >> H[i];
  }
  
  vector<int> high(N);
  high[0] = H[0];
  for (int i=1; i<N; i++) {
    high[i] = max(high[i-1], H[i]);
  }
  
  int ans = 0;
  for (int i=0; i<N; i++) {
    if (H[i] == high[i]) ans ++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int i, j, n;
  float d[4], x[4], y[4];

  scanf("%d", &n);
  for(i = 0; i < n; i++){
    for(j = 0; j < 4; j++){
      scanf("%f%f", &x[j], &y[j]);
    }
    d[0] = x[1]-x[0];
    d[1] = y[1]-y[0];
    d[2] = x[3]-x[2];
    d[3] = y[3]-y[2];
    if(d[0]*d[3] == d[1]*d[2]){
      printf("YES\n");
    }else{
      printf("NO\n");
    }
  }
  return 0;
}

Measured memory_bytes: 616
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll int64_t
#define all(v) v.begin(), v.end()
#define bitrep(n) for(int bit=0;bit<(1<<n);bit++)

//貪欲法はクソ
int main() {

  int N; cin >> N ;

  vector<int> A(N); rep(i,N) cin >> A[i];

  sort(all(A));

  reverse(all(A));

  ll ans=0;

  int x=0;

  for(int i=0;i<N;){
    int j=0;
    while(A[i+j]==A[i]){
      j++;
      if(i+j>=N) break;
    }

    if(j>=4){
      if(x!=0) ans=(ll)x*A[i];//ここにきづかんかったのは悪かった。ただllはまじで勝手に処理しろ
      else ans=(ll)A[i]*A[i];
      break;
      }

    else if(j==3||j==2){
      if(x!=0){
        ans=(ll)x*A[i]; break;//llぐらい自分で処理して
      }
      else x=A[i];
    }
    i+=j;
    
  }

  cout << ans << endl;
  

  return 0;
}

Measured memory_bytes: 640
#include <stdio.h>

int main(void){
  int a, i, j, k, l;
  int n[1000], x[1000], sum[1000] = {0};

  a = 0;
  while (1) {
    scanf("%d%d", &n[a], &x[a]);
    if (n[a] == 0 && x[a] == 0) {
      break;
    }
    a++;
  }

  for (i = 0; i < a; i++) {
    for (j = 1; j <= n[i] - 2; j++) {
      for (k = j + 1; k <= n[i] - 1; k++) {
        for (l = k + 1; l <= n[i]; l++) {
          if (j + k + l == x[i]) {
            sum[i]++;
          }
        }
      }
    }
  }

  for (i = 0; i < a; i++) {
    printf("%d\n", sum[i]);
  }

  return 0;
}



Measured memory_bytes: 2124
#ABC112B
n,T = list(map(int,input().split()))
c,t = [0]*n,[0]*n
for i in range(n):
    c[i],t[i] = list(map(int,input().split()))
    
a = []
for i in range(n):
    if t[i]<=T:
        a.append(c[i])
if a==[]:
    print('TLE')
else:
    print(min(a))

Measured memory_bytes: 3060