akhauriyash/Code-Regression huggingface dataset:
IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 i          PIC 9(10) VALUE 1 COMP.
01 N          PIC 9(10).
01 num        PIC 9(10) VALUE 4.
01 ans        PIC X(12).
01 zs         PIC Z(9)9.
01 S          PIC X(3).
01 C1.
   03 C11 OCCURS 4 DEPENDING num.
      05 C    PIC 9(10) VALUE 0 COMP.
01 j1         PIC X(12) VALUE "AC WA TLERE".
01 REDEFINES j1.
  03 j        PIC X(3) OCCURS 4 INDEXED BY ix.
01 mul        PIC X(3) VALUE " x ".

PROCEDURE DIVISION.
  ACCEPT N.
  PERFORM VARYING i FROM 1 BY 1 UNTIL N < i
    ACCEPT S
    SET ix TO 1
    PERFORM UNTIL 4 < ix
      SEARCH j VARYING ix
        AT END
          CONTINUE
        WHEN S = j(ix)
          ADD 1 TO C(ix)
          SET ix UP BY 1
      END-SEARCH
    END-PERFORM
  END-PERFORM.
  PERFORM VARYING i FROM 1 BY 1 UNTIL num < i
    MOVE SPACE TO ans
    MOVE C(i) TO zs
    STRING FUNCTION TRIM(j(i)) mul FUNCTION TRIM(zs) INTO ans
    DISPLAY FUNCTION TRIM(ans)
  END-PERFORM.
  STOP RUN.


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

int main() {
  int n;cin>>n;
  vector<int> l(n);
  rep(i,n)cin>>l[i];
  int cnt=0;
  rep(i,n-2)for(int j=i+1;j<n-1;j++)for(int k=j+1;k<n;k++){
    if(abs(l[i]-l[j])<l[k]&&l[k]<l[i]+l[j]&&l[i]!=l[j]&&l[j]!=l[k]&&l[k]!=l[i])cnt++;
  }
  cout<<cnt<<endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007
#define INF (1e9)
#define PI (acos(-1))
#define mp make_pair
#define pb push_back
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl

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

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

template <class T> inline auto __lcm(T &a, T &b)
{ return a * b / __gcd(a, b); }


int main() {
    int N;
    cin >> N;
    string S, T;
    cin >> S >> T;

    rep(i, N) {
        cout << S[i] << T[i];
    }

    return 0;
}


Measured memory_bytes: 256
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int e=1;
  		int b=0;

  		int[] a=new int[n];
		for(int c=0;c<n;c++){
    		a[c]=sc.nextInt();
           if(a[c]==e){
            b++;
           	e++;
           }
    	}
     int ans=n-b;
  		if(b==0){
        	ans=-1;
        }

    	System.out.println(ans);
    }
}



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

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

using ll = long long;

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

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

int main() {
  int N;
  cin>>N;
  vector<int> v(N);
  for(int i = 0; i < N; i++) cin>>v[i];
  vector<int> ans;
  for(int i = 0; i < N; i++) {
    for(int j = (int)v.size()-1;j>=0;j--){
      if(v[j]==j+1){
        ans.push_back(j+1);
        v.erase(v.begin()+j);
        break;
      }
    }
  }
  if((int)v.size()!=0)cout<<-1<<endl;
  else{
    reverse(ans.begin(),ans.end());
    for(auto x:ans) cout<<x<<endl;
  }
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();
      if(a<=c&&c<=b)System.out.println("Yes");
      else System.out.println("No");
    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <cstdio>
#include <cstdlib>

int num[1000] = {0};
int id = 0;

void push(int x){
    num[id++] = x;
}

int pop(){
    return num[--id];
}

int main(){
    char ch[15];
    int a,b;

    while(scanf("%s",ch) != EOF ){
        if(ch[0] == '+'){
            //
            a = pop();
            b = pop();
            push(a+b);
        } else if(ch[0] == '-'){
            a = pop();
            b = pop();
            push(b-a);
        } else if(ch[0] == '*'){
            a = pop();
            b = pop();
            push(a*b);
        } else{
            push(atoi(ch));
        }
    }
    printf("%d\n",pop());
}


Measured memory_bytes: 3204
fn main() {
    let scan = std::io::stdin();

    let mut line = String::new();

    let _ = scan.read_line(&mut line);
    let vec: Vec<&str> = line.split_whitespace().collect();

    let n: u32 = vec[0].parse().unwrap_or(0);
    let m: u32 = vec[1].parse().unwrap_or(0);

    println!("{} {}", n*m, 2*(n+m));
}


Measured memory_bytes: 5020
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main() {
  string s;
  ll n, m;
  cin >> n >> m;
  if (n == m) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main(void){
    int n, k, t, u, v, l;
    int i;
    long long j;
    int input;
    int dd = 0;
    double ans;
    cin >> n >> k >> t >> u >> v >> l;
    int map[10005] = {};
    for(i = 0; i < n; i++){
        cin >> input;
        map[input] = 1;
    }

    j = 0;
    for(i = 0; i < l; i++){
        if(map[i] == 1){
            j = j + t*v;
            if(j >= (k+1)*t*v){
                j = (k+1)*t*v;
            }
            if(j > l - i + 1 || j < 0){
                dd += l - i;
                break;
            }
        }   
    
        if(j > 0){
            dd++;
            j--;
        }
        //cout << i << " " << dd << " " << j << endl;
    }
    //cout << dd <<endl;

    ans = (double)dd/v + (double)(l-dd)/u;

    std::cout << std::fixed;
    std::cout << std::setprecision(10) << ans << endl;
    return 0;
}

Measured memory_bytes: 3324
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);

		String a = sc.next();
		String b = sc.next();
		String c = sc.next();
		
		char[] ah = a.toCharArray();
		char[] bh = b.toCharArray();
		char[] ch = c.toCharArray();
		
		List<Character> alist = new ArrayList<>();
		List<Character> blist = new ArrayList<>();
		List<Character> clist = new ArrayList<>();
		
		for(int i=0;i<ah.length; i++){
			alist.add(ah[i]);
		}
		
		for(int i=0;i<bh.length; i++){
			blist.add(bh[i]);
		}

		for(int i=0;i<ch.length; i++){
			clist.add(ch[i]);
		}

		char temp = alist.get(0);
		for(;;){
			if ('a' == temp){
				if(alist.isEmpty()){
					System.out.println("A");
					return;
				}
				temp = alist.remove(0);
			}
			if ('b' == temp){
				if(blist.isEmpty()){
					System.out.println("B");
					return;
				}
				temp = blist.remove(0);
			}
			if ('c' == temp){
				if(clist.isEmpty()){
					System.out.println("C");
					return;
				}
				temp = clist.remove(0);
			}
		}
	}
}


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

constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;

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

    int n, m; cin >> n >> m;
    vector<vector<bool>> g(n, vector<bool>(n));
    for (int i = 0; i < m; i++) {
        int a, b; cin >> a >> b; a--, b--;
        g[a][b] = g[b][a] = true;
    }

    vector<int> c(n);
    iota(c.begin(), c.end(), 0);
    int ans = 0;
    do {
        bool flag = true;
        for (int i = 0; i < n - 1; i++) {
            if (!g[c[i]][c[i + 1]]) flag = false;
        }
        if (flag) ans++;
    } while (next_permutation(c.begin() + 1, c.end()));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

int N, D;

vector<vector<double>> vec;

void solve();

int main() {
  cin >> N >> D;
  for (int i = 0; i < N; i++) {
    vector<double> row;
    for (int j = 0; j < D; j++) {
      double x;
      cin >> x;
      row.push_back(x);
    }
    vec.push_back(row);
  }
  solve();
}

bool isSquared(double num) {
  if (num < 0) {
    return false;
  }
  double x = pow(num, 0.5);
  return floor(x) == x;
}

void solve() {
  int count = 0;

  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (i >= j) {
        continue;
      }

      double sum = 0.0;
      for (int d = 0; d < D; d++) {
        sum += pow(vec[i][d] - vec[j][d], 2);
      }
      if (isSquared(sum)) {
        count++;
      }
    }
  }

  cout << count;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/02/27  Problem: ABC 111 D / Link: http://abc111.contest.atcoder.jp/tasks/abc111_d  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----

- 腕の不変量
- 移動可能な点集合の確認
- マンハッタンチャンス
- 上から二分探索のノリ

----解説ここまで---- */

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

	LL N;
	cin >> N;
	vector<LL> x(N), y(N);
	for (int i = 0; i < N; ++i) {
		cin >> x[i] >> y[i];
	}
	int parity = abs(x.front() + y.front()) % 2;
	auto ok = [&]() {
		bool valid = 1;
		FOR(i, 0, N) {
			valid &= (parity == (abs(x[i] + y[i]) % 2));
		}
		return valid;
	};

	if (!ok()) {
		cout << -1 << endl;
	}
	else {
		int M = 32;
		VL arms(M);
		FOR(i, 0, M) {
			arms[i] = (1LL << ((M - 1) - i));
		}
		if (parity % 2 == 0)arms.push_back(1);
		M = SZ(arms);

		cout << M << endl;
		FOR(i, 0, M) {
			cout << arms[i] << " \n"[i == M - 1];
		}

		FOR(i, 0, N) {
			LL X = x[i] + y[i];
			LL Y = x[i] - y[i];
			LL curX = 0, curY = 0;
			string s = "";
			FOR(j, 0, M) {
				if (abs(curX + arms[j] - X) <= abs(curX - arms[j] - X)) {
					curX += arms[j];
					if (abs(curY + arms[j] - Y) <= abs(curY - arms[j] - Y)) {
						s += "R";
						curY += arms[j];
					}
					else {
						s += "U";
						curY -= arms[j];
					}

				}
				else {
					curX -= arms[j];
					if (abs(curY + arms[j] - Y) <= abs(curY - arms[j] - Y)) {
						s += "D";
						curY += arms[j];
					}
					else {
						s += "L";
						curY -= arms[j];
					}

				}
			}
			cout << s << endl;
		}

	}

	return 0;
}


Measured memory_bytes: 256
n = gets.to_i
a = []
b = []
n.times do |i|
  a[i],b[i] = gets.chomp.split(" ").map(&:to_i)
end
a.sort!
b.sort!
i = (n-1)/2
if n % 2 == 1
  puts b[i] - a[i] + 1
else
  puts b[i] + b[i+1] - (a[i] + a[i+1]) +1
end

Measured memory_bytes: 19888
#include <math.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
int main(){
    int N;
    int K;
    cin >> N;
    cin >> K;
    double w;

    double Y =0;
    int i;
    double u = 0.5;
    for( i = 1; i <= N; i++){

            int e = i;
            int r = 0;
       while(e < K){

        e *= 2;
        r ++;
       }

       double T = pow(u,r);
       Y += T;

    }
    w =  Y/N;
    ;
    cout <<setprecision(12)<< w;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
typedef long long ll;
map<ll,ll>mp;
int main()
{
    ll n,x;
    mp[0]=1;
    ll cnt=0;
    ll sum=0;
    scanf("%lld",&n);
    for(int i=0; i<n; i++)
    {
        scanf("%lld",&x);
        sum+=x;
        cnt+=mp[sum];
        mp[sum]++;
    }
    cout<<cnt<<endl;
}



Measured memory_bytes: 12800
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll ans[200005];
ll n;
ll seg[800005];
bool comp(vector<ll> &v1, vector<ll> &v2){
    return v1[0] > v2[0];
}
void build(ll node,ll tl,ll tr){
    if(tl == tr){
        seg[node] = ans[tl];
        return;
    }
    ll tm = (tl + tr)/2;
    build(2*node, tl, tm);
    build(2*node + 1, tm+1, tr);
    seg[node] = max(seg[2 * node],seg[2*node + 1]);
}
ll query(ll node,ll tl,ll tr,ll l,ll r){
    if(l > r){
        return INT_MIN;
    }
    if(tr < l || tl > r){
        return INT_MIN;
    }
    if(l <= tl && r >= tr){
        return seg[node];
    }
    ll tm = (tl + tr)/2;
    ll left = query(2*node, tl, tm, l, r);
    ll right = query(2*node + 1, tm + 1, tr, l, r);
    return max(left,right);
}
void update(ll node,ll tl,ll tr,ll idx,ll val){
    if(tl == tr){
        seg[node] += val;
        return;
    }
    ll tm = (tl + tr)/2;
    if(idx <= tm){
        update(2*node, tl, tm, idx, val);
    }
    else{
        update(2*node + 1, tm + 1, tr, idx, val);
    }
    seg[node] = max(seg[2*node], seg[2*node + 1]);
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    ll a[n],b[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        cin>>b[i];
    }
    build(1, 1, n);
    vector<vector<ll>> v;
    for(int i=0;i<n;i++){
        vector<ll> k(3);
        k[0] = a[i];
        k[1] = i+1;
        k[2] = b[i];
        v.push_back(k);
    }
    sort(v.begin(),v.end(),comp);
    for(int i=0;i<n;i++){
        ll beauty = v[i][2];
        ll idx = v[i][1];
        beauty += query(1, 1, n, idx, n);
        update(1, 1, n, idx, beauty);
    }
    cout<<query(1, 1, n, 1, n)<<"\n";
}


Measured memory_bytes: 21452
"use strict"

const main = lines => {

  const l = [...lines[0]]
  
  let k = {}
  for (const v of l) {
    k[v] = k[v] ? k[v] + 1 : 1
  }
  
  let r = 'Yes'
  for (const v in k) {
    if (k[v] !== 2) r = 'No'
  }
  
  console.log(r)

}
  
main(require('fs').readFileSync('/dev/stdin', 'utf8').split('\n'))

Measured memory_bytes: 7372
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()

sum = 0
for i in range(1, n+1):
    if i % 15 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue

    sum += i

print(sum)

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

int main() {
  int n,k,q,a;
  cin>>n>>k>>q;
  vector<int> p(n,0);
  rep(i,q){
    cin>>a;a--;
    p.at(a)++;    
  }
  rep(i,n){
    p.at(i)=q-p.at(i);
    if(p.at(i)<k)cout<<"Yes"<<endl;
    else{cout<<"No"<<endl;}
  }
  
}



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

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

int main(){
  int K;
  string S;
  cin >> K >> S;
  
  if(S.size() <= K) cout << S << endl;
  else{
    rep(i,K) cout << S.at(i);
    cout << "..." << endl;
  }
}
  

Measured memory_bytes: 3632
#include <stdio.h>
#include<math.h>
int main(void){
    // Here your code !
    int r,g,b,a;
    scanf("%d %d %d",&r,&g,&b);
    a=100*r+10*g+b;
    if(a%4==0){
        printf("YES\n");
        
    }
    else printf("NO\n");
    return 0;
}


Measured memory_bytes: 128
#include<iostream>

using namespace std;

int N;

int main() {
	cin >> N;
	for (int i = 1; i < 10; i++) {
		for (int j = 1; j < 10; j++) {
			if (i * j == N) {
				cout << "Yes" << endl;
				return 0;
			}
		}
		if (i == 9) { cout << "No" << endl; }
	}
}

Measured memory_bytes: 256
#include <string>
#include <bits/stdc++.h>
#include <stdio.h>
#include<math.h>
#include <ctype.h>
#include <algorithm> // sort
#include <map> // pair
using namespace std;
 
int main() {
  int a,b,c;
  cin >> a >>b >>c;
  if(a==b&&b==c){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

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

typedef long long ll;
const int mod = 1e9 + 7;

ll N, K;

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

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

mint c[4005][4005];
void init() {
    c[0][0] = 1;
    for (int i = 0; i <= 4000; i++) {
        for (int j = 0; j <= i; j++) {
            c[i + 1][j] += c[i][j]; 
            c[i + 1][j + 1] += c[i][j];
        }
    }
}
mint comb(int x, int y) {
    return c[x][y];
}

mint f2(int x, int y) {
    return comb(x + y - 1, y - 1);
}

mint f(int x, int y) {
    if (x < y) return 0;
    if (x == 0 && y == 0) return 1;
    return f2(x - y, y);
}

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

    for (int i = 1; i <= K; i++) {
        mint blue = f(K, i);
        mint red = 0;
        {
            red += f(N - K, i - 1);
            red += f(N - K, i);
            red += f(N - K, i);
            red += f(N - K, i + 1);
        }

        mint ans = blue * red;
        printf("%lld\n", ans.x);
    }
}

Measured memory_bytes: 125568
import sys
input = sys.stdin.readline

n = int(input())
a = [int(x) for x in input().split()]

right = 0
ans = 0
S = 0

for left in range(n):
    while right < n and S + a[right] == S ^ a[right]:
        S += a[right]
        right += 1

    ans += right - left
    if left == right:
        right += 1
    else:
        S -= a[left]

print(ans)


Measured memory_bytes: 72396
a, b = map(int, input().split())
s = str(input())
cnt = 0

if s.count('-')==1 and s[a]=='-':
    for i in range(a):
        if int(s[i]) in range(0, 10):
            cnt += 1
    if s[a]=='-':
        cnt += 1
    for i in range(b):
        if int(s[a+1+i]) in range(0, 10):
            cnt += 1

    if cnt == a+b+1:
        print('Yes')
    else:
        print('No')

else:
    print('No')

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <istream>
#include <iomanip>
 
#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif


int main(int argc, char **argv){
	std::vector<int> stack;
	std::string buf;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif

#if INPUT_FROM_FILE
	while(std::getline(ifs, buf)){
#else
	while(std::getline(std::cin, buf)){
#endif
		int n = std::stoi(buf);

		if(n != 0){
			stack.push_back(n);
		}
		else{
			std::cout << stack.back() << std::endl;
			stack.pop_back();
		}
	}
	return 0;
}


Measured memory_bytes: 3044
S = input()
T = input()

count = 0
max_count = 0

for i in range(len(S) - len(T) +1):
    for j in range(len(T)):
        if S[i+j] == T[j]:
            count += 1
            if max_count <= count:
                max_count = count
        if j == (len(T) -1):
            count = 0

print(len(T) - max_count)


Measured memory_bytes: 9056
#include <iostream>

using namespace std;

int main(){
	int n,k,q;
	cin >> n >> k >> q;
	
	int a[q];
	int points[n];
	for(int i = 0; i < n; i++) points[i] = k-q;
	for(int i = 0; i < q; i++){
		cin >> a[i];
		points[a[i]-1]++;
	}
	for(int i = 0; i < n; i++) {
//		cout << points[i] << endl;
		if(points[i] > 0) cout << "Yes";
		else cout << "No";
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 4412
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll N; cin >> N;
  ll p[N]; ll ab[N];
  for (ll i = 0; i < N; i++) {
    cin >> p[i];
  }
  for (ll i = 0; i < N; i++) {
    ab[p[i]-1] = 1e9-N+i+1;
  }
  for (ll i = 0; i < N; i++) {
    cout << 30000*(i+1) << " ";
  }
  cout << endl;
  for (ll i = 0; i < N; i++) {
    cout << ab[i]-30000*(i+1) << " ";
  }
  cout << endl;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()

using namespace std;
signed main(){
  vector<vector<int>> a(3,vector<int>(3));
  rep(i,3){
    rep(j,3){
      cin>>a[i][j] ;
    }
  }
  int N ;
  cin>>N;
  vector<vector<int>> c(3,vector<int>(3));
  rep(i,3){
    rep(j,3){
      c[i][j] = 0 ;
    }
  }
  rep(i,N){
    int b ;
    cin>>b;
    rep(l,3){
      rep(j,3){
        if(b==a[l][j]){
          c[l][j]=1;
        }
      }
    }
  }
  if(c[0][0]+c[0][1]+c[0][2]==3){
    cout<<"Yes"<<endl;
  }
  else if(c[1][0]+c[1][1]+c[1][2]==3){
    cout<<"Yes"<<endl;
  }
  else if(c[2][0]+c[2][1]+c[2][2]==3){
    cout<<"Yes"<<endl;
  }
  else if(c[0][0]+c[1][1]+c[2][2]==3){
    cout<<"Yes"<<endl;
  }
  else if(c[0][2]+c[1][1]+c[2][0]==3){
    cout<<"Yes"<<endl;
  }
  else if(c[0][0]+c[1][0]+c[2][0]==3){
    cout<<"Yes"<<endl;
  }
  else if(c[0][1]+c[1][1]+c[2][1]==3){
    cout<<"Yes"<<endl;
  }
  else if(c[0][2]+c[1][2]+c[2][2]==3){
    cout<<"Yes"<<endl;
  }
  else {
    cout<<"No"<<endl;
  }
}  

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


int main() {
  int n;
  cin >> n;
  vector<string> t(n);
  rep(i,n) cin >> t.at(i);
  int a = 0;
  int b = 0;
  int c = 0;
  int d = 0;
  rep(i,n) {
    if (t.at(i) == "AC") {
      a++;
    }
  }
  rep(i,n) {
    if (t.at(i) == "WA") {
      b++;
    }
  }
  rep(i,n) {
    if (t.at(i) == "TLE") {
      c++;
    }
  }
  rep(i,n) {
    if (t.at(i) == "RE") {
      d++;
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
}

Measured memory_bytes: 6424
#include <iostream>
#include <cmath>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

void solve(long long N, long long D, std::vector<std::vector<long long>> X){
    int count = 0;
    REP(i, N-1) {
        for (int j = i+1; j < N; j++) {
            double dist = 0.0;
            REP(k, D)
                dist += pow(abs(X[i][k] - X[j][k]), 2);
            dist = sqrt(dist);
            if (floor(dist) == dist) count++;
        }
    }
    cout << count << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long N;
    scanf("%lld",&N);
    long long D;
    scanf("%lld",&D);
    std::vector<std::vector<long long>> X(N, std::vector<long long>(D));
    for(int i = 0 ; i < N ; i++){
        for(int j = 0 ; j < D ; j++){
            scanf("%lld",&X[i][j]);
        }
    }
    solve(N, D, std::move(X));
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<numeric>
using namespace std;
#define INF (1 << 30) - 1
#define LINF 1LL << 60
const int MOD = 1000000007;
using ll = long long;
using P = pair<int, int>;

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

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

mint f(int n){ 
  if(n == 0)return 1;
  mint x = f(n / 2); 
  x *= x; 
  if(n % 2 == 1)x *= 2;
  return x;
}

mint choose(int n, int a){
  mint x = 1, y = 1;
  for(int i = 0; i < a; ++i){
    x *= n - i;
    y *= i + 1;
  }
  return x / y;
}

mint fact[400400];
mint inv_fact[400400];
void init(){
	fact[0] = 1;
	for(int i = 1; i < 400400; ++i){
		fact[i] = fact[i - 1] * i;
	}

	inv_fact[400400 - 1] = fact[400400 - 1].inv();
	for(int i = 400400 - 1; i >= 1; --i){
		inv_fact[i - 1] = inv_fact[i] * i;
	}
}

mint comb(int n, int k){
	return fact[n] * inv_fact[n - k] * inv_fact[k];
}

int main(){
  init();
  int n, k;
  cin >> n >> k;

  mint ans = 1;
  for(int i = 1; i <= min(k, n - 1); ++i){
  	mint r = comb(n - 1, i);
  	ans += comb(n, i) * r;
  }

  cout << ans.x << endl;
  return 0;
}


Measured memory_bytes: 6528
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
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; }
int INF=1e10;
int MOD=1e9+7;
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int kurai(int a,int b){
  int m=pow(10,b),n=pow(10,b-1);
  return (a%m)/n;
}
int ketawa(int a){
  int k=0;
  rep(i,keta(a)){
  k+=kurai(a,i+1);
  }
  return k;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
int mid(int a,int b,int c){
  vector<int> k(3);
  k[0]=a;k[1]=b;k[2]=c;
  sort(all(k));
  return k[1];
}
bool sosuu(int a){
  bool b=1;
  if(a<=1)
    return 0;
  else{
  rep1(i,sqrt(a)-1){
  if(a%(i+1)==0)
  b=0;
  }
  return b;
  }
}
int modpow(int a,int b,int m=MOD){
 if(!b)return 1; if(b&1)return modpow(a,b-1,m)*a%m;
 int memo = modpow(a,b>>1,m);
 return memo*memo%m;
}
int fact_mod(int n) {
    int f=1; 
for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD;
    return f;
}
int mod_pow(int x,int n) {
    int res=1;
    while(n>0){
        if(n&1) res=(res*x)%MOD; 
        x=(x*x)%MOD;        
n>>=1; 
    }
    return res;
}
int c_mod(int n, int r) {
    if(r>n-r) r=n-r;
    if(r==0) return 1;
    int a=1;
    rep(i,r) 
a=a*((n-i)%MOD)%MOD;
    int b=mod_pow(fact_mod(r), MOD-2);
    return (a%MOD)*(b%MOD)%MOD;
}
signed main(){
  int a,b;
  cin>>a>>b;
  int c[a][b];
  rep(i,a)rep(j,b)
    cin>>c[i][j];
  int d=0;
  rep(i,a){
    rep(k,a){
    if(i<k){
    double e=0;
  rep(j,b){
  e+=abs(c[i][j]-c[k][j])*abs(c[i][j]-c[k][j]);
  }
    e=sqrt(e);
    if(e==floor(e))
      d++;
    }
  }
  }
  out(d);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793


  
int main(){
   int s;
   cin >> s;
   if(s<3)cout << 0 << endl;
   
   else{
    vector<ll> num(2001);
    num.at(0)=0;
    num.at(1)=0;
    num.at(2)=0;
    num.at(3)=1;
    num.at(4)=1;
    num.at(5)=1;
    for(int i=6;i<=2000;i++){
        num.at(i)=1;
        for(int j=3;j<=i-3;j++){
            int x=i-j;
            num.at(i)+=num.at(x);
            num.at(i)%=MM;
        }
    }
    cout << num.at(s) << endl;
   }
     
}


Measured memory_bytes: 3624
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int n, m, p;
int pos;
char str[10000];
map<string, vector<int> > mapto;
map<vector<int>, string> mapfrom;
map<string, string> convert;
vector<int> error;

vector<int> formula();
vector<int> factor() {
  vector<int> lhs;
  if (str[pos] == '(') {
    pos++;
    lhs = formula();
    pos++;
  } else {
    assert(isalpha(str[pos]));
    string s;
    while (isalpha(str[pos])) { s += str[pos++]; }
    if (!convert.count(s)) { return error; }
    if (!mapto.count(convert[s])) { return error; }
    lhs = mapto[convert[s]];
  }
  return lhs;
}

vector<int> term() {
  vector<int> lhs = factor();
  if (lhs == error) { return error; }
  while (str[pos] == '*' || str[pos] == '/') {
    int s = str[pos] == '*' ? 1 : -1;
    pos++;
    vector<int> rhs = factor();
    if (rhs == error) { return error; }
    REP(i, n) {
      lhs[i] += s * rhs[i];
    }
  }
  return lhs;
}

vector<int> formula() {
  vector<int> lhs = term();
  if (lhs == error) { return error; }
  while (str[pos] == '+' || str[pos] == '-') {
    pos++;
    vector<int> rhs = term();
    if (rhs == error) { return error; }
    REP(i, n) {
      if (lhs[i] != rhs[i]) { return error; }
    }
  }
  return lhs;
}

int main() {
  error = vector<int>(1, -1000000000);
  while (scanf("%d %d %d", &n, &m, &p), n|m|p) {
    pos = 0;
    mapto.clear();
    mapfrom.clear();
    REP(i, m) {
      string s;
      cin >> s;
      vector<int> vect(n, 0);
      REP(i, n) {
        scanf("%d", &vect[i]);
      }
      mapto[s] = vect;
      mapfrom[vect] = s;
    }
    scanf("%s", str);
    REP(i, p) {
      string from, to;
      cin >> from >> to;
      convert[from] = to;
    }
    vector<int> ans = formula();
    if (ans[0] <= -100000) {
      puts("error");
    } else if (mapfrom.count(ans)) {
      printf("%s\n", mapfrom[ans].c_str());
    } else {
      puts("undefined");
    }
  }
}

Measured memory_bytes: 0
import java.util.*;
public class Main{
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();
		
		if(n==1) {
			System.out.println("Hello World");
			
			
		}else if(n==2) {
			int A=sc.nextInt();
			int B=sc.nextInt();
			System.out.println(A+B);
			
		}
	}

}

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  long long int a=0,b=0,c=0,d=0,n=0,count=0,ans=0;
  string s;
  cin>>n;
  for(int i=1;i<=sqrt(2*n)+1;i++){
    count+=i;
    if(count>=n){
      cout<<i<<endl;
      return 0;
    }
  }
}
///////////////////////////

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

#define watch(x) cerr << (#x) << ": " << (x) << endl
#define int long long

void nope() {
    cout << -1 << endl;
    exit(0);
}

int32_t main() {

    int n; cin >> n;
    vector<int> b(n+1);
    for(int i = 1; i <= n; ++i) cin >> b[i];

    vector<int> ret;
    for(int i = 0; i < n; ++i) {
        int ind = n-i;
        while(ind > 0 && b[ind] != ind) --ind;
        if(ind == 0) nope();
        ret.push_back(ind);
        b.erase(b.begin()+ind);
    }

    for(int i = n-1; i >= 0; --i) {
        cout << ret[i] << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
priority_queue<int >q;
vector<int > a[1000001];
int main()
{
	int n,m;
	cin>>n>>m;
	long long ans=0;
	for(int i=1;i<=n;i++)
	{
		int x,y;
		cin>>x>>y;
		if(x>m)
		{
			continue;
		}
		a[m-x+1].push_back(y);
	}
	for(int i=1;i<=m;i++)
	{
		for(int j=0;j<a[i].size();j++)
		{
			q.push(-a[i][j]);
			ans+=a[i][j];
		}
		while(q.size()>i)
		{
			ans+=q.top();
			q.pop();
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 27388
import java.util.*;
public class Main { //クラス名はMain
    public static void main(String[] args) {
      	Scanner sc = new Scanner(System.in);
		int n1 = Integer.parseInt(sc.next());
     	int n2 = Integer.parseInt(sc.next());
     	int n3 = Integer.parseInt(sc.next());
      	int cnt = 0;
      
      	if( n1 == n2 ){
          cnt++;
        }
      	if( n2 == n3 ){
          cnt++;
        }
      	if( n3 == n1 ){
          cnt++;
        }
      
      	if( cnt == 1 ){
       	 System.out.println("Yes");
        }else{
          System.out.println("No");
        }
    }
}

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

#define _USE_MATH_DEFINES

#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <functional>
#include <utility>
#include <tuple>
#include <vector>
#include <string>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <iterator>
#include <bitset>
#include <complex>
#include <limits>
#include <random>


using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;

const double EPS = 1e-9;

struct UnionFind
{
	vector<int> parent;
	vector<int> rank;

	UnionFind(int N) :parent(N, 0), rank(N, 0)
	{
		rep(i, 0, N)parent[i] = i;
	}

	int find(int x)
	{
		if (parent[x] == x)return x;
		else return parent[x] = find(parent[x]);
	}

	void unite(int x, int y)
	{
		x = find(x);
		y = find(y);

		if (x == y)return;

		if (rank[x] < rank[y])parent[x] = y;
		else {
			parent[y] = x;
			if (rank[x] == rank[y])rank[x]++;
		}
	}

	bool same(int x, int y)
	{
		return find(x) == find(y);
	}
};

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

	int N, M;
	cin >> N >> M;

	UnionFind uf(N);

	int a, b;
	rep(i, 0, M)
	{
		cin >> a >> b;
		a--, b--;
		if (uf.same(a, b))continue;
		uf.unite(a, b);
	}

	vector<int> CNT(N, 0);

	rep(i, 0, N)
	{
		CNT[uf.find(i)]++;
	}

	int ma = 0;
	rep(i, 0, N)
	{
		chmax(ma, CNT[i]);
	}

	cout << ma << endl;

	return 0;
}


Measured memory_bytes: 7908
#include <iostream>
#include <ctime>
#define ESP 1e-10
using namespace std;
int main() {
	bool flag = false;
	time_t c1;
	while (true) {
		int H, W; cin >> H >> W;
		if (!flag) { c1 = clock(); flag = true; }
		if (H == 0 && W == 0) break;
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W;j++) {
				cout << "#";
			}
			cout << endl;
		}
		cout << endl;
	}
	time_t c2;
	while (true) {
		c2 = clock();
		if (c2 - c1 > 999) break;
	}
}

Measured memory_bytes: 3028
#include <queue>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <stack>
using namespace std;
typedef long long int ll;

#define EPS (1e-9)
#define INF (1e9)
#define PI (acos(-1))
#define REP(i,n) for(int i=0;i<n;i++)

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

ll beki(ll a, ll b) {
	ll tmp = 1;
	REP(i, b) tmp *= a;
	return tmp;
}

int N;
int a[110] = {};

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) {
		int tmp = i;
		int j = 2;
		while (tmp >= j * j) {
			if (tmp % j == 0) {
				a[j]++;
				tmp /= j;
			}
			else j++;
		}
		if (tmp != 1) a[tmp]++;
	}
//	REP(i, 100) cout << i << ":" << a[i] << endl;
	REP(i, 100) a[i]++;
	int ans = 0;
	REP(i, 98) {
		for (int j = i + 1; j < 99; j++) {
			for (int k = j + 1; k < 100; k++) {
				if (a[i] >= 5 && a[j] >= 5 && a[k] >= 3) ans++;
				if (a[i] >= 5 && a[j] >= 3 && a[k] >= 5) ans++;
				if (a[i] >= 3 && a[j] >= 5 && a[k] >= 5) ans++;
			}
			if (a[i] >= 25 && a[j] >= 3) ans++;
			if (a[i] >= 3 && a[j] >= 25) ans++;
			if (a[i] >= 15 && a[j] >= 5) ans++;
			if (a[i] >= 5 && a[j] >= 15) ans++;
		}
		if (a[i] >= 75) ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int a[]=new int[5];
		int z=0,y=0,fin=0;
		while(z<6){
			y=stdIn.nextInt();
			if(a[y]>2){
				fin=1;
				break;
			}
			else
				a[y]++;
			z++;
		}z=1;y=0;
		if(fin==1)
			System.out.println("NO");
		else{
			while(z<5){
				if(a[z]==2)
					y++;
				z++;
			}
			if(y==2)
				System.out.println("YES");
			else
				System.out.println("NO");
		}
	}
}

Measured memory_bytes: 21844
#include<iostream>
using namespace std;
int main(){
	int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f;
	b += a / 5;
	c += b / 2;
	d += c / 5;
	e += d / 2;
	f += e / 5;
	if (f >= 2)cout << "1\n"; else cout << "0\n";
}

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

int main()
{
	int n;
	cin>>n;
	if(n%10 == 3)
		cout<<"bon";
	else if( n%10 ==0 || n%10 ==1 ||n%10 ==6 || n%10 ==8)
		cout<<"pon";
	else
	{
		cout<<"hon";
	}
	
	//getchar();getchar();

	
	
	return 0;
}


Measured memory_bytes: 3580
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

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

	const int N = 1000;
	vector<int> table(N + 1);

	table[0] = s;
	for(int i = 0;i < N;i++)
	{
		if (s % 2 == 0)
		{
			s /= 2;
		}
		else
		{
			s = s * 3 + 1;
		}

		table[i + 1] = s;
	}

	int ans = N - 1;
	for (int i = 0; i < N; i++)
	{
		for (int k = i + 1; k < N; k++)
		{
			if (table[i] == table[k])
			{
				if (ans > k)
				{
					ans = k;
					break;
				}
			}
		}
	}

	cout << ans + 1 << endl;

	return 0;
}

Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split()]
m2 = 0
m4 = 0
for a in A:
    m2 += int(a%2 == 0 and not a%4 == 0)
    m4 += int(a%4 == 0)
if m4 >= N//2:
    print("Yes")
elif m4*2 + m2 >= N:
    print("Yes")
else:
    print("No")

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

int main()
{
    int n,m;
    cin >> n >> m;
    int x[m],y[m];
    int min,max;
    for(int i=0;i<m;i++){
        cin >> x[i] >> y[i];
        if(i==0) max = x[i],min = y[i];
        if(max < x[i]) max = x[i];
        if(min > y[i]) min = y[i];
    }
    if(min >= max)
        cout << min - max + 1 << endl;
    else
        cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
using namespace ::std;
int main()
{
	int a, b ,ans= 0;
	cin >> a >> b;
	if (a >= 6 && a <= 12)
	{
		ans = b / 2;
	}
	if (a >= 13)
	{
		ans = b;
	}
	cout << ans;
	return 0;
}

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

long long inp_n, i1, i2;

long long readNumber() {
	long long temp_func;
	scanf("%lld", &temp_func);
	return temp_func;
};
long long printNumber(long long temp_func) {
	printf("%lld ", temp_func);
	return 0;
};

long long powe5(const long long inp_nf) {
	
	return inp_nf * inp_nf * inp_nf * inp_nf * inp_nf;
	
};

int main() {
	
	inp_n = readNumber();
	
	for (i1 = 0; i1 <= 2000; i1++) {
		
		for (i2 = 0; i2 <= 2000; i2++) {
			
			if (powe5(i1) - powe5(i2) == inp_n) {
				
				printNumber(i1);
				printNumber(i2);
				return 0;
				
			};
			
			if (powe5(i2) - powe5(i1) == inp_n) {
				
				printNumber(i2);
				printNumber(i1);
				return 0;
				
			};
			
			if (powe5(-i1) - powe5(i2) == inp_n) {
				
				printNumber(-i1);
				printNumber(i2);
				return 0;
				
			};
			
			if (powe5(-i2) - powe5(i1) == inp_n) {
				
				printNumber(-i2);
				printNumber(i1);
				return 0;
				
			};
			
			if (powe5(-i1) - powe5(-i2) == inp_n) {
				
				printNumber(-i1);
				printNumber(-i2);
				return 0;
				
			};
			
			if (powe5(-i2) - powe5(-i1) == inp_n) {
				
				printNumber(-i2);
				printNumber(-i1);
				return 0;
				
			};
			
			if (powe5(i1) - powe5(-i2) == inp_n) {
				
				printNumber(i1);
				printNumber(-i2);
				return 0;
				
			};
			
			if (powe5(i2) - powe5(-i1) == inp_n) {
				
				printNumber(i2);
				printNumber(-i1);
				return 0;
				
			};
			
		};
		
	};
	
}

Measured memory_bytes: 1728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7/*998244353*/;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll); ll mod_fact(ll, ll); ll mod_inv(ll, ll); ll gcd(ll, ll); ll lcm(ll, ll);
//
using P = pair<ld, int>;
struct Edge{
    ld distance;
    int to;
    Edge(ld distance, int to) : distance(distance), to(to) {};
};
int main(){
    while(true){
        int n;
        cin >> n;
        if(!n) break;
        vector<pair<ld, ld>> coordinate(n);
        for(int i = 0; i < n; i++){
            int d, x, y;
            cin >> d >> x >> y;
            coordinate[d - 1] = make_pair(x, y);
        }
        vector<vector<Edge>> graph(n);
        for(int i = 0; i < n; i++){
            for(int j = i + 1; j < n; j++){
                ld d = sqrt((coordinate[i].first - coordinate[j].first) * (coordinate[i].first - coordinate[j].first) + (coordinate[i].second - coordinate[j].second) * (coordinate[i].second - coordinate[j].second));
                if(d - 50 < 1e-10){
                    graph[i].emplace_back(d, j);
                    graph[j].emplace_back(d, i);
                }
            }
        }
        int m;
        cin >> m;
        vector<int> s(m), g(m);
        for(int i = 0; i < m; i++) {int a, b; cin >> a >> b; a--; b--; s[i] = a; g[i] = b;}
        for(int i = 0; i < m; i++){
            vector<P> dis(n, make_pair(1e10, -1));//距離,parent
            priority_queue<P, vector<P>, greater<P>> pq;//距離,current node
            dis[s[i]] = make_pair(0, -1);
            pq.emplace(0, s[i]);
            while(!pq.empty()){
                auto p = pq.top();
                pq.pop();
                if(p.first <= dis[p.second].first){
                    for(auto itr : graph[p.second]){
                        if(p.first + itr.distance < dis[itr.to].first){
                            dis[itr.to] = make_pair(p.first + itr.distance, p.second);
                            pq.emplace(dis[itr.to].first, itr.to);
                        }
                    }
                }
            }
            vector<int> out;
            out.push_back(g[i]);
            int pnt = g[i];
            while(true){
                auto itr = dis[pnt];
                if(itr.first > 9e9) {cout << "NA" << "\n"; break;}
                if(itr.second == -1) break;
                out.push_back(itr.second);
                pnt = itr.second;
            }
            if(out.size() != 1){
                for(int i = out.size() - 1; i >= 0; i--){
                    cout << out[i] + 1;
                    if(i != 0) cout << " "; 
                }
                cout << "\n";
            }
        }
    }
}


Measured memory_bytes: 3156