akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>

#define ARRAY_MAX 50

#define COUNT_RESET 0

#define RETURN 0

#define ARRAY_END -1

#define TEST_ABSENT -1

#define BORDER_A 80

#define BORDER_B 65

#define BORDER_C 50

#define BORDER_D 30

/* テスト結果構造体の定義 */

struct test_result{

    signed short ssW_D_mid;      /* 中間試験結果用変数 */

    signed short ssW_D_fin;      /* 期末試験結果用変数 */

    signed short ssW_D_re;       /* 再試験結果用変数 */

    unsigned char ubW_D_eval;    /* 評定用変数 */

};

/* 関数の宣言 */

unsigned char s_EVALUATE(struct test_result test);

int main(){

    struct test_result test[ARRAY_MAX];          /* 構造体の宣言 */

    unsigned short usW_C_i;                      /* ループ変数 */

    unsigned short usW_C_count = COUNT_RESET;    /* 受験者カウンタ */

        /* 試験結果の入力 */

    for(usW_C_i = COUNT_RESET;usW_C_i < ARRAY_MAX;usW_C_i++){

            /* 各個人の結果の入力 */

        scanf("%d %d %d", &test[usW_C_i].ssW_D_mid, &test[usW_C_i].ssW_D_fin, &test[usW_C_i].ssW_D_re);

            /* 入力終了時の処理 */

        if(test[usW_C_i].ssW_D_mid == ARRAY_END && test[usW_C_i].ssW_D_fin == ARRAY_END && test[usW_C_i].ssW_D_re == ARRAY_END){

            break;

        }

            /* 評定を代入 */

        test[usW_C_i].ubW_D_eval = s_EVALUATE(test[usW_C_i]);

            /* カウンタをインクリメント */

        usW_C_count++;

    }

        /* 評定の出力 */

    for(usW_C_i = COUNT_RESET;usW_C_i < usW_C_count;usW_C_i++){

            /* 各個人の評定の出力 */

        printf("%c\n", test[usW_C_i].ubW_D_eval);

    }

    return RETURN;

}

/* 関数名：評定計算 */

/* 概要：成績から評定を求める */

/* 引数：test_result型のテスト結果構造体 */

/* 戻り値：評定 */

unsigned char s_EVALUATE(struct test_result test){

    signed short ssW_D_sum;        /* 中間期末合計点計算用の変数 */

    unsigned char ubW_D_result;    /* 評定用の変数 */

        /* 中間期末の合計点の計算 */

    ssW_D_sum = test.ssW_D_mid + test.ssW_D_fin;

        /* 評定の計算 */

    if(test.ssW_D_mid == TEST_ABSENT || test.ssW_D_fin == TEST_ABSENT){

            /* 評定をＦに */

        ubW_D_result = 'F';

    }

    else if(ssW_D_sum >= BORDER_A){

            /* 評定をＡに */

        ubW_D_result = 'A';

    }

    else if(ssW_D_sum >= BORDER_B){

            /* 評定をＢに */

        ubW_D_result = 'B';

    }

    else if(ssW_D_sum >= BORDER_C){

            /* 評定をＣに */

        ubW_D_result = 'C';

    }

    else if(ssW_D_sum >= BORDER_D){

            /* 再試験の処理 */

        if(test.ssW_D_re >= BORDER_C){

            /* 評定をＣに */

            ubW_D_result = 'C';

        }

        else{

                /* 評定をＤに */

            ubW_D_result = 'D';

        }

    }

    else{

            /* 評定をＦに */

        ubW_D_result = 'F';

    }

        /* 評定を返す */

    return ubW_D_result;

}


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

using namespace std;

int main()
{
    int n, a, min=1000001,max=-1000001;
    long long sum=0LL;
    scanf("%d", &n);
    for(int i=0;i<n;i++)
    {
        cin>>a;
        if(a<min) min=a;
        if(a>max) max=a;
        sum+=a;
    }
    printf("%d %d %lld\n", min, max, sum);
}


Measured memory_bytes: 3232
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int i = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int i = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define MP make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int MOD = 1e9 + 7;

int main() {
    ll N, M;
    cin >> N >> M;
    vector<ll> A(N);
    rep(i, N) { cin >> A[i]; }
    sort(All(A));
    vector<ll> R = A;
    reverse(All(R));
    vector<ll> sum(N + 1);
    rep(i, N) sum[i + 1] = R[i] + sum[i];
    ll lb = 0, ub = A[N - 1] + A[N - 1] + 1;

    while(ub - lb > 1) {
        ll mid = (ub + lb) / 2;
        ll s = 0;
        rep(i, N) {
            ll r = A[i];
            ll num = A.end() - lower_bound(All(A), mid - r);
            s += num;
        }
        if(s > M) {
            lb = mid;
        } else {
            ub = mid;
        }
    }
    ll res = 0;
    ll cnt = 0;
    rep(i, N) {
        ll r = A[i];
        ll num = A.end() - lower_bound(All(A), ub - r);
        res += A[i] * num + sum[num];
        cnt += num;
    }
    res += lb * (M - cnt);
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,K;
  cin >> N >> K;
  vector<int> A(N);
  for (int i=0; i<N; i++) {
    int n; cin >> n; A.at(n-1)++;
  }
  
  sort(A.begin(), A.end());
  
  int i = 0,res = 0;
  while( A.size() > K){
    res += A.at(i);
    i++; K++;
  }

  cout << res << endl;
  
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
void print(vector<vector<long long int>> &dp)
{
    for(long long int i=0;i<dp.size();i++)
    {
        for(long long int j=0;j<dp[0].size();j++)
        {
            cout<<dp[i][j]<<"   ";
        }
        cout<<endl;
    }
    
}
bool comp(pair<long long int,long long int> A,pair<long long int,long long int> B)
{
    return A.first<B.first;
}
int main() 
{
	long long int n,target;cin>>n>>target;
	vector<pair<long long int,long long int>> w;
	for(int i=0;i<n;i++)
	{
	    long long int a,b;cin>>a>>b;
	    w.push_back(make_pair(a,b));
	}
	sort(w.begin(),w.end(),comp);
	vector<vector<long long int>> dp(n+1,vector<long long int>(target+1,0));
	for(long long int i=1;i<=n;i++)
	{
	    for(long long int j=1;j<=target;j++)
	    {
	        //cout<<w[i-1].first<<" "<<j<<endl;
	        if(w[i-1].first>j)
	        {
	            dp[i][j]=dp[i-1][j];
	        }
	        else
	        {
	            dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i-1].first]+w[i-1].second);
	        }
	    }
	}
	//print(dp);
	cout<<dp[n][target];
}

Measured memory_bytes: 80256
#include<stdio.h>

int main()
{
	int a, b, c, sum;

	scanf("%d %d %d", &a, &b, &c);
	
	if (a < b) {
		if (b < c) {
			sum = a + b;
		}
		else {
			sum = a + c;
		}
	}
	else {
		if (a < c) {
			sum = a + b;
		}
		else {
			sum = b + c;
		}
	}

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

	return 0;

}

Measured memory_bytes: 128
#include <stdio.h>

int main(void){
        int a, b;
        printf("");
        scanf("%d %d", &a, &b);
        if(a,b>=1 && a,b<=100)
                printf("%d %d\n", a*b, (a+b)*2);
        else
                printf("\n");
        return 0;
}


Measured memory_bytes: 2076
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        long[] inpt = Reader.ReadLine().Split(' ').Select(a => long.Parse(a)).ToArray();
        this.ItemCount = (int)inpt[0];
        this.MaxWeight = inpt[1];
        for (int i = 0; i < ItemCount; i++)
        {
            this.Items.Add(new Item(Reader.ReadLine()));
        }
        this.Items = this.Items.OrderBy(a => a.Weight).ToList();
        long ans = GetAns(0, 0);
        Console.WriteLine(ans);
    }

    private Dictionary<int, Dictionary<long, long>> dic = new Dictionary<int, Dictionary<long, long>>();
    private long GetAns(int idx, long subTotalWeight)
    {
        if (!dic.ContainsKey(idx))
        {
            dic.Add(idx, new Dictionary<long, long>());
        }
        if (dic[idx].ContainsKey(subTotalWeight))
        {
            return dic[idx][subTotalWeight];
        }
        if (idx >= this.ItemCount)
        {
            return 0;
        }
        if (this.Items[idx].Weight > MaxWeight - subTotalWeight)
        {
            return 0;
        }
        long ans = GetAns(idx + 1, subTotalWeight + this.Items[idx].Weight) + this.Items[idx].Value;
        ans = Math.Max(ans, GetAns(idx + 1, subTotalWeight));
        dic[idx][subTotalWeight] = ans;
        return ans;
    }

    long MaxWeight;
    int ItemCount;


    private List<Item> Items = new List<Item>();
    class Item
    {
        public long Value;
        public long Weight;

        public Item(string init)
        {
            long[] tmp = init.Split(' ').Select(a => long.Parse(a)).ToArray();
            this.Weight = tmp[0];
            this.Value = tmp[1];
        }
    }

    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"



4 6
2 1
3 4
4 10
3 4

";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}

Measured memory_bytes: 15968
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define y_n(ans) cout<<(ans?"Yes":"No")<<endl;

int main() {
    double a, b, h, m;
    cin >> a >> b >> h >> m;
    double ap, bp;
    ap = 30.0 * h + 0.5 * m;
    bp = 6.0 * m;
    double distt = abs(ap - bp);
    if (distt > 180) distt = 360.0 - distt;
    double pi = acos(-1);
    double distr = (pi / 180.0) * distt;
    double ans = sqrt(a*a + b*b - 2*a*b*cos(distr));
    printf("%.15lf\n", ans);
}

Measured memory_bytes: 4256
import sys
sys.setrecursionlimit(10000)
d={}
d["a"]=list(input())
d["b"]=list(input())
d["c"]=list(input())
def f(x):
 if len(d[x])==0:
    return x
 y=d[x][0]
 d[x].pop(0)
 
 return f(y)
print(f("a").upper())

Measured memory_bytes: 38640
#include<bits/stdc++.h>
#define ll long long
using namespace std;
/*
int vistd[10004];
vector<int>a[10004];
vector<int>dis(10004,0);
void dfs(int k){
   if(vistd[k]==0){
    vistd[k]=1;
    for(int i=0;i<a[k].size();i++){
        if(!vistd[a[k][i]]){
/// to find the distance between each node and their children dis[a[k][i]]=dis[k]+1;
            dfs(a[k][i]);
        }
    }
   }

}
int freq[2004];
*/
int main()
{
int n,ans=0;
cin>>n;
int a[n+1];
for(int i=1;i<=n;i++){
    cin>>a[i];
    if(i%2!=0 && a[i]%2!=0)ans++;
}
cout << ans << endl;


}


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

using namespace std;
typedef long long lint;
 
int main(void)
{
    lint x, y, z, k;
    cin >> x >> y >> z >> k;
    vector<lint> a(x);
    vector<lint> b(y);
    vector<lint> c(z);

    for(int i = 0; i < x; i++){
        cin >> a[i];
    }
    for(int i = 0; i < y; i++){
        cin >> b[i];
    }
    for(int i = 0; i < z; i++){
        cin >> c[i];
    }
    vector<lint> xy(x*y);
    for(int i = 0; i < x; i++){
        for(int j = 0; j < y; j++){
            xy[i*y+j] = a[i] + b[j];
        }
    }
    sort(xy.begin(), xy.end(), greater<lint>());
    sort(c.begin(), c.end(), greater<lint>());
    lint k2 = min(x*y, k);
    vector<lint> xyz(k2*z);
    for(int i = 0; i < k2; i++){
        for(int j = 0; j < z; j++){
            xyz[i*z+j] = xy[i] + c[j];
            //cout << i*z+j << endl;
        }
    }
    sort(xyz.begin(), xyz.end(), greater<lint>());
    for(int i = 0; i < k; i++){
        cout << xyz[i] << endl;
    }
}

Measured memory_bytes: 31616
#include <bits/stdc++.h>
using namespace std;
constexpr char nl = '\n';
auto yesno(bool b) { return b ? "Yes" : "No"; }

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    string S;
    cin >> S;
    int n = 0;
    int nb = 0;
    for (char c : S) {
        bool b = false;
        if (c == 'a') {
            if (n < A + B) { b = true; n++; }
        } else if (c == 'b') {
            if (n < A + B && nb < B) { b = true; n++; nb++; }
        }
        cout << yesno(b) << nl;
    }
}


Measured memory_bytes: 896
#include<cstdio>
const int MAXN = 1000000;
typedef long long ll;
ll gcd(ll x, ll y) {
	return y == 0 ? x : gcd(y, x % y);
}
int main() {
	ll A, B; scanf("%lld%lld", &A, &B);
	ll C = gcd(A, B);
	int ans = 0;
	for(int i=2;i<=MAXN;i++) {
		if( C % i == 0 ) {
			ans++;
			while( C % i == 0 )
				C /= i;
		}
	}
	printf("%d\n", ans + (C != 1) + 1);
}

Measured memory_bytes: 128
fun main(args : Array<String>) {
  val (h, w) = readLine()!!.split(" ").map { it.toInt() }
  val dp = Array(h) { IntArray(w) { 0 } }.apply { get(0)[0] = 1 }
  (0 until h).forEach { x ->
    readLine()!!.forEachIndexed { y, s -> if (s == '#') dp[x][y] = -1 }
  }
  set(dp, 0, 0)
  print(if (dp[h - 1][w - 1] == 0) -1 else h * w - dp[h - 1][w - 1] - dp.map { it.count { it == -1 } }.sum())
}
fun set(dp: Array<IntArray>, x: Int, y: Int) {
  if (y > 0 && dp[x][y - 1] != -1 && (dp[x][y - 1] == 0 || dp[x][y - 1] > dp[x][y] + 1)) {
    dp[x][y - 1] = dp[x][y] + 1
    set(dp, x, y - 1)
  }
  if (x > 0 && dp[x - 1][y] != -1 && (dp[x - 1][y] == 0 || dp[x - 1][y] > dp[x][y] + 1)) {
    dp[x - 1][y] = dp[x][y] + 1
    set(dp, x - 1, y)
  }
  if (x < dp.size - 1 && dp[x + 1][y] != -1 && (dp[x + 1][y] == 0 || dp[x + 1][y] > dp[x][y] + 1)) {
    dp[x + 1][y] = dp[x][y] + 1
    set(dp, x + 1, y)
  }
  if (y < dp[0].size - 1 && dp[x][y + 1] != -1 && (dp[x][y + 1] == 0 || dp[x][y + 1] > dp[x][y] + 1)) {
    dp[x][y + 1] = dp[x][y] + 1
    set(dp, x, y + 1)
  }
}

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

int main(void) {
  int H, W, N;
  cin >> H >> W >> N;
  vector<int> a;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    for (int j = 0; j < tmp; j++) {
      a.push_back(i + 1);
    }
  }

  vector<vector<int>> ans(H, vector<int>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      int index = (i % 2 == 0 ? j : W - 1 - j);
      ans[i][index] = a[i * W + j];
    }
  }

  for (int i = 0; i < H; i++) {
    cout << ans[i][0];
    for (int j = 1; j < W; j++) {
      cout << " " << ans[i][j];
    }
    cout << endl;
  }
  return 0;
}

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

// clang-format off
#define forn(i, x, y) for(int i = x; i < y; i++)
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(NULL)
// clang-format on

const long long MOD = 1000000007;

using LL = long long;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VVLL = vector<VLL>;
using VVVLL = vector<VVLL>;

void add(LL &a, LL b)
{
  a += b;
  if (a >= MOD)
    a -= MOD;
}

int main()
{
  IOS;

  string K;
  cin >> K;
  int D;
  cin >> D;

  int n = K.size();
  VVVLL dp(10001, VVLL(2, VLL(100)));
  dp[0][0][0] = 1;

  forn(i, 0, n) forn(s, 0, 2) forn(d, 0, D)
  {
    for (int x = 0; x <= (s ? 9 : K[i] - '0'); x++)
      add(dp[i + 1][s || x < K[i] - '0'][(d + x) % D], dp[i][s][d]);
  }
  LL res = dp[n][0][0] + dp[n][1][0] - 1;
  if (res < 0)
    res += MOD;
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 20196
#include<bits/stdc++.h>
#define pi acos(-1)
#define mx 1e9
typedef long long ll;
using namespace std;
int main()
{
    ll h1,h2,m1,m2,k,s;
    cin>>h1>>m1>>h2>>m2>>k;
     if(m1>m2){
        m2=m2+60;
        h2=h2-1;
     }
      s=(h2-h1)*60+(m2-m1);
          cout<<s-k<<endl;

 return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
inline long long mod(long long n,long long m){return(n%m+m)%m;}
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    int n,k; cin>>n>>k;
    string s; cin>>s;
    vector<int> v; v.push_back(0);
    int cnt=1;
    for(int i=1;i<n;i++){
        if(s[i-1]!=s[i]){
            v.push_back(cnt);
            cnt=0;
        }
        cnt++;
    }
    v.push_back(cnt);
    n=v.size();
    for(int i=1;i<n;i++){
        v[i]+=v[i-1];
    }
    int ans=0;
    if(s[0]=='0'){
        for(int i=1;i<n;i++){
            if(i%2==1){
                ans=max(ans,v[i]-v[max(0,i-(2*k))]);
            }else{
                ans=max(ans,v[i]-v[max(0,i-(2*k+1))]);
            }
        }
    }else{
        for(int i=1;i<n;i++){
            if(i%2==1){
                ans=max(ans,v[i]-v[max(0,i-(2*k+1))]);
            }else{
                ans=max(ans,v[i]-v[max(0,i-(2*k))]);
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1020
N = int(input())
List = [list(map(int,input().split())) for x in range(N)]
List2 = []
for n in range(N):
  if n == 0:
    List2.append(List[0])
  else:
    a = List[n][0] + max(List2[n-1][1],List2[n-1][2])
    b = List[n][1] + max(List2[n-1][0],List2[n-1][2])
    c = List[n][2] + max(List2[n-1][0],List2[n-1][1])
    List2.append([a,b,c])

print(max(List2[-1]))
    

Measured memory_bytes: 47380
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
k=abs(a[-1]-a[0])
b=[]
for i in range(m-1):
  b.append(abs(a[i+1]-a[i]))
b.sort()
if n==1:
  print(k)
else:
  print(k-sum(b[-n+1:]))

Measured memory_bytes: 20464
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; 
	for(auto v:V)os << v << " "; return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; 
	for(auto s:S) os<<s<<" ";  return os<<"}"; 
}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
	return os<<"("<<P.first<<","<< P.second << ")";
}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {
	os<<"{ ";for(auto m:M)os<<"("<<m.F<<":"<<m.S<<")";
	return os<<"}";
}
#define cerr cout
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define For(i,n) for(int i=0;i<(int)n;++i)
#define Rev(i,n) for(int i=(int)n-1;i>=0;--i)
#define Rep(i,n) for(int i=1;i<=(int)n;++i)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpii;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

const int N = 100;
pair<string,string> A[N];

int main(){
	fio; cout<<fixed<<setprecision(25);	
	int n; cin >> n;

	int ans = 0;
	for(int i = 0;i < n; ++i){
		cin >> A[i].F >> A[i].S;
	}
	string x; cin >> x;
	int i = 0;
	for( ;i < n; ++i){
		if(A[i].F == x){
			++i;
			break;
		}
	}
	for( ;i < n; ++i)
		ans += stoi(A[i].S);
	cout << ans << endl;









	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int n = sc.nextInt();
			int p = sc.nextInt();
			int r = sc.nextInt();
			if(n==0 && p==0 && r==0) break;
			
			int[] s = new int[n];
			int[] t = new int[n];
			int[][] map = new int[n][p];
			int a, b, c;
			String d;
			for(int i=0;i<r;i++){
				a = sc.nextInt()-1;
				b = sc.nextInt()-1;
				c = sc.nextInt();
				d = sc.next();
				
				if(d.compareTo("WRONG")==0) map[a][b]++;
				else{
					t[a] += map[a][b]*1200 + c;
					s[a]++;
				}
			}
			
			int f;
			PriorityQueue<Integer> que = new PriorityQueue<Integer>();
			for(int i=p;i>=0;i--){
				for(int j=0;j<n;j++){
					if(s[j]==i && que.contains(t[j])==false) que.add(t[j]);
				}
				while(que.size()!=0){
					f = que.poll();
					for(int j=0;j<n;j++){
						if(s[j]==i && t[j]==f) System.out.println((j+1) + " " + i + " " + t[j]);
					}
				}
				que.clear();
			}
		}	
	}	
}

Measured memory_bytes: 63680
#include<iostream>
using namespace std;
#include<bits/stdc++.h>
#include<string.h>
#include <vector>
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
const int  nax  = 1e5 + 5;


int dist[nax];
vector<vector<int> > al(nax);
bool vis[nax];
int indegree[nax];



void dfs(int root){
	vis[root] = true;
	for(int x: al[root]){
		dist[x] = max(dist[x],dist[root]+1);
		indegree[x]--;
		if(indegree[x]==0) dfs(x);
	}

}

int main(){
	int n,m;
	cin >> n >> m;
	int x,y;
	while(m--){
		cin >> x >> y;
		al[x].pb(y);
		++indegree[y];
	}

	for(int i=1;i<=n ; ++i){
		if(!vis[i] && indegree[i]==0 ) dfs(i);
	}

	int ans = 0;

	for(int i=1 ; i <=n ; ++i){
		ans = max(ans,dist[i]);
	}
	cout << ans << endl;

}


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

int main(){
	int total;
	int cost;
	int totalCost;

	while(cin >> total, total){
		totalCost = 0;
		for(int i=0; i < 9; i++){
			cin >> cost;
			totalCost += cost;
		}
		total -= totalCost;

		cout << total << endl;
	}
}

Measured memory_bytes: 1160
n=int(input())
m=-1
for i in range(2,10**5):
  if n==i*(i-1)//2:
    m=i
    break
if m==-1:print("No");exit()
print("Yes")
ans=[[]for _ in range(m)]
for i in range(m-1):
  if i==0:x=1
  else:x=ans[0][i]
  for j in range(m-1):
    ans[i].append(x)
    if i<=j:x+=j+1
    else:x+=1
x=1
for j in range(m-1):
  ans[-1].append(x)
  x+=j+2
print(m)
for i in ans:
  print(m-1,end=" ")
  print(*i)

Measured memory_bytes: 12424
#include<stdio.h>
#include<math.h>

long long int gojohou(int A,int B)
{
    if(A==0)
    {
        return B;
    }
    if(B==0)
    {
        return A;
    }
    
    if(A<B)
    {
        return gojohou(A,B%A);
    }
    if(A>B)
    {
        return gojohou(A%B,B);
    }
}

int main()
{
    long long int A;
    scanf("%lld",&A);
    
    long long int B;
    scanf("%lld",&B);
    
    long long int RETURN=A*B/gojohou(A,B);
    
    printf("%lld",RETURN);
    
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
using ll = long long;
using pll = pair<ll, ll>;
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define VREP(s, ite) for (auto ite = s.begin(); ite != s.end(); ++ite)
#define FI first
#define SE second
//#define endl "\n"
#define ciosup  \
    cin.tie(0); \
    ios::sync_with_stdio(false);
#define eb emplace_back
#define vint vector<int>
#define vll vector<ll>
constexpr ll INF = 1e9 + 7;
constexpr ll MOD = 1e9 + 7;

template<typename T>
void vecin(vector<T>& v, int n = 0){
    if (n == 0)
        n = v.size();
    for (int i = 0; i < n; ++i)
    {
        cin >> v[i];
    }
}
template <typename T>
void vecout(vector<T> &v, int n = 0)
{
    if (n == 0)
        n = v.size();
    for (int i = 0; i < n-1; ++i)
    {
        cout << v[i] << " ";
    }
    cout << v[n - 1] << endl;
}
void print(string s){
    cout << s << endl;
}

int main()
{
    ciosup;
    int n;
    cin >> n;
    vint h(n);
    vecin(h);
    priority_queue<int> pque;
    int ans = 0, prev = h[0];
    FOR(i,1,n){
        if (prev < h[i]){
            pque.emplace(ans);
            ans = 0;
        }else{
            ++ans;
        }
        prev = h[i];
    }
    pque.emplace(ans);
    ans = pque.top();
    cout << ans << endl;
}

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

int main(){
   string s;   cin >> s;
   if(s == "Sunny") cout << "Cloudy" << endl;
   if(s == "Cloudy") cout << "Rainy" << endl;
   if(s == "Rainy") cout << "Sunny" << endl;

   
}



Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container, std.range;

void main()
{
    auto nm = readln.split.to!(int[]);
    auto N = nm[0];
    auto M1 = nm[1];
    auto M2 = nm[2];

    int[] as, bs, cs;
    foreach (_; 0..N) {
        auto abc = readln.split.to!(int[]);
        as ~= abc[0];
        bs ~= abc[1];
        cs ~= abc[2];
    }

    auto DP = new int[][][](N+1, 10*N+1, 10*N+1);
    foreach (ref dp1; DP) foreach (ref dp2; dp1) dp2[] = int.max/3;
    DP[0][0][0] = 0;
    foreach (i; 0..N) {
        foreach (j; 0..10*N+1) {
            foreach (k; 0..10*N+1) {
                DP[i+1][j][k] = min(DP[i+1][j][k], DP[i][j][k]);
                auto jj = j + as[i];
                auto kk = k + bs[i];
                if (jj <= 10*N && kk <= 10*N) {
                    DP[i+1][jj][kk] = min(DP[i+1][jj][kk], DP[i][j][k] + cs[i]);
                }
            }
        }
    }
    auto r = int.max/3;
    foreach (j; 1..10*N+1) {
        foreach (k; 1..10*N+1) {
            if (j * M2 == k * M1) {
                r = min(r, DP[N][j][k]);
            }
        }
    }
    writeln(r == int.max/3 ? -1 : r);
}

Measured memory_bytes: 37156
/// You just can't beat the person who never gives up
/// ICPC next year

#include<bits/stdc++.h>
using namespace std ;
const int N = 1e5+5 ;
const long long mx = 1e18 ;

int n ;
long long a[N] ;
int main(){
    cin >> n ;
    for(int i=0;i<n;++i) cin >> a[i] ;
    sort(a,a+n);
    long long cur = 1 ;
    for(int i=0;i<n;++i){
        long long x = a[i] ;
        if(x==0) return cout << 0,0 ;
        if(cur>mx/x) return cout << -1,0 ;
        cur *= x ;
    }
    cout << cur ;
    return 0;
}


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

int main() {
	int i,tmp;
	vector<int> a(10000),b(10000);

	for (i = 0; i < 3000; i++) {
		cin >> a[i] >>b[i];
		if (a[i] == 0 && b[i] == 0)
			break;
	}

	for (i = 0; i < 3000; i++) {
		if (a[i] == 0 && b[i] == 0)
			break;
		if (a[i] > b[i]) {
			tmp = a[i];
			a[i] = b[i];
			b[i] = tmp;
		}
	}

	for (i = 0; i < 3000; i++) {
		if (a[i] == 0 && b[i] == 0)
			break;
		cout << a[i] << " " << b[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 3080
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC044A
{
    class Program
    {
        static void Main(string[] args)
        {
            int N, K, X, Y,A;
            N = int.Parse(Console.ReadLine());
            K = int.Parse(Console.ReadLine());
            X = int.Parse(Console.ReadLine());
            Y = int.Parse(Console.ReadLine());
            if (N <= K) { A = N * X; }
            else { A = K * X + (N - K) * Y; }
            Console.WriteLine(A);
            Console.ReadKey();
        }
    }
}

Measured memory_bytes: 13140
#include<iostream>
#include<utility>
#include<vector>

using namespace std;
#define DBG(x) cerr << #x << ": " << x << endl
// http://genkisugimoto.com/jp/blog/procon/2015/04/15/print-debug-technique-in-cpp.html
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}

template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) { for (int i = 0; i < v.size(); ++i) { s << v[i]; if (i < v.size() - 1) s << "\t"; } return s; }

typedef long long ll;

// UNDONE
int main(){
	int n;
	cin >> n;
	int result = 0;
	vector<int> a(n+1);
	for(int i=1; i<=n; i++){
		cin >> a[i];
		int zibun = i;
		int suki = a[i];
		if(suki > zibun){
			continue;
		}
		else { // 自分の番号より好きな相手の番号のほうが小さい
			if(a[suki] == zibun){
				result++;
			}
		}
	}
	cout << result << endl;

	return 0;
}


Measured memory_bytes: 640
# -*- coding: utf-8 -*-
N = int(input())
A = []
B = []
for _ in range(N):
    a1, b1 = map(int, input().split())
    A.append(a1)
    B.append(b1)
    
ans = 0
for i in range(N)[::-1]:
    if ((A[i] + ans) % B[i]) != 0:
        ans +=  B[i] - ((A[i] + ans) % B[i])
print(ans)    

Measured memory_bytes: 11040
#include <bits/stdc++.h>
using namespace std;
int main () {
	int n;
	string s;
	cin>>n>>s;
	s+="+";
	int i;
	i=0;
	int ans=0;
	while(1){
		ans++;
		for (int j=i;j<=n;j++){
			if (s[i]!=s[j]) {
				i=j;
				break;
			}
		}
		if (i==n){
			cout<<ans<<endl;
			return 0;
		}
	}
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
ll findGCD(ll i,ll j,ll m)
{
    ll arr[5];
    arr[0]=i;
    arr[1]=j;
    arr[2]=m;
    ll result = arr[0];
    for (ll i = 1; i < 3; i++)
        result = gcd(arr[i], result);
    return result;
}
int main()
{
    ll k,i;
    cin>>k;
    ll j,m;
    ll sum=0;
    for(i=1; i<=k; i++)
    {
        for(j=1; j<=k; j++)
        {
            for(m=1; m<=k; m++)
            {
                ll x= findGCD(i,j,m);
                sum+=x;
            }
        }
    }
    cout<<sum<<endl;

    return 0;
}



Measured memory_bytes: 3620
#include <iostream>

using namespace std;

int main(void) {
  char x, y;
  cin >> x >> y;
  if (x == y) {
    cout << '=';
  }
  else if (x < y) {
    cout << '<';
  }
  else {
    cout << '>';
  }
  cout << endl;
  return 0;
}

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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

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

  int c[3][3];
  rep(i, 3) rep(j, 3) cin >> c[i][j];

  rep(a0, 101) {
    int b[3];
    rep(i, 3) {
      b[i] = c[0][i]-a0;
    }
    int a[3];
    rep(i, 3) {
      a[i] = c[i][0]-b[0];
    }
    rep(i, 3) rep(j, 3) {
      if(c[i][j] != a[i]+b[j]) {
	cout << "No" << endl;
	return 0;
      }
    }
  }
  cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.math.*;
class Main{
	public static void main(String args[]){
		Scanner s=new Scanner(System.in);
		int a=s.nextInt();
		for(int i=0;i<a;i++){
			BigInteger b=s.nextBigInteger();
			BigInteger c=s.nextBigInteger();
			BigInteger d=b.add(c);
			if(d.compareTo(new BigInteger("99999999999999999999999999999999999999999999999999999999999999999999999999999999"))==1)System.out.println("overflow");
			else System.out.println(d.toString());
		}
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
#define fir first
#define sec second
#define pb 	push_back
#define ll  long long
//#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int>
#define debug(x) cerr<<#x<<" =: "<<x<<endl;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define Find find_by_order
#define Order order_of_key
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937 mrand(random_device{}());
ll rnd(ll x) { return mrand() % x;}
ll ksm(ll a,ll b,ll mod){ll ans=1;a%=mod;while(b){if(b&1) ans=ans*a%mod;b>>=1;a=a*a%mod;}return ans;}
ll phi(ll n){ll ans=n;for(ll i=2;i*i<=n;i++){if(n%i==0) {while(n%i==0) n/=i;ans=ans*(i-1)/i;}}if(n>1) ans=ans*(n-1)/n;return ans;}
//head

const int maxn=2e3+7;
const ll mod=1e9+7;

//string ss[maxn];


int a[10000008];

int cnt[10000008];

ll solve(ll T){
	int n;cin>>n;
	for(int i=1;i<=n;i++) for(int j=i;j<=n;j+=i) cnt[j]++;
	ll ans=0;
	for(int i=1;i<=n;i++) ans+=1ll*cnt[i]*i;
	cout<<ans<<endl;
	return 0;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll T=1;
//    cin>>T;
    for(ll cas=1; cas<=T; cas++) {
        solve(T);
    }
	return 0;
}


Measured memory_bytes: 42688
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

long P = 10^^9+7;

long pow(long x, long n) {
    long y = 1;
    while (n) {
        if (n%2 == 1) y = (y * x) % P;
        x = x^^2 % P;
        n /= 2;
    }
    return y;
}


void main()
{
    auto nm = readln.split.to!(long[]);
    writeln(pow(nm[0], nm[1]));
}


Measured memory_bytes: 2488
import java.util.Scanner;

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

		int n = Integer.parseInt(sc.next());

		Long[] step = new Long[n];
		int max = 0;
		int count = 0;

		for (int i = 0; i < n; i++) {
			step[i] = Long.parseLong(sc.next());
		}

		for (int i = 0; i < n - 1; i++) {
			if (step[i] >= step[i + 1]) {
				count++;
				if (count > max) {
					max = count;
				}
			} else {
				if (count > max) {
					max = count;
				}
				count = 0;
			}
		}

		System.out.println(max);

	}
}

Measured memory_bytes: 48308
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
  int n;
  cin>>n;
  vector<int> data(n);
  for(int i=0;i<n;i++)cin>>data[i];
  int cnt=0;
  ll mini=1LL<<60;
  for(int i=0;i<n;i++){
    if(mini>=data[i]){
      cnt++;
      mini=data[i];
    }
  }
  cout<<cnt<<endl;
}

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

int n;
vector < int > G[105];
int st[105] = {};
int et[105];
int t = 1;

void dfs(int v)
{
    if ( st[v] != 0 ) return;
    st[v] = t;
    t++;
    for ( auto &x : G[v] ) {
        dfs(x);
    }
    et[v] = t;
    t++;
}

int main()
{
    cin >> n;
    for ( int i = 0; i < n; i++ ) {
        int u, k;
        cin >> u >> k;
        for ( int j = 0; j < k; j++ ) {
            int v;
            cin >> v;
            G[u].push_back(v);
        }
        sort(begin(G[u]), end(G[u]));
    }

    for ( int i = 1; i <= n; i++ ) dfs(i);
    
    for ( int i = 1; i <= n; i++ ) {
        cout << i << " " << st[i] << " " << et[i] << endl;
    }

    return (0);
}



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

typedef long long ll;

ll x;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> x;
    ll a = 100;

    int res = 0;
    while (a < x) {
        a += a / 100;
        ++res;
    }
    cout << res << endl;

    return 0;
}



Measured memory_bytes: 3656
/*-----------------------------------
                -----------MEHEDI HASAN--------------
                -----CSE,JAHANGIRNAGAR UNIVERSITY----
                -----------------------------------*/
//--------------------------------------------------------------------//
#include<bits/stdc++.h>
#include <cassert>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
//--------------------------------------------------------------------//
#define FAST        ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
#define cc(x)       cout<<#x<<"="<<x<<" ";
#define ccc(x)      cout<<x<<" ";
#define ccp(x)      cout<<#x<<"="<<"("<<x.ff<<" "<<x.ss<<") ";
#define CC(x)       for(auto xx: x) cout<<xx<<" ";
#define CCp(x)      for(auto xx: x) cout<<"("<<xx.ff<<" "<<xx.ss<<") ";
#define ee          cout<<"\n";
#define OK          cout<<"Ok"<<"\n";
//--------------------------------------------------------------------//
#define ff          first
#define ss          second
#define ll          long long
#define ull         unsigned long long
#define pii         pair<int,int>
#define mp          make_pair
#define ps          push
#define psb         push_back
#define psf         push_front
#define pp          pop
#define ppb         pop_back
#define ppf         pop_front
#define all(x)      x.begin(),x.end()
#define TESTS       int t;cin>>t;for(int tcase=1;tcase<=t;tcase++)
#define ordered_set tree< int, null_type, less_equal< int >, rb_tree_tag, tree_order_statistics_node_update>
//--------------------------------------------------------------------//
#define MAX (int)(3e6)
#define MOD (ll)(1e9+7)


int main()
{
    FAST
    string s;
    cin>>s;
    if(s.size()==6 and s[2]==s[3] and s[4]==s[5] ) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;





    return 0;
}
//--------------------------------------------------------------------//
/*
>Check Corner Cases (n==1 or T==1)
>Overflow issues?
>LB / UB !!not found!! check?
*/
//--------------------------------------------------------------------//
/* ---INPUT---
--------(1)------
2
1 2 4

-------(2)-------


-------(3)-------
4
1 2 2
1 3 4
3 4 5

-------(4)-------



--------------
*/
//--------------------------------------------------------------------//


Measured memory_bytes: 256
PROGRAM ATCODER

implicit none
integer :: n, m, i, j, a, ans
integer,allocatable :: x(:), dx(:),dx1(:),bar(:)

read(*,*) n, m
allocate(x(m))
allocate(dx(m-1))
allocate(dx1(m-1))
allocate(bar(n-1))
read(*,*) (x(i), i=1,m)

if(n >= m) then
	ans = 0
	write(*,'(i0)') ans
    stop
end if

call hs(m,x) !昇順に並び替え

do i =1, m-1
	dx(i) = x(i+1) - x(i)
end do

call hs(m-1,dx)

ans = sum(dx)

if (n > 1) then
	ans = ans - sum(dx(m-n+1:m-1))
end if

write(*,'(i0)') ans

END PROGRAM ATCODER


subroutine hs(n,array)
  implicit none
  integer,intent(in) :: n
  integer,intent(inout) :: array(1:n)
  
  integer ::i,k,j,l
  integer :: t
  
  if(n <= 0)then
     write(6,*)"Error, at heapsort"; stop
  endif
  if(n == 1)return
 
  l=n/2+1
  k=n
  do while(k /= 1)
     if(l > 1)then
        l=l-1
        t=array(L)
     else
        t=array(k)
        array(k)=array(1)
        k=k-1
        if(k == 1) then
           array(1)=t
           exit
        endif
     endif
     i=l
     j=l+l
     do while(j <= k)
        if(j < k)then
           if(array(j) < array(j+1))j=j+1
        endif
        if (t < array(j))then
           array(i)=array(j)
           i=j
           j=j+j
        else
           j=k+1
        endif
     enddo
     array(i)=t
  enddo
 
  return
end subroutine hs

Measured memory_bytes: 1536
#include <iostream>
#include <string>
 
int main()
{
  int N, K, x[100], result = 0;
  std::cin >> N >> K;
  
  for(int i = 0; i < N; i++)
  {
    std::cin >> x[i];
  }
  
  for(int i = 0; i < N; i++)
  {
    if(K - x[i] > x[i])
    {
      result += x[i] * 2;
    }
    else
    {
      result += (K - x[i]) * 2;      
    }
  }
  
  std::cout << result;
}

Measured memory_bytes: 3160
n, m = map(int, input().split())

MOD = 10**9 + 7
if 1 < abs(n - m):
    ans = 0
else:
    ans = 1
    for i in range(1, n + 1):
        ans *= i
        ans %= MOD
    for i in range(1, m + 1):
        ans *= i
        ans %= MOD
    if n == m:
        ans *= 2
        ans %= MOD
print(ans)

Measured memory_bytes: 39408
import Foundation

/*
// 1
let N = Int(readLine()!)!

// 1 2
let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let R = Int(split[1])!

//
let array = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }

*/

//
let array1 = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
let array2 = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
let array3 = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
let numbers = [array1, array2, array3]
var bingos = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

let N = Int(readLine()!)!
for i in 0..<N {
  var num = Int(readLine()!)!
  for i in 0...2 {
    for j in 0...2 {
      if num == numbers[i][j] {
        bingos[i][j] = 1
      }
    }
  }
}

if bingos[0] == [1, 1, 1] || bingos[1] == [1, 1, 1] || bingos[2] == [1, 1, 1] {
  print("Yes")
} else if bingos[0][0] == 1 && bingos[1][0] == 1 && bingos[2][0] == 1 {
  print("Yes")
} else if bingos[0][1] == 1 && bingos[1][1] == 1 && bingos[2][1] == 1 {
  print("Yes")
} else if bingos[0][2] == 1 && bingos[1][2] == 1 && bingos[2][2] == 1 {
  print("Yes")
} else if bingos[0][0] == 1 && bingos[1][1] == 1 && bingos[2][2] == 1 {
  print("Yes")
} else if bingos[0][2] == 1 && bingos[1][1] == 1 && bingos[2][0] == 1 {
  print("Yes")
} else {
  print("No")
}

Measured memory_bytes: 7908
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def prime_factorization(n):
    res = []
    for i in range(2, int(pow(n, 0.5)) + 1):
        if n % i == 0:
            ex = 0
            while n % i == 0:
                ex += 1
                n //= i
            res.append([i, ex])
    if n != 1:
        res.append([n, 1])

    return res


def resolve():
    n = int(input())

    P = [0] * 1000
    for i in range(1, n + 1):
        t = prime_factorization(i)
        for num, ex in t:
            P[num] += ex

    res = 1
    for p in P:
        res *= p + 1
        res % mod

    print(res % mod)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
typedef long long ll;
#define mp(a, b) make_pair(a, b);
typedef pair<string, ll> psl;
psl val[maxn];
unordered_map<string, ll> M[2];
unordered_map<string, bool> inq[2];
queue<string> Q[2];
int n;
inline bool ext(const int & id, const string & s) { return M[id].find(s) != M[id].end();}
inline void chmin(ll & x, const ll & y) { if(x > y) x = y;}
ll ans = -1;
inline void chans(const int & id, const string & s) { if(ext(id, s)) ans = (ans == -1 ? M[id][s] : min(ans, M[id][s]));}
void update(const int & nxtid, const string & nxt, const ll dis)
{
	if(!ext(nxtid, nxt) || (M[nxtid][nxt] > dis))
	{
		M[nxtid][nxt] = dis;
		if(!inq[nxtid][nxt])
		{
			Q[nxtid].push(nxt);
			inq[nxtid][nxt] = 1;
		}
	}
}
bool is_palindrome(const string & s) { for(int i = 0, j = s.length() - 1; i < j; ++i, --j) if(s[i] != s[j]) return 0; return 1;}
int main()
{
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) 
	{
		cin >> val[i].first >> val[i].second;
		for(int id = 0; id < 2; ++id)
		{
			if(id)
			{
				for(int j = 0; j <= val[i].first.length(); ++j)
					if(is_palindrome(val[i].first.substr(0, j)))
						update(id, val[i].first.substr(j), val[i].second);
			}
			else
			{
				for(int j = val[i].first.length(); ~j; --j)
					if(is_palindrome(val[i].first.substr(j)))
						update(id, val[i].first.substr(0, j), val[i].second);
			}
		}
	}
	while(!Q[0].empty() || !Q[1].empty())
	{
		for(int id = 0; id < 2; ++id)
			while(!Q[id].empty())
			{
				string x = Q[id].front(); Q[id].pop(); inq[id][x] = 0;
				for(int i = 1; i <= n; ++i)
				{
					string rev, y;
					int nxtid;
					bool isrev = 0;
					if(!id) rev = x, y = val[i].first, nxtid = id ^ 1;
					else y = x, rev = val[i].first, nxtid = id;
					reverse(rev.begin(), rev.end());
					if(rev.length() > y.length()) { swap(rev, y); nxtid ^= 1; isrev = 1;}
					auto res = mismatch(rev.begin(), rev.end(), y.begin());
					if(res.first == rev.end())
					{
						auto nxt = y.substr(res.second - y.begin());
						if(isrev) reverse(nxt.begin(), nxt.end());
						update(nxtid, nxt, M[id][x] + val[i].second);
					}
				}
			}
	}
	chans(0, "");
	chans(1, "");
	printf("%lld\n", ans);
	return 0;
}
/*
3
bccbcc 3
ccb 2
cbb 5
*/

Measured memory_bytes: 4024
#include<bits/stdc++.h>
using namespace std;
vector<vector<int>> x;
int n,m;
bool visited [100009];
int dp[100009];
int solve(int curr){
    if(dp[curr]!=-1)
        return dp[curr];
    int temp=-1;
    for(auto i: x[curr]){
        if(dp[i]!=-1) {
            temp = 1 + dp[i];
            dp[curr] = max(dp[curr],temp);
        }else
            dp[curr] = max(dp[curr], 1 + solve(i));

    }
    if(dp[curr]==-1) {
        return dp[curr] = 0;
    }
    return dp[curr];
}
int main() {
    scanf("%d%d",&n,&m);
    x.resize(n+5);
    int from,to;
    for(int i=0;i<m;++i){
        scanf("%d%d",&from,&to);
        x[from].push_back(to);
    }
    memset(visited,false,sizeof visited);
    memset(dp,-1,sizeof dp);
    int ans = -1;
    for(int i=1;i<=n;++i)
        ans = max(ans,solve(i));
    printf("%d",ans);
}

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

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

int main() {
  int n;
  int ac = 0, wa = 0, tle = 0, re = 0;

  cin >> n;
  rep(i, n) {
    string s;
    cin >> s;
    if (s == "AC") {
      ac++;
    } else if (s == "WA")
    {
      wa++;
    } else if (s == "TLE") {
      tle++;
    } else {
      re++;
    }
    
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}


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

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int N;
    cin >> N; 
    vector<long long> DP(10001,0);
    for (int x = 1; x*x <= 10000; ++x) {
        for (int y = 1; x*x + y*y + x*y <= 10000; ++y) {
            for (int z = 1; x*x + y*y + z*z + x*y  + z*x + z*y  <= 10000; ++z) {
                ++DP[x*x + y*y + x*y + z*z + z*x + z*y];
            }
        }
    }
    for (int i = 1; i<=N; ++i) cout << DP[i] << '\n';
}


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

int INF = 1001001001;

int main(){
    int h,n; cin >> h >> n;
    vector<int> dp(h+1,INF);
    dp[0] = 0;
    rep(i,n){
        int a,b; cin >> a >> b;
        rep(j,h){
            int nj = min(j+a,h);
            dp[nj] = min(dp[nj],dp[j]+b);
        }
    }
    cout << dp[h] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define fori(a) for(auto i : a )
#define all(a) begin(a), end(a)
#define set(a,b) memset(a,b,sizeof(a))
#define sz(a) a.size()
#define pi 3.14159
#define ll long long
#define ull unsigned long long
#define pb push_back
#define PF push_front //deque
#define mp make_pair
#define pq priority_queue
#define mod 1000000007
#define f first
#define s second
#define pii pair< int, int >
#define vi vector<int>
#define vpii vector<pii>
#define debug(v) for(auto i:v) cout<<i<<" ";
#define tc int t; cin >> t; while(t--)

using namespace std;
string repeat(string s, int n) {
    string s1 = "";
    for (int i=0; i<n;i++)
        s1+=s;
    return s1;
}
string getString(char x) {
    string s(1, x);
    return s;
}

void optimizeIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
int gcd(int a, int b){
    if (a == 0)  return b;
    return gcd(b % a, a);
}
void  solve(){
  int a,b,k;
  cin>>a>>b>>k;
  int i=__gcd(a,b);
  while(k>0){
    if(a%i==0 && b%i==0) k--;
    i--;
  }
  cout<<i+1<<endl;
}
int main(){
    optimizeIO();
    // tc
    { solve();
    }
}


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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second

typedef long long ll;
typedef pair<int,int> P;
typedef pair<P,P> PP;

struct edge {
	int to,cost;
	edge(int t,int c):to(t),cost(c) {}
};

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

//-----------------------------------------------------------------------------

int n,m;
queue<int> a[301];
bool flg[301];
int cnt[301];

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

	REP(i,302) flg[i]=false;

	cin>>n>>m;
	REP(i,n) {
		REP(j,m) {
			int tmp; cin>>tmp; tmp--;
			a[i].push(tmp);
		}
	}
	int ans=INF;
	REP(i,m) {
		REP(j,n) while(flg[a[j].front()]) a[j].pop();
		REP(i,302) cnt[i]=0;
		REP(j,n) cnt[a[j].front()]++;
		int idx=0;
		REP(j,m) {
			if(cnt[j]>cnt[idx]) idx=j;
		}
		flg[idx]=true;
		ans=min(ans,cnt[idx]);
	}

	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 768
# Author: cr4zjh0bp
# Created: Sat Mar 28 15:38:17 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

x, y = na()

ans = 0
while y >= x:
    y //= 2
    ans += 1

print(ans)

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
    int a,b,c,d,i,e;
    cin>>a>>b>>c>>d;
    if (a>b){
        e=b*c+(a-b)*d;
    }
    else {
        e=a*c;
    }
    cout<<e;
    return 0;
}

Measured memory_bytes: 256