akhauriyash/Code-Regression huggingface dataset:
/*
    問題をよく読もう！
    論理的に考えよう！
    サンプルを確認しよう!
    絶対に諦めるな！
    工夫をしろ！
    配列は少し多めにとっておく

    Twitterは終わるまでログアウト！
    （間違えて解法をツイートしてはいけないから）

*/
//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include<cstring>
//namespace
using namespace std;
//繰り返し
#define REP(i, m, n) for(int i=(int)m; i<(int)n; ++i)
#define rep(i, n) REP(i, 0, n)
//イテレータ
#define all_range(C) begin(C), end(C)
//簡略化
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
typedef pair<string,int> pst;

const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
//最大最小
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) {if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) {if(a<b) a=b;}

//関数

//最大公約数を求める
ll my_gcd(ll x, ll y) {
  ll r;

  while(y!=0) {
    r = x%y;
    x = y;
    y = r;
  }

  return x;
}

//最小公約数を求める
ll my_lcm(ll x, ll y) {

  return (x*y)/my_gcd(x,y);
}

//xのy乗を求める ※参考：10^18乗まで
ll my_pow(ll x, ll y) {
  ll sum = 1;

  while(y>0) {
    sum *= x;
  }

  return sum;
}

/*考えを書くスペース
xxxxxxxxxx  0000000000 最初のsearchで
xoooooooxx  0111111100
xxoooooxxx  0011111000
xxxoooxxxx  0001110000
xxxxoxxxxx  0000100000
xxxxxxxxxx  0000000000
xxxxoxxxxx  0000200000
xxxoooxxxx  0002220000
xxoooooxxx  0022222000
xxxxxxxxxx  0000000000
*/
//main.cpp----------------------------
#define max_n 100

void solve();

ll a, b;

int main() {
  cin >> a >> b;

  solve();

  return 0;
}

void solve() {

  if(a<0&&b<0) {
    if((abs(a-b)+1)%2==0) {
      cout << "Positive" << endl;
    }else {
      cout << "Negative" << endl;
    }
  }else if(a>0&&b>0) {
    cout << "Positive" << endl;
  }else {
    cout << "Zero" << endl;
  }
  
}

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        InputStreamScanner in = new InputStreamScanner(System.in);
        new Main().solve(in, out);
        out.flush();
    }

    private void solve(InputStreamScanner in, PrintWriter out) {
        int x = in.nextInt();
        int y = in.nextInt();

        out.println(x + y / 2);
    }

    static class InputStreamScanner {

        private InputStream in;

        private byte[] buf = new byte[1024];
        private int len = 0;
        private int off = 0;

        InputStreamScanner(InputStream in)	{
            this.in = in;
        }

        String next() {
            StringBuilder sb = new StringBuilder();
            for (int b = skip(); !isSpace(b);){
                sb.appendCodePoint(b);
                b = read();
            }
            return sb.toString();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        char nextChar() {
            return (char)skip();
        }

        int skip() {
            for (int b; (b = read()) != -1;) {
                if (!isSpace(b)) {
                    return b;
                }
            }
            return -1;
        }

        private boolean isSpace(int c) {
            return c < 33 || c > 126;
        }

        private int read() {
            if (len == -1) {
                throw new InputMismatchException("End of Input");
            }
            if (off >= len){
                off = 0;
                try {
                    len = in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException(e.getMessage());
                }
                if (len <= 0) {
                    return -1;
                }
            }
            return buf[off++];
        }
    }
}

Measured memory_bytes: 22356
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>

using namespace std;

int main()
{
    int s,t,v;
    
    scanf("%d%d%d",&s,&t,&v);
    
    if(s<=v*t)
        puts("Yes");
    else
        puts("No");

    return 0;
}

Measured memory_bytes: 3668
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
#include <numeric>
#include <random>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef vector<pair<int, int> > VPII;
typedef vector<string> VS;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<int, int> P;
typedef pair<int, pair<P, P> > PP;

#define INF 999999999999999997;
#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORL(i,a,b) for(LL i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
#define O(s) cout<<s<<endl;

#define DUMP_VVI(b) FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}

template<class T>T IN() { T d; cin >> d; return d; }

LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; } // 最大公約数（Greatest Common Divisor）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; } // 最小公倍数（Least Common Multiple）
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); } // うるう年判定

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int dxx[8] = { 0,1,1,1,0,-1,-1,-1 };
int dyy[8] = { 1,1,0,-1,-1,-1,0,1 };

// vector注意
// vec[i][j]の形に入力を入れるとき、vecは初期化してある必要がある.

// ------------------- include, typedef, define END. -------------------

int main() {
	FAST_IO;
	bool dbgF = true; // for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;

	LL N, M, K;
	cin >> N >> M >> K;
	string ans = "No";

	FOR(i, 0, N + 1) {
		FOR(j, 0, M + 1) {
			// i個の行とj個の列のボタンを押す
			LL nowK = i*(M - j) + j*(N - i);
			if (nowK == K) {
				ans = "Yes";
			}
		}
	}
	O(ans);
	return 0;
}


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

int main(){
    int n;
    cin>>n;
    map<string,long long> mp;
    string s;
    for(int i=0;i<n;i++){
        cin>>s;
        sort(s.begin(),s.end());
        mp[s]++;
    }
    long long res=0;
    for(auto i:mp){
        res+=(i.second*(i.second-1))/2;
    }
    cout<<res<<"\n";
    return 0;
}

Measured memory_bytes: 11136
#include<cstdio>
#include<iostream>
#include<vector>
#include<tuple>
#include<queue>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>

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

using namespace std;

int main(int argc, char* argv[]){
  long long int N, K;
  cin >> N >> K;
  vector<long long int> S;

  for(long long int i = 0; i < N; i++){
    S.push_back(0);
  }

  rep(i, K){
    long long int d;
    cin >> d;
    rep(j, d){
      long long int b;
      cin >> b;
      S[b - 1]++;
    }
    
  }

  long long int ans = 0;
  rep(i, N){
    if(S[i] == 0) ans++;
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3632
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>
#include <limits>

using namespace std;

template<class T = int,T divided_by = 10>
constexpr T PINF(){ return std::numeric_limits<T>::max()/divided_by; }
template<class T = int,T divided_by = 10>
constexpr T MINF(){ return std::numeric_limits<T>::lowest()/divided_by; }

template<class T = int> T gcd(T a, T b){ return b ? gcd(b,a%b) : a; }
template<class T = int> T lcm(T a, T b){ return a / gcd(a,b) * b; }
template<class T = int> T lcm_safe(T a, T b){ T p = a/gcd(a,b); return (b <= PINF<T>()/p) ? p*b:PINF<T>(); }
//オーバーフローするとき+INFを返す
//
//


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


    long long n;
    cin >> n;
    string str;
    cin >> str;
    const bool S = false, W = true;
    vector<vector<bool>> poss(4);
    const int WS = 0, SS = 1, SW = 2, WW = 3;

    poss[WS].push_back(W); poss[WS].push_back(S);
    poss[SS].push_back(S); poss[SS].push_back(S);
    poss[SW].push_back(S); poss[SW].push_back(W);
    poss[WW].push_back(W); poss[WW].push_back(W);

    for(int i = 0; i < str.size(); ++i){
         // cout << str[i] << endl;
        if(str[i] == 'o') {
            for(auto& item : poss){
            // cout << "#" << endl << endl;
                int last1 = item[item.size()-2], last2 = item[item.size()-1];
                if(last1 == W && last2 == S) { item.push_back(W); }
                if(last1 == S && last2 == S) { item.push_back(S); }
                if(last1 == S && last2 == W) { item.push_back(W); }
                if(last1 == W && last2 == W) { item.push_back(S); }
            }
        } else {
            for(auto& item : poss){
            // cout << "!" << endl << endl;
                int last1 = item[item.size()-2], last2 = item[item.size()-1];
                if(last1 == W && last2 == S) { item.push_back(S); }
                if(last1 == S && last2 == S) { item.push_back(W); }
                if(last1 == S && last2 == W) { item.push_back(S); }
                if(last1 == W && last2 == W) { item.push_back(W); }
            }
        }
    }

    // for(auto line: poss) {
    //     for(auto chara : line){
    //         if(chara == S) {
    //             cout << "S";
    //         }else {
    //             cout << "W";
    //         }
    //     }
    //     cout << endl;
    // }
    for(auto line: poss) {
        if(line[0] == line[line.size() - 2] && line[1] == line[line.size() - 1]){
            for(int i = 1; i < line.size() - 1; ++i){
                if(line[i] == S) {
                    cout << "S";
                }else {
                    cout << "W";
                }
            }
            cout << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 592
n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))
d.sort()
t.sort()
i,j=0,0
while i<m:
  if t[i]<d[j]:
    print("NO")
    exit()
  elif t[i]==d[j]:
    i+=1
    j+=1
  else:
    j+=1
  if j==n and i<m:
    print("NO")
    exit()
print("YES")


Measured memory_bytes: 35420
#include<iostream>
using namespace std;
string str[8],tmp;
char ch;
int main(){
  while(cin>>str[0]){
    for(int i=1;i<8;i++)cin>>str[i];
    getline(cin,tmp);
    //11
    //11
    for(int i=0;i<7;i++){
      for(int j=0;j<7;j++){
	if(str[i][j]=='1'&&str[i+1][j]=='1'&&str[i][j+1]=='1'&&str[i+1][j+1]=='1'){
	  ch='A';
	}
      }
    }

    //1
    //1
    //1
    //1
    for(int i=0;i<5;i++){
      for(int j=0;j<8;j++){
	if(str[i][j]=='1'&&str[i+1][j]=='1'&&str[i+2][j]=='1'&&str[i+3][j]=='1')ch='B';
      }
    }
    
    //1111
    for(int i=0;i<8;i++){
      for(int j=0;j<5;j++){
	if(str[i][j]=='1'&&str[i][j+1]=='1'&&str[i][j+2]=='1'&&str[i][j+3]=='1')ch='C';
      }
    }
    
    //01
    //11
    //10
    for(int i=0;i<6;i++){
      for(int j=0;j<7;j++){
	if(str[i][j+1]=='1'&&str[i+1][j]=='1'&&str[i+1][j+1]=='1'&&str[i+2][j]=='1')ch='D';
      }
    }
    
    //110
    //011
    for(int i=0;i<7;i++){
      for(int j=0;j<6;j++){
	if(str[i][j]=='1'&&str[i][j+1]=='1'&&str[i+1][j+1]=='1'&&str[i+1][j+2]=='1')ch='E';
      }
    }
    
    //011
    //110
    for(int i=0;i<7;i++){
      for(int j=0;j<6;j++){
	if(str[i][j+1]=='1'&&str[i][j+2]=='1'&&str[i+1][j]=='1'&&str[i+1][j+1]=='1')ch='G';
      }
    }

    //10
    //11
    //01
    for(int i=0;i<6;i++){
      for(int j=0;j<7;j++){
	if(str[i][j]=='1'&&str[i+1][j]=='1'&&str[i+1][j+1]=='1'&&str[i+2][j+1]=='1')ch='F';
      }
    }

    cout<<ch<<endl;
  }
  return 0;
}

Measured memory_bytes: 1180
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pp long long int
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define zip(i,a,b) for(int i=a;i<b;i++)
#define ll unsigned long long int
#define test long int t;cin>>t; while(t--)
#define um unordered_map
#define en '\n'
#define us unordered_set
#define mm 1000000007

bool check_prime(long long n)
{
	int flag = 0;
	for (long long i = 2; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			flag = 1;
			break;
		}
	}
	if (n == 1)
		return false;
	else if (flag == 0 || n == 2 || n == 3)
	{
		return true;
	}
	else
	{
		return false;
	}

}

int binaryExponentiation(int x, int n) //function to calculate x raise to power n
{
	int result = 1;
	while (n > 0)
	{
		if (n % 2 == 1)
			result = result * x;
		x = x * x;
		n = n / 2;
	}
	return result;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	if (fopen("input.txt", "r"))
	{
		freopen ("input.txt" , "r" , stdin);
		freopen ("output.txt" , "w" , stdout);
	}
#endif
	//_______________________________-code starts-______________________________________________________________________________


	int n, k;
	cin >> n >> k;
	int a[n];
	rep(i, 1, n)
	{
		a[i] = 0;
	}
	while (k--)
	{
		int m;
		cin >> m;
		while (m--)
		{
			int x;
			cin >> x;
			a[x]++;
		}
	}
	int cnt = 0;
	rep(i, 1, n)
	{
		if (a[i] == 0)
		{
			cnt++;
		}
	}
	cout << cnt << en;

	return 0;
}

Measured memory_bytes: 3652
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = [list(map(int,input().split())) for _ in range(N)]
    MOD = 10**9+7
    
    dp = [[0]*((1<<N)+1) for _ in range(N+1)]
    dp[0][0] = 1

    for i in range(N):
        for s in range(1<<N):
            if dp[i][s] == 0:
                continue
            for j in range(N):
                jb = 1<<j
                if not (s&jb) and a[i][j]:
                    dp[i+1][s|jb] += dp[i][s]
    
    print(dp[-1][(1<<N)-1]%MOD)

if __name__ == "__main__":
    main()


Measured memory_bytes: 422152
N, K = map(int,input().split())
p = list(map(int,input().split()))
# print(p)
a = [0]
for pi in p:
	a.append(a[-1] + (1 + pi) / 2)
# print(a)
l = [a[i + K] - a[i] for i in range(N - K + 1)]
ans = max(l)
print(ans)

Measured memory_bytes: 25060
#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-04-26 11:34:25
 **/

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int flag = 0;
  for (auto e : vec) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int flag = 0;
  for (auto e : st) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int flag = 0;
  for (auto e : mp) os << (flag++ ? ", " : "{") << e;
  return os << '}';
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

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

  int64 n, m, d; cin >> n >> m >> d;

  if (d == 0) {
    cout << setprecision(17) << (double)(m - 1) / (double)(n) << endl;
  } else {
    cout << setprecision(17) << 2.0 * (double)(n - d) / (double)(n * n) * (double)(m - 1) << endl;
  }

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()

int main(){
  ll n;
  cin >> n;
  ll number1 = n % 10;
  ll number100 = n / 100;
  ll number10 = n / 10 % 10;
  if(number1==7||number10==7||number100==7){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

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

int main(){
	string s;
	while(cin >> s){
		int ans = 0, n = s.size() - 1;
		for(int i = 0; i < s.size() / 2; i++)
			if(s[i] != s[n-i]) ans++;
		cout << ans << endl;
	}
	return 0;
} 

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

const int MOD = 1000000007;

int modpow(long long b, int e)
{
    int a = 1;
    
    while (e)
    {
        if (e & 1)
            a = (a * b) % MOD;
        b = (b * b) % MOD;
        e >>= 1;
    }
    
    return a;
}

const int maxn = 300000;
long long fac[maxn];
long long inv[maxn];
long long fac_inv[maxn];

void init()
{
    fac[0] = 1;
    inv[0] = 1;
    fac_inv[0] = 1;
    
    for (int i = 1; i != maxn; ++i)
    {
        fac[i] = (fac[i - 1] * i) % MOD;
        inv[i] = modpow(i, MOD - 2);
        fac_inv[i] = (fac_inv[i - 1] * inv[i]) % MOD;
    }
}

int n, a, b, c;

void take_input()
{
    cin >> n >> a >> b >> c;
}

void solve()
{
    long long num = 0;
    
    long long sum = 0;
    long long term = 1;
    long long mult = (b * inv[a + b]) % MOD;
    for (int j = 0; j != n; ++j)
    {
        long long cnt = (fac[n + j - 1] * ((fac_inv[n - 1] * fac_inv[j]) % MOD)) % MOD;
        sum += ((cnt * term) % MOD) * (n + j);
        term = (term * mult) % MOD;
        sum %= MOD;
    }
    sum *= modpow((a * inv[a + b]) % MOD, n);
    num += sum % MOD;
    
    sum = 0;
    term = 1;
    mult = (a * inv[a + b]) % MOD;
    for (int j = 0; j != n; ++j)
    {
        long long cnt = (fac[n + j - 1] * ((fac_inv[n - 1] * fac_inv[j]) % MOD)) % MOD;
        sum += ((cnt * term) % MOD) * (n + j);
        term = (term * mult) % MOD;
        sum %= MOD;
    }
    sum *= modpow((b * inv[a + b]) % MOD, n);
    num += sum % MOD;
    
    num = (((num * 100) % MOD) * inv[a + b]) % MOD;
    cout << num << '\n';
}

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

Measured memory_bytes: 7296
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;

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

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

fn main() {
    input! {
        n: usize,
        k: usize,
        mut a: [usize; n],
        mut f: [usize; n],
    }
    if a.iter().sum::<usize>() <= k {
        return println!("0")
    }
    a.sort();
    f.sort_by(|x, y| y.cmp(x));
    
    let mut l = 0;
    let mut r = 10usize.pow(12u32) + 1;
    while l + 1 < r {
        let m = (l + r) / 2;
        let mut k_cnt = 0;
        for i in 0..n {
            if a[i] * f[i] > m {
                k_cnt += a[i] - m / f[i];
            }
        }
        if k_cnt <= k {
            r = m;
        } else {
            l = m;
        }
    }
    println!("{}", r);
}


Measured memory_bytes: 10492
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    int t,a;
    scanf("%d %d %d",&n,&t,&a);
    int h[n+5];
    for(int i=0;i<n;i++) scanf("%d",&h[i]);
    double mini=1000000;
    int ans=0;
    for(int i=0;i<n;i++){
        double temp=(double)t-0.006*h[i];
        temp=temp-(double)a;
        temp=abs(temp);
        if(temp<mini){
            ans=i+1;
            mini=temp;
        }
    }
    printf("%d\n",ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
//#define int long long

struct IoSetup {
    IoSetup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout <<fixed<<setprecision(12);
        cerr <<fixed<<setprecision(12);
    }
}IoSetup;

typedef long long ll;
typedef pair < int , int >  pii;
static constexpr const signed int INF = 0x3f3f3f3f;
static constexpr const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static constexpr const signed int SMOD = 1000000007;
static constexpr const signed int NMOD = 998244353;
static constexpr const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static constexpr const signed int dy[]={0,-1,0,1,-1,1,-1,1};

inline bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>bool chmax(T &a, const T &b){return(a<b?a=b,true:false);}
template<class T>bool chmin(T &a, const T &b){return(a>b?a=b,true:false);}
inline int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

struct UnionFind {
    vector<int> u;
    explicit UnionFind(int n): u(n+5, -1) {}
    int  size(int x)        { return (-u[root(x)]); }
    int  root(int x)        { return (u[x] < 0)? x : u[x] = root(u[x]); }
    bool same(int x,int y) { return root(x) == root(y); }
    bool unite(int x,int y){return (x=root(x))==(y=root(y))?false:(u[x]+=u[y],u[y]=x,true) ;}
};


signed main() {

    int n, m;
    cin >> n >> m;
    vector<int> p(n+1), v(n+1);
    for(int i = 1; i <= n; i++) {
        cin >> p[i];
        v[p[i]] = i;
    }
    UnionFind uf(n);

    int x, y;
    for(int i = 0; i < m; i++) {
        cin >> x >> y;
        uf.unite(x, y);
    }

    int sum = 0;

    for(int i = 1; i <= n; i++) {
        sum += uf.same(i, v[i]);
    }

    cout << sum << endl;
  
    return 0;
}



Measured memory_bytes: 1408
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int n;R(n);
    int p[22];
    FOR(i,1,n)R(p[i]);
    int an=0;
    FOR(i,2,n-1){
        if(p[i]>p[i-1]&&p[i]<p[i+1])an++;
        if(p[i]>p[i+1]&&p[i]<p[i-1])an++;
    }
    W(an);
    return 0;
}


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

int x[100010],y[100010];

signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n,a,b,c,d,ans,i,ouo;
	cin>>n;
	a=b=c=d=0;
	for(i=0;i<n;i++)
	{
		cin>>ouo;
		if(i&1)
		{
			y[ouo]++;
		}
		else
		{
			x[ouo]++;
		}
	}
	for(i=1;i<=100000;i++)
	{
		if(y[i]>y[d])
		{
			d=i;
		}
		if(y[d]>y[c])
		{
			swap(c,d);
		}
		if(x[i]>x[b])
		{
			b=i;
		}
		if(x[b]>x[a])
		{
			swap(a,b);
		}
	}
	if(a!=c)
	{
		ans=n-x[a]-y[c];
	}
	else
	{
		ans=min(n-x[a]-y[d], n-x[b]-y[c]);
	}
	cout<<ans<<'\n';
	
	return 0;
}

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

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define forn(i, n) for(int i = 0; i < int(n); i++) 
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out << "(" << a.x << ", " << a.y << ")";
}

template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
	out << "[";
	forn(i, sz(v)) {
		if(i) out << ", ";
		out << v[i];
	}
	return out << "]";
}

mt19937 rnd(time(NULL));

const int INF = int(1e9);
const li INF64 = li(1e18);
const int MOD = int(1e9) + 7;
const ld EPS = 1e-9;
const ld PI = acos(-1.0);

const int N = 18;
const int M = 51;

int n;
pt a[N];

bool read () {
	if (scanf("%d", &n) != 1)
		return false;
	forn(i, n)
		scanf("%d", &a[i].x);
	forn(i, n)
		scanf("%d", &a[i].y);
	return true;
}

int dp[1 << N][M];

void solve() {
	forn(i, 1 << n) forn(j, M)
		dp[i][j] = INF;
	dp[0][0] = 0;
	int fl = (1 << n) - 1;
	forn(mask, 1 << n) forn(lst, M) if (dp[mask][lst] < INF){
		int cur = fl;
		forn(i, n) if ((mask >> i) & 1)
			cur ^= ((1 << i) - 1);
		int cnt = 0;
		forn(i, n) if (!((mask >> i) & 1)){
			bool tmp = cnt & 1;
			tmp ^= (cur >> i) & 1;
			if (tmp && lst <= a[i].x){
				dp[mask | (1 << i)][a[i].x] = min(dp[mask | (1 << i)][a[i].x], dp[mask][lst] + cnt);
			}
			if (!tmp && lst <= a[i].y){
				dp[mask | (1 << i)][a[i].y] = min(dp[mask | (1 << i)][a[i].y], dp[mask][lst] + cnt);
			}
			++cnt;
		}
	}
	int ans = INF;
	forn(i, M) ans = min(ans, dp[(1 << n) - 1][i]);
	printf("%d\n", ans == INF ? -1 : ans);
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
	
	int tt = clock();
#endif
	
	cerr.precision(15);
	cout.precision(15);
	cerr << fixed;
	cout << fixed;

#ifdef _DEBUG
	while(read()) {	
#else
	if(read()) {
#endif
		solve();
		
#ifdef _DEBUG
	cerr << "TIME = " << clock() - tt << endl;
	tt = clock();
#endif

	}
}

Measured memory_bytes: 52480
# C
import math
A, B = map(int, input().split())


X1 = B*10
X2 = math.ceil((B+1)*10) - 1
X3 = math.ceil((A/0.08))
X4 = math.ceil(((A+1)/0.08)) - 1

# print(X1, X2, X3, X4)
if X3<=X1 and X1 <= X4 and X4 <= X2:
    print(int(X1))
elif X3<=X1 and X1 <= X2 and X2 <= X4:
    print(int(X1))
elif X1<=X3 and X3 <= X4 and X4 <= X2:
    print(int(X3))
elif X1<=X3 and X3 <= X2 and X2 <= X4:
    print(int(X3))
else:
    print(-1)

Measured memory_bytes: 3188
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public final class Main {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String[] line = in.nextLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int x = Integer.parseInt(line[1]);
        int t = Integer.parseInt(line[2]);
        int full = n / x + (n % x != 0 ? 1 : 0);
        System.out.println(full * t);
    }
}


Measured memory_bytes: 35668
#include<stdio.h>
#include<math.h>
int main()
{
	int N,f[100][10],i,j,x,y,a[10];
	int count;
	long long p[100][11],sum,max;
	scanf("%d",&N);
	for(i=0;i<N;i++)
	{
		for(j=0;j<10;j++)
		{
			scanf("%d",&f[i][j]);
		}
	}
	for(i=0;i<N;i++)
	{
		for(j=0;j<11;j++)
		{
			scanf("%lld",&p[i][j]);
		}
	}
	
	for(x=1;x<=1023;x++)
	{
		sum=0;
		y=x;
		a[0]=y/(pow(2,9));
		for(i=1;i<10;i++)
		{
			y-=a[i-1]*pow(2,10-i);
			a[i]=y/(pow(2,9-i));
		}
		
		for(i=0;i<N;i++)
		{
			count=0;
			for(j=0;j<10;j++)
			{
				if((f[i][j]==1)&&(a[j]==1))
					count++;
			}
			sum+=p[i][count];
		}
		if(x==1) max=sum;
		if(sum>max) max=sum;
	}
	printf("%lld",max);
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <set>
#include <string.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REP3(i,st,en) for(ll (i)=(st);(i)<(en);(i)++)

using P = pair<ll, ll>;
const int MOD = 1e9+7;
const ll INF = 1e+14;
const double PI = 3.14159265349;



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

  ll A,B;
  cin >> A >> B;

  cout << max(0ll, A-B*2) << "\n";
  return 0;
}


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

int main(){
  int n, m, b[100], a[100][100], c[100] = {};
  cin >> n >> m;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      cin >> a[i][j];
    }
  }
  for(int i = 0; i < m; i++){
    cin >> b[i];
  }
  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      c[i] += a[i][j] * b[j];
    }
  }
  for(int i = 0; i < n; i++){
    cout << c[i] << endl;
  }
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){

  int n,a,b;
  string str;

  int x, t;
  cin >>x >> t;
  cout << (x<t ? 0 : x-t) fin;
  
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;



Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>

using namespace std;

int n;
vector<string> g;

bool contradiction = false;
int colors[200];

void dfs(int v, int c=0) {
  if (colors[v] != -1) {
    if (colors[v] != c) {
      contradiction = true;
    }
    return;
  }
  colors[v] = c;
  for (int w = 0; w < n; ++w) {
    if (g[v][w] == '1') {
      dfs(w, !c);
    }
  }
}

int main()
{
  cin >> n;
  g.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> g[i];
  }

  memset(colors, -1, sizeof(colors));
  dfs(0, 0);

  if (contradiction) {
    cout << -1 << endl;
    return 0;
  }

  vector<vector<int>> dist(n, vector<int>(n));

  const int inf = 1000000;

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      dist[i][j] = g[i][j] - '0';
      if (dist[i][j] == 0) dist[i][j] = inf;
      if (i == j) dist[i][j] = 0;
    }
  }

  for (int t = 0; t < n; ++t) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (dist[i][j] > dist[i][t] + dist[t][j]) {
          dist[i][j] = dist[i][t] + dist[t][j];
        }
      }
    }
  }

  int result = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (dist[i][j] < inf) {
        result = max(result, dist[i][j]);
      }
    }
  }

  result++;
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 640
n, m = map(int, input().split())
num = [0] * n
sc = []
S = 0
C = 1
for i in range(m):
    s, c = map(int, input().split())
    # if num[s-1] != 0 and num[s-1] != c:
    #     print(-1)
    #     exit()
    # num[s-1] = c
    sc.append([s-1, c])

# if 1 < n and num[0] == 0:
#     print(-1)
#     exit()

for i in range(1000):
    ok = True
    string = str(i)
    if len(string) == n:
        for j in range(m):
            if string[sc[j][S]] != str(sc[j][C]):
                ok = False
                break
        if ok:
            print(i)
            exit()         
print(-1)

Measured memory_bytes: 9088
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>

int main()
{
	long long a = 0, b = 0, c = 0, d = 0, e = 0, min = 0, ma = 0, ans = 0, count = 0,nagax=0,nagay=0;
	bool okada = true;
	bool whiteyoko = false, whitetate = false;
	char grid[100][100];
	using namespace std;
	int answer[100][100] = {};
	cin >> a >>b>>c>>d;
	nagax = c - a;
	nagay = d - b;
	cout << c-nagay<<" "<<d+nagax<<" "<< c - nagay-nagax<<" "<<d+nagax-nagay<<endl;

	}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int MOD = 1000000007;
const int MAX = 2000100;
long long fac[MAX], finv[MAX], inv[MAX];
void init_comb() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long comb(int n, int r) {
  if (n < r) return 0;
  if (n < 0 || r < 0) return 0;
  return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  init_comb();
  int x, y;
  cin >> x >> y;
  ll ans = 0;
  rep(i, x+1) {
    if ((x-i)%2 || (x-i)/2+i*2 != y)
      continue;
    (ans += comb(i+(x-i)/2, i)) %= MOD;
  }
  cout << ans << endl;
  return 0;
  return 0;
}

Measured memory_bytes: 47104
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
ll power(ll x,ll y,ll p){
ll res = 1;x = x % p;
while (y > 0){
if (y & 1){res = (res*x) % p;}
y = y>>1;
x = (x*x) % p;}
return res;}
ll mcd(ll a,ll b){
    if(b>a)swap(a,b);
    if(b==0)return a;
    else return mcd(b,a%b);
}
ll t,n,m,k;
bool esprimo(ll n){
ll s=0;
for(ll i=1;i*i<=n;i++){
    if(n%i==0){s++;}}
if(s>=2){return false;}
return true;
}
int main(){
        cout<<fixed<<setprecision(12);
//cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

cin>>n;
long double a[n];
for(int i=0;i<n;i++){cin>>a[i];}
long double dp[n+1][n+1];
memset(dp,0,sizeof dp);
dp[1][0]=a[0];
for(int i=2;i<=n;i++){
dp[i][0]=dp[i-1][0]*a[i-1];
}
dp[1][1]=1-a[0];
for(int i=2;i<=n;i++){
    for(int j=1;j<i;j++){
        dp[i][j]=dp[i-1][j]*a[i-1]+dp[i-1][j-1]*(1-a[i-1]);
    }
    dp[i][i]=dp[i-1][i-1]*(1-a[i-1]);
}
long double ans=0;
for(int i=0;i<=n/2;i++){
ans+=dp[n][i];
}
for(int i=0;i<=n;i++){
    for(int j=0;j<=n;j++){
      // cout<<dp[i][j]<<" ";
    }
 //   ans+=a[i][n];
    //cout<<endl;
}
cout<<ans<<endl;
}



Measured memory_bytes: 144360
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;


/*
DP
フィボナッチ数列

*/

int main(){

  int n;
  cin >> n;
  int fib[n+1];
  fib[0] = 1;
  fib[1] = 1;
  REP2(i,2,n+1){
    fib[i] = fib[i-1] + fib[i-2];
  }

  cout << fib[n] << endl;
  return 0;
}



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

typedef unsigned long ul;
typedef long long ll;
typedef pair<ul, ul> P; //ペア　タイプでふ

int main()
{
    int a, b;
    cin >> a >> b;
    cout << a * b / 2;
}

Measured memory_bytes: 256
import java.util.Scanner;
 
public class Main{
    public static void main(String[] args){
        int sum=0,i=0,j;
        String t;
        Scanner s = new Scanner(System.in);
        while(true){
            t = s.next();
            if(t.charAt(0) =='0'&&t.length()==1)break;
            for(i=0;i<t.length();i++){
                sum+=t.charAt(i)-'0';
            }
            System.out.println(sum);
            sum = 0;
        }
    }
}


Measured memory_bytes: 26236
import numpy as np
from itertools import combinations as comb
N = int(input())
F = np.array([list(map(int, input().split())) for i in range(N)])
P = np.array([list(map(int, input().split())) for i in range(N)])
max_score = -10**7 * N - 1
d_arrN = list(range(N))
d_arr10 = list(range(10))
for i in range(10):
	for o_c in comb(d_arr10, i + 1):
		c_i = F[:, o_c].sum(axis=1)
		score = P[d_arrN, c_i].sum()
		max_score = max(max_score, score)
print(max_score)

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

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

  string ans = "Three";
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;

    if (s == "Y") ans = "Four";
  }

  cout << ans << endl;

  return 0;
}


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

int main() {
  int t,n,s=4;
  while(s--) {
    cin >> t >>n;
    int sum=0;
    if(t==1) cout << 6000*n << endl;
    else if(t==2) cout << 4000*n << endl;
    else if(t==3) cout << 3000*n << endl;
    else cout << 2000*n << endl;
  } 
  return 0;
}  


Measured memory_bytes: 1160
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl

const ll mod = 1e9+7;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

int main() {
    int n, K; cin >> n >> K;
    vector<ll> a(n);
    rep(i, n) cin >> a.at(i);

    combination c(n+5);

    sort(a.begin(), a.end());
    mint sum = 0;
    for(int i=0; i<n; i++){
        mint tmp = c(i, K-1);
        mint tmp2 = a.at(i);
        sum+=tmp * tmp2;
    }

    sort(a.rbegin(), a.rend());
     for(int i=0; i<n; i++){
        mint tmp = c(i, K-1);
        mint tmp2 = a.at(i);
        sum-=tmp * tmp2;
    }   

    cout << sum.x << endl;
}

Measured memory_bytes: 2560
#include <iostream>
#include <string>
#include <limits.h>
#include <numeric>
#include <math.h>
#include <bits/stdc++.h>
#define rep(i,c) for (int i=0;i<c;i++)
using namespace std;
typedef long long ll;

int main(){
  int K;
  cin >> K;
  string s;
  cin >> s;
  int size = (int)(s.length());
  if(size <= K) cout << s << endl;
  else {
    rep(i,K){
      cout << s[i];
    }
    cout << "..." << endl;
  }
}

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
    int n;cin >>n;
    map<ll,int>mp;
    for (int i = 0; i < n; ++i) {
        int a;cin >>a;
        mp[a]++;
    }
    vector<ll>ans;
    ans.push_back(0);
    ans.push_back(0);
    for(auto p:mp){
        if(p.second>=2)ans.push_back(p.first);
        if(p.second>=4)ans.push_back(p.first);
    }
    sort(all(ans));
    reverse(all(ans));
    cout <<ans[0]*ans[1]<<endl;
}

Measured memory_bytes: 9736
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
const Int MOD = 1000000007;
Int dp[300][300][2]; // dp[3色になるマス][2色になるマス][i%2]
int main()
{
    int N, M; cin >> N >> M;
    struct cond { int jmin = 0, jmax = INT_MAX, kmin = 0, kmax = INT_MAX; };
    vector<cond> C(N+1);
    for (int i = 0; i < M; i++) {
        int l, r, x; cin >> l >> r >> x;
        if (x == 1) {
            C[r].kmax = min(C[r].kmax, l-1);
        } else if (x == 2) {
            C[r].kmin = max(C[r].kmin, l);
            C[r].jmax = min(C[r].jmax, l-1);
        } else {
            C[r].jmin = max(C[r].jmin, l);
        }
    }
    dp[0][0][0] = 1;
    for (int i = 1; i <= N; i++) {
        for (int j = 0; j < i; j++) {
            for (int k = 0; k < i; k++) {
                dp[j][k][i%2] = 0;
            }
        }
        for (int j = 0; j < i; j++) {
            for (int k = 0; k < i; k++) {
                int c = dp[j][k][(i%2)^1];
                dp[j][k][i%2] += c;
                dp[j][i-1][i%2] += c;
                dp[k][i-1][i%2] += c;
            }
        }
        for (int j = 0; j < i; j++) {
            for (int k = 0; k < i; k++) {
                if (C[i].jmin <= j && j <= C[i].jmax && C[i].kmin <= k && k <= C[i].kmax) {
                    dp[j][k][i%2] %= MOD;
                } else {
                    dp[j][k][i%2] = 0;
                }
            }
        }
    }
    Int ans = 0;
    for (int j = 0; j < N; j++) {
        for (int k = 0; k < N; k++) {
            ans += dp[j][k][N%2];
        }
    }
    cout << ans % MOD << '\n';
    return 0;
}

Measured memory_bytes: 1664