akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <unordered_map>
#include <iomanip>
#include <cmath>
#include <tuple>
using namespace std;
using ll = long long;
#define rep(i, j, n) for(int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for(int i = (int)n - 1; j <= i; --i)

constexpr ll MOD = 0x3b9aca07;
constexpr int INF = 0x3f3f3f3f;
constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;


int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	ll a, b, c; cin >> a >> b >> c;
	// a + b + 2 * root(a * b) < c
	// 4 * a * b < (c - a - b) ^ 2
	if (0 < c - a - b && 4 * a * b < (c - a - b) * (c - a - b)) cout << "Yes";
	else cout << "No";
	return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <limits>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
using lint = long long;
using P = pair<int, int>;

int F, H, I, J, K, L, M, N, S, T, U;
// lint F, H, I, J, K, L, M, N, S, T, U;
// string A, B;
int ans = 0;

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

	cin >> N;

	int tmp = N;
	rep(i, N) {
		cin >> F;
		if (F <= tmp) {
			ans++;
			tmp = F;
		}
	}

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

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

using namespace std;

int main()
{
	int N, W;
	cin >> N >> W;
	int w[N], v[N];
	for (int i=0;i<N;i++)
		cin >> w[i] >> v[i];
	long long x[W+1];
	memset(x, 0, sizeof(x));
	for(int i=0;i<N;i++)
	{
		for(int j=W;j>=0;j--)
			if(x[j] || j == 0)
				if(j + w[i] <= W)
					x[j+w[i]] = max(x[j] + v[i], x[j+w[i]]); 
	}
	long long ans = 0;
	for(int i=0;i<=W;i++)
		ans = max(ans, x[i]);
	cout << ans << "\n";
	return 0;
}




Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <unistd.h>
#include <cctype>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 1 << 30
#define LLINF LLONG_MAX/3
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
using ll = long long;
using Pll = pair<ll,ll>;
using Pii = pair<int,int>;
using Pdd = pair<double,double>;
using dcomplex = complex<double>;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cerr<<a[i]<<((i==a.size()-1)?"\n":" ");}}
ll gcd(ll a,ll b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}
ll fact(ll a){ll b=1;for(ll i=1;i<=a;i++)b*=i;return b;}
ll power(ll x,ll n){ll a=1;REP(i,n)a*=x;return a;}
double inf() {return std::numeric_limits<double>::infinity();}

ll N;
ll A[100010];

int main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  REP(i,N) cin >> A[i+1];
  ll s = 0, ans;
  FOR(i,1,N+1) {
    s += abs(A[i]-A[i-1]);
  }
  FOR(i,1,N) {
    ans = s-abs(A[i]-A[i-1])-abs(A[i+1]-A[i])+abs(A[i+1]-A[i-1]);
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 2048
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
	if(!x){putchar('0');return;}
	int top=0;
	while(x)stack[++top]=x%10,x/=10;
	while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    int n=read(),a=read(),m=read(),b=read(),t=read();
    if(a<=b)puts("NO");
	else 
	{
		if(1LL*abs(n-m)<=1LL*t*(a-b))puts("YES");
		else puts("NO");
	}
    return 0;
}

Measured memory_bytes: 1532
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;
const int MOD = 1000000007;


typedef long long int ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

//石の座標と個数を指定して消す関数．
void del(vector<vector<int> >& stone,int x,int y,int nums){
    rep(i,nums){
        stone[y][x-i]=stone[y-1][x-i];
        if(stone[y-1][x-i]!=0){
            del(stone,x-i,y-1,1);
        }
    }
}

int soleve(vector<vector<int> > stone,int h){
    int score = 0;
    bool onemore; // stoneの配置が変わった場合もう一度上からみるフラグ

    do{
        onemore = false;
        rep(i,h){
            int pre = stone[i+1][0];
            int same = 1;
            rep(j,4){
                
                if(pre == stone[i+1][j+1] && pre != 0){
                //同じ要素だった
                    same++;
                }else if(same >= 3){
                //違う要素だったがそれまでに3個連続していた
                    score += same * stone[i+1][j];
                    del(stone,j,i+1,same);
                    same = 1;
                    pre = stone[i+1][j+1];
                    onemore = true;
                }else {
                //それ以外
                    same = 1;
                    pre = stone[i+1][j+1];
                }
            }

            if(same >= 3){
            //最後の行の最後を確認
                score += same * stone[i+1][4];
                del(stone,4,i+1,same);
                onemore = true;
                same = 0;
            }
        }
    }while(onemore);
    return score;
}


int main() {
    int h;
    vector<int> toprow(5,0);//簡単のため最上段の上に0でうめた行を追加．
    cin>>h;
    while (h){
      vector<vector<int> > stones;
      stones.push_back(toprow);
      rep(i,h){
          vector<int> row(5);
          rep(j,5) {
              cin>>row[j];
          }
          stones.push_back(row);
      }
      cout<<soleve(stones,h)<<endl;
      cin>>h;
    }
    
    return 0;
}



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

typedef long long ll;
#define sc scanf
#define pf printf
#define pb push_back

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

    char pn;
    ll nm, nx, nd, ans;
    cin>>nm>>nx>>pn>>nd;
    nx = (nx*100) + nd;
    ans = (nm*nx)/100;
    cout<<ans<<endl;


    return 0;
}


Measured memory_bytes: 3660
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf,comb
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
c = list(input())
i = 0
j = n - 1
ans = 0
while i < j:
    while i < n and c[i] != 'W':
        i += 1
    while j > 0 and c[j] != 'R':
        j -= 1
    if i < j:
        ans += 1
        c[i] = 'R'
        c[j] = 'W'
print(ans)

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

int		main(void)
{
	string	S;
	string	out;
	int		j;

	j = 0;
	cin>>S;
	for (int i = 0; i < S.size(); i++)
	{
		if (!(S[i] == 'B'))
		{
			out[j] = S[i];
			j++;
		}
		if (S[i] == 'B' && !(j == 0))
			j--;
	}
	for (size_t i = 0; i < j; i++)
		cout<<out[i];
	cout<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>
 
int main(){
  int N,i,j,flag=0;
  int A[100];
  int minj,temp,count=0;
 
  scanf("%d",&N);
 
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(i=0;i<N;i++){
    minj = i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj])
        minj = j;
     }  
    if(i!=minj){
      temp=A[i];    
      A[i]=A[minj];
      A[minj]=temp;
      count++;
      }
     }
    for(i=0;i<N;i++){
      if(i<N-1) printf("%d ",A[i]);
      else printf("%d\n",A[i]);
    }
    printf("%d\n",count);  
 
    return 0;
   } 



Measured memory_bytes: 2140
import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		int S = Integer.parseInt(tokens[0]);
		int W = Integer.parseInt(tokens[1]);
		if (W >= S) {
			System.out.println("unsafe");
		} else {
			System.out.println("safe");
		}
	}

	void calc() {
	}

	void showResult() {
	}

}


Measured memory_bytes: 32692
/*
    Author:zeke
    
    pass System Test!
    GET AC!!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rep3(var, min, max) for (ll (var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll (var) = (max) - 1; (var) + 1 > (min); --(var))
#define Mp(a,b) make_pair((a),(b))
#define F first
#define S second
#define Icin(s) ll (s);cin>>(s);
#define Scin(s) ll (s);cin>>(s);
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll MOD = 1e9 + 7;
ll INF =1e18;
typedef int Weight;
struct Edge {  //src:辺の始点,dst:辺の終点,weight:辺の重さ
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) { }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
Graph g;
V vec;
VV have;
bool h=true;
vector<bool> have1;
void dfs(int x,int reg,int prev){
    if(!h)return;
    //cout<<x<<"番目探索開始"<<endl;
    if(vec[x]==1e18){
        vec[x]=reg;
    //    cout<<"更新"<<reg<<endl;
    }else{
        if(reg!=vec[x]){
            h=false;
            return;
        }
    }
    if(have1[x])return;
    have1[x]=true;
    rep(i,g[x].size()){
        if(prev!=g[x][i].dst){
          //  have[i][g[x][i].dst]=1;
            dfs(g[x][i].dst,vec[x]+g[x][i].weight,x);
            if(!h)return;
        }
    }
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;
    cin>>n>>m;
    vec.resize(n+1,1e18);
   // have.resize(n+1,V(n+1));
    have1.resize(n+1,false);
    g.resize(n+1);
    rep(i,m){
        ll l,r,d;
        cin>>l>>r>>d;
        g[l].push_back(Edge(l,r,d));
        g[r].push_back(Edge(r,l,-d));
    }
    rep3(i,1,n+1){
        if(vec[i]==1e18){
            dfs(i,0,-1);
        }
    }
    
    if(h){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 16128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;
const int N=100000+5;

int a[N];
int b[N];

int main()
{
    ll t;
    cin>>t;
    cout<<3*t*t;
    return 0;
}
/*

*/


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long x,i,cnt;
    cin>>x;
    if(x>=101&&x<10E18)
    {
        cnt=1;
        i=100*1.01;
        while(i<x)
        {
            i=i*1.01;
            cnt++;
        }
        cout<<cnt<<endl;
    }
    return 0;
}


Measured memory_bytes: 3636
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
    int r, g, b, n;
    cin >> r >> g >> b >> n;
    int ans = 0;
    rep(i, n / r + 1 ) {
        rep(j, n / g  + 1 ) {
            if ( n - i * r - j * g < 0 ) continue;
            if ( n - i * r - j * g == 0 || ( n - i * r - j * g ) % b == 0 ) {
                ++ans;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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

int main(){
  int N, M, sum=0, num;
  cin >> N;
  M = N;
  
  while(M >= 1){
    num = M % 10;
    sum += num;
    M = (M -num) / 10;
  }
  if(N % sum == 0){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
}

Measured memory_bytes: 3592
def f(n, k):
    c = 0
    for i in range(k, n + 2):
        d = i*(n - i) + i * (i + 1) // 2 - i * (i - 1) // 2 + 1
        c = (c + d) % int(1e9 + 7)
    return c

print(f(*map(int, input().split())))


Measured memory_bytes: 9184
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include "bits/stdc++.h"

using namespace std;
#define D double
#define int long long


class BTag {
public:
    void solve(std::istream &in, std::ostream &out) {
      int a, v, b, w, t;
      in >> a >> v >> b >> w >> t;
      if (v != w) {
        double d = -1;
        if (b - a < 0 && v - w > 0) {
          d = (D) (b - a) / (w - v);
        } else if (b - a > 0 && v - w > 0) {
          d = (D) (b - a) / (v - w);
        }
        if (d >= 0 && d <= t) {
          out << "YES" << endl;
        } else {
          out << "NO" << endl;
        }
      } else {
        out << "NO" << endl;
      }
    }
};


signed main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout << fixed;
  BTag solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 3692
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/

#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
#include <stack>
#include <bitset>
/*
多倍長整数, cpp_intで宣言
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
*/

//#pragma gcc target ("avx2")
//#pragma gcc optimization ("o3")
//#pragma gcc optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a) //少数出力
#define printLdb(a) printf("%.50Lf\n", a) //少数出力
#define printdbd(a) printf("%.16lf\n", a) //少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str()) //string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2LL) //等差数列の和、初項,末項,項数
#define pb push_back
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0L)*2.0L*PI)
#define rad_to_deg(rad) (((rad)/2.0L/PI)*360.0L)
#define Please return
#define AC 0
#define manhattan_dist(a, b, c, d) (abs(a - c) + abs(b - d)) /*(a, b) から (c, d) のマンハッタン距離 */
#define inf numeric_limits<double>::infinity();
#define linf numeric_limits<long double>::infinity()


using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1e9+7;
constexpr long double eps = 1e-6;
const long double PI = acosl(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1 && c != ' ') {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/

map< int64_t, int > prime_factor(int64_t n) {
	map< int64_t, int > ret;
	for (int64_t i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}


int main() {

	ll n;
	scanf("%lld", &n);
	auto m = prime_factor(n);
	ll ans = 0;
	for (auto& [p, e] : m) {
		for (int i = 1; i <= e; ++i) {
			e -= i;
			++ans;
		}
	}
	printf("%lld\n", ans);

	Please AC;
}

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

int main(){
    int min, max, a;
    int ii = 0;
    cin >> min >> max >> a;
    for(int i = min;i <= max;i++){
        
        if(a % i == 0){
            ii++;
        }
        
    }
    cout << ii << endl;
    return 0;
}

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

int main()
{
    int a, i;
    
    for(i=0; i<2; i++){
        cin >> a;
        if(a % 2 == 0) {
            cout << "Even" << endl;
            return 0;
        } 
    }
    cout << "Odd" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

bool IsPrime(int num)
{
    if(num<2) return false;
    else if(num==2) return true;
    else if(num%2==0) return false;
    double sqrtNum=sqrt(num);
    for(int i=3;i<=sqrtNum;i+=2)
    {
        if(num%i==0)
        return false;
    }
    return true;
}

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

    int n;cin>>n;
    for(int i=n;true;i++){
        if(IsPrime(i)){
            cout<<i<<endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
while True:
  try:
    ans = 0

    n = int(raw_input())

    for i in range(10):
      for j in range(10):
        for k in range(10):
          for l in range(10):
            if i+j+k+l == n:
              ans += 1

    print ans

  except EOFError:
    break

Measured memory_bytes: 6264
#include <bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i=x;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define UNIQ(a) unique(all(a))
#define UNIQNUM(a) UNIQ(a)-a.begin()
#define UNIQIT(a) a.erase(UNIQ(a), a.end());
#define VOUT(v,i) cout<<#v<<": ";for(int i=0;i<(int)v.size();i++){cout<<v[i]<<" ";}cout<<"\n";
#define vout(v) VOUT(v,z);
#define vmin(v) *min_element(all(v))
#define vmax(v) *max_element(all(v))
#define vsum(v) accumulate(all(v), 0LL);
#define MOUT(m,r,c) rep(i,r){rep(j,c){cout<<m[i][j]<<" ";}cout<<endl;}
#define mout(m) MOUT(m,m.size(),m[0].size())
#define debg(a) cout<<#a<<": "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define digit(a) to_string(a).length();
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef vector<ll> V;
// const long long MOD=1000000007;
const long long INF = 1e18;
#define EPS (1e-7)
#define PI (acos(-1))
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) { a = b; return true; }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) { a = b; return true; }
    return false;
}

const string YES = "Yes";
const string NO = "No";
#define judge(f) cout<<(f?YES:NO)<<"\n";

void solve(long long N, long long M){
    judge(N==M);
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    solve(N, M);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    int a, b;
    cin >> a >> b;
    if(a >12) cout << b << endl;
    else if(a < 6) cout << 0 << endl;
    else cout << b/2 << endl;
    return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
#include <algorithm>
#include <cctype>
#include <vector>
#include <limits.h>
#include <stack>
#include <queue>

using namespace std;

#define PI 3.14159265359
#define INF LLONG_MAX


int main(int argc, char const *argv[])
{
    int X, A, B;
    cin >> X >> A >> B;

    X -= A;
    int rem = X % B;
    cout << rem << endl;

    return 0;
}

Measured memory_bytes: 256
from typing import List


def answer(n: int, d: int, x: int, a: List[int]) -> int:
    eaten_chocolates = 0
    for i in range(n):
        eaten_chocolates += len(range(1, d + 1, a[i]))

    return eaten_chocolates + x


def main():
    n = int(input())
    d, x = map(int, input().split())
    a = [int(input()) for _ in range(n)]
    print(answer(n, d, x, a))


if __name__ == '__main__':
    main()


Measured memory_bytes: 10172
#include <iostream>
#include <math.h>
#include <vector>
#include <string>
using namespace std;
int main() {
	int N = 0;
	scanf("%d", &N);
	vector<long>v (N+1,0);

	/*
	for (int x = 1; x < 100; x++) {
		for (int y = 1; y < 100; y++) {
			for (int z = 1; z < 100; z++) {
				if ((x * x + y * y + z * z + x * y + x * z + z * y) != 0 && ((x * x + y * y + z * z + x * y + x * z + z * y) < v.size())) {
					v[(x * x + y * y + z * z + x * y + x * z + z * y) - 1]++;
				}
				
			}
			
		}
		
	}*/

	for (int i = 1; i <= 100; i++) {
		for (int w = 1; w <= 100; w++) {
			for (int y = 1; y <= 100; y++) {
				if (((i * i) + (w * w) + (y * y) + (i * w) + (i * y) + (y * w)) <= v.size()) {
					v[((i * i) + (w * w) + (y * y) + (i * w) + (i * y) + (y * w))]++;

				}

			}

		}
	}
	
	for (int i = 1; i <= N; i++) {
		string str = to_string(v[i]);
		const char* l = str.c_str();
		printf(l);
		printf("\n");
	}
	
	return 0;
}

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

#define all(x) (x).begin(),(x).end()
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)

typedef long long ll;
const ll MOD = 1e9 + 7;
const ll inf = 1LL<<60;
const double eps = 1e-9;


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

    for (int i = 0; i <= x; i++) {
        if (floor(i*1.08) == x) {
            cout << i << endl;
            return 0;
        }
    }

    cout << ":(" << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<cmath>
#include<string>
#include<cstring>
using namespace std;
#define REP(i, a,b) for(i=a;i<b;i++) 
#define output(x) cout<<x<<endl;

int par[100001];

void init(int n) {
	for (int i = 0; i < n; i++) {
		par[i] = i;
	}
}
//木の根を求める
int root(int x) {
	if (par[x] == x)
		return x;
	else {
		return par[x] = root(par[x]);
	}
}
//find
bool same(int x, int y) {
	return root(x) == root(y);

}
//union
void unite(int x, int y) {
	x = root(x);
	y = root(y);
	if (x == y) return;
	par[x] = y;
}

int main()
{
	long long int i, j, k, l, m, n, sum, flag,ans1;
	sum = 0;
	flag = 0;
	ans1 = 0;
	string S, A,B;
	cin >> S;
	k = S.size();
	REP(i, 0, k) {
		if (S[i] != 'x') {
			A.push_back(S[i]);
		}
	}
	l = A.size();
	vector<long long int> ans(l+1);
	B = A;
	int y;
	y = 0;
	reverse(A.begin(),A.end());
	if (A == B) {
		m = 0;
		REP(i, 0, k) {
			if (S[i] == B[m]) {
				ans[m] = y;
				y = 0;
				m++;
			}
			else {
				y++;
			}

		}
		ans[m] = y;
		for (i = 0; i < l - i; i++) {
			ans1 += abs(ans[i] - ans[l - i]);
		}

		output(ans1);


	}
	else
		output(-1);


	



	return 0;
}



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

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

    int count = 0;
    for(int i =0; i < N-2; i++){
        if(S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C') count++;
    }

    cout << count << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pld pair<long double, int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define ff first
#define ss second
#define SZ(x) ((int)(x).size())
#define ld long double
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MAXN = 1e6+100;
int N, a[MAXN], smallest[MAXN];
bool prime[MAXN];
string ans1 = "pairwise coprime";
string ans2 = "setwise coprime";
string ans3 = "not coprime";

void read(){
    cin >> N;
    for(int i = 0; i < N; i++) cin >> a[i];
}

void sieve(){
    memset(prime, true, sizeof(prime));
    prime[0] = prime[1] = false;
    iota(smallest, smallest+MAXN, 0);
    for(int i = 2; i * i < MAXN; i++){
        if(prime[i]){
            smallest[i] = i;
            for(int j = 2 * i; j < MAXN; j += i)
                prime[j] = false, smallest[j] = i;
        }
    }
}

void solve(){
    read();
    sieve();
    vector<int> cnt(MAXN, 0);
    int d = a[0];
    for(int i = 0; i < N; i++){
        d = __gcd(d, a[i]);
        int n = a[i];
        while(n != 1){
            cnt[smallest[n]]++;
            n /= smallest[n];
        }
    }
    bool a2 = (d == 1);
    for(int i = 0; i < N; i++){
        int n = a[i];
        while(n != 1){
            int cnt2 = 0, div = smallest[n];
            while(n != 1 && (n % div == 0)){
                n /= div;
                cnt2++;
            }
            if(cnt[div] > cnt2){
                if(a2 == true) cout << ans2;
                else cout << ans3;
                return;
            }
        }
    }
    cout << ans1;
    return;
}

int main(){
    ios_base::sync_with_stdio(false);
    solve();
    return 0;
}



Measured memory_bytes: 15908
#include <iostream>
#include <map>
#define lint long long

using namespace std;

int main(){
  lint N;
  cin >> N;
  map<lint ,lint> mp;
  lint sum = 0;
  mp[sum]++;
  for(lint i=0;i<N;i++){
    lint tmp;
    cin >> tmp;
    sum += tmp;
    mp[sum]++;
  }


  lint counter = 0;
  for(auto itr=mp.begin(); itr != mp.end(); itr++){
    if(itr->second<2){
      continue;
    }else{
      counter+= itr->second * (itr->second - 1) / 2;
    }
  }

  std::cout << counter << std::endl;

  return 0;
}



Measured memory_bytes: 12800
s = io.read()
k = io.read("*n")
local n = #s
local t = {}
for i = 1, n - 1 do
  local b = s:byte(i) - 97
  if 0 < b then
    local need = 26 - b
    if need <= k then
      b = 0
      k = k - need
    end
  end
  t[i] = b
end
k = k % 26
do
  local b = s:byte(n) - 97
  b = (b + k) % 26
  t[n] = b
end
for i = 1, n do
  io.write(string.char(97 + t[i]))
end
io.write("\n")


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
/*
template<class... T>
ostream& operator<<(ostream& os, tuple<T...>& t) {
	for (size_t i = 0; i < tuple_size< tuple<T...> >::value; ++i) {
		if (i) os << " ";
		os << get<0>(t);
	}
	return os;
}
*/
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int N, M, P;
	while (cin >> N >> M >> P, N || M || P) {
		vector<int> X(N); cin >> X;
		int sum = 0;
		REP(i, N) sum += X[i];
		sum *= 100;
		sum -= sum * P / 100;
		int ans;
		if (X[M-1] == 0) ans = 0;
		else ans = sum / X[M-1];
		cout << ans << endl;
	}
}

Measured memory_bytes: 3180
while 1:
    try:
        l,r=map(str,input().split("="))
        l,l2=map(str,l.split("+"))
        count=0
        n=0
        if len(l)>1 and l[0]=="X" or len(l2)>1 and l2[0]=="X" or len(r)>1 and r[0]=="X":n=1
        for i in range(n,10):
            lx=l.replace("X",str(i))
            l2x=l2.replace("X",str(i))
            rx=r.replace("X",str(i))
            if int(lx)+int(l2x)==int(rx):
                print(i)
                count+=1
                break
        if count==0:print("NA")
    except:break


Measured memory_bytes: 5600
//url:
//problem name:

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
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;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
    int N,M; cin >> N >> M;
    int ans = 0;
    REP(i,M) {
        int a; cin >> a;
        ans += a;
    }
    if(N - ans >= 0) cout << N - ans << endl;
    else cout << -1 << endl;
}

Measured memory_bytes: 3636
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 1000000007
#define LINF 100000000000000007
#define MOD 1000000007
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
//typedef long long int ll;
typedef pair<int,int> P;
struct edge{int to,cost;};

int ans;
int n,m;//i円にできる数
signed main(){
	
	cin>>n;
	int num=10;
	if(n%2==1){
		cout<<0<<endl;
		return 0;
	}
	while(num<=n){
		ans+=n/num;
		num*=5;
	}
	cout<<ans<<endl;
	
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;

int main() {
    int V, E;
    cin>>V>>E;
    ll D[V][V];
    for(int i=0;i<V;++i){
        for(int j=0;j<V;++j){
            if(i!=j) D[i][j] = big;
            else D[i][j] = 0;
        }
    }
    int s, t;
    ll d;
    for(int i=0;i<E;++i){
        cin>>s>>t>>d;
        D[s][t] = d;
    }
    bool negative = false;
    for(int k=0;k<V;++k){
        for(int i=0;i<V;++i){
            for(int j=0;j<V;++j){
                if((D[i][k]==big) | (D[k][j]==big)) continue;
                D[i][j] = min(D[i][j], D[i][k] + D[k][j]);
                if(i==j){
                    if(D[i][j]<0) negative = true;
                }
            }
        }
    }
    if(negative) cout<<"NEGATIVE CYCLE"<<endl;
    else{
        for(int i=0;i<V;++i){
            for(int j=0;j<V;++j){
                if(D[i][j]==big) cout<<"INF";
                else cout<<D[i][j];
                if(j<V-1)cout<<' ';
            }
            cout<<endl;
        }
    }
}




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

vector<int> binary(int i, int n, int N){
    int x = 1;
    rep(j,N){
        x *= n;
    }
    vector<int> vec(N);
    rep(j,N){
        x /= n;
        vec[j] = i / x;
        i -= x * vec[j];
    }
    return vec;
}


int main(){
    int D,G;
    cin >> D >> G;
    vector<pair<int,int> > point(D);
    int ans = 2000;
    rep(i,D){
        cin >> point[i].first >> point[i].second;
    }
    int num = 1;
    rep(i,D){
        num *= 2;
    }
    rep(i,num){
        vector<int> complete = binary(i,2,D);
        vector<pair<int,int> > point_copy(D);
        int sub_ans = 0;
        int sub_point = 0;
        rep(j,D){
            point_copy[j].first = point[j].first;
            point_copy[j].second = point[j].second;
        }
        rep(j,D){
            if(complete[j] == 1){
                sub_ans += point_copy[j].first;
                sub_point += point_copy[j].second + (j + 1) * 100 * point_copy[j].first;
                point_copy[j].first = 0;
            }
        }
        for (int j = D - 1; j >= 0; j--){
            if (sub_point >= G){
                break;
            }
            else if (point_copy[j].first == 0){
                continue;
            }
            else if (sub_point + (j + 1) * 100 * (point_copy[j].first - 1) >= G){
                if ((G - sub_point) % ((j + 1) * 100) == 0){
                    sub_ans += (G - sub_point) / ((j + 1) * 100);
                    sub_point = G;
                }
                else{
                    sub_ans += (G - sub_point) / ((j + 1) * 100) + 1;
                    sub_point = G;
                }
            }
            else{
                sub_ans += (point_copy[j].first - 1);
                sub_point += (j + 1) * 100 * (point_copy[j].first - 1);
            }
        }
        if (sub_point >= G){
            ans = min(ans, sub_ans);
        }
    }
    cout << ans << endl;
}


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

int main(){
  long long int s;
  cin >> s;
  long long int x1, x2, x3, y1, y2, y3;
  x1 = 0;
  y1 = 0;
  x2 = 1000000000;
  y2 = 1;
  y3 = s/(1000000000);
  if(s != y3*1000000000){
    y3++;
  }
  x3 = y3*(1000000000)-s;
  string x1s, x2s, x3s, y1s, y2s, y3s;
  x1s = to_string(x1);
  x2s = to_string(x2);
  x3s = to_string(x3);
  y1s = to_string(y1);
  y2s = to_string(y2);
  y3s = to_string(y3);
  string s_ans = x1s + ' '+ y1s + ' '+  x2s +' '+ y2s+' ' + x3s+' ' + y3s;
  cout << s_ans << endl;
  //cout << x2*y3-x3*y2 << endl;
  //cout << y3*1000000000 << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int n,m;
  scanf("%d %d",&n,&m);
  int a[m];
  int i;
  for(i=0;i<m;++i){
    scanf("%d",&a[i]);
  }
  int sum=0;
  for(i=0;i<m;++i){
    sum+=a[i];
  }
  if(n-sum>=0){
    printf("%d\n",n-sum);
  }else{
    printf("-1\n");
  }
  return 0;
}


Measured memory_bytes: 1720
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	string s;
	cin >> s;
	bool f = false;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'C') {
			for (int j = i+1; j < s.length(); j++) {
				if (s[j] == 'F') {
					cout << "Yes" << endl;
					return 0;
				}
			}
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
def num(v):
    return len(tuple(filter(lambda x: x >= v - 1, e)))


n = int(input())
e = [0] * (n + 1)

for i in range(2, n + 1):
    b = i
    j = 2
    while j * j <= i:
        while b % j == 0:
            b //= j
            e[j] += 1
        j += 1
    if b > 1:
        e[b] += 1
e = tuple(filter(lambda x: x > 0, e))

ans = 0
ans += num(75)
ans += num(25) * (num(3) - 1)
ans += num(15) * (num(5) - 1)
ans += num(5) * (num(5) - 1) // 2 * (num(3) - 2)
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int  ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

int main() {
	sll(n);
	vector<PLL> edges;
	LL sum = (n%2 == 1 ? n : n+1);
	rep(i, 1, n+1) {
		rep(j, i+1, n+1) {
			if(i+j != sum)	edges.push_back(make_pair(i, j));
		}
	}
	pll((LL)edges.size()); nl;
	rep(it, edges.begin(), edges.end())	pll(it->first), pll(it->second), nl;
}


Measured memory_bytes: 512
N = int(input())
s = []
for i in range(1,N):
    a = 0
    b = 0
    A = i
    B = N-i
    while A != 0:
        a += A%10
        A = A//10
    while B !=0:
        b += B%10
        B = B//10
    add = a+b
    s.append(add)
print(min(s))


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

int main() {
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  while (k--) {
    if (a >= b) b *= 2;
    else if (b >= c) c *= 2;
  }
  cout << ((a < b && b < c) ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 3576
n, q = map(int, input().split())
s = input()
LR = [list(map(int, input().split())) for _ in range(q)]

t = [0]*(n+1)

for i in range(n):
    t[i+1] = t[i] + (1 if s[i:i+2]=="AC" else 0)

for i in LR:
    l, r = i[0], i[1]
    print(t[r-1] - t[l-1])

Measured memory_bytes: 92792
/*
ID: wangjun30
TASK:
LANG: C++
*/
#include<iostream>
using namespace std;
int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<c-d+b<<' '<<d+c-a<<' '<<a-d+b<<' '<<c-a+b;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;



int main(){
    int n;
    cin >> n;
    map<string, int> smap;
    int ans=0;
    for(int i=0; i<n; i++){
        string s;
        cin >> s;
        smap[s] ++;
        if(smap[s] == 1) ans++;
    }
    cout << ans << endl;

   

}

Measured memory_bytes: 19084
N = int(input())

def getDivisors(x):
    anss = set()
    for d in range(1, int(x**0.5)+1):
        if x%d == 0:
            anss.add(d)
            anss.add(x//d)
    return anss

divs = getDivisors(N) | getDivisors(N-1)
#print('divs:', divs)

ans = 0
for k in divs:
    if k == 1: continue
    x = N
    while x >= k:
        if x%k == 0:
            x //= k
        else:
            x %= k
    if x == 1:
        ans += 1

print(ans)


Measured memory_bytes: 3952
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(int i=a;i<=b;i++)
inline ll r() {
	ll x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')c=getchar();
	if(c=='-')f=-1,c=getchar();
	while(isdigit(c))x=x*10+c-'0',c=getchar();
	return x*f;
}
#define d r()
ll n;
string s[2]={"No","Yes"};
int main(){
	cin>>n;
	cout<<s[(n>=30)];
	return 0;
}


Measured memory_bytes: 3624
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
const int maxn = 3e3 + 7;
int dp1[maxn][maxn],dp2[maxn][maxn];
int a[maxn],b[maxn];
int main()
{
	int n,t;
	cin >> n >> t;
	for(int i = 1;i <= n;i++){
		cin >> a[i] >> b[i];
	}
	for(int i = 1;i <= n;i++){
		for(int j = 0;j < t;j++){
			dp1[i][j] = dp1[i - 1][j];
			if(j >= a[i]){
				dp1[i][j] = max(dp1[i][j],dp1[i - 1][j - a[i]] + b[i]);
			}
		}
	}
	for(int i = n;i >= 1;i--){
		for(int j = 0;j < t;j++){
			dp2[i][j] = dp2[i + 1][j];
			if(j >= a[i]){
				dp2[i][j] = max(dp2[i][j],dp2[i + 1][j - a[i]] + b[i]);
			}
		}
	}
	int ans = 0;
	for(int i = 1;i <= n;i++){
		for(int j = 0;j < t;j++){
			ans = max(ans,dp1[i - 1][j] + dp2[i + 1][t - j -1] + b[i]);
		}
	}
	cout << ans << endl;
	return 0;
 } 

Measured memory_bytes: 70784
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

typedef unsigned long long UL;
typedef long long LL;
#define LP(i, a, b) for (int i = int(a); i < int(b); i++)
#define LPE(i, a, b) for (int i = int(a); i <= int(b); i++)
typedef pair<int, int> PII;
typedef vector<vector<PII> > WAL;
typedef vector<vector<int> > SAL;
#define Ep 1e-13

#define INF 1e9
int const MaxSize = 1e5 + 10;
LL const MOD = 1e9 + 7;

LL fac(LL n) {

	if (1 == n)
		return 1;
	else
		return (n * fac(n - 1)) % MOD;

}

int main() {
	ios_base::sync_with_stdio(false);
	//freopen("/Users/george/A_1.in", "r", stdin);

	LL N, M;

	cin >> N >> M;

	LL ans = (fac(N) * fac(M)) % MOD;
	if (N == M) {

		ans *= 2;
		ans %= MOD;

	} else if (abs(N - M) == 1) {

	} else {
		ans = 0;
	}

	cout << ans;
}


Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
 
int main()
{
    int a[10]={0};
//    for(int i=0;i<10;i++)
//    {
//        printf("%d ",a[i]);
//    }
    int n,k;
    int ans = 0;
    int flag = 0;
    int x;
    scanf("%d %d",&n,&k);
    for(int i=0;i<k;i++)
    {
        scanf("%d",&x);
        a[x]++;
    }
//    for(int i=0;i<10;i++)
//    {
//        printf("%d ",a[i]);
//    }
    for(int i=n;i<1000000;i++)
    {
        int t = i;
        flag = 0;
        while(t)
        {
            int p = t%10;
            if(a[p]!=0)
            {
                flag = 1;
                break;
            }
            t/=10;
        }
        if(flag==1)
            continue;
        else
        {
             ans = i;
             break;
        }
        //printf("%d ",i);
    }
    printf("%d",ans);
}

Measured memory_bytes: 256
import copy
N,K = map(int,input().split())
lis = list(map(int,input().split()))
final = copy.copy(lis)
count = []
ans_K = 0
ans = 0
for i in range(1,41):
    check = 0
    for j in range(N):
        if lis[j]%2 != 0:
            check += 1
        if lis[j] == 1:
            lis[j] =0
        lis[j] = lis[j]//2
    if check >= N//2 +1:
        count.append(0)
    else:
        count.append(1)
count.reverse()
for k in range(len(count)):
    if count[k] == 1:
        if ans_K +(2 ** (len(count)-k-1)) <=K:
            ans_K += 2 ** (len(count)-k-1)
for l in final:
    ans += ans_K^l
print(ans)

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

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

    int r;
    cin >> r;
    int s = 3 * r * r;
    cout << s;

    return 0;
}


Measured memory_bytes: 3660
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0558
AC
"""
import sys
from sys import stdin
from collections import deque
input = stdin.readline
from collections import defaultdict

def bfs(field, sx, sy, gx, gy):
    """
    ??????????????°???????????´????????°????????§????????¢????±???????
    :param field:
    :param sx: ??????????????°????????§?¨?
    :param sy:
    :param gx: ??´????????°????????§?¨?
    :param gy:
    :return: ????????????????????´???????????§????????¢
    """
    # ????????????????§????????????´????????§?¨?????????????
    dy = [-1, 1, 0, 0]
    dx = [0, 0, -1, 1]

    # ??°???????????????(?§????????????£????????????????????????????????§??????????????¨)
    Y = len(field)
    X = len(field[0])
    # d = [[float('inf')] * X for _ in range(Y)] #  ??????????????°?????????????????¢???INF??§?????????
    d = defaultdict(int)

    # ???????????????????????????????????°???????????´????????°????????§????????¢????±???????
    Q = deque()
    Q.append((sx, sy))
    d['{:04d}{:04d}'.format(sy, sx)] = 0               #  ??????????????°??????????????????0
    while Q:
        cx, cy = Q.popleft()        #  ?????¨??°?????§?¨?
        if cx == gx and cy == gy:
            break
        for i in range(4):
            nx = cx + dx[i]
            ny = cy + dy[i]
            # ?§?????????? ??°????????????????????????????????? and ?£?????????£???????????? and ??¢?????¢?´¢?????§?????? ??´???
            if (0 <= nx < X) and (0 <= ny < Y) and field[ny][nx] != 'X' and '{:04d}{:04d}'.format(ny, nx) not in d:
                Q.append((nx, ny))
                d['{:04d}{:04d}'.format(ny, nx)] = d['{:04d}{:04d}'.format(cy, cx)] + 1
    return d['{:04d}{:04d}'.format(gy, gx)]


def solve(field, N):
    # ??????????????°???(S)??¨??´????????°???(N)?????????
    pos = [[None, None] for _ in range(N+1)]
    for y, row in enumerate(field):
        for mark in 'S123456789':
            if mark in row:
                if mark == 'S':
                    pos[0] = [row.index(mark), y]
                else:
                    pos[int(mark)] = [row.index(mark), y]

    total_move = 0
    start = pos[0]
    for goal in pos[1:]:
        sx, sy = start
        gx, gy = goal
        res = bfs(field, sx, sy, gx, gy)
        # print('From: ({}, {}) -> To: ({}, {}), step: {}'.format(sx, sy, gx, gy, res))
        # print('min move: {}'.format(abs(sx-gx) + abs(sy-gy)))
        total_move += res
        start = goal

    return total_move


def main(args):
    # N = 9
    # data = [
    #     '.X...X.S.X',
    #     '6..5X..X1X',
    #     '...XXXX..X',
    #     'X..9X...X.',
    #     '8.X2X..X3X',
    #     '...XX.X4..',
    #     'XX....7X..',
    #     'X..X..XX..',
    #     'X...X.XX..',
    #     '..X.......'
    # ]
    H, W, N = map(int, input().split())
    data = [input().strip('\n') for _ in range(H)]
    field = [list(x) for x in data] #  data????????????????????????????????????????????????
    result = solve(field, N)
    print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Measured memory_bytes: 108712