akhauriyash/Code-Regression huggingface dataset:
import sys
input = sys.stdin.readline
N, M = map(int,input().split())
ab = []
c = []
def bit(ls):
    res = 0
    for elem in ls:
        res += 2**(elem-1)
    return res

for i in range(M):
    ab.append(list(map(int,input().split())))
    l = list(map(int,input().split()))
    val = bit(l)
    c.append(val)
dp = [10**6]*(2**N)
dp[0] = 0
for i in range(M):
    for j in range(2**N):
        dp[c[i] | j] = min(dp[c[i] | j], dp[j]+ab[i][0])
if dp[2**N-1] == 10**6:
    print(-1)
else:
    print(dp[2**N-1])


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

public class Main {
	private static void solve(){
		//Implement solution here.
		int n = ni();
		int x = ni();
		int[] l = new int[n];
		for(int i = 0; i < n; i++) {
			l[i] = ni();
		}
		
		int d = 0;
		int result = 1;
		for(int i = 0; i < n; i++) {
			d += l[i];			
			if(d > x)break;
			result++;
		}
		System.out.println(result);
	}

	//Switch input source (stdin/file)
	private static BufferedReader br  = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args){
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

Measured memory_bytes: 21844
#include<iostream>

int main(){
     int H,W;
     while(1){
       std::cin>>H>>W;
       if(H==0 || W==0) break;
       for(int i=0;i<H;i++){
          for(int j=0;j<W;j++){
              if((i+j)%2==0) std::cout<<"#";
              else std::cout<<".";
          }
          std::cout<<std::endl;
       }
       std::cout<<std::endl;
    }   

   return 0;
}

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

const lli mod = 1000000007LL;
const lli MAXN = 100;
lli N;
string A, B, C;
lli dp[MAXN][2];

int main() {
  while(cin >> A && A != "0") {
    cin >> B >> C;
    reverse(A.begin(), A.end());
    reverse(B.begin(), B.end());
    reverse(C.begin(), C.end());
    N = A.size();
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    for(lli i = 0; i < N; ++i) {
      for(lli j = 0; j < 2; ++j) {
        if(!dp[i][j]) continue;
        vector<lli> a, b;
        if(A[i] == '?') {
          for(lli d = i+1==N; d <= 9; ++d) a.push_back(d);
        } else {
          a.push_back(A[i]-'0');
        }
        if(B[i] == '?') {
          for(lli d = i+1==N; d <= 9; ++d) b.push_back(d);
        } else {
          b.push_back(B[i]-'0');
        }
        for(lli s = 0; s < a.size(); ++s) {
          for(lli t = 0; t < b.size(); ++t) {
            lli c = a[s] + b[t] + j;
            lli nj = c / 10;
            c %= 10;
            if(C[i] != '?' && C[i]-'0' != c) continue;
            if(i+1 == N && c == 0) continue;
            ( dp[i+1][nj] += dp[i][j] ) %= mod;
          }
        }
      }
    }
    cout << dp[N][0] << endl;
  }
  return 0;
}

Measured memory_bytes: 1212
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <map>
#include <queue>
#include <set>

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

using namespace std;

template<typename T> T gcd(T a, T b){return (a % b)? gcd(b, a % b) : b;}
template<typename T> T lcm(T a, T b){return a * b / gcd(a, b);}

int main(void){
    int n;
    cin >> n;
    int l[n];
    REP(i,n) cin >> l[i];

    sort(l, l+n, greater<int>());
    int ans = 0;
    REP(i,n-2){
        for(int j = i+1; j < n-1; j++){
            if(l[i] == l[j]) continue;
            for(int k = j+1; k < n; k++){
                if(l[j] == l[k]) continue;
                if(l[i] < l[j] + l[k]){
                    ans++;
                    // cout << i +1<< j+1 << k+1 << endl;
                }
            }
        }
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
 
using namespace std;
 
// typedef
typedef long long ll;
typedef long double ldbl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;
 
// container util
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for (typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
// repetition
#define FOR(i,m,n) for (ll (i) = ((ll) m); (i) < ((ll) n); ++(i))
#define RFOR(i,m,n) for (ll (i) = ((ll) (m)-1); (i) >= ((ll) n); --(i))
#define REP(i,n) FOR(i,0,n)
 
// i/o
#define TFOUT(b,t,f) cout << ((b)? (t) : (f)) << endl
 
// constant
const double PI  = acos(-1.0);
const int    MOD = (int)(1e9 + 7);
// DO NOT set INFTY_XXXs constants. They may bring some BUG! Use MAX_XXXs in climit instead.
 
// clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
// debug
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

int main() {
    int n, m; cin >> n >> m;
    vector<int> nodes;
    vector< set<int> > edges(n);
    for (int i = 0; i < n; i++) {
        int h; cin >> h;
        nodes.push_back(h);
    }
    for (int i = 0; i < m; i++) {
        int a, b; cin >> a >> b;
        a--; b--;
        edges[a].insert(b);
        edges[b].insert(a);
    }

    int ans = 0;
    for (int i = 0; i < n; i++) {
        int is_good = 1;
        for (int nextto : edges[i]) {
            if (nodes[i] <= nodes[nextto]) {
                is_good = 0;
                break;
            }
        }
        ans += is_good;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 17704
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	vector<int> v;
	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		int x; cin >> x;
		v.push_back(x);
	}
	vector<int>c = v;
	sort(c.begin(), c.end());
	for (int i = 0; i < n; i++) {
		if (v[i]!=c[n-1]) {
			cout << c[n - 1] << endl;
		}
		else {
			cout << c[n - 2] << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
#define int long long
inline void read (int &x) {
	char ch = getchar(); int f = 0; x = 0;
	while (!isdigit(ch)) { if (ch == '-') f = 1; ch = getchar(); }
	while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar(); if (f) x = -x;
} int a, v, b, w, t;
signed main() {
    read (a), read (v), read (b), read (w), read (t);
    if (labs (a - b) <= t * (v - w)) return puts ("YES"), 0;
    else return puts ("NO"), 0;
}


Measured memory_bytes: 3636
#include<stdio.h>
int main()
{
  int a,b,i,j;
  while(1)
	   {
  scanf("%d%d",&a,&b);
  if(a==0&&b==0){break;}

  for(i=1;i<=a;i++)
    {
      for(j=1;j<=b;j++)
	{
	  if(j%2==1)
	    {
	      if(i%2==1)printf("#");
	      else printf(".");
	    }
	  else 
	    {
              if(i%2==1)printf(".");
	      else printf("#");
	    }
	}
      printf("\n");
    }
  printf("\n");
    
	   }
  return 0;
}



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

void getKnapsack(int i, int j, vector<pair<ll int, ll int>> &arr, vector<vector<ll int>> &dp){
    if(i == 0 || j == 0){
        dp[i][j] = 0; 
        return;
    }
    //cout << "i : " << i << ", j : " << j << endl;
    if(dp[i-1][j] == -1){
        getKnapsack(i-1, j, arr, dp);
    }
    if(j - arr[i-1].first < 0){
        dp[i][j] = dp[i-1][j];
    }else{
        if(dp[i-1][j- arr[i-1].first] == -1){
            getKnapsack(i-1, j - arr[i-1].first, arr, dp);
        }
        dp[i][j] = max(dp[i-1][j], arr[i-1].second + dp[i-1][j- arr[i-1].first]);
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n, w;
    cin >> n >> w;
    vector<pair<ll int, ll int>> arr(n, {0,0});
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i].first >> arr[i].second;
    }
    
    vector<ll int> tempdp(w+1, -1);
    vector<vector<ll int>> dp(n+1, tempdp);

    getKnapsack(n, w, arr, dp);

    cout << dp[n][w] << endl;

    return 0;
}

Measured memory_bytes: 80256
n = int(input())

ans = 10**9
for i in input().split():
    check = int(i)
    if check % 2 == 1:
        print(0)
        exit()
    
    count=0
    while check % 2 == 0:
        check /= 2
        count+=1
    ans=min(ans,count)
    
print(ans)

Measured memory_bytes: 3060
fun main (args:Array<String>){
    val numOfSlime = readLine()!!.toInt()
    val strS = readLine()!!
    var ans = numOfSlime
    for(i in 0..numOfSlime-2){
        if(strS[i] == strS[i+1]){
            ans--
        }
    }
    print(ans)
}

Measured memory_bytes: 36916
from operator import itemgetter
 
n = int(input())
l = []
for i in range(n):
    si,pi = input().split()
    l.append([i,si,int(pi)])

l.sort(key=itemgetter(2))
l.reverse()
l.sort(key=itemgetter(1))
for i in range(n):
    print(l[i][0] + 1)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

struct union_find{
    vector<ll> parent;
    vector<ll> nums;
    union_find(ll n){
        parent.resize(n);
        nums.resize(n, 1LL);
        rep(i, 0, n) parent[i] = i;
    }
    ll root(ll x){
        if(parent[x] == x) return x;
        parent[x] = root(parent[x]);
        return parent[x];
    }
    void unite(ll x, ll y){
        ll rx = root(x);
        ll ry = root(y);
        if(rx != ry){
            parent[rx] = ry;
            nums[ry] += nums[rx];
        }
    }
    bool same(ll x, ll y){
        ll rx = root(x);
        ll ry = root(y);
        if(rx == ry) return true;
        return false;
    }
    ll size(ll x){
        return nums[root(x)];
    }
};  

typedef struct EdgeInfo{
    ll cost;
    ll srt;
    ll end;
    ll id;
    EdgeInfo() {;};
    EdgeInfo(ll _cost, ll _srt, ll _end, ll _id) : cost(_cost), srt(_srt), end(_end), id(_id) {};    
    ~EdgeInfo() {;};
} edge;
bool operator<(const edge& t1, const edge& t2) { return (t1.cost < t2.cost); };
bool operator>(const edge& t1, const edge& t2) { return (t1.cost > t2.cost); };
bool operator<=(const edge& t1, const edge& t2) { return (t1.cost <= t2.cost); };
bool operator>=(const edge& t1, const edge& t2) { return (t1.cost >=t2.cost); };

int main(){
    ll N, M;
    cin >> N >> M;
    vector<edge> E(M);
    rep(i, 0, M){
        ll s, t, w;
        cin >> s >> t >> w;
        // if inputs are 1-indexed, enable following line.
        // s--; t--;
        E[i] = edge(w, s, t, i);
    }
    sort(E.begin(), E.end());
    ll ans = 0;
    struct union_find t(N);
    set<ll> used_edges;
    rep(i, 0, M){
        if(!t.same(E[i].srt, E[i].end))
        {
            ans += E[i].cost;
            t.unite(E[i].srt, E[i].end);
            used_edges.insert(E[i].id);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 6452
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
int main() {
#ifdef LOCAL
    //freopen("input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    vector<int> h(n);
    for (int &i : h)
        cin >> i;
    vector<int> dp(n);
    dp[0] = 0;
    dp[1] = abs(h[0] - h[1]);
    for (int i = 2; i < n; ++i) {
        dp[i] = min(dp[i - 1] + abs(h[i - 1] - h[i]), dp[i - 2] + abs(h[i - 2] - h[i]));
    }
    cout << dp[n-1];
    return 0;
}

Measured memory_bytes: 3964
/**
 * Author : Deep Raval
 * There are no two words in the English language more harmful than "good job".
 * 1729 0_0
**/
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <numeric>
using namespace std;
using ll = long long;
#define endl '\n'
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) 
{
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define FAST_IO ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0);
#define bp(x) __builtin_popcount(x)
#define zf(x) __builtin_clz(x)
#define zl(x) __builtin_ctz(x)
#define par(x) __bultin_parity(x)
#define all(x) (x).begin(), (x).end()
/* **************************************************************************************** */

void test_case()
{
    string s;
    cin >> s;

    ll ans = 0;
    for(char c : s)
    {
        ans += (c - '0');
        ans %= 9;
    }

    if(ans)
    {
        cout << "No" << endl;
    }
    else 
    {
        cout << "Yes" << endl;
    }
	return ;
}
int main()
{
	FAST_IO
    int t = 1;
    //cin >> t;
    while(t--)
        test_case();
	return 0;
}

Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector<string> s(3);
	rep(i,3) cin >> s.at(i);
	string ans="";
	rep(i,3) ans+=s.at(i).at(0);
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
int main(){
	std::vector<int> quadruple{ 1, 3 }, quadruple_double, quadruple_odd;
	while (quadruple[quadruple.size() - 2] <= 1000000) {
		quadruple.push_back(quadruple.back() + quadruple.size() + 1);
		quadruple[quadruple.size() - 2] += quadruple[quadruple.size() - 3];
	}
	quadruple.pop_back(); quadruple.pop_back();
	for (auto i = 0; i < quadruple.size(); ++i) {
		for (auto j = 0; j <= i; ++j) {
			quadruple_double.push_back(quadruple[i] + quadruple[j]);
		}
	}
	std::sort(quadruple_double.begin(), quadruple_double.end());
	quadruple_double.erase(std::unique(quadruple_double.begin(), quadruple_double.end()), quadruple_double.end());
	std::copy_if(quadruple.begin(), quadruple.end(), std::back_inserter(quadruple_odd), [](const int a) {return a % 2 == 1; });
	std::vector<int> min_odd(1000001, 1000000);
	min_odd[0] = 0;
	for (auto i = 0; i < min_odd.size(); ++i) {
		for (const auto o : quadruple_odd) if (o + i < min_odd.size()) {
			if (min_odd[o + i] > min_odd[i] + 1) {
				min_odd[o + i] = min_odd[i] + 1;
			}
		}
		else break;
	}

	while (true) {
		int n; std::cin >> n; if (n == 0) return 0;
		if (std::binary_search(quadruple.begin(), quadruple.end(), n)) {
			std::cout << 1;
		}
		else if (std::binary_search(quadruple_double.begin(), quadruple_double.end(), n)) {
			std::cout << 2;
		}
		else if (std::any_of(quadruple.begin(), quadruple.end(), [&quadruple_double, n](const int q) {return std::binary_search(quadruple_double.begin(), quadruple_double.end(), n - q); })) {
			std::cout << 3;
		}
		else if (std::any_of(quadruple_double.begin(), quadruple_double.end(), [&quadruple_double, n](const int q) {return std::binary_search(quadruple_double.begin(), quadruple_double.end(), n - q); })) {
			std::cout << 4;
		}
		else {
			std::cout << 5;
		}
		std::cout << ' ' << min_odd[n] << '\n';
	}
}



Measured memory_bytes: 6680
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

static const long long mod = 1000000007;

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll maxv = 0;
  ll minv = INF;
  ll n;
  cin >> n;
  rep(i,n){
    ll a;
    cin >> a;
    chmax(maxv, a);
    chmin(minv, a);
  }

  cout << maxv - minv << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(auto i=0;i<n;++i)
#define REPR(i,n) for(auto i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(auto i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}

int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int main(){

  int a, b;
  cin >> a >> b;
  if(a <= 8 && b <= 8){
    cout <<"Yay!\n";
  }else{
    cout << ":(" << endl;
  }
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <map>
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i <= n; i++)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
using namespace std;
int mod = 1e9 + 7;
ll gcd(ll, ll);
ll numFact(ll a);

int main()
{
	ll A, B;
	cin >> A >> B;
	ll g = gcd(A, B);
	ll numF = numFact(g);
	co(numF + 1);
	return 0;
}

ll gcd(ll a, ll b)
{
	if (a < b)return gcd(b, a);
	return b ? gcd(b, a%b) : a;
}

ll numFact(ll a)
{
	ll res = 0;
	ll i = 2;
	ll a_o = a;
	while ((a > 1) && i * i <= a_o)
	{
		if (a%i == 0)
		{
			res++;
			while (a%i == 0)
			{
				a /= i;
			}
		}
		i++;
	}
	if (a > 1)res++;
	return res;
}


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

int a,b,k;

int main()
{
	scanf("%d %d %d",&a,&b,&k);
	
	for(int i=a;i<=min(a+k-1,b);i++)
		printf("%d\n",i);
	for(int i=max(a+k,b-k+1);i<=b;i++)
		printf("%d\n",i);
	return 0;
}

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; 
using P = pair<int,int>;

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 long long INF = 1LL << 60;
const long long mod = 1000000007;


int main(void){
    set<string> S;
    int n;cin >> n;
    for(int i=0;i<n;i++){
	string a;
	cin >> a;
	S.insert(a);
    }
    cout << S.size() << endl;
    return 0;
}


Measured memory_bytes: 19152
package main

import (
    "fmt"
    "math"
)


func main() {
    var n int
    var t, a float64
    var h float64
    fmt.Scan(&n)
    fmt.Scan(&t)
    fmt.Scan(&a)
    minScore := float64(10000)
    index := -1
    for i := 0; i < n; i++ {
        fmt.Scan(&h)
        if math.Abs(a - t + h * 0.006) < minScore {
            minScore = math.Abs(a - t + h * 0.006)
            index = i
        }
    }
    fmt.Println(index + 1)
}

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

using namespace std;

int main(void) {
	string S, T;
	cin >> S >> T;
	int A, B;
	cin >> A >> B;
	string U;
	cin >> U;
	if(S == U) {
		cout << (A - 1) << ' ' << B << '\n';
	} else {
		cout << A << ' ' << (B - 1) << '\n';
	}
	return 0;
}



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

int main() {
  int a;
  cin>>a;
  string p;
  vector<string> vec(a);
  for(int i=0;i<a;i++){
    cin>>p;
    sort(p.begin(),p.end());
    vec.at(i)=p;
  }
  
sort(vec.begin(),vec.end());
  
  long long int y=1;
  long long int  answer=0;

  for(int i=0;i<a;i++){
    if(i==a-1){
    answer+=(y*(y-1))/2;
    break;
    }
    if(vec.at(i)==vec.at(i+1)){
    y++;
    }
    if(vec.at(i)!=vec.at(i+1)){
    answer+=(y*(y-1))/2;
    y=1;
    }
  }

   cout<<answer<<endl;
}


Measured memory_bytes: 5760
n = int(input())
a = list(map(int, input().split()))
sum_a = sum(a)
# print(n,a,sum_a)
x = [0]*n
x[0] = sum_a
for i in range(1,n,2):
    # print(x[0],i)
    x[0] -= 2*a[i]
x[-1] = int(a[-1])*2-x[0]
for i in range(n-2,0,-1):
    x[i] = a[i]*2-x[i+1]
# x[-1] = int(a[2])*2-x[0]
# x[1] = int(a[1])*2-x[2]
for i in range(len(x)):
    print(x[i], end=' ')


Measured memory_bytes: 14032
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;


int main() {
    int n, k;
    cin >> n >> k;
    vector<int> v(n, 0);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    sort(v.begin(), v.end());
    cout << accumulate(v.end() - k, v.end(), 0) << endl;
}




Measured memory_bytes: 3628
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl '\n'
int mod=1e9+7;

signed main(){
  string s;
  cin>>s;
  string t="keyence";

  int id1=0;;
  for(int i=0;i<t.size();i++){
    if(s[i]!=t[i]){
      break;
    }
    id1++;
  }
  int id2=0;
  int k=t.size()-1;
  for(int i=s.size()-1;i>=0;i--){
    if(s[i]!=t[k]){
      break;
    }
    id2++;
    k--;
  }

  if(id1+id2>=t.size())cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    int N;cin>>N;
    vector<ll>V(N+1);
    for(int i=0;i<N;i++)cin>>V[i];
    V[N]=10000000000;
    sort(V.begin(),V.end());
    V[N]=0;
    int count=0;
    int ans=0;
    for(int i=0;i<N;i++){
        count++;
        if(V[i]!=V[i+1]){
            ll x=V[i];
            if(x>count)ans+=count;
            else ans+=count-x;
            count=0;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
N,K = map(int,input().split())
S = input()
#print(S)

same = 0
diff = 0
for n in range(N-1):
  if S[n] == S[n+1]:
    same += 1
  else:
    diff += 1

ans = same+min(diff,2*K)
print(ans)


Measured memory_bytes: 39408
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

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

    int ans=1;
    for(int b=2;b*b<=X;b++){
        for(int p=2;pow(b,p)<=X;p++){
            ans=max(ans,(int)pow(b,p));
        }
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <ctype.h>

int main()
{
	char a;
	while(1){
		scanf("%c",  &a);
		if(isalpha(a)){
			if(islower(a)){
				printf("%c", toupper(a));
			}
			else{
				printf("%c", tolower(a));
			}
		}
		else{
			printf("%c", a);
		}
		if(a=='\n'){
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 524
#!/usr/bin/env python3
import sys


def solve(S: str):
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            print('Bad')
            return
    print('Good')
    return


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

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(int i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
double ans=0;
const double eps=1e-5;
double func(double t,double v,double t2,double time){
    if(t2<=time && t2+t>=time){
        return v;
    }
    else if(t2>time){
        return v+(t2-time);
    }
    else{
        return v+(time-(t2+t));
    }
}
void Main(){
    int n;cin >> n;
    vector<double> t(n+2),v(n+2),t2(n+3,0);
    t[0]=0;v[0]=0;
    For(i,1,n+1) cin >> t[i];
    For(i,1,n+1) cin >> v[i];
    t[n+1]=accumulate(t.begin(),t.end()-1,0.0);v[n+1]=0;
    For(i,1,n+3){
        t2[i]=t2[i-1]+t[i-1];
    }
    double vel=0;
    for(double time=0;time<t[n+1]+eps;time+=0.5){
        double newvel=time;
        For(i,0,n+2){
            newvel=min(newvel,func(t[i],v[i],t2[i],time));
        }
        ans+=(vel+newvel)/4;
        vel=newvel;
    }

    cout << fixed << setprecision(10) << ans << endl;
}
int main(){
    Main();
    /*
    東方風神録は神が出てくるので当然神ゲー
    */
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int A,B,total;
  int n=0;
  scanf("%d ", &A);
  scanf("%d\n", &B);
  if(A>=3&&A<=20&&B>=3&&B<=20){
  while(n<2){
  if(A>=B){
    total=total+A;
    A--;
    n++;
  }
  else{
    total=total+B;
    B--;
    n++;
  }
  }
  }
  printf("%d",total);
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iterator>
#include<sstream>
#include<iomanip>
#include<map>
#include<queue>
#include<deque>
#include<fstream>

#define rep(i, n) for (ll i = 0; i < n; i++) 
#define rrep(i, n) for(ll i = n-1; i>=0; i--)
#define range(i, n, m) for (ll i = n; i < m; i++) 
#define rrange(i, n, m) for (ll i = n - 1; i => m; i--) 
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vp vector<pair<ll, ll> >
#define vvp vector<vector<pair<ll, ll> > >
#define First first
#define Second second.first
#define Third second.second
//#define MOD 998244353

typedef long long int ll;
typedef unsigned long long int ull;

using namespace std;

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

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

	ll N, D;
	cin >> N >> D;

	vvl X(N, vector<ll>(D));
	rep(i, N) {
		rep(k, D) {
			cin >> X[i][k];
		}
	}

	ll ret = 0;
	rep(i, N) {
		range(k, i + 1, N) {
		ll sum = 0;
			rep(l, D) {
				sum += pow(X[i][l] - X[k][l], 2);
			}
			if (sqrt(sum) == (ll)sqrt(sum)) ret++;
		}
	}

	cout << ret << endl;


	return 0;
}



Measured memory_bytes: 888
n, m = map(int, input().split())
h = list(map(int, input().split()))
is_good = [1] * n
for _ in range(m):
    a, b = map(lambda x: int(x)-1, input().split())
    if h[a] > h[b]:
        is_good[b] = 0
    elif h[a] < h[b]:
        is_good[a] = 0
    else:
        is_good[a] = is_good[b] = 0
print(sum(is_good))


Measured memory_bytes: 20112
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  int count=0;
  cin>>s;
  if(s.size()==1){
    cout<<count<<endl;
    return 0;
  }
  for(int i=0;i<s.size()-1;i++)
    if(s[i] == s[i+1]){
      count+=1;
      if(s[i+1]-'0')
        s.replace(i+1,1,"0");
      else
        s.replace(i+1,1,"1");
    }
  cout<<count<<endl;
  return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define int long long
#define sz(x) (int)(x.size())
using namespace std;

signed main() {
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    cout << max(a[n / 2] - a[n / 2 - 1], 0ll) << "\n";

}

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

int main(){
        long int stack[199]={0};
        char buf='a';
        long int i=0;
        while(buf!='\n'){
                cin.get(buf);
                if(buf==' '){
                        i++;
                }else if(buf=='+'){
                        i=i-2;
                        stack[i]=stack[i]+stack[i+1];
                        stack[i+1]=0;
                }else if(buf=='-'){
                        i=i-2;
                        stack[i]=stack[i]-stack[i+1];
                        stack[i+1]=0;
                }else if(buf=='*'){
                        i=i-2;
                        stack[i]=stack[i]*stack[i+1];
                        stack[i+1]=0;
                }else if(buf=='\n'){
                        break;
                }else{
                        stack[i]=stack[i]*10+buf-0x30;
                }   
        }
        cout<<stack[i]<<endl;

        return 0;
}

Measured memory_bytes: 3084
fun judge(ret: Boolean, ok: String, ng: String) = if (ret) println(ok) else println(ng)
fun inRange(a: Int, b: Int, c: Int): Boolean = if (a < b && b < c) true else false

fun main(args: Array<String>) {
  val (a,b,c) = readLine()!!.split(' ').map(String::toInt)

  judge(inRange(a,b,c), "Yes", "No")
}



Measured memory_bytes: 32140
#include <iostream>

using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}

int main(void) {
	ll a, b, c, d, cd, ans, cn, dn, cdn;
	cin >> a >> b >> c >> d;
	a--;
	cd = c * d / gcd(c, d);
	cn = (b / c) - (a / c);
	dn = (b / d) - (a / d);
	cdn = (b / cd) - (a / cd);
	ans = b - a;
	ans -= cn + dn;
	ans += cdn;
	cout << ans << "\n";
	return 0;
}

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

using namespace std;

typedef long long ll;
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(void){
    int a, b;
    cin >> a >> b;
    int ans = 0;
    for(int i = 0; i < 2; i++){
    if(a <= b){
        ans += b;
        b--;
    }else{
        ans += a;
        a--;
    }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
  int W,a,b;
  scanf("%d %d %d",&W,&a,&b);
  if(a + W < b || b + W < a){
    if(a < b){
      printf("%d",b - a - W);
    }else{
      printf("%d",a - b - W);
    }
  }else{
    printf("0");
  }
  return 0;
}

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

int main() {
  int N, a, w, t, r;
  cin >> N;
  a=0;
  w=0;
  t=0;
  r=0;
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  for (int j = 0; j < N; j++) {
    if (S.at(j)=="AC") {
      a=a+1;
    }
    else {
      if (S.at(j)=="WA") {
        w=w+1;
      }
      else {
        if (S.at(j)=="TLE") {
          t=t+1;
        }
        else {
          r=r+1;
        }
      }
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
}


Measured memory_bytes: 6424
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define nn '\n'
#define YES {cout<<"YES"<<'\n';}
#define NO {cout<<"NO"<<'\n';}
#define Yes {cout<<"Yes"<<'\n';}
#define No {cout<<"No"<<'\n';}
#define yes {cout<<"yes"<<'\n';}
#define no {cout<<"no"<<'\n';}
void YN(bool flg){cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg){cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define out(n) {cout << n << '\n';}
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    VI d(n); REP(i,n) cin >> d[i]; SORT(d);
    out(d[n/2]-d[n/2-1]);

    return 0;
}

Measured memory_bytes: 1024
fact = [1]
mod = 10**9+7
for i in range(1,10**6 + 1):
    fact.append((fact[-1]*i)%mod)
def ncr(n,r):
    return ((fact[n]) * pow(fact[r],mod-2,mod) * pow(fact[n-r],mod-2,mod))%mod
x,y = map(int,input().split())
a = (2*x - y)//3
b = (2*y -x)//3
if (x+y)%3!=0 or min(a,b)<0:
    print(0)
else:
    print(fact[a+b]*pow(fact[a],mod-2,mod)*pow(fact[b],mod-2,mod)%mod) 

Measured memory_bytes: 93932
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder_ABC089_A
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();

            int min = 9999999;

            for (int i = 0; i < str.Length - 2; ++i)
            {
                int a = int.Parse((str.Substring(i, 3)));

                int diff = Math.Abs(753 - a);
                if (diff < min)
                {
                    min = diff;
                }
            }

            Console.WriteLine(min.ToString());
        }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int,int>;

int main(void){
    int n; cin >> n;
  vector<ll> a(n);
  for(int i=0; i<n; i++) cin >> a[i];
  
  ll ans = 0;
  for(int i=0; i<n; i++){
  	for(int j=0; j<n; j++){
    	if(ans < abs(a[i] - a[j])) ans = abs(a[i] - a[j]);
    }
  }
  cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3640
////*24-AUG-19*///
//Why do we fall?//
// So we can learn to pick ourself up!//
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define int long long
#define endl "\n"
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fr(a,b,c) for(int a=b; a<c; a++)
#define frr(a,b,c) for(int a=b;a>=c;a--)
#define pb push_back
#define pii pair<int,int>
#define R(a) ll a; cin >> a;

typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;

#define RA(a, n) ll a[(n) + 1] = {}; fr(i, 1, (n)+1) {cin >> a[i];}
#define RM(a, n, m) int a[n + 1][m + 1] = {}; fr(i, 1, n+1) {fr(j, 1, m+1) cin >> a[i][j];}
#define reset(X) memset(X, 0, sizeof(X))
using vi=vector<int>;
const int inf = 1e18;
const int mod=1e9+7;
unsigned int power(int x, unsigned int y, int p)
{
    int res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
bool isPrime(int n)
{   if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;
    return true;
}
int modInverse(int n, int p)
{
    return power(n, p-2, p);
}
bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    if(b.fi==a.fi)return (a.se>b.se);
    return (b.fi>a.fi);
}
signed main()
{
    fastio;
    R(n);R(k);
    RA(a,n);
    sort(a+1,a+n+1);
    int su=0;
    frr(i,n,1)
    {
        if(k>=1)k-=1;
        else
            su+=a[i];
    }
    cout<<su<<endl;
}


Measured memory_bytes: 1792
package main

import (
   "fmt"
)

func solution(n int, h []int) string {
   for i := n - 1; i > 0; i-- {
        if h[i] >= h[i-1] {
                continue
        }
        h[i-1]--
        if h[i] < h[i-1] {
                return "No"
        }
   }
   return "Yes"
}

func main() {
   var n int
   fmt.Scan(&n)
   h := make([]int, n)
   for i := range h {
        fmt.Scan(&h[i])
   }
   fmt.Println(solution(n, h))
}

Measured memory_bytes: 6308
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}

int main(){
   string s,t;
   cin >> s >> t;
   bool j=true;
   for(int i=0;i<s.length();i++){
      if(s[i]!=t[i]){
         j=false;
         break;
      }
   }
   if(j&&s.length()+1==t.length())cout << "Yes"<<endl;
   else cout << "No" << endl;
   
   return 0;
}


Measured memory_bytes: 3592
#include <cstdio>
#include <algorithm>
using namespace std;
struct node{
	int no, v;
};
node a[200005];
int ans[200005];
bool cmp(node a, node b){
	return a.v < b.v;
}
int main(){
	int i, n;
	scanf("%d", &n);
	for(i=1; i<=n; i++){
		scanf("%d", &a[i].v);
		a[i].no=i;
	}
	sort(a+1, a+1+n, cmp);
	for(i=1; i<=n; i++){
		if(i<=n>>1)
			ans[a[i].no]=a[(n>>1)+1].v;
		else
			ans[a[i].no]=a[(n>>1)].v;
	}
	for(i=1; i<=n; i++)
		printf("%d\n", ans[i]);
	return 0;
}

Measured memory_bytes: 4480
n, m = map(int, input().split())
a = [[] for i in range(n)]
b = []

for i in range(n):
    a[i] = list(map(int, input().split()))

for i in range(m):
    b.append(list(map(int, input().split())))

for i in range(n):
    c = 0
    for j in range(m):
        c += a[i][j] * b[j][0]
    print(c)
        




Measured memory_bytes: 6032
n,k=map(int,input().split())
a=[int(j) for j in input().split()]
ans=10**100

for i in range(1<<(n-1)):
    p,q,tmp=1,0,a[0]
    for j in range(n-1):
        if tmp<a[j+1]:
            p+=1
            tmp=a[j+1]
            continue
        if i&(1<<j):
            q+=tmp-a[j+1]+1
            p+=1
            tmp+=1
    if p>=k:
        if ans>q:
            ans=q

print(ans)



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


int main(){
    int N; cin >> N;
    string S; cin >> S;
    int ans = 1;
    for (int i = 0; i < N-1; i++)
    {
        if(S[i+1] != S[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;
#define PI 3.14159265359
#define tMOD 998244353
#define mkpr(x,y) make_pair(x,y)


int main(){
    ll vec[5];
    ll ans=0;
    for(ll i=0;i<5;i++){
        ll t;
        cin>>t;
        if(t==0){
            ans =i;
            break;
        }
    }
    cout<<ans+1<<endl;

}









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

const char wall = '#';
vector<vector<char>> fields;
vector<vector<bool>> used;
vector<vector<ll>> dist;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};

ll N;
vector<ll> A;
// vectorのリサイズ
// A.resize(N);

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

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

  ll n;
  cin >> n;
  set<ll> s;
  rep(i, n) {
    ll a;
    cin >> a;
    s.insert(a);
  }
  if (n == s.size()) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 9600
#include<stdio.h>
int main(void)
{
    float a,c;
	int b[8],i;
	for(i=0;i<8;i++) b[i]=0;
	while((scanf("%f %f",&a,&c))!=EOF){
		if(a>=1.1) b[0]=b[0]+1;
		else if(a>=0.6) b[1]=b[1]+1;
		else if(a>=0.2) b[2]=b[2]+1;
		else if(a<0.2) b[3]=b[3]+1;
		if(c>=1.1) b[4]=b[4]+1;
		else if(c>=0.6) b[5]=b[5]+1;
		else if(c>=0.2) b[6]=b[6]+1;
		else if(c<0.2) b[7]=b[7]+1;
	}
	for(i=0;i<4;i++){
	    printf("%d %d\n",b[i],b[i+4]);
	}
	return 0;
}

Measured memory_bytes: 2684
/*https://atcoder.jp/contests/abc125/tasks/abc125_a*/

import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int v[] = new int[n];
        for (int i = 0; i < n; ++i){
            v[i] = in.nextInt();
        }
        int c[] = new int[n];
        for (int i = 0; i < n; ++i){
            c[i] = in.nextInt();
        }

        int diff, max_diff = 0;

        // 宝石ごとに価値-コストが正か調べる
        for (int i = 0; i < n; ++i){
            if ((diff = v[i]-c[i]) > 0){
                max_diff += diff;
            }
        }
        System.out.println(max_diff);
    }
}


Measured memory_bytes: 21716
#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use proconio::{input, marker::*};
use superslice::*;
use num::integer::*;
fn main() {
    input! {
        k: usize
    }
    let mut sum = 0;
    for a in 1..=k {
        for b in 1..=k {
            for c in 1..=k {
                let g = gcd(b, c);
                let g = gcd(g, a);
                sum += g;
            }
        }
    }
    println!("{}", sum);
}


Measured memory_bytes: 2172
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for(int i=0; i<(a); i++)
typedef long long ll;

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template<typename Head> void dump(Head&& head) { cerr << head; dump(); }
template<typename Head, typename... Tail> void dump(Head&& head, Tail&&... tail) { cerr << head << ", "; dump(forward<Tail>(tail)...); }
#define debug(...) do {cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; dump(__VA_ARGS__); } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

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

const ll inf = 1LL<<60;

int main()
{
  ll n;
  cin >> n;
  ll x;
  cin >> x;
  ll t;
  cin >> t;

  cout << (n+x-1)/x * t << endl;

  return 0;
}


Measured memory_bytes: 3608
# coding: utf-8
# Your code here!
from collections import Counter

n = int(input())
v = [int(s) for s in input().split()]

even = v[::2]
odd = v[1::2]

even_c = Counter(even)
odd_c = Counter(odd)
even_list = even_c.most_common()
odd_list = odd_c.most_common()

if even_list[0][0] != odd_list[0][0]:
    print(n - even_list[0][1] - odd_list[0][1])
else:
    if len(even_list) > 1 and len(odd_list) > 1:
        print(min(n - even_list[0][1] - odd_list[1][1], n - even_list[1][1] - odd_list[0][1]))
    elif len(even_list) == 1 and len(odd_list) == 1:
        print(int(n / 2))
    elif len(even_list) == 1:
        print(n - even_list[0][1] - odd_list[1][1])
    else:
        print(n - even_list[1][1] - odd_list[0][1])
        
        

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

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

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

ll N;

signed main()
{
    cin >> N;
    ll cur_max = 0;
    ll ans = 0;
    REP(i, N) {
        ll h;
        cin >> h;
        if(cur_max <= h) {
            cur_max = h;
            ans++;
        }
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 256
nk = input().split()
n = int(nk[0])
k = int(nk[1])

su = [0] * n
d = []


for i in range(k):
	d.append(int(input()))
	a = input().split()
	for j in a:
		su[int(j)-1] = 1

cnt = 0
# print(su)

for i in su:
	if int(i) == 0:
		cnt += 1

print(cnt)



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

    long long a,b,c,d,sumw=0,sume=0;
    string sr;
    vector<long long>ww;
    vector<long long>ee;
    vector<long long>vc;
    cin>>a;
    getchar();
    cin>>sr;
    for(long long i=0; i<sr.size(); i++)
    {
        if(sr[i]=='W')
        {
            sumw++;
        }
        else
        {
            sume++;
        }
        ww.push_back(sumw);
        ee.push_back(sume);
    }

    for(long long i=0; i<sr.size(); i++)
    {

        long long summer=0;
        if(i>0)
            summer=summer+ww[i-1];
        summer=summer+sume-ee[i];


        vc.push_back(summer);
       // cout<<summer<<endl;

    }




    sort(vc.begin(),vc.end());
    cout<<vc[0];



}


Measured memory_bytes: 15720