akhauriyash/Code-Regression huggingface dataset:
// Code for B - An Odd Problem
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define FOR(i,x,y) for(ll i=x;i<(ll)(y);i++)

#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

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

  vector<int> a(N);
  REP(i, N) {
    cin >> a[i];
  }

  int total = 0;
  REP(i, N) {
    int x = i + 1;
    if (x % 2 == 1 && a[i] % 2 == 1) {
      total ++;
    }
  }

  cout << total << endl;
  return 0;
}


Measured memory_bytes: 3596
import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)

def checkstr(i,j,s1,s2):
	#print(i,j)
	if j == len(s2):
		#print("yap")
		return True
	if s1[i]=="?" or s1[i]==s2[j]:
		if checkstr(i+1,j+1,s1,s2):
			return True
	else:
		return False

s1 = input()
s2 = input()

j=0

#print(len(s1),len(s2))

if len(s1)<len(s2):
	print("UNRESTORABLE")
	exit()

for i in range(len(s1)-len(s2),-1,-1):
	#print(i)
	if checkstr(i,j,s1,s2):
		#print("yah",i,j)
		s=s1[:i]+s2+s1[i+len(s2):]
		#print(s)
		print(s.replace('?', 'a'))
		exit()
	if i==0:
		print("UNRESTORABLE")






Measured memory_bytes: 38384
import copy

n,m = map(int, input().split())
li = list(map(int, input().split()))

ans = 10**18
for i in range(2**n):
    check = [0]*n
    
    for j in range(n):
        if ((i >> j) & 1):
            check[n - j - 1] = 1

    if sum(check) < m:
        continue
    
    li_copy = copy.copy(li)
    tmp_ans = 0
    
    for x in range(n):
        if x == 0:
            continue
        if check[x] == 0:
            continue
        
        s = max(li_copy[0:x])
        t = li_copy[x]

        if s >= t:
            tmp_ans += s - t + 1
            li_copy[x] = s + 1
    ans = min(ans, tmp_ans)
    
print(ans)

Measured memory_bytes: 9356
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String[] s = br.readLine().split(" ");
        br.readLine();
        String[] t = br.readLine().split(" ");
        Map<String, Boolean> map = new HashMap<String, Boolean>();
        for(String k : s) map.put(k, true);
        
        System.out.println(Arrays.stream(t).filter(x -> map.containsKey(x)).count());
    }
}


Measured memory_bytes: 31596
#include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;

// @@ !! LIM()

int main(/* int argc, char *argv[] */) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll a, b, c; cin >> a >> b >> c;
  ll ans = LLONG_MAX;
  if (a % 2 == 0) {
    ans = 0;
  }else {
    ans = min(ans, b*c);
  }
  if (b % 2 == 0) {
    ans = 0;
  }else {
    ans = min(ans, a*c);
  }
  if (c % 2 == 0) {
    ans = 0;
  }else {
    ans = min(ans, b*a);
  }
  cout << ans << endl;

  return 0;
}



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

using namespace std;

using ll = long long;
using ld = long double;

const double PI = 3.1415926535897932384626433832795;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : abs(x); }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

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

	int n, m;
	cin >> n >> m;

	vector<vector<int>> g(n);
	vector<int> indegree(n);
	for (int i = 0; i < n - 1 + m; i++) {
		int a, b;
		cin >> a >> b;
		a--; b--;

		g[a].push_back(b);
		indegree[b]++;
	}

	vector<int> par(n);
	for (int i = 0; i < (int)par.size(); i++) {
		par[i] = i;
	}

	queue<int> que;
	int root = 0;
	for (int i = 0; i < (int)indegree.size(); i++) {
		if (indegree[i] == 0) {
			que.push(i);
			root = i;
		}
	}

	while (!que.empty()) {
		int now = que.front(); que.pop();

		for (auto nextIdx : g[now]) {
			indegree[nextIdx]--;
			if (indegree[nextIdx] == 0) {
				par[nextIdx] = now;
				que.push(nextIdx);
			}
		}
	}

	for (int i = 0; i < (int)par.size(); i++) {
		cout << (i == root ? 0 : par[i] + 1) << endl;
	}
	return 0;
}


Measured memory_bytes: 7040
#include <iostream>
using namespace std;
int n;
int a[101];
int main(){
	cin >> n;
	for(int i = 1 ; i <= n ; ++ i)
		cin >> a[i];
	int ans = 0;
	for(int i = 1 ; i <= n ; i += 2)
		if(a[i] & 1)
			ans ++;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3576
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <queue>
#include <algorithm>
#include <set>
#include <map>

using namespace std;
typedef long long ll;
using P = pair<ll,ll>;

int main() {
    ll N;
    cin >> N;
    priority_queue<ll,vector<ll>,greater<ll>> Qd,Qt;
    for(int i=0;i<N;i++){
        ll a;
        cin >> a;
        Qd.push(a);
    }
    ll M;
    cin >> M;
    for(int i=0;i<M;i++){
        ll a;
        cin >> a;
        Qt.push(a);
    }
    while(!Qd.empty() && !Qt.empty()){
        ll tmpd = Qd.top(),tmpt = Qt.top();
        if(tmpd<tmpt) Qd.pop();
        else if(tmpd==tmpt){
            Qt.pop();
            Qd.pop();
        }
        else break;
    }
    cout << ((Qt.empty()) ? "YES" : "NO") << endl;
}

Measured memory_bytes: 6000
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

#define dprint(Exp,...) if(Exp){fprintf(stderr, __VA_ARGS__);}
#define printe(...) fprintf(stderr, __VA_ARGS__);
#define PrtExp(_Exp)  cerr<< #_Exp <<" = "<< (_Exp)
#define PrtExpN(_Exp)  cerr<< #_Exp <<" = "<< (_Exp) <<"\n"

#define SINT(n) scanf("%d",&n)
#define SINT2(n,m) scanf("%d %d",&n,&m)
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o)
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p)
#define SINT5(n,m,o,p,q) scanf("%d %d %d %d %d",&n,&m,&o,&p,&q)
#define SLL(n) scanf("%lld",&n)
#define SLL2(n,m) scanf("%lld %lld",&n,&m)
#define SLL3(n,m,o) scanf("%lld %lld %lld",&n,&m,&o)
#define SST(s) scanf("%s",s)
#define SCH(c) scanf("%c",&c)

#define GC() getchar()

#define PINT(n) printf("%d",(int)(n))
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m))
#define PINT3(n,m,l) printf("%d %d %d",(int)(n),(int)(m),(int)(l))
#define PLL(n) printf("%lld",(long long)(n))
#define PST(s) printf("%s",(s))
#define PCH(s) printf("%c",(s))

#define PINTN(n) printf("%d\n",(int)(n))
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m))
#define PINT3N(n,m,l) printf("%d %d %d\n",(int)(n),(int)(m),(int)(l))
#define PLLN(n) printf("%lld\n",(long long)(n))
#define PSTN(s) printf("%s\n",(s))
#define PCHN(s) printf("%c\n",(s))

#define PSP() printf(" ")
#define PN() printf("\n")

#define PC(c) putchar(c)
#define CSP (' ')
#define SN ("\n")

#define rep(i,a) for(int i=0;i<a;i++)
#define reP(i,a) for(int i=0;i<=a;i++)
#define Rep(i,a) for(int i=a-1;i>=0;i--)
#define ReP(i,a) for(int i=a;i>=0;i--)

#define rEp(i,a) for(i=0;i<a;i++)
#define rEP(i,a) for(i=0;i<=a;i++)
#define REp(i,a) for(i=a-1;i>=0;i--)
#define REP(i,a) for(i=a;i>=0;i--)

#define repft(i,a,b) for(int i=a;i<b;i++)
#define repfT(i,a,b) for(int i=a;i<=b;i++)
#define Repft(i,a,b) for(int i=a-1;i>=b;i--)
#define RepfT(i,a,b) for(int i=a;i>=b;i--)

#define foreach(a,it) for(auto it = a.begin(); it != a.end(); ++it)

#define FILL(a,v) fill(begin(a),end(a), v)
#define FILL0(a) memset(a,0,sizeof(a))
#define FILL1(a) memset(a,-1,sizeof(a))

typedef long long ll;

typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll>   Pll;


const int INF = 0x2aaaaaaa; // 715,827,882
const ll INFLL = 0x1f1f1f1f1f1f1f1fLL;//2,242,545,357,980,376,863

template <class A, class B> inline ostream& operator<<(ostream& st, const pair<A, B>& P) { return st << "(" << P.first << "," << P.second << ")"; };
template <class A, class B> inline pair<A, B> operator+(const pair<A, B>& P, const pair<A, B>& Q) { return pair<A, B>(P.first + Q.first, P.second + Q.second); };
template <class A, class B> inline pair<A, B> operator-(const pair<A, B>& P, const pair<A, B>& Q) { return pair<A, B>(P.first - Q.first, P.second - Q.second); };

#define fs  first
#define sc  second



int main() {
	int n;
	int x = 0, y = 0, t=0;

	cin >> n;
	rep(i, n) {
		int T, X, Y;
		cin >> T >> X >> Y;
		if (abs(X - x) + abs(Y - y) > T-t) {
			puts("No"); return 0;
		}
		if ((abs(X - x) + abs(Y - y)+ T-t)%2==1) {
			puts("No"); return 0;
		}
		x = X; y = Y; t = T;
	}
	puts("Yes"); return 0;

	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def main():
    n = int(input().strip())
    v = list(map(int, input().strip().split()))
    v.sort()
    M = v[-1]
    d = INF
    ans = -1
    for c in v[:-1]:
        if abs(c - M//2) <= d:
            d = abs(c - M//2)
            ans = c
    print(M, ans)


if __name__ == '__main__':
    main()


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

void print_array(vector<int> a) {
    size_t array_size = a.size();
    for (int i = 0; i < array_size; i++) {
        if (i) cout << ' ';
        cout << a[i];
    }
    cout << endl;
}

void insertionSort(vector<int>& a, int n) {
    for (int i = 1; i < n; i++) {
        int key = a[i];
        int j = i - 1;
        while (j >= 0 && a[j] > key) {
            a[j + 1] = a[j];
            j--;
        }
        a[j + 1] = key;
        print_array(a);
    }
}

int main() {
    int n,num;

    cin >> n;
    vector<int> a;
    for (int i = 0; i < n; i++) {
        cin >> num;
        a.push_back(num);
    }
  
    print_array(a);
    insertionSort(a, n);

    return 0;
}


Measured memory_bytes: 3144
#include<bits/stdc++.h>
using namespace std ;
#define Next( i, x ) for( register int i = head[x]; i; i = e[i].next )
#define rep( i, s, t ) for( register int i = (s); i <= (t); ++ i )
#define drep( i, s, t ) for( register int i = (t); i >= (s); -- i )
#define re register
#define int long long
int gi() {
	char cc = getchar() ; int cn = 0, flus = 1 ;
	while( cc < '0' || cc > '9' ) {  if( cc == '-' ) flus = - flus ; cc = getchar() ; }
	while( cc >= '0' && cc <= '9' )  cn = cn * 10 + cc - '0', cc = getchar() ;
	return cn * flus ;
}
const int N = 2e5 + 5 ; 
const int P = 2019 ; 
char s[N] ; 
int g[N] ; 
int f[N], a[N], n, inv[N], I10 ; 
int fpow( int x, int k ) {
	int ans = 1, base = x ;
	while( k ) {
		if( k & 1 ) ans = ans * base % P ;
		base = base * base % P, k >>= 1 ; 
	} return ans ; 
}
signed main()
{
	scanf("%s", s + 1 ), n = strlen( s + 1 ) ;
	rep( i, 1, n ) a[i] = s[i] - '0' ;
	rep( i, 1, n ) f[i] = ( f[i - 1] * 10 + a[i] ) % 2019 ;
	//fi - fj * 10^{i-j} | 2019
	//fi % 2019 = fj * 10^{i-j} * 10^{n} % 2019
	//fi * 10^{n-i} = fj * 10^{n-j}
	I10 = fpow( 10, P - 2 ), inv[0] = 1 ; 
	rep( i, 1, n ) inv[i] = inv[i - 1] * 10 % P ;
	int Ans = 0 ; g[0] = 1 ; 
	rep( i, 1, n ) {
		Ans = Ans + g[f[i] * inv[n - i] % P] ;
		++ g[f[i] * inv[n - i] % P] ;
	}
	printf("%lld\n", Ans ) ;
	return 0 ;
}


Measured memory_bytes: 8660
#include <bits/stdc++.h>
using namespace std;
struct point {
    double x, y;
    point (){}
    point (double x, double y) : x(x), y(y) {}
    point friend operator - (point l, point r) {
        return point (l.x - r.x, l.y - r.y);
    }
    double friend operator * (point l, point r) {
        return l.x * r.x + l.y * r.y;
    }
    double friend operator ^ (point l, point r) {
        return l.x * r.y - l.y * r.x;
    }
    double len () {
        return sqrt (x * x + y * y);
    }
} p0, p1, p2, P;
int main () {
    int Q;
    cin >> p0.x >> p0.y >> p1.x >> p1.y;
    cin >> Q;
    P = p1 - p0;
    while (Q --) {
        cin >> p2.x >> p2.y;
        p2 = p2 - p0;
        double u = P ^ p2;
        if (u > 0) cout << "COUNTER_CLOCKWISE" << endl;
        else if (u < 0) cout << "CLOCKWISE" << endl;
        else {
            u = P * p2;
            if (u < 0) cout << "ONLINE_BACK" << endl;
            else {
                if (P.len () >= p2.len ()) cout << "ON_SEGMENT" << endl;
                else cout << "ONLINE_FRONT" << endl;
            }
        }
    }
    return 0;
}



Measured memory_bytes: 3228
#include<bits/stdc++.h>
#define REP(i,n) for(ll i=0;i<(n);i++)
#define INF 1e9
#define All(x) (x).begin(),(x).end()
#define Cout(x) cout << (x) << endl
typedef long long ll;
using namespace std;

int main(){
    ll N,A,B,X,Y;
    string s,t;
    cin>>N>>s;
    int cnt=0;
    REP(i,N-2){
        if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')cnt++;
    }
    Cout(cnt);
}

Measured memory_bytes: 256
import math
import cmath
def dot(a:complex,b:complex):
  return (a.conjugate()*b).real
def cross(a:complex,b:complex):
  return (a.conjugate()*b).imag
next=[1,2,0]
try:
  while True:
    l=list(map(float,input().split()))
    p=[complex(l[2*j],l[2*j+1]) for j in range(4)]
    flg_ans=True
    sgn=1 if cross(p[0]-p[3],p[1]-p[3])>0 else -1
    for i in range(3):
      flg_ans=flg_ans and (sgn*cross(p[i]-p[3],p[next[i]]-p[3]))>0
    print('YES' if flg_ans else 'NO')
except EOFError:
  pass


Measured memory_bytes: 5700
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define F first
#define S second

using namespace std;
typedef pair<int,int> P;

const int MOD=1000000007;
int INF=100100100100100;

signed main(){
  int n;cin>>n;
  int a[3],b[3];
  int po[3];
  int ans=0;
  int c=0;
  cin>>a[0]>>a[1]>>a[2]>>b[0]>>b[1]>>b[2];
  
  rep(i,3){
    if(a[i]<=b[i])po[i]=0;
    else po[i]=1;
    if(po[i]==1)c++;
  }
  rep(i,3){
    for(int j=i+1;j<3;j++){
      if(po[i]>po[j]){
        swap(a[i],a[j]);
        swap(b[i],b[j]);
        swap(po[i],po[j]);
      }
    }
  }
  if(c==0 || c==3){
    if(c==3){
      rep(i,3)swap(a[i],b[i]);
    }
    rep(i,n+1){
      rep(j,n+1){
        int res=0;
        int nokori=n-i*a[0]-j*a[1];
        if(nokori<0)continue;
        res+=i*b[0]+j*b[1];
        int ko,amari;
        if(a[2]<b[2]){
          ko=nokori/a[2],amari=nokori%a[2];
          res+=ko*(b[2])+amari;
        }
        //cout<<i<<" "<<j<<" "<<ko<<" "<<res<<endl;
        
        ans=max(ans,res);
      }
    }
  }
  else if(c==1){
    rep(i,n+1){
      rep(j,n+1){
        int res=0;
        int nokori=n-i*a[0]-j*a[1];
        if(nokori<0)continue;
        nokori+=i*b[0]+j*b[1];
        int ko=nokori/b[2],amari=nokori%b[2];
        res=ko*a[2]+amari;
        //cout<<i<<" "<<j<<" "<<ko<<" "<<res<<endl;
        ans=max(ans,res);
      }
    }
  }
  else if(c==2){
    rep(i,n*n+1){
      int res=0;
      int nokori=n/a[0]*b[0]+(n%a[0]);
      if(nokori<i*b[1])continue;
      nokori-=i*b[1];
      int j=nokori/b[2];
      nokori-=j*b[2];
      res=nokori+i*a[1]+j*a[2];
      //cout<<n/a[0]<<" "<<i<<" "<<j<<" "<<res<<endl;
        
      ans=max(ans,res);
      
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<ctime>
#include<cmath>
#include<utility>
#include<cstdlib>
#include<bitset>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iomanip>
using namespace std;                       

#define ll long long
#define pb push_back
#define mp make_pair

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

const ll M = 1e9 + 7;

ll fastpo(ll a, ll x){
    if(x == 0) return 1ll;
    if(x == 1) return a;
    ll y = fastpo(a, x/2);
    if(x%2 == 0){
        return y*y;
    }
    return y*y*a;
}

ll inv(ll a, ll M){
    return fastpo(a, M-2);
}

ll gcdExtended(ll a, ll b, ll *x, ll *y) 
{ 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    ll x1, y1; 
    ll gcd = gcdExtended(b%a, a, &x1, &y1); 
  
    *x = y1 - (b/a) * x1; 
    *y = x1; 
  
    return gcd; 
}

ll modInverse(ll a, ll m) 
{ 
    ll x, y; 
    ll g = gcdExtended(a, m, &x, &y); 
    if (g != 1) 
        return -1; 
    else
    { 
        ll res = (x%m + m) % m; 
        return res;
    } 
}


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

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

void print(vector<int> &a){
    int n = a.size();
    for(int i=0; i<n; i++){
        cout<<a[i]<<" ";
    }
    cout<<endl;
}

int main(){
//    clock_t time_req;
//     time_req = clock();
    fastio;
    int t;
    cin>>t;
    int ac = 0, tle = 0, re = 0, wa = 0;
    for(int i=0; i<t; i++){
        string s;
        cin>>s;
        if(s == "AC") ac++;
        if(s == "WA") wa++;
        if(s == "TLE") tle++;
        if(s == "RE") re++;
    }
    cout<<"AC x "<<ac<<endl;
    cout<<"WA x "<<wa<<endl;
    cout<<"TLE x "<<tle<<endl;
    cout<<"RE x "<<re<<endl;
    // time_req = clock()-time_req;
    // cout<<"Time taken: "<<(float)time_req/CLOCKS_PER_SEC<<"s"<<endl;
    return 0;
}

Measured memory_bytes: 3652
parseInt(x::String) = parse(Int, x)
parseInt(x::SubString{String}) = parse(Int, x)
parseInt(x::Char) = parse(Int, x)
parseInt(x::Float64) = trunc(Int, x)
parseFloat(x::String) = parse(Float64, x)
parseFloat(x::Int) = trunc(Float64, x)
parseFloat(x::SubString{String}) = parse(Float64, x)
parseFloat(x::Char) = parse(Float64, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n=parseInt(readline())
    a=parseMap(split(readline()))
    one,two,four=0,0,0
    for i in a
        if i%4==0
            four+=1
        elseif i%2==0
            two+=1
        else
            one+=1
        end
    end
    if two>0
        one+=1
    end
    if one<=four+1
        println("Yes")
    else
        println("No")
    end
end
main()

Measured memory_bytes: 167208
#include <stdio.h>


int main()
{
	unsigned long A, B;
	long ans;
	char op;


	scanf("%ld %c %ld", &A, &op, &B);

	if(op == '+')
		ans = A + B;
	else
		ans = A - B;

	printf("%ld\n", ans);

	return 0;
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
ll n,r;
//ld ;
//string s,t,u;
// char c;

int main() {
  cin >> n >> r;
  ll rn = (n>10)?r:r+1000-100*n;
  cout << rn << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
    long long x,y,u,v,t;
    cin>>x>>y>>u>>v>>t;
    if(x<u)
    {
        if(x+y*t>=u+v*t) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    else
    {
        if(x-y*t<=u-v*t) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}


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

using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 1145141919454519;

int main() {

    ll N, M;
    cin >> N >> M;

    for(ll i = 0; i < M; i++){
        ll t; cin >> t;
        N -= t;
    }

    if(N > 0){
        cout << "No" << endl;
    } else{
        cout << "Yes" << endl;
    }


}

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

int main()
{
    int a,p; // 変数の宣言
    cin >> a >> p; // 入力

    int sum = a*3 + p; // リンゴを全て砕き、かけらの合計を求める

    int apple_pie; // 作れるアップルパイの数
    
    if(sum %2 == 1) // かけらの合計が奇数の時
    {
        apple_pie = (sum - 1) / 2;
    }
    else // かけらの合計が偶数の時
    {
        apple_pie = sum / 2;
    }

    cout << apple_pie << endl;
}

Measured memory_bytes: 256
s = '0'
s += input()


def isPara(string, l, r):
    while l <= r:
        if s[l] != s[r]:
            return False
        l += 1
        r -= 1
    return True


def solve():
    N = len(s)-1
    if s[N] == '1' or s[1] == '0':
        print(-1)
        return
    if isPara(s, 1, N-1) == False:
        print(-1)
        return
    sz = 1
    while sz < N:
        if(s[sz] == '1'):
            sz += 1
        else:
            break
    sz -= 1
    # a max chain of sz
    now = 1
    for i in range(2, N+1):
        print(str(now) + ' ' + str(i))
        if(s[i-1] == '1'):
            now = i


solve()


Measured memory_bytes: 4560
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ans = 0
for i in range(n):
    ans += b[a[i]-1]
    if i <= n-2 and a[i]+1 == a[i+1]:
        ans += c[a[i]-1]

print(ans)


Measured memory_bytes: 3064
import sys
sys.setrecursionlimit(10**7)

def dfs(v, d=0, p=-1):
    global dist
    dist[v] = d
    for u in to[v]:
        if u == p:
            continue
        dfs(u, d+1, v)


def calcDist(s):
    global dist
    dist = [0 for _ in range(N)]
    dfs(s)
    return dist


N, s, t = map(int, input().split())
s -= 1
t -= 1
to = [[] for _ in range(N)]
dist = [0 for _ in range(N)]


for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

distS = calcDist(s)
distT = calcDist(t)

mx = 0
for i in range(N):
    if distS[i] < distT[i]:
        mx = max(mx, distT[i])

ans = mx - 1
print(ans)




Measured memory_bytes: 117060
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 10;
int n, m, s[N], p[N];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  FOR(i, 0, m){
    int k;
    cin >> k;
    FOR(_, 0, k){
      int a;
      cin >> a;
      s[i] += 1<<(a-1);
    }
  }
  FOR(i, 0, m) cin >> p[i];
  int ans = 0;
  FOR(i, 0, 1<<n){
    FOR(j, 0, m) if( __builtin_parity(i&s[j]) != p[j]) goto bad;
    ans++;
bad:;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
// Greatest_Common_Divisor.cpp
#include <iostream>
using namespace std;

//最大公約数を求める関数
int Greatest_Common_Divisor(int, int);
void Swap(int&, int&);

int main()
{
	int x, y;
	cin >> x >> y;

	cout << Greatest_Common_Divisor(x, y) << endl;

	cin.get();
	cin.get();
	return 0;
}

int Greatest_Common_Divisor(int x, int y) {
	int i;
	if(x == y) return x;
	if(x < y) Swap(x, y);

	i = x % y;

	int tmp = i;

	while (i) {
		if (tmp % i == 0 && y % i == 0) {
			return i;
		}
		i--;
	}
}

void Swap(int &x, int &y) {
	int tmp;
	tmp = x;
	x = y;
	y = tmp;
}


Measured memory_bytes: 3104
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) {
		FS r = new FS();
		int n = r.nextInt();
		int[] S = new int[n];
		for(int i=0; i<n; i++) {
			S[i] = r.nextInt();
		}
		int q = r.nextInt();
		int c = 0;
		for(int i=0; i<q; i++) {
			int t = r.nextInt();
			if(Arrays.binarySearch(S, t) >= 0) c++;
		}
		System.out.println(c);
	}
	
	// Read Class
	static class FS {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}
	
		private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
		private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
		private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
	
		public boolean hasNext() { skipUnprintable(); return hasNextByte();}
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while(isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		public int nextInt() {
			return (int)nextLong();
		}
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while(true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if(b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}
}

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

int main(){
  int n, m, l;
  cin >> n >> m >> l;
  
  int a[110][110] = {0};
  int b[110][110] = {0};
  long long int c[110][110] = {0};
  rep(i, n){
    rep(j, m){
      cin >> a[i][j];
    }
  }
  
  rep(j, m) {
    rep(k, l) {
      cin >> b[j][k];
    }
  }

  rep(i, n) {
    rep(k, l) {
      rep(j, m) {
        c[i][k] += a[i][j] * b[j][k];
      }
      if(k) cout << " ";
      cout << c[i][k];
    }
    cout << endl;
  }
  
  
  return 0;
}



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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define each(it,v) for(auto &it : v)
#define mod 1000000007
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vl vector<long>
#define P pair<int,int>
using namespace std;

main()
{
        int n,k,x,y; cin>>n>>k>>x>>y;
        int ans=0;
        rep(i,n)
        {
                if(i+1<=k)ans+=x;
                else ans+=y;
        }
        cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
	char S[100],space;
	int K,i,len;
	scanf("%d",&K);
	scanf("%c",&space);
	gets(S);
	len=strlen(S);
	if(len<=K)
	{
		puts(S);
	}
	else if(len>K)
	{
		for(i=0;i<K;i++)
		{
			printf("%c",S[i]);
		}
		printf("...\n");
	}
	
}

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

#define fs first
#define sc second
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

const int32_t inf = 1001001001;
const int64_t infll = 1001001001001001001ll;
const int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}, dy[] = {-1, 0, 0, 1, -1, -1, 1, 1};

template <typename T> using vector2d = vector<vector<T>>;

// clang-format off
template <typename T> void sort(vector<T> &v) { sort(all(v)); }
ostream &operator<<(ostream &os, __int128_t value) { if (ostream::sentry(os)) { __uint128_t tmp = value < 0 ? -value : value; char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
istream &operator>>(istream &is, __int128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } if (in[0] == '-') value *= -1; return is; }
ostream &operator<<(ostream &os, __uint128_t value) { if (ostream::sentry(os)) { char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[value % 10]; value /= 10; } while (value != 0); int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
istream &operator>>(istream &is, __uint128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } return is; }
template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << v[0]; for (int i = 1; i < v.size(); ++i) os << " " << v[i]; return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << p.fs << " " << p.sc; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.fs >> p.sc; return is; }

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

inline int64_t in() { int64_t x = 0; cin >> x; return x; }
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

signed main(int argc, char *argv[]) {
  char a, b;
  cin >> a >> b;
  if (a < b)
    cout << "<" << endl;
  else if (a > b)
    cout << ">" << endl;
  else
    cout << "=" << endl;
}


Measured memory_bytes: 256
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
const ll MOD = /*1'000'000'007LL;*/ 998'244'353LL;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
const int dx[4]={ 1,0,-1,0 };
const int dy[4]={ 0,1,0,-1 };

ll N;
ll X, M;

ll ans = 0;
ll idx[100001] ={};
ll sum[100001] ={};

signed main(){
    cin >> N >> X >> M;

    ll i = 1;
    sum[X] = ans = 1+X;
    N--;
    while(N > 0){
        X = X*X%M;
        ans += X;
        if(sum[X] > 0){
            ll cycle = ans - sum[X];
            ll len = i - idx[X];
            ll tmp = (N-1) / len;
            ans += tmp * cycle;
            N -= tmp * len;
            N--;
            break;
        }
        idx[X] = i;
        i++;
        sum[X] = ans;
        N--;
    }
    assert(N <= 100001);
    while(N > 0){
        X = X*X%M;
        ans += X;
        N--;
    }
    cout << ans-1 << endl;
}

Measured memory_bytes: 5120
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,b,n) for(int i=b;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
struct edge{ int a,b,c,d;};
int n,m,q;
int ans=0;
vector<edge> y;
void dfs(vector<int>A){
  if(A.size()==n+1){
    int tot=0;
    rep(i,q)if(A[y[i].b]-A[y[i].a]==y[i].c)tot+=y[i].d;
    ans=max(ans,tot);
    return;
  }
  A.push_back(A.back());
  while(A.back()<=m){
    dfs(A);
    A.back()++;
  }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin>>n>>m>>q;
    y=vector<edge>(q);
    rep(i,q)cin>>y[i].a>>y[i].b>>y[i].c>>y[i].d;
    dfs(vector<int>(1,1));
    cout<<ans<<endl;
    return 0;
}


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


int main(){
  ll N;
  cin >> N;
  vector<ll> A(N),so(1000008,0);
  rep(i,0,N) cin >> A[i];

  sort(A.begin(), A.end());

  ll res = 0;

  rep(i,0,N){
    bool x = false;
    if(i && A[i-1]==A[i])x=true;
    if(i+1!=N && A[i+1]==A[i])x=true;
    if(x && so[A[i]]==0){
      for(int j=A[i];j<1000007;j+=A[i]){
        so[j]=1;
      }
      continue;
    }

    if(so[A[i]]==0){
      res++;
      for(int j=A[i];j<1000007;j+=A[i]){
        so[j]=1;
      }
    }
  }
  cout << res << endl;
}



Measured memory_bytes: 12684
#include <bits/stdc++.h>
#define int long long
#define double long double
const int INF = (int)1e18 + 18;
const int maxn = (int) 1e6 + 6; 
using namespace std;
 
int n, a, b;
 
signed main() {

	cin >> n >> a >> b;

	int ans = min(n*a, b);

	cout << ans << endl;

	return 0;
}

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

using namespace std;

void solve()
{
	double a, b, n;
	cin >> a >> b >> n;

	double x = min(n, b - 1);

	cout << floor(a * x / b) << endl;

}

int main()
{
	solve();

	return 0;
}

Measured memory_bytes: 3780
#include <bits/stdc++.h>
using namespace std;
int main() {
    char b; cin >> b;
    if(b == 'A') cout << 'T' << endl;
    else if(b == 'T') cout << 'A' << endl;
    else if(b == 'C') cout << 'G' << endl;
    else cout << 'C' << endl;
    return 0;
}

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

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  string S;
  cin >> S;
  const size_t len = S.length();
  reverse(begin(S), end(S));
  vector<int> dp(len + 1, 0);
  for (size_t i = 0, d = 1; i < len; ++i, d = d * 10 % 2019)
    dp[i + 1] = (dp[i] + (S[i] - '0') * d) % 2019;
  array<long long int, 2019> counts = {};
  for (auto& e : dp)++counts[e];
  long long int ans = 0;
  for (auto& e : counts)ans += e * (e - 1) / 2;
  cout << ans << endl;
}


Measured memory_bytes: 4352
h, w = map(int, input().split())
s = []
s.append(['.']*(w+2))
for i in range(1, h+1):
    t = input()
    u = ['.']
    for j in range(w):
        u.append(t[j])
    u.append('.')
    s.append(u)
s.append(['.']*(w+2))
key = True
d = [[0, -1], [0, 1], [-1, 0], [1, 0]]
flag = True
for i in range(1, h+1):
    for j in range(1, w+1):
        if s[i][j] == '#':
            key = False
            for k in range(len(d)):
                if s[i+d[k][0]][j+d[k][1]] == '#':
                    key = True
            if not key:
                flag = False
                break
    if not flag:
        break
if flag:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 40048
#coding:utf-8
import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    N = II()
    A = LMIIS()
    B = LMIIS()
    GA = deque() #ai > bi の組
    GB = deque()
    for a,b in zip(A,B):
        if a > b:
            GA.append(a-b)
        elif a < b:
            GB.append(b-a)
    
    for ga in GA:
        tmp = ga
        while GB:
            gb = GB.popleft()
            if gb >= tmp*2:
                GB.append(gb-tmp*2)
                break
            else:
                tmp -= gb//2
        if len(GB) == 0:
            print('No')
            return
    print('Yes')
        
    

if __name__ == '__main__':
    main()

Measured memory_bytes: 68460
import java.util.Scanner;

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String output = "No";
        
        main:
        for (int i = 1; i <= 9; i ++) {
            for (int j = i; j <= 9; j ++) {
                if (i * j == n) {
                    output = "Yes";
                    break main;
                }
            }
        }
        
        System.out.println(output);
    }
    
}


Measured memory_bytes: 21844
package main
import (
  "container/list"
  "fmt"
)
func main() {
  var x string
  stack := list.New()
  fmt.Scan(&x)
  for i:=0;i<len(x);i++ {
    switch x[i:i+1] {
    case "S": stack.PushFront("S")
    case "T":
      if stack.Len() == 0 {
        stack.PushFront("T")
        break
      }
      s,_ := stack.Remove(stack.Front()).(string)
      if s == "T" {
        stack.PushFront("T")
        stack.PushFront("T")
      }
    }
  }
  fmt.Println(stack.Len())
}

Measured memory_bytes: 13952
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lldd long double
int main()
{
  string s;
  cin>>s;
  ll sum=0;
  for(ll i=0; i<s.length(); i++)
  {
    s[i]=s[i]-'0';
    sum= sum + s[i];
  }
  if(sum%9==0)
    cout<<"Yes";
  else 
    cout<<"No";
}

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

int main() {
  int i, N, a[110], count=0, A=0, B=0;
  
  cin >> N;
  rep(i,N) cin >> a[i];
  
  sort(a,a+N,greater<int>());
  
  for(i=0;i<N/2;i++){
    A+=a[2*i];
    B+=a[2*i+1];
  }
  
  if(N%2==1) A+=a[N-1];
  
  cout << A-B;
  
}

Measured memory_bytes: 3636
/*

Code for problem A by cookiedoth
Generated 09 Aug 2020 at 02.58 PM


   ,##.                   ,==.
 ,#    #.                 \ o ',
#        #     _     _     \    \
#        #    (_)   (_)    /    ; 
 `#    #'                 /   .'  
   `##'                   "=="

^_^
-_-
z_z

*/

#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <functional>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <complex>
#include <cassert>
#include <random>
#include <cstring>
#include <numeric>
#define ll long long
#define ld long double
#define null NULL
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define debug(a) cerr << #a << " = " << a << endl
#define forn(i, n) for (int i = 0; i < n; ++i)
#define sz(a) (int)a.size()

using namespace std;

template<class T> int chkmax(T &a, T b) {
	if (b > a) {
		a = b;
		return 1;
	}
	return 0;
}

template<class T> int chkmin(T &a, T b) {
	if (b < a) {
		a = b;
		return 1;
	}
	return 0;
}

template<class iterator> void output(iterator begin, iterator end, ostream& out = cerr) {
	while (begin != end) {
		out << (*begin) << " ";
		begin++;
	}
	out << endl;
}

template<class T> void output(T x, ostream& out = cerr) {
	output(x.begin(), x.end(), out);
}

void fast_io() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

int n;

map<pair<int, int>, ll> mp;

void read() {
	cin >> n;
	for (int i = 0; i < n; ++i) {
		string s;
		cin >> s;
		int dot_pos = -1;
		ll number = 0;
		for (int i = 0; i < s.size(); ++i) {
			if (s[i] == '.') {
				dot_pos = i;
			} else {
				number *= 10;
				number += (ll)(s[i] - '0');
			}
		}
		int pw10 = 0;
		if (dot_pos != -1) {
			pw10 = (int)s.size() - 1 - dot_pos;
		}
		int pw2 = 0, pw5 = 0;
		while (number % 2 == 0) {
			pw2++;
			number /= 2;
		}
		while (number % 5 == 0) {
			pw5++;
			number /= 5;
		}
		mp[{pw2 - pw10, pw5 - pw10}]++;
	}
	ll ans = 0;
	for (auto pp1 : mp) {
		for (auto pp2 : mp) {
			if (pp1.first.first + pp2.first.first >= 0 && pp1.first.second + pp2.first.second >= 0) {
				if (pp1.first == pp2.first) {
					ans += pp1.second * (pp1.second - 1) / 2;
				}
				if (pp1.first < pp2.first) {
					ans += pp1.second * pp2.second;
				}
			}
		}
	}
	cout << ans << '\n';
}

signed main() {
	fast_io();
	read();
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define ref(i,n) for(int i=0;i<n;i++)
using namespace std;
#define INF 111111111111
#define mod 998244353
typedef long long ll;
typedef pair<int,int> P;
int n,m;
int a[200000],b[200000],c[200000];


int main()
{

        cin>>n>>m;
        ref(i,n){
            cin>>b[i];
        }
        ref(j,m){
            ref(i,n){
                if(i>=b[i])c[i-b[i]]++;
                else c[0]++;
                if(n>i+b[i]+1) c[i+b[i]+1]--;


            }
            b[0]=c[0];
            bool done=1;
            ref(i,n-1){
                b[i+1]=c[i+1]+b[i];
                if(b[i+1]<n) done=0;
            }
            if(done) break;
            ref(i,n) c[i]=0;
        }
        ref(i,n) cout<<b[i]<<" ";
    return 0;
        }


Measured memory_bytes: 5140
/*

*/
#include<bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,a,n) for(int i=(a);i<(n);i++)
#define repe(i,a) for(auto &i:a)

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  int x;cin>>x;
  cout<<10-x/200<<endl;
}

Measured memory_bytes: 3652
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)*}
    };
}

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: usize,
        aa: [usize;n-1]
    }
    let mut v = vec![0;n];
    for a in aa {
        v[a-1] += 1;
    }
    for i in v {
        println!("{}", i);
    }
}


Measured memory_bytes: 5556
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int mod = 1e9 + 9;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t = 1 ;
	//cin >> t;
	while(t--){
		int n;
		cin >> n;
		vector<int> dp(3,0);
		for(int day = 0; day < n; day++){
			vector<int> c(3);
			vector<int> temp(3,0);
			for(int i = 0; i < 3; i++)
				cin >> c[i];
			for(int i = 0; i < 3; i++)
				for(int j = 0; j < 3; j++){
					if(i != j){
						temp[j] = max(temp[j] , dp[i] + c[j]); 
					}
				}
			dp = temp;
		}
		cout << max(dp[0],max(dp[1],dp[2])) << endl;

	}
	return 0;
}


Measured memory_bytes: 3636
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
*/public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		B solver = new B();
		solver.solve(1, in, out);
		out.close();
	}
static class B   {
public void solve(int testNumber, Scanner in, PrintWriter out) {
        // 入力
        String S = in.next();
        String T = in.next();
        int ans = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) != T.charAt(i)) ans++;
        }
        // 出力
        out.println(ans);

    }

}
}



Measured memory_bytes: 41360
#define _USE_MATH_DEFINES
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<utility>
#include<queue>
#include<stdbool.h>
#include<math.h>
#include<sstream>
typedef long long ll;
#define N (1000000000+7)
using namespace std;
typedef pair<int, int> P;

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

int sum[100010] = { 0 };

string origin[4] = { "maerd","remaerd","esare","resare" };

int main(void) {
	string s, t = "";
	cin >> s;
	reverse(s.begin(), s.end());
	for (int i = 0;i < s.length();i++) {
		t += s[i];
		//cout << t << endl;
		if (t.length() == 5) {
			if ((t == origin[0]) || (t == origin[2]))t = "";
		}
		if (t.length() == 6) {
			if (t == origin[3])t = "";
		}
		if (t.length() == 7) {
			if ((t == origin[1])) {
				t = "";
			}
			else {
				cout << "NO" << endl;
				return 0;
			}
		}
	}
	cout << "YES" << endl;
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
#include <set>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int m;
    while (cin >> m, m){
        vector<pair<int, int>> v, v2;
        for (int i = 0; i < m; ++i) {
            int a, b;
            cin >> a >> b;
            v.emplace_back(a, b);
        }
        int n;
        cin >> n;
        set<pair<int, int>> s;
        for (int i = 0; i < n; ++i) {
            int a, b;
            cin >> a >> b;
            s.emplace(a, b);
            v2.emplace_back(a, b);
        }
        for (int i = 0; i < n; ++i) {
            int pp = v2[i].first-v[0].first, qq = v2[i].second-v[0].second;
            int valid = 1;
            for (int j = 0; j < m; ++j) {
                if(!s.count(make_pair(v[j].first+pp, v[j].second+qq))) valid = 0;
            }
            if(valid) {
                cout << pp << " " << qq << "\n";
            }
        }
    } 
    return 0;
}



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

int main()
{
  int a,b;
  cin>> a;
  cin >> b;
   if (a<b)
   {
   cout << "0"<< endl;
   }
     else 
     {
     cout << "10"<< endl;
   }
 
 return 0;
}



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

int main()
{
    int n;
    cin>>n;
    
    int a,b;
    cin>>a>>b;
    
    for(int i=a;i<=b;i++)
    {
        if(i%n==0)
        {
            cout<<"OK"<<endl;
            return 0;
        }
    }
    
    cout<<"NG"<<endl;
}


Measured memory_bytes: 3568