akhauriyash/Code-Regression huggingface dataset:
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {

    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

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

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

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


fn main() {
    input!{
        n: u64,
    }
    println!("{}", n.pow(3)+n.pow(2) +n)
}


Measured memory_bytes: 2120
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


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;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

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


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


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n;
  cin>>n;
  vector<ll> v(n);
  rep(i,n) cin>>v[i];
  sort(ALL(v));
  double ans=v[0];
  rep(i,n-1) ans=(ans+v[i+1])/2;
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
using namespace std;
int main() {
	int n;
	while (true) {
		map<int,int> dp;
		scanf("%d", &n);
		if (n == 0) break;
		bool neko = false;
		for (int i = 0;i < n;++i) {
			long long a, b, c;
			scanf("%lld%lld%lld", &a, &b, &c);
			if (b*c+dp[a] >= 1000000&&dp[a] < 99999999) {
				printf("%d\n", a);
				neko = true;
				dp[a] = 9999999999;
			}
			else {
				dp[a] += b*c;
			}
		}
		if (neko == false)printf("NA\n");
	}
}


Measured memory_bytes: 1244
#include<stdio.h>
int main(void)
{
 int a,b;
 
  scanf("%d",&a);
  scanf("%d",&b);
  
  
  if(a>b)
  printf("a > b\n");
  if(a==b)
  printf("a == b\n");
  if(a<b)
  printf("a < b\n");
  
  return(0);
  
}


Measured memory_bytes: 2112
#![allow(non_snake_case)]

use std::io::{stdin, Read};
use std::str::FromStr;
fn read_option<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok()
}
fn read<T: FromStr>() -> T {
    let opt = read_option();
    opt.expect("failed to parse token")
}

fn main() {
    let x: isize = read();
    println!("{}", if x >= 30 {
        "Yes"
    } else {
        "No"
    });
}


Measured memory_bytes: 2172
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

#ifdef DEBUG
    #define IFD if(true)
#else
    #define IFD if(false)
#endif

int main()
{
    int A, B;
    cin >> A >> B;

    if(A < B) swap(A, B);
    cout << max(A * 2 - 1, A + B) << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String string = in.next();
        int res = string.length() - 2;
        if (string.charAt(0) != string.charAt(string.length() - 1))
        {
            if (res % 2 == 0)
                System.out.println("Second");
            else
                System.out.println("First");
        }
        else{
            if(res%2==0)
                System.out.println("First");
            else
                System.out.println("Second");
        }
    }
}


Measured memory_bytes: 26312
use std::io;
use std::cmp;


fn main() {
    let (a, b, c) = {
        let i = read::<usize>();
        (i[0], i[1], i[2])
    };

    println!("{}", cmp::min(c, b / a));
}


#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
std::str::FromStr,
T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
std::str::FromStr,
T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

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

int main(){
    #ifdef LOCAL_DEFINE
        freopen("./a.in","r",stdin);
        freopen("./a.out", "w",stdout);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n,m;
    cin >> n >> m;
    int sum = 0;
    for (int i=0;i<m;i++) {
        int temp;
        cin >> temp;
        sum += temp;
    }

    if (sum > n) {
        cout << -1 << endl;
    } else {
        cout << n - sum << endl;
    }

    return 0;
}

Measured memory_bytes: 3696
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define Sort(v, n) sort(v, v+n);
#define VSort(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
const ll MOD = 1000000007;

int main() {
    string s;
    cin >> s;
    int ans = 0;
    for(int i = 0;i<s.size() -1;i++) {
        for(int j = i+1;j<s.size();j++) {
            bool f = true;
            for(int k = i;k <= j;k++) {
                if(s[k] != 'A' &&s[k] != 'C' &&s[k] != 'G' &&s[k] != 'T') {
                    f = false;
                }
            }
            if(f == true) {
                ans = max(ans,j - i+1);
            }
        }
    }
    rep(i,s.size()) {
        if(s[i] == 'A' ||s[i] == 'C' ||s[i] == 'G' ||s[i] == 'T') {
            ans = max(1,ans);
        }
    }
    cout << ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define endl '\n'
# define PI  3.14159265358979323846
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 2e6+5;
const int INF = 1e18L;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << 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...);
}
int ar[N];
int dp[N];
signed main(){
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	IOS;
	int T=1;
	// cin >> T;
	while(T--){
		int n,r;
		cin >> n >> r;
		if(n>=10)cout<<r<<endl;
		else
			cout << r+ 100*(10-n);

	
	}
	cerr << "Time Taken : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cstring>
using namespace std;
const int MAX=1005;
int dp[MAX][MAX]={0};
int main(){
	string x,y;
	int q;
	cin>>q;
	while(q--){
		cin>>x>>y;
		memset(dp,0,sizeof(dp));
		x=" "+x;y=" "+y;
		for(int i=1;i<x.length();i++){
			for(int j=1;j<y.length();j++){
				if(x[i]==y[j])dp[i][j]=dp[i-1][j-1]+1;
				else {
					dp[i][j]=max(dp[i][j-1],dp[i-1][j]);
				}
			}
		}
		cout<<dp[x.length()-1][y.length()-1]<<endl;
	}
	return 0;
}


Measured memory_bytes: 7112
#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node {
  int key;
  Node *next, *prev;
};

Node *nil;

Node* listSearch(int key){
  Node *cur = nil->next;
  while(cur != nil && cur->key != key){
    cur = cur->next;
  }
  return cur;
}

void init(){
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  Node *cur = nil->next;
  int isf = 0;
  while(1){
    if(cur == nil)break;
    if(isf++ > 0)printf(" ");
    printf("%d",cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(Node *t){
  if(t == nil)return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void deleteFirst(){
  deleteNode(nil->next);
}

void deleteLast(){
   deleteNode(nil->prev);
}

void deleteKey(int key) {
  deleteNode(listSearch(key));
}

void insert(int key) {
  Node *x = (Node *)malloc(sizeof(Node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main() {
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for( i = 0; i < n; i++ ) {
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) { insert(key); np++; size++; }
    else if ( com[0] == 'd' ) {
      if ( strlen(com) > 6 ) {
	if ( com[6] == 'F' ) deleteFirst();
	  else if ( com[6] == 'L' ) deleteLast();
      } else {
	deleteKey(key); nd++;
      }
      size--;
    }
  }

  printList();

  return 0;
}



Measured memory_bytes: 33848
#include <stdio.h>

int main(void)
{
    int num[5];
    int k;
    int temp, result=0;
    int i, j;

    if(scanf("%d%d%d%d%d%d", &num[0],&num[1],&num[2],&num[3],&num[4],&k) == 1);

    for(i=0; i<4; i++)
    {
        temp = num[i + 1] - num[0];

        if(temp > k)
            result++;
    }

    for(i=1; i<4; i++)
    {
        temp = num[i + 1] - num[1];

        if(temp > k)
            result++;
    }
    
    temp = num[2] - num[3];
    if(temp > k)
        result++;

    temp = num[2] - num[4];
    if(temp > k)
        result++;

    temp = num[3] - num[4];
    if(temp > k)
        result++;

    if(result == 0)
        printf("Yay!");
       
    else
        printf(":(");

        return(0);
}


Measured memory_bytes: 128
S = input()
sumS = int(S[0]) + int(S[1]) + int(S[2]) + int(S[3])
def minus(a, sumS):
    sS = sumS
    ba = bin(a)
    for ia,aa in enumerate(ba[::-1]):
        if aa == 'b':
            break
        elif aa == '1':
            sS -=  2 * int(S[ia+1:ia+2])
    if sS == 7:
        T = ['+', '+', '+', '=7']
        for ia,aa in enumerate(ba[::-1]):
            if aa == '1':
                T[ia] = '-'

        result = ''
        for i in range(len(S)):
            result += S[i] + T[i]
        return result
    else:

        return minus(a+1,sumS)
print(minus(0,sumS))

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;

public static class P
{
    static bool IsValid(RollingHash hash, int len)
    {
        HashSet<ulong> hashes = new HashSet<ulong>();
        for (int i = len; i <= hash.Length - len; i++)
        {
            hashes.Add(hash.Slice((i - len), len));
            if (hashes.Contains(hash.Slice(i, len))) return true;
        }
        return false;
    }

    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        var s = Console.ReadLine();
        var hash = new RollingHash(s);

        int valid = 0, invalid = n;
        while (invalid - valid > 1)
        {
            var mid = (valid + invalid) / 2;
            if (IsValid(hash, mid)) valid = mid;
            else invalid = mid;
        }

        Console.WriteLine(valid);
    }
}


class RollingHash
{
    const ulong MASK30 = (1UL << 30) - 1;
    const ulong MASK31 = (1UL << 31) - 1;
    const ulong MOD = (1UL << 61) - 1;
    const ulong POSITIVIZER = MOD * ((1UL << 3) - 1);
    static uint Base;
    static ulong[] powMemo = new ulong[5000 + 1];
    static RollingHash()
    {
        Base = (uint)new Random().Next(129, int.MaxValue);
        powMemo[0] = 1;
        for (int i = 1; i < powMemo.Length; i++)
            powMemo[i] = CalcMod(Mul(powMemo[i - 1], Base));
    }

    public int Length => hash.Length - 1;
    ulong[] hash;

    public RollingHash(string s)
    {
        hash = new ulong[s.Length + 1];
        for (int i = 0; i < s.Length; i++)
            hash[i + 1] = CalcMod(Mul(hash[i], Base) + s[i]);
    }

    public ulong Slice(int begin, int length)
    {
        return CalcMod(hash[begin + length] + POSITIVIZER - Mul(hash[begin], powMemo[length]));
    }

    private static ulong Mul(ulong l, ulong r)
    {
        var lu = l >> 31;
        var ld = l & MASK31;
        var ru = r >> 31;
        var rd = r & MASK31;
        var middleBit = ld * ru + lu * rd;
        return ((lu * ru) << 1) + ld * rd + ((middleBit & MASK30) << 31) + (middleBit >> 30);
    }

    private static ulong Mul(ulong l, uint r)
    {
        var lu = l >> 31;
        var rd = r & MASK31;
        var middleBit = lu * rd;
        return (l & MASK31) * rd + ((middleBit & MASK30) << 31) + (middleBit >> 30);
    }

    private static ulong CalcMod(ulong val)
    {
        val = (val & MOD) + (val >> 61);
        if (val >= MOD) val -= MOD;
        return val;
    }
}

Measured memory_bytes: 17372
a, b = gets.split(" ").map(&:to_i)
ss = Array.new(a + 1){Array.new(b + 1, 0)}
a.times do |i|
    ary = gets.split(" ").map(&:to_i)
    ss[i][0, b] = ary
    ss[i][b] = ary.inject(:+)
end
ss[a] = ss.transpose.map{|j| j.inject(:+)}
(a + 1).times do |k|
    puts ss[k].join(" ")
end

Measured memory_bytes: 9108
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define REP(i,n) for(int i=(0);i<(n);i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

const int N=500005;
int n,a,b,c,d;
char s[N];

inline int chk(int l,int r){
	rep(i,l,r-1)
		if(s[i]=='#'&&s[i+1]=='#')return 0;
	return 1;
}

inline int chk2(int l,int r,int a,int b){
	if(!chk(l,r))return 0;
	rep(i,a,b)
		if(s[i]=='.'&&s[i-1]=='.'&&s[i+1]=='.')return 1;
	return 0;
}

int main(){
	cin>>n>>a>>b>>c>>d;
	scanf("%s",s+1);
	if(c<d){
		if(chk(a,c)&&chk(b,d))
			puts("Yes");
		else
			puts("No");
	}
	else{
		if(chk(b,d)&&chk2(a,c,b,d))
			puts("Yes");
		else
			puts("No");
	}
	return 0;
}

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

int main() {
  int N;
  cin>>N;
  set<string> s;
  for(int i=0;i<N;i++){
	string x;
    cin>>x;
  	s.insert(x);
  }
  cout<<s.size()<<endl;
}
  

Measured memory_bytes: 19176
#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define UNIQUE(v) { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); }
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 (a > b) {a = b; return 1;} return 0; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) (q ? "Yes" : "No")
#define YES(q) (q ? "YES" : "NO")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) { cerr << "[DEBUG] " #q ": ["; REP(dumpall_i, (q).size()) { cerr << q[dumpall_i] << (dumpall_i == (q).size() - 1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl; }

// gcc拡張マクロ
#define gcd __gcd
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
using  ll = long long;
using ull = unsigned long long;
using  ld = long double;
using namespace std;

// モジュール
// Union-Find モジュール
struct union_find {
    vector<ull> par;
    vector<ull> num;
    union_find(ull n) : par(n, 0), num(n, 1) { iota(ALL_OF(par), 0); }
    ull root(ull i) { return par[i] == i ? i : (par[i] = root(par[i])); }
    bool same(ull i, ull j) { return root(i) == root(j); }
    void unite(ull i, ull j) {
        ull ri = root(i);
        ull rj = root(j);
        if (ri != rj) {
            if (num[ri] > num[rj]) swap(ri, rj);
            par[ri] = rj;
            num[rj] += num[ri];
        }
    }
};

// 処理内容
int main() {
    
    ll n, m; cin >> n >> m;

    union_find uf(n);
    REP(i, m) {
        ll x, y, z;
        cin >> x >> y >> z;
        uf.unite(--x, --y);
    }

    vector<ull> unq(n);
    REP(i, n) {
        unq[i] = uf.root(i);
    }
    UNIQUE(unq);
    cout << unq.size() << endl;
    
}

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

#define endl '\n'

inline int sumDigit(int n) {
    int res = 0;
    while(n != 0) {
        res += n % 10;
        n /= 10;
    }
    return res;
}

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

    int n, a, b;
    cin >> n >> a >> b;
    int res = 0;
    for(int i = 1; i <= n; i++) {
        int sum = sumDigit(i);
        if(a <= sum && sum <= b) {
            res += i;
        }
    }
    cout << res;

    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
MAX = 10 ** 6 + 5
cnt = [0] * MAX
ok = [True] * MAX
for x in a:
    cnt[x] += 1
ans = 0
for i in range(1, MAX):
    if cnt[i] > 0:
        for j in range(i * 2, MAX, i):
            ok[j] = False       
        if ok[i] and cnt[i] == 1:
            ans += 1
print(ans)

Measured memory_bytes: 34924
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <deque>
#define pb push_back
#define mod 1000000007
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;

map<int,int> mp;
int main(void){
  int n,x;
  ll res=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>x;
    if(mp.find(x)==mp.end()){
      mp[x]=1;
      res++;
    }
    else{
      mp[x]=mp[x]+1;
      if(mp[x]%2==0) res--;
      else res++;
    }
  }
  cout<<res<<endl;
  return 0;
}


Measured memory_bytes: 4864
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

int main() {
	string s, t;
	int a, b;
	cin >> s >> t;
	cin >> a >> b;
	string u;
	cin >> u;
	if (s == u) {
		a -=1;
	}
	else if (t == u) {
		b -=1;
	}
	cout << a <<" "<< b << endl;
}

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

using namespace std;
using ll = long long;

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

	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for (auto &x : a) {
		cin >> x;
	}
	int L = 0, R = *max_element(a.begin(), a.end()) + 1;
	while (R - L > 1) {
		int mid = (L + R) / 2;
		ll cnt = 0;
		for (int i = 0; i < n; i++) {
			cnt += (a[i] - 1) / mid;
		}
		(cnt > k ? L : R) = mid;
	}
	cout << R << '\n';
}

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

int main(){
  int N;
  cin >> N;
  map<int,int> m;
  for (int i=0;i<N;i++){
    int x;
    cin >> x;
    m[x]++;
  }
  int ans=0;
  for (auto x : m){
    int y=x.second;
    if (y%2==1){
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 4992
#import<atcoder/all>
int o(int a,int b){return a<b?b:a;}int e(){return 0;}int K,A,T=3<<17;main(){atcoder::segtree<int,o,e>P(T);for(std::cin>>K>>K;std::cin>>A;)P.set(A,P.prod(o(0,A-K),-o(-T,~K-A))+1);std::cout<<P.prod(0,T);}

Measured memory_bytes: 8656
#include <string>
#include <algorithm>
#include <vector> 
#include <math.h>
#include <iostream>
using namespace std;
long long mod = 1000000000 + 7;


int main()
{
	int a, b, c,d,e,k;
	cin >> a >> b >> c >> d >> e >> k;

	int i = e-a;
	string ans = "Yay!";
	if (i > k) {
		ans = ":(";
	}
	cout << ans << endl;
	return 0;

}

Measured memory_bytes: 256
s = input()
l = len(s)
h = int(l/2)

if l % 2 ==0:
  for i in range(h):
    if s[2*i] == 'L' or s[2*i + 1] == 'R':
      print('No')
      break
  else:
    print('Yes')

else:
  for i in range(h):
    if s[2*i] == 'L' or s[2*i + 1] == 'R':
      print('No')
      break
  else:
    if s[l-1] == 'L':
      print('No')
    else:
      print('Yes')

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
void ido(int M, int T, int time[])
{
	for (int i = 0; i < T; i++) {
		if (time[i] == 2)
			for (int j = 0; j < M; j++) {
				if (i - j - 1 >= 0)
					time[i - j - 1] = 1;
				if (i + j < T && time[i + j] != 2)
					time[i + j] = 1;
			}
	}
}

int main()
{
	int N, an, ret = 0, time[10000], T, M;
	cin >> N >> M >> T;
	for (int i = 0; i < T; i++)
		time[i] = 0;
	for (int i = 0; i < N; i++) {
		cin >> an;
		time[an] = 2;
	}
	ido(M, T, time);
	for (int i = 0; i < T; i++)
		if (!time[i])
			ret++;
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 3152
n = int(input())
dic = {}
for i in range(n):
	s = input()
	if s in dic:
		dic[s] += 1
	else:
		dic[s] = 1
dic_sorted = sorted(dic.items(), key = lambda x: x[1], reverse = True)
ans = []
temp = 0
for k, v in dic_sorted:
	if not temp:
		temp = v
	if temp == v:
		ans.append(k)
	else:
		break
ans.sort()
for e in ans:
	print(e)

Measured memory_bytes: 45788
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
double kyori(int x1,int x2,int y1,int y2){
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int main() {
  int n;
  cin >> n;
  vector<pair<int,int>> xy(n);
  int n_1=1;
  rep(i,n){
    int a,b;
    cin >> a >> b;
    xy.at(i)=make_pair(a,b);
  }
  for(int i=1;i<=n;i++){
    n_1*=i;
  }
  sort(xy.begin(),xy.end());
  double ans=0;
  do{
    double p=0;
    rep(i,n-1){
      p+=kyori(xy.at(i).first,xy.at(i+1).first,xy.at(i).second,xy.at(i+1).second);
    }
    p/=n_1;
    ans+=p;
  } while(next_permutation(xy.begin(),xy.end()));
  printf("%.10lf",ans);
  
}
  

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

int main() {
  string A;
  cin >> A;
  //SUN,MON,TUE,WED,THU,FRI,SAT
  if (A == "SUN")
    cout << 7 << endl;
  if (A == "MON")
    cout << 6 << endl;
  if (A == "TUE")
    cout << 5 << endl;
  if (A == "WED")
    cout << 4 << endl;
  if (A == "THU")
    cout << 3 << endl;
  if (A == "FRI")
    cout << 2 << endl;
  if (A == "SAT")
    cout << 1 << endl;
}

Measured memory_bytes: 256
#!/usr/bin/perl

use strict;
use warnings;

my $n = <STDIN>;
my $s = <STDIN>;
chomp $s;
my $t = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (my $i=0; $i<length($s); $i++) {
    substr($s, $i, 1, substr($t, index($t, substr($s, $i, 1))+$n, 1));
}

print "$s\n";

Measured memory_bytes: 768
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

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

    string ans;
    rep(i, 4) {
        ans.push_back(s[i]);
    }
    ans.push_back(' ');
    for(int i = 4; i < 12; i++) {
        ans.push_back(s[i]);
    }

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

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;





int main(void) {
    
    
    int n;
    cin>>n;
    vi v(n);
    rep(i,n)cin>>v[i];
    int odd=0,even=0;
    rep(i,n){
        if(v[i]%2==0){
            even++;
        } else{
            odd++;
        }
    }
    even+=odd/2;
    odd%=2;
    if(odd>0){
        fin("NO");
        return 0;
    }
    fin("YES");
}


Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <numeric>
#include <functional>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<double> X(N), Y(N);
    for (int n = 0; n < N; ++n) {
        cin >> X[n] >> Y[n];
    }
    
    double Res = 0.0;
    for (int n = 0; n < N; ++n) {
        for (int m = n+1; m < N; ++m) {
            double dX = X[n] - X[m];
            double dY = Y[n] - Y[m];
            Res += sqrt(dX*dX + dY*dY);
        }
    }
    Res *= double(2)/N;
    cout << fixed;
    cout.precision(15);
    cout << Res << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

class CumulativeSum {
    vector<ll> numbers;
    vector<ll> sums;

public:
    CumulativeSum(int n) {
        numbers.resize(n);
        sums.resize(n);
    }

    void set(int i, ll value) {
        numbers[i] = value;
    }

    ll getSum(int i) {
        if (i == -1) return 0;
        if (i == sums.size()) return sums.back();
        return sums[i];
    }

    ll getSectionSum(int start, int end) {
        return getSum(end) - getSum(start - 1);
    }

    void calculate() {
        for (int i = 0; i < numbers.size(); i++) {
            sums[i] = getSum(i - 1) + numbers[i];
        }
    }

};


bool check(ll n, ll k, vector<ll> &numbers, ll target) {
    vector<ll> v(n);
    rep(i, n) v[i] = numbers[i] % target;
    sort(v.begin(), v.end());
    vector<ll> u(n);
    rep(i, n) u[i] = target - v[i];

    CumulativeSum csv(n), csu(n);
    rep(i, n) csv.set(i, v[i]);
    rep(i, n) csu.set(i, u[i]);
    csv.calculate();
    csu.calculate();

    rep(i, n - 1) {
        ll l = csv.getSectionSum(0, i);
        ll r = csu.getSectionSum(i + 1, n - 1);
        if (max(l, r) <= k) return true;
    }
    return false;
}

int main() {
    ll n, k;
    cin >> n >> k;
    vector<ll> numbers(n);
    rep(i, n) cin >> numbers[i];

    ll all = accumulate(numbers.begin(), numbers.end(), 0ll);

    ll ans = 1;
    for (ll i = 1; i * i < all; i++) {
        if (all % i != 0) continue;
        if (check(n, k, numbers, i)) cmax(ans, i);
        if (check(n, k, numbers, all / i)) cmax(ans, all / i);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <cstring>

using namespace std;

//const char t[20]="CODEFESTIVAL2016";

int main(){
	int n,a,b;
	scanf("%d%d%d",&n,&a,&b);
	char ch;
	getchar();
	int sum=0,sumb=0;
	for (int i=1;i<=n;i++){
		ch = getchar();
		if (ch=='a'){
			if (sum<a+b){
				sum++;
				cout<<"Yes"<<endl;
			}
			else cout<<"No"<<endl;
		}
		else if (ch=='b'){
			if (sum<a+b && sumb<b){
				sum++;
				sumb++;
				cout<<"Yes"<<endl;
			}
			else cout<<"No"<<endl;
		}
		else cout<<"No"<<endl;
	}


	return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll m = 0, s = 0,a;
  rep(i,4){
    cin >> a;
    m += (s + a)/60;
    s = (s + a)%60;
  }
  cout << m << endl << s << endl;
  return 0;
}

Measured memory_bytes: 3112
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String args[]) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			while (true) {
				String str = br.readLine();
				String s[] = str.split(" ");
				int n = Integer.parseInt(s[0]);
				int p = Integer.parseInt(s[1]);
				if (n == 0 && p == 0)
					break;
				int parsonP[] = new int[n];
				boolean notHave[] = new boolean[n];
				int count = 0;
				int newParson = 0;
				while (true) {
					for (int i = 0; i < n; i++) {
						if (p == 0) {
							p += parsonP[i];
							parsonP[i] = 0;
							notHave[i] = true;
						} else {
							parsonP[i] += 1;
							p--;
							if (parsonP[i] != 0)
								notHave[i] = false;
						}
					}
					for (int i = 0; i < n; i++) {
						if (!notHave[i]) {
							count++;
							newParson = i;
						}
					}
					if (count == 1 && p == 0)
						break;
					count = 0;
				}
				System.out.println(newParson);
			}
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}


Measured memory_bytes: 26040
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, l, r) for (int i = l; i <= (int)(r); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define all(v) v.begin(), v.end()
#define MOD (int) (1e9+7)
#define INF (int) 1e9
#define LLINF (ll) 1e18

int main(){
    string s,t;
    cin >> s >> t;
    int ans = 0;
    rep(i, s.size()){
        if(s[i]!=t[i])ans++;
    }
    cout << ans << endl;
    // printf("%d\n", N);
    return 0;
}

Measured memory_bytes: 3900
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;


public class MyProgram
{	
  
    public static void Main()
	{
        int D = int.Parse(Console.ReadLine());
        Console.Write("Christmas");
        for(int i = 0 ; i < 25-D ; i++)
        {
            Console.Write(" Eve");
        }
        Console.WriteLine();
  
    }
    
}


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

int main() {
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<int64_t> a(n);
  for (int64_t i = 0; i < n; i++) {
    if (i == 0) continue;
    a[i] = a[i-1];
    if ((s.at(i) == 'C') && (s.at(i-1) == 'A')) {
      a[i]++;
    }
  }
  int l, r;
  for (int64_t i = 0; i < q; i++) {
    cin >> l >> r;
    cout << a[r-1] - a[l-1] << endl;
  }
}



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

int main() {

    string s;
    cin >> s;

    int ans = 0;
    if (s[0] == '1') ans++;
    if (s[1] == '1') ans++;
    if (s[2] == '1') ans++;

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

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>
 
template <class T> void chmin(T&a,const T&b) { a = min(a,b); }
template <class T> void chmax(T&a,const T&b) { a = max(a,b); }
 
void print(){cout<<endl;}
template <class Head, class... Tail>
void print(Head&& h,Tail&&... t){ 
	if(sizeof...(t)==0)
		cout<<h;
	else
		cout<<h<<' ';
	print(move(t)...);
}
 
const double EPS =1e-9;
const long INF =2147483647;//32bit 2*1e+9
const long MOD =1e+9+7;
#define PI 3.14159265258979
 
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

int main(void){	
	string S;
	cin>>S;

	if(S=="AC"){
		puts("Yes");
		return 0;
	}
	
	REP(i,(int)S.length()-2){
		if(S.substr(i,2)=="AC"){
			puts("Yes");
			return 0;
		}
	}
	print("No");
	return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
    int seki[]={0,6000,4000,3000,2000};
    int b;   
    int a;
    int kin=0;
    public void solve(){
        Scanner sc=new Scanner(System.in);
        for(int i=1;i<5;i++){
        a = sc.nextInt();
        b = sc.nextInt();
        kin =seki[a]*b;
  
        
            
        System.out.println(kin);
        }
    }
    public static void main(String[] args){
      Main obj=new Main();
        obj.solve();
    }
}

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

#sys.setrecursionlimit(10**9)

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')

#import numpy as np
import bisect
from collections import deque

def main():
	n=II()
	A=[II() for _ in range(n)]

	Q=deque([A[0]])
	#print(Q)
	for i in range(1,n):
		if A[i]<=Q[0]:
			Q.appendleft(A[i])
		else:
			a=bisect.bisect_left(Q,A[i])
			Q[a-1]=A[i]
	print(len(Q))








if __name__ == "__main__":
	main()

Measured memory_bytes: 45404
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define pb push_back
#define READ(FILE) freopen(FILE,"r",stdin)
#define WRITE(FILE) freopen(FILE,"w",stdout)
#define loop(i,s,e) for(int i=s;i<e;i++)
#define mego fast();
using namespace std;
void fast()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

ll lcm(ll x, ll y)
{
    return (x*y)/__gcd(x,y);
}
int sum(string s)
{
    int x=0,sz=s.size();
    loop(i,0,sz)x+=(s[i]-'0');
    return x;
}
/*
struct node
{
int data;
node *link;
};
typedef node* nodeptr;
void head_insert(nodeptr& head,int x)
{
    nodeptr tmp;
    tmp=new node;
    tmp->data=x;
    tmp->link=head;
    head=tmp;
}
nodeptr search(nodeptr head,int x)
{
    nodeptr cur=head;
    if(cur ==  nullptr)return cur;
    while(cur->data!=x&&cur->link!=nullptr)
    {
        cur=cur->link;
    }
    if(cur->data==x)return cur;
    else return nullptr;
}
void show(nodeptr head)
{
    nodeptr cur=head;
    if(cur==nullptr)return;
   // cout<<head->data<<" ";
    while(cur->link!=nullptr){
        cout<<cur->data<<" ";
        cur=cur->link;
    }
    cout<<endl;
}
*/

int main()
{
    mego
string s,t;
cin>>s>>t;
map<int,int> ma;
int ans=0;
loop(i,0,t.size())
ans+=(s[i]!=t[i]);

cout<<ans;
  return 0;
}


Measured memory_bytes: 3796
#include <iostream>
#include<string>
#include <cmath>

using namespace std;

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

	int num = std::stod(a + b);

	//cout << num << endl;
	int sqrt_num = sqrt(num);
	if (sqrt_num * sqrt_num == num) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;
int main()
{
    int x[5];
 	for (int i=0;i<5;i++){
      cin >> x[i];
    }
  	for (int i=0;i<5;i++){
      if(x[i] == 0){
        cout << i+1;
      }
    }
}


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>//ソートなどに必要
using namespace std;

int main() 
{
    int a, b, c, x;
    int answer = 0;
    cin >> a >> b >> c >> x;//改行を気にしない、多いときはfor文で。

    for(int i = 0; i <= a; i++)
    {
      for(int j = 0; j <= b; j++)
      {
        for(int k = 0; k <= c; k++)
        {
          if(500*i+100*j+50*k == x) answer++;
        }
      }
    }

    cout << answer << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
    
    static final long MOD = (int)1e9+7;
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        char[] s = sc.next().toCharArray();
        
        HashMap<Character, Integer> h = new HashMap<>();
        for(char c : s){
            int tmp = h.getOrDefault(c, 0);
            h.put(c, tmp+1);
        }
        
        long ans = 1;
        for(Integer v : h.values()){
            ans *= v+1;
            ans %= MOD;
        }
        
        System.out.println(ans-1);
    }
}

Measured memory_bytes: 25960
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

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

#define X real()
#define Y imag()
typedef complex<double> P;

double cross(P a,P b){return a.X*b.Y-a.Y*b.X;}
bool ccw(P a,P b,P c){return cross(b-a,c-a)>=0;}

int main(){
	
	double a[8];
	
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7])!=EOF){
		
		P b[4];
		rep(i,4)b[i]=P((double)a[i*2],(double)a[i*2+1]);
		
		bool ok = true;
		rep(i,4){
			if(!ccw(b[i],b[(i+1)%4],b[(i+2)%4]))ok=false;
		}
		
		bool ok2 = true;
		rep(i,4){
			if(!ccw(b[i],b[(i+3)%4],b[(i+2)%4]))ok2=false;
		}
		if(ok||ok2)puts("YES");
		else puts("NO");
	}
	
}

Measured memory_bytes: 1180
#include <bits/stdc++.h>
#define MODNum 1000000007
#define REP(type, i, a, b) for( type i = a; i < b; i++ )
typedef long long ll;

using namespace std;

int main (void) {
    ll N, Y;
    ll aans, bans, cans;
    aans = -1;
    bans = -1;
    cans = -1;
    cin >> N >> Y;
    for ( int i = 0; i <= N; i++ ){
        for ( int j = N - i; j >= 0; j-- ){
            int k = N - i - j;
            if ( Y == ( 10000 * i + 5000 * j + 1000 * k ) ){
                aans = i;
                bans = j;
                cans = k;
            }
        }
    }
    cout << aans << " " << bans << " " << cans << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class MainClass
{
    static void Main()
    {
        int N = int.Parse(ReadLine());
        var A = ReadLine().Split().Select(long.Parse).ToArray();
        var que = new PriorityQueue<long>(N + 1, (x, y) => -x.CompareTo(y));
        Array.Sort(A);
        Array.Reverse(A);
        long ans = 0;
        que.Push(A[0]);
        for (int i = 1; i < N; i++)
        {
            var q = que.Pop();
            ans += q;
            que.Push(A[i]);
            que.Push(A[i]);
        }
        WriteLine(ans);
    }
}
public class PriorityQueue<T>
{
    public long Size { get; private set; } = 0;
    public long MaxSize { get; private set; } = 0;
    public T[] m_heap;
    private Comparison<T> Comp = null;

    public PriorityQueue(long maxSize, Comparison<T> comp)
    {
        if (maxSize <= 0)
            throw new Exception();
        MaxSize = maxSize;
        m_heap = new T[maxSize];

        Comp = comp;
    }

    public void Push(T x)
    {
        if (Size == MaxSize)
        {
            T[] new_heap = new T[MaxSize << 1];
            Array.Copy(m_heap, new_heap, MaxSize);
            m_heap = new_heap;
            MaxSize <<= 1;
        }

        long i = Size++;
        while (i > 0)
        {
            long p = (i - 1) / 2;
            if (Comp(m_heap[p], x) <= 0)
                break;
            m_heap[i] = m_heap[p];
            i = p;
        }
        m_heap[i] = x;
    }

    public T Pop()
    {
        if (Size == 0)
            throw new Exception("Queue is empty.");

        T result = m_heap[0];
        T x = m_heap[--Size];
        long i = 0;
        while (i * 2 + 1 < Size)
        {
            long c1 = i * 2 + 1, c2 = i * 2 + 2;
            if (c2 < Size && Comp(m_heap[c2], m_heap[c1]) < 0)
                c1 = c2;
            if (Comp(m_heap[c1], x) >= 0)
                break;
            m_heap[i] = m_heap[c1];
            i = c1;
        }
        m_heap[i] = x;

        return result;
    }
}


Measured memory_bytes: 48916
/*
 Algorithms and Data Structures 1
 Insertion Sort
 Name: Ryuya Asada
 ID: s1260064
*/


#include <stdio.h>


int gcd(int, int);


int main(int argc, char* argv[]) {
    int a=0;
    int b=0;

    scanf("%d %d", &a, &b);
    printf("%d\n", gcd(a, b));
    return 0;
}


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

    return gcd(b, a%b);
}


Measured memory_bytes: 2148
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static int N = sc.nextInt();
	static int H = sc.nextInt();
	static int W = sc.nextInt();
	public static void main(String[] args) {
		int ans = (N-H+1)*(N-W+1);
		System.out.println(ans);
	}
}


Measured memory_bytes: 21460
#include <stdio.h>
int main(void){
    char S[5];
    int n = 0;
    int i;
    
    scanf("%s", S);
    
    for(i = 0; i < 4; i++){
        if(S[i] == '+'){
            n++;
        }else{
            n--;
        }
    }
    
    printf("%d\n", n);
    
    return 0;
}


Measured memory_bytes: 128
#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_imports)]

use std::collections::HashSet;
use std::collections::HashMap;
use std::collections::BTreeSet;
use std::collections::VecDeque;
use std::cmp::{max, min};

// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

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

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

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

fn main() {
    input! {
        a: usize,
        b: usize
    }
    let mut ret: f64 = 0.0;
    for i in 1..a + 1 {
        let mut tmp: f64 = 1.0 / (a as f64);
        let mut now = i;
        while now < b {
            now *= 2;
            tmp /= 2.0;
        }
        ret += tmp;
    }
    println!("{}", ret);
}

Measured memory_bytes: 4352