akhauriyash/Code-Regression huggingface dataset:
a=[0]*9
a[0],a[1],a[2]=map(int, input().split())
a[3],a[4],a[5]=map(int, input().split()) 
a[6],a[7],a[8]=map(int, input().split()) 
N=int(input())
B=[]
for i in range(N):
  B.append(int(input()))
S=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]
ans='No'
for lis in S:
  n=0
  if ans=="Yes":
    break
  for i in range(3):
    if a[lis[i]] in B:
      n+=1
    if n==3:
      ans="Yes"

print(ans)
  




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

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

	int y = stoi(s.substr(0, 4));
	if (y < 2019) {
		cout << "Heisei" << endl;
		return 0;
	}
	else if (y > 2019) {
		cout << "TBD" << endl;
		return 0;
	}
	int m = stoi(s.substr(5, 2));
	if (m <= 4) {
		cout << "Heisei" << endl;
		return 0;
	}
	else {
		cout << "TBD" << endl;
		return 0;
	}

}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val N = readLine()!!.split(" ")
    val a = N[0].toInt()
    val b = N[1].toInt() 
    val temp = b - a
    var m = 0
    for (i in 1..(temp-1) step 1){
        m += i
    }
    val snowm = m - a
    println(snowm)

}


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

using namespace std;

int main()

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

    int n,k,i,j;
    cin>>n>>k;
    vector<int> v[n+1];
    if(k>(n-1)*(n-2)/2){
    cout<<-1;
    }else{
    int t=(n-1)*(n-2)/2;	
    for(i=2;i<=n;i++){
    	v[1].push_back(i);
    }
    int flag=0,edges=n-1;
    for(i=2;i<=n-1;i++){
     for(j=i+1;j<=n;j++){
     	if(k<t){
     		edges++;
     		t--;
     		v[i].push_back(j);
     	}
     	if(k==t){
     		flag=1;
     		break;
     	}
     }
     if(flag)
     	break;
    }
    cout<<edges<<endl;
    for(i=1;i<=n;i++){
    	for(j=0;j<v[i].size();j++)
    		cout<<i<<" "<<v[i][j]<<endl;
    }
    }  
    

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int n, i , x, y,sum = 0;

    scanf("%d", &n);

    if(n > 0 && n < 10)
    {
        for(i = 0; i < n ; i++)
        {
            sum++;
        }
        printf("%d\n",sum);
    }
    else if(n >= 10 && n <= 99)
        printf("9\n");
    else if(n > 99 && n < 1000)
    {
        x = n - 90;
        printf("%d\n",x);
    }
    else if(n > 999 && n < 10000)
    {
        printf("909\n");
    }
    else if(n > 9999 && n < 100000)
    {
        y = n - 9090 ;
        printf("%d\n", y);
    }
    else if(n > 99999)
        printf("90909\n");

    return 0;
}


Measured memory_bytes: 1732
import sys
for abcdef in sys.stdin:
    a,b,c,d,e,f = map(float,abcdef.split(" "))
    if a!=0:
        y=(a*f-c*d)/(a*e-b*d)
        y=round(y,3)
        x=(c-b*y)/a
        x=round(x,3)
    else:
        y=c/b
        y=round(y,3)
        x=(f-e*y)/d
        x=round(x,3)
    print "{0:.3f} {1:.3f}".format(x,y)

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

using namespace std;
const int N = 200005;

int n, x, arr[N], l;

void init(){
	scanf("%d%d",&n,&x);
	l = 2 * n - 1;
	if(x == 1 or x == l){
		puts("No");
		return;
	}
	puts("Yes");
	arr[n - 1] = x;
	int v = x;
	for(int i = n; i < l; i++){
		v++;
		if(v > l) v = 1;
		arr[i] = v;
	}
	v = x;
	for(int i = n - 2; i > -1; i--){
		v--;
		if(v < 1) v = l;
		arr[i] = v;
	}
	for(int i = 0; i < l; i++){
		printf("%d\n",arr[i]);
	}
}

int main(){
	
	init();
	return 0;
}

Measured memory_bytes: 2304
using System;
class Prpgram
{
    static void Main(string[] args)
    {
        string input = Console.ReadLine();
        string[] inputlist = input.Split(' ');

        int N = int.Parse(inputlist[0]);
        int M = int.Parse(inputlist[1]);

        int g = (N * (N - 1) / 2);
        int k = (M *( M - 1) / 2);
        int ans = g + k;

        Console.Write(ans);

    }

}

Measured memory_bytes: 11092
import sys
n = int(input())
a = list(map(int,sys.stdin.readline().split()))
a.sort()
minA = a[0]
mx = a[-1]
ans = []
t = ''
# ans.append(t)
s =0

if a[0]<0 and a[-1]>-1:
    l = a[0]
    h = a[-1]
    for i in range(1,n-1):
        if a[i]<0:
            ans.append([h,a[i]])
            h = h-a[i]
        else:
            ans.append([l,a[i]])
            l = l-a[i]
    ans.append([h,l])
    s = h-l
elif a[0]>-1 and a[-1]>-1:
    c = a[0]-a[-1]
    ans.append([a[0],a[-1] ])
    for i in range(1, n - 2):
        ans.append([c,a[i]])
        c = c - a[i]
    if n>2:
        ans.append([a[-2],c])
        s = a[-2]-c
    else:
        s=c
else:
    c = a[-1]-a[0]
    ans.append([a[-1],a[0]])
    for i in range(1, n-1):
        ans.append([c,a[i]])
        c= c-a[i]
    s=c

print(s)
# print(ans)
for v,w in ans:
    print(v,w)

Measured memory_bytes: 22408
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
using P = pair<int,int>;
using ll = long long;
static const int INF = 1000000000;
static const ll MOD = 1000000007;

ll gcd(ll a, ll b){return b!=0 ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}

int main(){
	int n, x;
	cin >> n >> x;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	
	sort(a.begin(), a.end());
	
	int ans = 0;
	for(int i = 0; i < n; ++i){
		if(a[i] <= x){
			ans++;
		}
		else{
			break;
		}
		x -= a[i];
	}
	if(ans == n && x > 0) cout << n - 1 << endl;
	else cout << ans << endl;
	
	return 0;
}



Measured memory_bytes: 256
n = gets.to_i
g = Array.new(n+1){Array.new}
(n-1).times do |i|
  u,v,w = gets.chomp.split(" ").map(&:to_i)
  g[u].push([v,w])
  g[v].push([u,w])
end
dist = Array.new(g.length,-1)
dist[1] = 0
queue = [1]
while !queue.empty?
  v = queue[0]
  queue.shift
  g[v].each{|des|
    if dist[des[0]] == -1
      dist[des[0]] = des[1]%2 ^ dist[v]
      queue.push(des[0])
    end
  }
end
n.times do |i|
 puts dist[i+1]
end

Measured memory_bytes: 33872
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
using namespace std;

int main(){

	for (int i = 1; i < 10; i++)
		for (int j = 1; j < 10; j++)
			cout << i << "x" << j << "=" << i*j << endl;

	return 0;
}



Measured memory_bytes: 2972
#include <iostream>
#include <queue>
#include <algorithm>
#include <utility>
#include <vector>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    int n,d,a;  cin >> n >> d >> a;
    vector<pair<int, int> >m(n);
    rep(i, n)   cin >> m[i].first >> m[i].second;
    sort(m.begin(), m.end());
    queue<pair<int, int> > q;
    ll ans = 0;
    ll damage = 0;
    rep(i, n){
        int x = m[i].first;
        int h = m[i].second;
        while(q.size() && q.front().first < x){
            damage -= q.front().second;
            q.pop();
        }
        h -= damage;
        if(h > 0){
            int count = (h + a - 1)/a;
            ans += count;
            damage += count*a;
            q.push(pair<int, int>(x+2*d, count*a));
        }
    }
    cout << ans << endl;
}


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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define FILL(n,first_dimension_size,value) fill((int*)n,(int*)(n+first_dimension_size),value)
#define INF (1 << 29)
#define MOD 1000000007
//int dx[4] = {1,0,0,-1};
//int dy[4] = {0,1,-1,0};


int main(){
  
  int n,k;
  string s;
  cin >> n >> k >> s;
  vector<ll> zero,one;
  zero.push_back(0);
  one.push_back(0);
  int old = 0;
  s += '9';
  for(int i = 0;i < n;i++){
    if(s[i] != s[i+1]){
      if(s[i] == '0'){
        zero.push_back(i-old+1);
        old = i+1;
      }else{
        one.push_back(i-old+1);
        old = i+1;
      }
    }
  }
  REP(i,zero.size())if(i)zero[i] += zero[i-1];
  REP(i,one.size())if(i)one[i] += one[i-1];
  ll res = 0;
  if(s[0] == '0'){
    for(int i = 0;i < zero.size();i++){
      res = max(res,zero[min(i+k,(int)zero.size()-1)]-zero[i]+one[min(i+k,(int)one.size()-1)]-one[max(0,i-1)]);
    }
  }else{
    for(int i = 0;i < zero.size();i++){
      res = max(res,zero[min(i+k,(int)zero.size()-1)]-zero[i]+one[min(i+k+1,(int)one.size()-1)]-one[min(i,(int)one.size())]);
    }
  }
  cout << res << endl;



  return 0;
}


Measured memory_bytes: 1404
#include <bits/stdc++.h>
#define pb push_back
#define pll pair <ll, ll>
#define mp make_pair
#define pyshnapyshnakaa ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define x first
#define y second
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define plll pair <pair <ll, ll>, ll>
#define pllll pair <pair <ll, ll>, pair <ll, ll> >
#define psl pair <string, ll>
#define all(a) a.begin(), a.end()
#include <cmath>
#include <iostream>
#include <unordered_map>

typedef long long ll;

typedef long double ld;

using namespace std;

const ll maxn = 1e3;

ll n, m, k;

bool A[maxn][maxn];

ll D[maxn][maxn];

int main() {
    ll q, w, e, a, b, c, d;
    cin >> n >> m;
    for (q = 0; q < n; q++) {
        string s;
        cin >> s;
        for (w = 0; w < s.length(); w++) {
            if (s[w] == '.') {
                A[q][w] = 0;
            }
            else {
                A[q][w] = 1;
            }
        }
    }
    ll ans = 0;
    if (A[0][0] == 1 || A[n - 1][m - 1] == 1) {
        ans++;
        ans++;
    }
    for (q = 0; q < n; q++) {
        for (w = 0; w < m; w++) {
            if (q == 0 && w == 0) {
                continue;
            }
            if (q == 0) {
                D[q][w] = D[q][w - 1] + (A[q][w - 1] != A[q][w]);
                continue;
            }
            if (w == 0) {
                D[q][w] = D[q - 1][w] + (A[q - 1][w] != A[q][w]);
                continue;
            }
            D[q][w] = min(D[q - 1][w] + (A[q - 1][w] != A[q][w]), 
                D[q][w - 1] + (A[q][w - 1] != A[q][w]));
        }
    }
    cout << (ans + D[n - 1][m - 1]) / 2;
    return 0;
}


Measured memory_bytes: 2816
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		long n = stdIn.nextLong();
		long t;
		long ans = stdIn.nextLong();
		for(long i=1; i<n; i++){
			t = stdIn.nextLong();
			ans = lcd(ans,t);
		}

		System.out.println(ans);

		stdIn.close();
	}

	static long lcd(long a,long b){
		long p = a;
		long q = b;
		long r = a % b;
		while(r != 0){
			p = q;
			q = r;
			r = p % q;
		}
		return a / q * b;
	}
}

Measured memory_bytes: 21716
// abc051_b
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int K, S;
    cin >> K >> S;
    int ans = 0;
    REP(x, K+1) REP(y, K+1){
        if (0 <= S - x - y && S - x - y <= K) ans++;
    }
    print(ans);


    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#define N 100

int main()
{
  
  int A[N], i, n, num, count = 0, flag = 1;

  scanf("%d", &n);
  for(i = 0; i < n; i ++) scanf("%d", &A[i]);

  while(flag){
    flag = 0;
    for(i = n-1; i > 0; i--){
      if(A[i] < A[i-1]){
	num = A[i-1];
	A[i-1] = A[i];
	A[i] = num;
	flag = 1;
	count += 1;
      }
    }
  }

  for(i = 0; i < n; i++){
    if(i == n-1) printf("%d", A[i]);
    else printf("%d ", A[i]);
  }
  printf("\n%d\n", count);

  return 0;
}

Measured memory_bytes: 600
#pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << " ";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define dl double
#define wh while
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tp tuple
#define ft first
#define sc second
#define ve vector
#define tos to_string
#define len length
#define rt return 0
#define gcd __gcd
#define lcm(n, m) n * m / gcd(n, m)
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define ea(i, n) for(auto&& i: n)
#define so(n) sort(n.begin(), n.end())
#define sp(n) cout << fixed << setprecision(n)
#pragma endregion
// sqrt ルート, int 2*10^9, __gcd

int main() {
  int N;
  dl a = 0;
  ci(N);
  ve<dl> x(N), y(N);
  rep(i, N){
  	ci(x.at(i), y.at(i));
  }
  rep(i, N){
  	rep(j, N){
      a += sqrt(pow(x.at(i) - x.at(j), 2) + pow(y.at(i) - y.at(j), 2)) / 2;
    }
  }
  sp(10);
  co(a / N * 2);
}

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

//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (a); i > (n); --i)
#define arep(i, x) for (auto &&i : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define rirep(i, x) for (auto i = (x).rbegin(); i != (x).rend(); ++i)
//降順はgreater<T>()
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
// gcd lcmはそのままok
#define gcd(a, b) __gcd(a, b)
#define bits(n) (1LL << (n))
#define pcnt(x) __builtin_popcountll(x)
//配列内等要素削除
#define unique(x) (x).erase(unique((x).begin(), (x).end()), (x).end())
#define Fixed(n) fixed << setprecision(n)
//総和
#define sowa(n) (((n) * ((n) + 1)) / 2)
#define pb(x, a) (x).push_back(a)
#define fb(x, a) (x).push_front(a)
#define eb(x, a) (x).emplace_back(a)
#define cauto const auto &
using P = pair<int, int>;
using Graph = vector<vector<P>>;
template <class T>  //昇順
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T>  //降順
using max_heap = priority_queue<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class A>
using uset = unordered_set<A>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {  //多次元初期化
  std::fill((T *)array, (T *)(array + N), val);
}
template <class A, class B>
bool chmax(A &a, const B &b) {  //最大値更新 返り値はbool
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class A, class B>
bool chmin(A &a, const B &b) {  //最小値更新 返り値はbool
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9 + 7;
constexpr int mod2 = 998244353;
//} END

signed main(void) {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  int n, k;
  cin >> n >> k;
  vector<int> x(n);
  arep(i, x) cin >> i;

  rep(i, k, n) {
    if (x[i - k] < x[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  }

  return 0;
}

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

const int maxn = 220000;

int a[maxn], b[maxn], c[maxn];

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for(int i = 0; i < n; ++ i) cin >> a[i];
	for(int j = 0; j < n; ++ j) cin >> b[j];
	int ans = 0;
	for(int i = 28; i >= 0; -- i) {
		for(int j = 0; j < n; ++ j) c[j] = b[j] & ((1 << i + 1) - 1);
		sort(c, c + n);
		int cnt = 0;
		for(int j = 0; j < n; ++ j) {
			a[j] &= (1 << i + 1) - 1;
			cnt += (upper_bound(c, c + n, (1 << i + 1) - 1 - a[j]) - lower_bound(c, c + n, (1 << i) - a[j]));
			cnt += (upper_bound(c, c + n, (1 << i + 2) - 1 - a[j]) - lower_bound(c, c + n, (3 << i) - a[j]));
			cnt &= 1;
		}
		if(cnt & 1) ans |= 1 << i;
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 2560
n,m = gets.chop.split.map(&:to_i)

a = m.times.map{gets.split.map(&:to_i)}



t = [0]*n
t[0]=1 if n!=1
b=[]

a.each do |fed1, fed2|
  if b[fed1] && b[fed1] != fed2 || fed2==0&&fed1==1&&n!=1
    puts "-1"
    exit
  end
  b[fed1]=fed2
  t[fed1-1] = fed2
end

puts t.map{|x|x.to_s}*""


Measured memory_bytes: 1788
program get_everything
  implicit none
  integer, parameter :: inf = 1e9
  integer :: n, m, a, b, c(12) = 0, dp(0:2**12) = inf, k, i, j, u
  read(*,*) n, m
  u = 2**n-1
  do i = 1, m
    k = 0
    read(*,*) a, b
    read(*,*) c(1:b)
    do j = 1, b
      k = ibset(k,c(j)-1)
    end do
    dp(k) = min(dp(k),a)
  end do
  do i = 1, u
    do j = 1, i
      dp(or(i,j)) = min(dp(or(i,j)),dp(i)+dp(j))
    end do
  end do
  if (dp(u) == inf) then
    write(*,'(i0)') -1
  else
    write(*,'(i0)') dp(u)
  end if
end program get_everything

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main() {
	int N;
    cin >> N;
    vector<int> X(N);
    for(int i=0; i<N; i++) {
        cin >> X[i];
    }
    int min_P;
    long min_P_stamina = numeric_limits<long>::max();
    for(int p=1; p<=100; p++) {
        long val_p = 0;
        for(int i=0; i<N; i++) {
            val_p += pow(p-X[i], 2);
        }
        if(val_p < min_P_stamina) {
            min_P = p;
            min_P_stamina = val_p;
        }
    }
    cout << min_P_stamina << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define inf 1e9
#define ll long long 
#define M 1000000007
#define P pair<int,int>
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define rep(i,n) FOR(i,0,n)
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265

int a=-1,b=-1,c=-1,d=-1;
string s;

int main(){
  cin>>s;
  rep(i,s.size()){
    if(s[i]=='S') a=1;
    if(s[i]=='E') b=1;
    if(s[i]=='N') c=1;
    if(s[i]=='W') d=1;
  }

  if(a*c>0&&b*d>0)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;

  return 0;
}


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

int main(){
  int i,a,b,c,array[101],d=0,e=0;
  cin>>a>>b>>c;
  for(i=0;i<b;i++){
    cin>>array[i];
  }
  for(i=0;i<b;i++){
    d+=(array[i]>=c);
    e+=(array[b-1-i]<=c);
  }
  if(d>e){
    cout<<e;
  }else{
    cout<<d;
  }
  cout<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
    int n, x, i, r, z, num, tmp = 0;
    for(;scanf("%d%d", &n, &x); tmp = 0){
        if( n == 0 && x == 0 ){
            break;
        }
        for( i = 1; i <= n; i++ ){
            for( r = i+1 ; r <= n; r++ ){
                for( z = r+1; z <= n; z++ ){
                    num = i + r + z;
                    if( num == x ){
                        tmp += 1;
                    }
                }
            }
        }
        printf("%d\n",tmp);
    }
    return 0;
}

Measured memory_bytes: 600
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string.h>

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

#define MAX (101)
#define MOD (1000000007)

using namespace std;

typedef long long ll;

int n;
/* 0, 1, 2, 3番前の値のセットのメモ化テーブルを作る */
ll dp[MAX][4][4][4];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> n;
    ll result = 0;
    
    dp[0][3][3][3] = 1;
    
    /* a:0 c:1 g:2 t:3 */
    REP(i, n) {
        REP(j, 4) {
            REP(k, 4) {
                REP(l, 4) {
                    /* 意味ないからcontinue */
                    if (dp[i][j][k][l] == 0) {
                        continue;
                    }
                    REP(m, 4) {
                        /* AGC */
                        if (m == 1 && j == 2 && k == 0) {
                            continue;
                        }
                        /* GAC */
                        if (m == 1 && j == 0 && k == 2) {
                            continue;
                        }
                        /* ACG */
                        if (m == 2 && j == 1 && k == 0) {
                            continue;
                        }
                        /* A#GC */
                        if (m == 1 && j == 2 && l == 0) {
                            continue;
                        }
                        /* AG#C */
                        if (m == 1 && k == 2 && l == 0) {
                            continue;
                        }
                        dp[i + 1][m][j][k] += dp[i][j][k][l];
                        dp[i + 1][m][j][k] %= MOD;
                    }
                }
            }
        }
    }

    REP(i, 4) {
        REP(j, 4) {
            REP(k, 4) {
                result += dp[n][i][j][k];
                result %= MOD;
            }
        }
    }
    
    cout << result << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt();
      String a = scan.next();
      String b = scan.next();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++){
      if(!a.isEmpty()){
          sb.append(a.charAt(i));
      }
      if(!b.isEmpty()){
          sb.append(b.charAt(i));
      }
    }
    System.out.println(sb.toString());
  }
}

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

typedef int64_t Int;
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << endl; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << std::endl;
}

int main() {
    Int n;
    cin >> n;
    string s;
    cin >> s;
    Int wr = 0;
    Int rw = 0;
    for (Int i = 0; i < n; i++) {
        if (s[i] == 'R') {
            rw++;
        }
    }
    Int res = rw;
    for (Int i = 0; i < n; i++) {
        if (s[i] == 'R') {
            rw--;
        }
        if (s[i] == 'W') {
            wr++;
        }
        res = min(res, min(rw, wr) + abs(rw - wr));
    }
    print(res);
    return 0;
}


Measured memory_bytes: 3756
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
	char s[201], t[201], p[101];

	cin >> s >> p;
	strcpy(t,s);
	strcat(s,t);
	if ( strstr(s ,p) == NULL )
		{ 
			cout << "No" << '\n';
	    }
	else 
	{ 
		cout << "Yes" << '\n';
	}

	return 0;
}


Measured memory_bytes: 3108
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include <climits>
#include<fstream>
using namespace std;
//---------------------------------------------------
//library zone!!!!!
typedef long long ll;
typedef long double ld;
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld mod_pow(ld x, ll n, ll p) {
	ld res = 1;
	while (n > 0) {
		if (n & 1) res = res * x;
		x = x * x;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
signed main() {
	int n, ma = -Inf, mi = Inf;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int t;
		cin >> t;
		ma = max(ma, t);
		mi = min(mi, t);
	}
	cout << ma - mi << endl;
}

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

#define REP(i,num) for(ll i=0;i<(num);++i)
#define FOR(i,c,num) for(ll (i)=(c);(i)<(num);++(i))
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){T x; cin >> x; return (x);}
template<typename T=ll,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return x;}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	auto N=in();
	auto P=vecin<double>(N);
	vector<vector<double>> dp(N+1,vector<double>(N+1,0));
	dp[0][0]=1;
	REP(i,N){
		REP(j,N){
			dp[i+1][j] += dp[i][j]*(1.0-P[i]);
			dp[i+1][j+1] += dp[i][j]*(P[i]);
		}
	}
	auto H=(N-N/2ll);
	double S=0;
	for(int i=H;i<=N;i++){
		S+=dp[N][i];
	}
	out(S);
	return 0;
}


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

int main(void) {
	int N;
	cin >> N;
	map<string, bool> S;
	int num = 0;
	for (int i = 0; i < N; i++) {
		string str;
		cin >> str;
		if (S[str] == false)
			num++;
		S[str] = true;
	}
	cout << num << endl;
	return 0;
}

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

int group(int x){
  if(x == 2) return 0;
  if(x == 4 || x == 6 || x == 9 || x == 11) return 1;
  return 3;
}

int main(){
  int x,y;
  scanf("%d%d",&x,&y);
  printf("%s\n",group(x) == group(y) ? "Yes" : "No");
}


Measured memory_bytes: 256
h,w=map(int,input().split())
s=[['.'*(w+2)]]+[list('.'+input()+'.') for i in range(h)]+[['.'*(w+2)]]
for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j]=='.':
            s[i][j]=str(s[i-1][j-1:j+2].count('#')+s[i][j-1:j+2].count('#')+s[i+1][j-1:j+2].count('#'))
    print(''.join(s[i][1:w+1]))

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n,a,b,ans=0;
	cin>>a>>b;
	for(int i=1;i<=10000;i++){
		if(i*8/100==a && i/10==b){
			cout<<i<<endl;
			return(0);
		}
		//cout<<i/100*8<<endl;
	}
	cout<<"-1"<<endl;
  return(0);
}

Measured memory_bytes: 256
/*
Looking from a window above
It's like a story of love
Can you hear me?
Came back only yesterday
I'm moving further away
Want you near me
All I needed was the love you gave
All I needed for another day
And all I ever knew
Only you
Sometimes when I think of her name
When it's only a game
And I need you
Listen to the words that you say
It's getting harder to stay
When I see you
All I needed was the love you gave
All I needed for another day
And all I ever knew
Only you, only you
Uh uh uh only you, only you
Only you, only you, only you
This is going to take a long time
And I wonder what's mine
Can't take no more
Wonder if you'll understand
It's just the touch of your hand
Behind a closed door
And all I needed was the love you gave
All I needed for another day
And all I ever knew
Only you, only you, only you
All I needed was the love you gave
All I needed for another day
And all I ever knew
Only you, only you, only you
Only you
*/

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define ld long double
#define endl '\n'
#define rep(x,s,e) for(int x=s;x<=(e);x++)
#define repn for(int x=0;x<n;x++)
#define rep1n for(int x=1;x<=n;x++)
#define rep1m for(int y=1;y<=m;y++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define precise(x) cout << fixed << setprecision(x)
#define bits(x) __builtin_popcountll(x)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(x) ((int)(x.size()))
#define test int t; cin>>t; while(t--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)

typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef pair<int,int> pii;


void __print(int 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 see(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define see(x...)
#endif

const int inf = 3e18;
const int N = 5e5 + 100;




int32_t main(){ 
   FAST;
   int a, b;
   cin >> a >> b;
   if(a > b) swap(a,b);
   while(b--)  cout << a ;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
// From @th90tk297
#define int long long
int n, a[300000], b[300000], total;

signed main(){
    scanf("%d", &n);

    for(int e = 0; e < n; e++){
        scanf("%d", &a[e]);
        total += b[a[e]]++;
    }

    for(int i = 0; i < n; i++)
        printf("%lld\n", 1+ total - b[a[i]]);
  return 0;
}


Measured memory_bytes: 5248
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		for(int i=1; i<n; i++){
			for(int j=i+1; j<=n; j++){
				for(int k=0; k<10; k++){
					if((i>>k & 1)!=(j>>k & 1)){
						System.out.println(k+1);
						break;
					}
				}
			}
		}
	}
}


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


int main() {
    int N, i = 0;
    string str;
    cin >> str;
    N = str.length();
    string str1 = string(N, '1');
    string str0 = string(N, '0');
    while( (str0.substr(i,N-2*i) != str.substr(i, N-2*i)) && (str1.substr(i, N-2*i) != str.substr(i, N-2*i))){
        i += 1;
        if( i > N/2)
        {
            break;
        }
    }
    

    cout << N-i << endl;



    return 0;
}


Measured memory_bytes: 1024
x=int(input())
tempX=x
num=[]
ans=0
for i in range(x):
  if i!=0:
    if i !=1:
      num.append(i)
if x==2:
  ans=2
while ans==0:
  for i in num:
    if tempX%i == 0:
      tempX=tempX+1

      break
    if i==num[-1]:
      ans = tempX
print(ans)

Measured memory_bytes: 7064
s = input()
t = input()

def char_list(s):
    l = [0] * 26
    for x in s:
        i = ord(x) - ord("a")
        l[i] += 1
    l.sort()
    return l

l1 = char_list(s)
l2 = char_list(t)

if l1 == l2:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9228
//自称高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
    int ans = 0;
	int n , h, high = -1;
	cin >> n;
	REP(i,n){
		cin >>h;
		if(h >= high){
			ans ++;
			high = h;
		}
	}
    cout << ans << endl;
}

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li a[100100];

int main() {
    string s;
    cin >> s;
    li n = sz(s);
    if (n % 2 > 0) {
        if (s[0] == s[n - 1]) {
            puts("Second");
        } else {
            puts("First");
        }
        return 0;
    } else {
        if (s[0] == s[n - 1]) {
            puts("First");
        } else {
            puts("Second");
        }
        return 0;
    }

    return 0;
}

Measured memory_bytes: 512
//#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector") 
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>


#define ll long long
//#define int ll
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define ret(a) {cout << a; exit(0);}

using namespace std;

mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

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

const int N = 600 + 1;

int a , b;

main(){
	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
	cin >> a >> b;
	cout << max<int>(0 , a - 2 * b);
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int n,i,j,cnt=0;
	scanf("%d",&n);
	for(i=0;i<=n/7;i++){
			for(j=0;j<=n/4;j++){if(n==7*i+4*j){cnt=1;}}
	}
	printf(cnt?"Yes":"No");
	return 0;
}

Measured memory_bytes: 128
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define String std::string
#define fi first
#define se second
#define mp std::make_pair
#define Pair std::pair<int, int>
#define Map std::map< int, int >
#define Vector std::vector<int>
 
using std::cin;
using std::cout;
using std::endl;
 
typedef long long ll;
typedef unsigned long long ull;
 
const int N = 100000 + 5;
const int M = 1000 + 5;
const int K = 1e7 + 5;
// const int MOD = 1e9 + 7;
const int MOD = 10007;
const int inv2 = 500000004;
const int LOG = 40;
const ull BASE = 19260817;
const int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };
const int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };
const double PI = acos(-1);

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
 
template<class T>
inline T readT() {
    T res = 0, f = 1;
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) res = (res << 1) + (res << 3) + ch - '0';
    return res * f;
}
#define read readT<int>

bool inp[N * 2];
int prs[N * 2], end;
inline void sieve() {
    inp[1] = true;
    for (int i = 2; i <= 200000; i++) {
        if (!inp[i]) prs[++end] = i;
        for (int j = 1; j <= end && prs[j] * i <= 200000; j++) {
            inp[prs[j] * i] = true;
            if (i % prs[j] == 0) break;
        }
    }
}

int main() {
    int n;
    sieve();
    cin >> n;
    int *pos = std::lower_bound(prs + 1, prs + end + 1, n);
    printf("%d\n", *pos);
    return 0;
}

Measured memory_bytes: 512
#include "stdio.h"

int main(void){
  int x,y,z,i,j;
  scanf("%d %d", &x, &y);
  int a[x+1][y+1];
  for(i = 0; i <= x;i++){
    for(j = 0; j<=y;j++){
      a[i][j] = 0;
    }
  }
  for(i = 0; i < x; i++){
    for(j = 0; j < y; j++){
      scanf("%d ", &a[i][j]);
    }
  }
  for(i = 0; i < x; i++){
    for(j = 0; j < y; j++){
      a[i][y] += a[i][j];
    }
  }
  for(i = 0; i < y; i++){
    for(j = 0; j < x; j++){
      a[x][i] += a[j][i];
    }
  }
  for(i = 0; i < y; i++){
    a[x][y] += a[x][i];
  }
  for(i = 0; i <= x; i++) {
    for (j = 0; j <= y; j++){
      if(j != y){
        printf("%d ", a[i][j]);
      }else{
        printf("%d", a[i][j]);
      }
    }
    printf("\n");
  }
}



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

int main() {
  int n;
  cin >> n;
  vector<int> a(n+1);
  for(int i=1;i<n+1;i++){
    cin >> a.at(i);
  }
  
  vector<int> b(n+1,0);
  for(int i=n;i>0;i--){
    int sum=0;
    for(int j=i*2;j<n+1;j+=i){
      sum ^= b.at(j);
    }
    b.at(i) = a.at(i)^sum;
  }
  
  vector<int> ans;
  
  for(int i=1;i<n+1;i++){
    if(b.at(i) == 1){
      ans.push_back(i);
    }
  }
  
  cout << ans.size() << endl;
  for(int i=0;i<ans.size();i++){
    cout << ans.at(i) << " ";
  }
  cout << endl;
  
  return(0);
}

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

using namespace std;
int main(){
    int k=0;
    string s;
    cin>>s;
    string t;
    cin>>t;
    for(int i=0;i<3;i++){
        if(s[i]==t[i]) k++;
    }
    cout<<k<<endl;
return 0;
}




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

using namespace std;

int f(int n) {
    return n * (n + 1) / 2;
}

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

    set<int> st;
    int mx = 1;
    while (f(mx) < N) {
        st.emplace(mx);
        mx++;
    }
    st.emplace(mx);

    st.erase(f(mx) - N);
    for (auto x:st) cout << x << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
using namespace std;
bool b[14][14];
int r[]={-1,0,0,1}, l[]={0,1,-1,0};

int func(int a[14][14], int x, int y){
	if(a[x][y] == 0 || a[x][y] == -1 || b[x][y])return 0;
	b[x][y] = true;
	for(int i = 0;i < 4;i++)func(a, x+r[i], y+l[i]);
	return 0;
}

int main(){
	int a[14][14];
	string s;
	while(cin >> s){
		if(s == "")cin >>s;
		fill((int*)a, (int*)(a+14), -1);
		fill((int*)b, (int*)(b+14), 0);
		int ans = 0;
		for(int i = 1;i <= 12;i++){
			if(i != 1)cin >> s;
			for(int j = 1;j <= 12;j++)a[i][j] = s[j-1]-'0';
		}
		for(int i = 1;i <= 12;i++){
			for(int j = 1;j <= 12;j++){
				if(!b[i][j] && a[i][j]){func(a, i, j);ans++;}
			}
		}
		cout << ans << endl;
		/*for(int i = 0;i < 14;i++){
			for(int j = 0;j < 14;j++)cout << a[i][j] << " ";
			cout << endl;
		}*/
	}
	return 0;
}

Measured memory_bytes: 3012
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	cin>>a;
	for (long long i=-1000;i<=1000;i++)
		for (long long n=-1000;n<=1000;n++)
			if ((pow(i,5))-(pow(n,5))==a)
			{
				cout<<i<<" "<<n;
				return 0;
			}
	return 0;
}


Measured memory_bytes: 4096
#include<stdio.h>
int main(){
	long long x,c,a,b,n;
	scanf("%lld",&n);
	for(a=(n/4+1);a<=3500;a++){
		for(b=a*n/(4*a-n)+1;b<=3500;b++){
			x=a*b*n%(4*a*b-n*(a+b));
			c=a*b*n/(4*a*b-n*(a+b));
			if(x==0&&c>0){
				printf("%lld %lld %lld\n",a,b,c);
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 128
import sys
from io import StringIO
import unittest

def resolve():

    sh, sm, gh, gm , k = map(int,input().split())

    team = (gh*60 + gm) - (sh*60 + sm)

    print(team - k)



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

    def test_入力例_1(self):
        input = """10 0 15 0 30"""
        output = """270"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """10 0 12 0 120"""
        output = """0"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Measured memory_bytes: 71044
#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define acc(v) accumulate(v.begin(), v.end(), 0)

using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;

int main()
{
	string s, t, u;
	cin >> s >> t;
	int a, b;
	cin >> a >> b;
	cin >> u;
	cout << (s == u ? a - 1 : a) << " " << (t == u ? b - 1 : b) << endl;
	return 0;
}


Measured memory_bytes: 256
import Data.Functor ((<$>))

main = do
    [a, b, c] <- map read . words <$> getLine
    let x = a :: Int
    let ord = case (a < b, b < c, c < a) of
          (True, True, _) -> [a, b, c]
          (True, False, True) -> [c, a, b]
          (True, False, False) -> [a, c, b]
          (False, True, True) -> [b, c, a]
          (False, True, False) -> [b, a, c]
          (False, False, _) -> [c, b, a]
    putStrLn $ unwords $ map show ord



Measured memory_bytes: 3624
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int a = 0;
		String C[] = new String[H];
		//int C[][] = new int[H][W];
		for(int i=0;i<H;i++){
			C[i] = sc.next();
		}
		/*for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					C[i][j] = sc.nextInt();
				}
			}*/
		for(int i=0;i<H;i++){
			System.out.println(C[i]);
			System.out.println(C[i]);
		}
	}
}

Measured memory_bytes: 23724
#include<bits/stdc++.h>
#include <iostream>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1<<29;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
int dp[100001];
int main() {

	int n;
	cin>>n;

	dp[0]=0;
	for(int i=1; i<n+1; i++){
		dp[i]=100001;
		dp[i]=min(dp[i],dp[i-1]+1);
		for(int k=6; k<i+1; k*=6){
			dp[i]=min(dp[i],dp[i-k]+1);
		}
		for(int l=9; l<i+1; l*=9){
			dp[i]=min(dp[i],dp[i-l]+1);
		}
	}
	cout<<dp[n]<<endl;
	return 0;
}


Measured memory_bytes: 640
import std.stdio, std.math, std.algorithm, std.array, std.string, std.conv, std.container, std.range;
pragma(inline, true) T[] Reads(T)() { return readln.split.to!(T[]); }
alias reads = Reads!int;
pragma(inline, true) void scan(Args...)(ref Args args) {
    string[] ss = readln.split;
    foreach (i, ref arg ; args) arg = ss[i].parse!int;
}


void main() {
    int n; scan(n);
    int[] b = reads();
    auto a = new int[n];
    a[0] = b[0];
    foreach (i; 1..n-1)
        a[i] = min(b[i-1], b[i]);
    a[n-1] = b[$-1];
    writeln(a.sum);
}


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

const double PI = atan(1) * 4;

struct Point{
	double x;
	double y;
};

void Print_Point(Point p)
{
	//ex: double n = 123.456000 
	//setprecision: 設定小數點精度 -> 123.456
	//fixed: 固定小數點精度 -> 123.45600000
	cout << fixed << setprecision(8) << p.x << " " << p.y << endl;
}

Point RotateC60(Point start, Point end)  //向量旋轉-60度 
{
	//orig: 原向量  next: 旋轉-60度的向量 
	double angle60 = PI / 3;
	Point orig = {end.x - start.x, end.y - start.y};  
	Point next = {orig.x * cos(angle60) - orig.y * sin(angle60),
				  orig.x * sin(angle60) + orig.y * cos(angle60)};
	Point u = {start.x + next.x, start.y + next.y};
	return u;
}

void Koch_Curve(Point p1, Point p2, int n)
{
	Point s = {(2*p1.x + p2.x) / 3, (2*p1.y + p2.y) / 3};
	Point t = {(2*p2.x + p1.x) / 3, (2*p2.y + p1.y) / 3};
	Point u = RotateC60(s, t);
	
	if (n > 1)
	{
		Koch_Curve(p1,  s, n-1);
		Koch_Curve( s,  u, n-1);
		Koch_Curve( u,  t, n-1);
		Koch_Curve( t, p2, n-1);
	}
	else
	{
		Print_Point(p1);
		Print_Point(s);
		Print_Point(u);
		Print_Point(t);
	}
}



int main ()
{
	int n;
	cin >> n;

	Point p1{0, 0}, p2{100, 0};
	
	if (n)
	{
		Koch_Curve(p1, p2, n);
		Print_Point(p2);
	}
	else
	{
		Print_Point(p1);
		Print_Point(p2);	
	}
	return 0;
 } 


Measured memory_bytes: 3500
#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long  int a,v,b,w,t;
    cin >> a >>v >>b >> w >> t;
    if(abs(a-b) <= (v-w)*t) cout << "YES" << endl;
    else cout << "NO" << endl;
}


Measured memory_bytes: 3636
N, K = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
numc = 0
numf = 0

for i in range(0, N):
    for j in range(0,i):
        if A[j] > A[i]:
            numc += 1
        if A[i] > A[j]:
            numf += 1
numbers = (numc*K*(K+1) + numf*K*(K-1))//2
 
ans = int(numbers % (10**9 + 7))
print(ans)

Measured memory_bytes: 3188
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <queue>
#include <map>
#include <tuple>
using namespace std;

int N, K;

int main() {
	cin >> N >> K;
	if (2 * K - 1 <= N) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256