akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 1
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
 
 
void func(long long N, long long L){
 
    vector<lli> a(N);
    lli sum = 0;
    lli num = INF;
    REP(i,0,N){
        sum += L+i;
        //if(DEBUG)cout<<"L+i="<<L+i<<endl;
        if(abs(num) > abs(L+i)){
            num = L+i;
        }
    }
    //if(DEBUG)cout<<"num="<<num<<endl;
    sum -= num;
    cout<<sum<<endl;
 
}
 
int main(){
    // cout << fixed << setprecision(5);
 
    long long N;
    scanf("%lld",&N);
    long long L;
    scanf("%lld",&L);
    func(N, L);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cassert>
//#include <tuple>
#include <cmath>
using namespace std;

signed main() {
	int n, i, j;
	int ans = 0;
	
	cin >> n;
	for (i = 1; i <= n; i += 2) {
		int cnt = 0;
		for (j = 1; j <= i; j++) {
			if (i % j == 0) cnt++;
		}
		if (cnt == 8) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 888
from math import *
n,k=map(int,input().split())
dict1={}
flag=0
ans=0
if(k%3==0):
    flag=1
for i in range(1,n+1):
    try:
        dict1[i%k]+=1
    except:
        KeyError
        dict1[i%k]=1
dict2={}
for i in dict1.keys():
    try:
        if(dict2[i]==1):
            a=1
    except:
        KeyError
        if((i+i)%k==0):
            ans+=dict1[i]*dict1[i]*dict1[i]
            dict2[i]=1
            dict2[k-i]=1
print(ans)

Measured memory_bytes: 15080
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#include <complex>
#define full(c) c.begin(), c.end()
#define vector2d(name,type,h,w,init) vector<vector<type>> name(h,vector<type>(w,init)) 
const int PRIME = 1000000007;
const int INT_INF = 2147483647;
const long long int LL_INF = 9223372036854775807;
const double PI = acos(-1);
const double EPS = 0.000000001;
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;

int main() {
	const int dx[4] = { 0,1,0,-1 };
	const int dy[4] = { -1,0,1,0 };
	while (1) {
		ll h, w, l;
		cin >> h >> w >> l;
		if (h == 0 && w == 0 && l == 0) break;
		ll i, j, k, d, x, y, detect[100][100][4];
		vector2d(f, char, h, w, 0);
		for (i = 0; i < h; i++) {
			for (j = 0; j < w; j++) {
				for (k = 0; k < 4; k++) {
					detect[i][j][k] = -1;
				}
			}
		}
		for (i = 0; i < h; i++) {
			string tmp;
			cin >> tmp;
			for (j = 0; j < w; j++) {
				f[i][j] = tmp[j];
				if (f[i][j] == 'N') y = i, x = j, d = 0;
				if (f[i][j] == 'E') y = i, x = j, d = 1;
				if (f[i][j] == 'S') y = i, x = j, d = 2;
				if (f[i][j] == 'W') y = i, x = j, d = 3;
			}
		}
		while (l > 0) {
			if (detect[y][x][d] != -1) {
				ll dif = detect[y][x][d] - l;
				l %= dif;
				if (l == 0) l += dif;
			}
			detect[y][x][d] = l;
			ll nx = x + dx[d], ny = y + dy[d];
			if (nx < 0 || w <= nx || ny < 0 || h <= ny || f[ny][nx] == '#') {
				d = (d + 1) % 4;
			}
			else {
				x = nx;
				y = ny;
				l--;
			}
		}
		cout << y + 1 << " " << x + 1 << " ";
		if (d == 0) cout << "N" << endl;
		if (d == 1) cout << "E" << endl;
		if (d == 2) cout << "S" << endl;
		if (d == 3) cout << "W" << endl;
	}
	return 0;
}





Measured memory_bytes: 3472
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define int int64_t
#define double long double
#define rep(i, N) for(int i=0; i<N; i++)
#define repr(i, N) for(int i=N-1; i>=0; --i)
#define all(v) v.begin(),v.end() 
using namespace std;
//using pr = pair<int, int>;
using tup  = tuple<int, int, int>;
using vec  = vector<int>;
using vvec = vector<vec>;

//プロトタイプ宣言

//グローバル変数
//const int INF = ;
//const int MAX_N = ;
//const int MAX_M = ;
//vvec dp(MAX_N, vec(MAX_M));

//関数：
/* メイン・プログラム */
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	int a, b; cin >> a >> b;
	
	int aa = 0;
	int bb = 0;
	rep(i, b) aa += a*pow(10, i);
	rep(i, a) bb += b*pow(10, i);
	//aa = aa - '0';
	//bb = bb - '0';
	int ans;
	if(aa < bb) ans = bb;
	else ans = aa;
	cout << ans << endl;
	return 0;
}

/*	(n * m) % dvs = ((n%dvs) * (m%dvs)) % dvs
*/

//std::string str;
//str = std::to_string(int i);
//bitset<3> s(N);
//int ans = (char)grid - '0';
//int id = lower_bound(all(arr), x) - arr.begin();
//cout << fixed << setprecision(10) << tld << endl;
//vector<int> sub(itr,itr+d); //イテレーターで部分数列(i=0...d)を指定

/*	struct data {
	char *name;
	int age;
	int height;
	double weight;
};*/

/*	string ans(lgd, '0');
	string &refer = ans;
	for(int i=0; i<lgd; i++) refer[i] = (char)vd[i] + '0';*/

/*	map<int,int> mp;
for(auto p : mp) {
	ct += p.second*(p.second-1); }

map<int,int>::iterator itr;
for(itr = mp.begin(); itr != mp.end(); itr++) {
	ans += itr->second * (itr->second-1);
}*/


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<limits>
#include<iomanip>
#include<cmath>
#include<climits>

using namespace std;

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

const int mod=1e9+7;

int main(){
    int n;
    cin >> n;
    vector<int> v(n),c(n),d(n);
    for(int i=0;i<n;i++)    cin >> v[i];
    for(int i=0;i<n;i++)    cin >> c[i];
    for(int i=0;i<n;i++)    d[i]=v[i]-c[i];
    sort(d.begin(),d.end());
    reverse(d.begin(),d.end());
    int ans=0;
    for(int i=0;i<n;i++){
        if(d[i]<0)  break;
        ans+=d[i];
    }  
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll n; string s;
    cin >> n >> s;
    map<char, ll> cnt;
    rep(i, n) cnt[s[i]]++;
    (cnt['R'] > cnt['B']) ? Yes() : No();
}

Measured memory_bytes: 3636
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
#include <list>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

int main() {
	int p, q;
	while(cin >> p >> q) {
		int pos = 1, r = 1;
		int s, g;
		bool loop = false;
		map<int, int> memo;
		while(r != 0) {
			p *= 10;
			if(memo[p]) {
				loop = true;
				s = memo[p]-1;
				g = pos;
				break;
			} else {
				memo[p] = pos;
				pos++;
			}
			cout << p/q;
			p -= (p/q)*q;
			r = p-(p/q)*q;
		}
		cout << endl;

		if(loop) {
			REP(i, g-1) {
				if(i >= s) {
					cout << "^";
				} else {
					cout << " ";
				}
			}
			cout << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1196
import java.util.*;
import java.awt.*;
import java.awt.geom.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] $) {
        Scanner sc = new Scanner(in);
        int s=sc.nextInt();
        HashSet<Integer> set=new HashSet<>();
        set.add(s);
        int temp=s,ans=0,size=set.size();
        while (true){
            ans++;
            if(temp%2==0)temp/=2;
            else temp=3*temp+1;
            set.add(temp);
            if(set.size()==size)break;
            size=set.size();
        }
        out.println(ans+1);
    }
}

Measured memory_bytes: 23764
import java.io.*;
import java.nio.CharBuffer;
import java.util.NoSuchElementException;

public class Main {

    public static void main(String[] args) {
        SimpleScanner scanner = new SimpleScanner(System.in);
        PrintWriter writer = new PrintWriter(System.out);

        int n = scanner.nextInt();
        int k = scanner.nextInt();
        if (n <= 1) {
            if (k > 0)
                writer.println(-1);
            else {
                writer.println(n == 0 ? "0 0" : "0 1 1 0");
            }
        } else if (k < (1 << n)) {
            for (int i = (1 << n) - 1; i >= 0; --i)
                if (i != k)
                    writer.print(i + " ");
            writer.print(k + " ");
            for (int i = 0; i < 1 << n; ++i)
                if (i != k)
                    writer.print(i + " ");
            writer.print(k + " ");
            writer.println();
        } else
            writer.println(-1);

        writer.close();
    }

    private static int getF(int u, int[] f) {
        return f[u] == u ? u : (f[u] = getF(f[u], f));
    }

    private static class Link {
        final int to;
        final int weight;

        Link(int to, int weight) {
            this.to = to;
            this.weight = weight;
        }
    }

    private static class SimpleScanner {

        private static final int BUFFER_SIZE = 10240;

        private Readable in;
        private CharBuffer buffer;
        private boolean eof;

        SimpleScanner(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
            buffer = CharBuffer.allocate(BUFFER_SIZE);
            buffer.limit(0);
            eof = false;
        }


        private char read() {
            if (!buffer.hasRemaining()) {
                buffer.clear();
                int n;
                try {
                    n = in.read(buffer);
                } catch (IOException e) {
                    n = -1;
                }
                if (n <= 0) {
                    eof = true;
                    return '\0';
                }
                buffer.flip();
            }
            return buffer.get();
        }

        void checkEof() {
            if (eof)
                throw new NoSuchElementException();
        }

        char nextChar() {
            checkEof();
            char b = read();
            checkEof();
            return b;
        }

        String next() {
            char b;
            do {
                b = read();
                checkEof();
            } while (Character.isWhitespace(b));
            StringBuilder sb = new StringBuilder();
            do {
                sb.append(b);
                b = read();
            } while (!eof && !Character.isWhitespace(b));
            return sb.toString();
        }

        int nextInt() {
            return Integer.valueOf(next());
        }

        long nextLong() {
            return Long.valueOf(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

Measured memory_bytes: 44320
#include <iostream>
#include <stack>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <functional>
#include <string>
#include <cstdlib>
#include <numeric>
#include <cstdbool>
#include <cstring>
#include <map> 
#include<set>
#include<queue>
#include <iomanip>

typedef long long ll;

#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;

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

const long long INF = 1000000000000000;
const ll inf = -1e18;
typedef pair<ll, ll> P;
ll ma = 1000000000 + 7;
ll mx = 1000003;
ll h,n, w,m,t; string s;
ll R, C;
ll sy, sx, gy, gx;
char maze[20][20];
ll dis[20][20];
int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, 1, 0, -1 };
ll gcd(ll x, ll y) {
	if (x % y == 0) return y;
	return gcd(y, x % y);
}
ll lcm(ll a,ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
void comb(vector<vector <ll> >& v) {
	for (ll i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (ll k = 1; k < v.size(); k++) {
		for (int j = 1; j < k; j++) {
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j])%ma;
		}
	}
}

ll GetDigit(ll num) {
	return log10(num) + 1;
}
ll Combination(int n, int r)
{
	if (n - r < r) r = n - r;
	if (r == 0) return 1;
	if (r == 1) return n;

	vector<ll> numerator(r);
	vector<ll> denominator(r);

	for (int k = 0; k < r; k++)
	{
		numerator[k] = n - r + k + 1;
		denominator[k] = k + 1;
	}

	for (int p = 2; p <= r; p++)
	{
		int pivot = denominator[p - 1];
		if (pivot > 1)
		{
			int offset = (n - r) % p;
			for (int k = p - 1; k < r; k += p)
			{
				numerator[k - offset] /= pivot;
				denominator[k] /= pivot;
			}
		}
	}

	ll result = 1;
	for (int k = 0; k < r; k++)
	{
		if (numerator[k] > 1) result *= numerator[k];
		result %= ma;
	}

	return result;
}

ll bfs() {
	queue<P> que;
	for (int i = 0; i < R; i++) {
		for (int j = 0; j < C; j++) dis[i][j] = INF;
	}
	que.push(P(sy - 1, sx - 1));
	dis[sy - 1][sx - 1] = 0;

	while (que.size() > 0) {
		P p = que.front();
		que.pop();
		if (p.first == gy - 1 && p.second == gx - 1) break;
		for (ll i = 0; i < 4; i++) {
			ll ny = p.first + dy[i];
			ll nx = p.second + dx[i];
			if (0 <= ny && ny < R && 0 <= nx && nx < C && maze[ny][nx] == '.' && dis[ny][nx] == INF) {
				que.push(P(ny, nx));
				dis[ny][nx] = dis[p.first][p.second] + 1;
			}
		}
	}
	return dis[gy - 1][gx - 1];
}
ll dp[20500];
int main() {
	cin >> n;
	vector<ll> p(n);
	vector<ll> q(n);
	vector<ll> v(n);
	rep(i, n) {
		cin >> p[i];
	}
	rep(i, n) {
		cin >> q[i];
	}
	iota(v.begin(), v.end(), 1);
	ll pres = 1;
	ll qres = 1;
	ll a = 1;
	ll flg = 0;
	do {
		bool pflg = true;
		bool qflg = true;
		rep(i, n) {
			if (p[i] != v[i]) {
				pflg = 0;
			}
		}
		rep(i, n) {
			if (q[i] != v[i]) {
				qflg = 0;
			}
		}
		if (pflg) {
			pres = a;
			++flg;
		}
		if (qflg) {
			qres = a;
			++flg;
		}
		++a;
		if (flg == 2)break;
	} while (next_permutation(v.begin(), v.end()));
	cout << abs(pres - qres) << endl;
}



Measured memory_bytes: 256
def gcd(x,y):
    if x<y:
        z=x
        x=y
        y=z
    while True:
        if x%y==0:
            break
        else:
            z=x%y
            x=y
            y=z
    return y

x,y = map(int,input().split())
answer=gcd(x,y)
print(answer)


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

int i,j,k;
const ll MOD = 1000000000 + 7;

int main(){
    int n;
    cin>>n;
    vector<string> s;
    int ans=0;
    j=0;
    REP(i,n){
        string tmp;
        cin>>tmp;
        s.push_back(tmp);
    }
    sort(s.begin(),s.end());
    string asahi="";
    for(auto it=s.begin();it !=s.end();++it){
        if(*it!=asahi){
            ans++;
            asahi=*it;
        }
    }
    cout<<ans<<'\n';

    return 0;
}

Measured memory_bytes: 11600
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define ll long long
//{{{ read()
ll read(){
	ll 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^48),ch=getchar();
	return x*f;
}
//}}}
const int N=1e5+5;
struct each{
	int p;
	ll x;
}a[N];
ll ans;
int n,s,las;
bool com(each x,each y){
	return x.p<y.p;
}
ll sol(int l,int r,int s){
	if(s<=a[l].p) return a[las=r].p-s;
	if(s>=a[r].p) return s-a[las=l].p;
	if(a[l].x>=a[r].x){
		a[l].x+=a[r].x;
		ll d=sol(l,r-1,s);
		d+=a[r].p-a[las].p,las=r;
		return d;
	}
	else{
		a[r].x+=a[l].x;
		ll d=sol(l+1,r,s);
		d+=a[las].p-a[l].p,las=l;
		return d;
	}
}
int main(){
	n=read(),s=read();
	for(int i=1;i<=n;i++)
		a[i].p=read(),a[i].x=read();
	sort(a+1,a+n+1,com);
	printf("%lld\n",sol(1,n,s));
	return 0;
}


Measured memory_bytes: 5632
#include <stdio.h>
int main(void) {
    int n, p[100], c=0, i;
    
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&p[i]);
    
    for(i=0;i<n-2;i++){
        if((p[i]<p[i+1])&&(p[i+1]<p[i+2])) c++;
        else if((p[i]>p[i+1])&&(p[i+1]>p[i+2])) c++;
    }
    printf("%d\n",c);
    return 0;
}

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

//ライブラリ始まり

//定数

//円周率
const double PI = 3.1415926535897932384;

//天井
const int INF = 1000000000; // = 10^9
const ll LINF = 1000000000000000; // = 10^15

//ABC文字列
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZABC";
const string abc = "abcdefghijklmnopqrstuvwxyzabc";

//よくあるmodくん
const ll MOD = 1000000007; // = 10^9 + 7

//関数

//ctoi
int ctoi(char c){
  if (c == '0') {
    return 0;
  }
  if (c == '1') {
    return 1;
  } 
  if (c == '2') {
    return 2;
  } 
  if (c == '3') {
    return 3;
  }
  if (c == '4') {
    return 4;
  } 
  if (c == '5') {
    return 5;
  } 
  if (c == '6') {
    return 6;
  }
  if (c == '7') {
    return 7;
  } 
  if (c == '8') {
    return 8;
  } 
  if (c == '9') {
    return 9;
  }
  return -1;  
}

//素数判定
bool PN(int x) {
  if (x <= 1) {
    return false;
  }
  if (x == 2) {
    return true;
  }
  for (int i = 2; i < sqrt(x) + 1; i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}

//ライブラリ終わり

void DO(int c, int x, vector<int> &t, vector<vector<int>> xy) {
  int XS = xy.size();
  if (t.at(x) != -1) {
    return;
  }
  t.at(x) = c;
  for (int i = 0; i < XS; i++) {
    if (xy.at(i).at(0) > x) {
      break;
    }
    if (xy.at(i).at(0) == x) {
      DO(c, xy.at(i).at(1), t, xy);
    }
    if (xy.at(i).at(1) == x) {
      DO(c, xy.at(i).at(0), t, xy);
    }
    
  }
}

int main() {
  int N, H, W;
  cin >> N >> H >> W;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int A, B;
    cin >> A >> B;
    if (A >= H && B >= W) {
      ans++;
    }
  }
  cout << ans << endl;
}
    
    
  
  
  

Measured memory_bytes: 3732
//     _
//   _/_\_
//   (O_o)
//  ~(   )~
//   (~~~)
//   /   \

#include <bits/stdc++.h>

#define left nadnlassad
#define right asdaslknd
#define y1 kjdajasjdsas
#define nxt accepted
#define prev why_would_you_call_when_you_are_high

#define pb push_back
#define mp make_pair
#define mt make_tuple

#define f first
#define s second

#define ll long long
#define ld long double
#define ull unsigned ll

#define hash_t pair<ll, ull>
#define pii pair<int, int>
#define uint unsigned int
#define puu pair<uint, uint>

#define sqr(x) ((x) * 1LL * (x))

#define vec vector<int>
#define sz(v) int(v.size())
#define all(v) v.begin(), v.end()
#define endl "\n"
#define bits(x) __builtin_popcountll(x)
#define forn(i, s, t) for(int i = (int) s; i <= (int) t; i++)
#define form(i, t, s) for(int i = (int) t; i >= (int) s; i--)

using namespace std;

void rf() {
    #define fname "sparse"
    #ifdef SONY
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        //freopen(fname".in", "r", stdin);
        //freopen(fname".out", "w", stdout);
    #endif //SONY
}

const int nx[8] = {2, -2, -2, 2, 1, 1, -1, -1};
const int ny[8] = {1, 1, -1, -1, 2, -2, -2, 2};
const int Nx[4] = {0, 0, -1, 1};
const int Ny[4] = {1, -1, 0, 0};

const ll LINF = (ll) 5e18;
const int INF = 1e9 + 7;

const int N = 6e5 + 1;
const int MAXN = 3e6 + 1;
const double EPS = 1e-9, PI = 3.14159265359;

inline int get_int() {
    char x = getchar();
    int ret = 0;
    bool neg = 0;
    while (!('0' <= x && x <= '9')) {
        if (x == '-')
            neg = 1;
        x = getchar();
    }
    while ('0' <= x && x <= '9') {
        ret = ret * 10 + x - '0';
        x = getchar();
    }
    if (neg) ret *= -1;
    return ret;
}

int n;
int dp[MAXN], suff[MAXN];

int add(int x, int y) {
    x += y;
    if (x >= INF) x -= INF;
    if (x < 0) x += INF;
    return x;
}

int main() {
    srand(time(0));
    //ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //rf();
    ld beg = clock();
    cin >> n;
    forn (i, n + 1, n * 3) dp[i] = 1;
    dp[n] = n;
    form (i, n * 3, n) {
        suff[i] = add(suff[i + 1], dp[i]);
    }
    form (i, n - 1, 1) { 
        int ans = dp[i + 1];
        ans = add(ans, (n - 1) * 1ll * (n - 1) % INF);
        ans = add(ans, add(suff[i + 3], -suff[i + n + 2]));
        dp[i] = ans;
        suff[i] = add(suff[i + 1], dp[i]);
    }
    cout << dp[1];
    #ifdef SONY
        fprintf(stderr, "\n%.6f", (double) (clock() - beg) / CLOCKS_PER_SEC);
    #endif //SONY
    return 0;
}

Measured memory_bytes: 23680
/** author: __nishad__ **/
//#pragma GCC optimize(2)
//#pragma GCC optimize(3, "Ofast", "inline")
#include<bits/stdc++.h>
using namespace std;


typedef long long ll ;
typedef vector<ll> vll ;

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define precision(k) cout<<setprecision(k)<<fixed;
#define loop(i,a,b) for(ll i=(a);i<=(b);++i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define pb push_back
#define mp make_pair
#define pi 3.14159265358979323
#define endl "\n"

int main()
{
    IOS;

    int a, b;
    cin>>a>>b;
    cout<<a*b;

}


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

ll gcd(ll x, ll y);
int fac(ll n, vector<int> num);

const int INF = 1001001001;

//mint�p�̕ϐ� (10��9��)
const int mod = 1000000007;

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

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream & is, const mint & a) { return is >> a.x; }
ostream& operator<<(ostream & os, const mint & a) { return os << a.x; }

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> b(0);

    for (int i = 0; i < n; i++) {
        if (i % 2 == 1)
            b.emplace_back(a[i]);
        else
            b.insert(b.begin(), a[i]);
    }

    if (n % 2 == 0)
        reverse(b.begin(), b.end());

    for (int i = 0; i < n; i++) {
        cout << b[i] << " ";
    }

    return 0;
}

/*���C�u�����ő����*/
//���[�O���b�h�̌ݏ��@
ll gcd(ll x, ll y) {
    ll num[3];
    num[0] = (x > y) ? x : y;
    num[1] = (x <= y) ? x : y;
    num[2] = num[0] % num[1];

    while (num[2]) {
        num[0] = num[1];
        num[1] = num[2];
        num[2] = num[0] % num[1];
    }

    return num[1];
}

/*�f��������*/
//���색�C�u����
int fac(ll n, vector<int> num) {
    ll kazu = n;
    for (int i = 2; i <= sqrt(n); i++) {
        while (1) {
            if (kazu % i != 0) break;

            kazu /= i;
            num[i]++;
        }
    }
    if (kazu == n && n != 1) return 1;
    int ans = 0;
    if (kazu != 1) ans++;
    for (int i = 2; i <= sqrt(n); i++) {
        for (int j = 1; j <= num[i]; j++) {
            num[i] -= j;
            ans++;
        }
    }
    return ans;
}

Measured memory_bytes: 5032
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);i++)
int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
int main(){
    //75 = 5 * 5 * 3; x^4 * y^4 * z^2; x^14 * y^4; x^24 * y^2; 2^74;
    int n; cin >> n;
    int num_prime[25];
    rep(i,25){
        int temn=n;
        int temc=0;
        while(temn!=0){
            temc += temn / prime[i];
            temn = temn / prime[i];
        }
        num_prime[i] = temc;
    }
    int ans = 0;
    for(int i=0;i<25;i++) for(int j=i+1;j<25;j++) for(int k=j+1;k<25;k++){
        if(num_prime[i] >= 4 && num_prime[j]>=4 && num_prime[k] >= 2) ans++;
        if(num_prime[i] >= 4 && num_prime[j]>=2 && num_prime[k] >= 4) ans++;
        if(num_prime[i] >= 2 && num_prime[j]>=4 && num_prime[k] >= 4) ans++;
    }
    for(int i=0;i<25;i++) for(int j=i+1;j<25;j++){
        if(num_prime[i] >= 14 && num_prime[j]>=4) ans++;
        if(num_prime[i] >= 24 && num_prime[j]>=2) ans++;
        if(num_prime[i] >= 4 && num_prime[j]>=14) ans++;
        if(num_prime[i] >= 2 && num_prime[j]>=24) ans++;
    }
    for(int i=0;i<25;i++){
        if(num_prime[i] >= 74) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MOD=1000000007;
int n,k;
LL fac[4000000],inv_fac[4000000],dp[2001];
void check_mod(LL &a) { if (a>=MOD) a%=MOD; }
int ksm(LL a, int b)
{
	LL ret=1ll;
	while (b) {
		if (b&1) ret*=a;
		check_mod(ret);
		a*=a;
		check_mod(a);
		b>>=1;
	}
	return ret;
}
int main()
{
	LL lt;
	int t;
	scanf("%d%d",&n,&k);
	if (k==1) {
		printf("1\n");
		return 0;
	}
	fac[0]=1;
	t=n*k;
	for (int i = 1; i < t; ++i) {
		fac[i]=1ll*i*fac[i - 1];
		check_mod(fac[i]);
	}
	inv_fac[t-1]=ksm(fac[t-1],MOD-2);
	for (int i=t-2;i;--i) {
		inv_fac[i]=1ll*(i+1)*inv_fac[i+1];
		check_mod(inv_fac[i]);
	}
	inv_fac[0]=1;
	dp[0]=1;
	t=-2;
	for (int i=1;i<=n;++i) {
		t+=k-1;
		for (int j=0;j<=i;++j) {
			++t;
			lt=fac[t]*inv_fac[t-k+2];
			check_mod(lt);
			lt*=inv_fac[k-2];
			check_mod(lt);
			dp[j]*=lt;
			if (j) dp[j]+=dp[j - 1];
			check_mod(dp[j]);
		}
		t-=i+1;
	}
	printf("%lld\n",dp[n]*fac[n]%MOD);
	return 0;
}

Measured memory_bytes: 62720
void main() {
  problem();
}

void problem() {
  auto X = scan!long;

  long solve() {
    foreach(t; 1..999_999) {
      if (t * X % 360 == 0) return t;
    }

    return 0;
  }

  solve().writeln;
}

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

import std.stdio, std.numeric, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");

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


Measured memory_bytes: 2676
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int[] a = new int[N];
    
    for (int i = 0; i < N; i++) {
      a[i] = sc.nextInt();
    }

    sc.close(); 

    long sum = 0;

    for (int i = 0; i < N; i++) {
      while (a[i] % 2 == 0) {
        sum++;
        a[i] = a[i] / 2; 
      }
    }

    System.out.println(sum);
  
  }

}

Measured memory_bytes: 34256
#include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;

#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define mod 1000000007
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(int x=j;x<n;x++)
#define all(x) (x).begin(), (x).end()

typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> pi;

bool prime(ll n)
{
    if(n<=1)return false;
    if(n<=3)return true;
    if(n%2==0||n%3==0)return false;
    for(ll i=5;i*i<=n;i+=6)
    {
        if(n%i==0||n%(i+2)==0)return false;
    }
    return true;
}
bool comp(pi a,pi b)
{
    if(a.fi==b.fi)return a.se<b.se;
    return a.fi>b.fi;
}

struct commp
{
    bool operator()(pi a,pi b)const{
        if(a.fi==b.fi)return a.se<b.se;
        return a.fi<b.fi;
    }
};
ll mulmod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a*b)%mod;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
ll n; cin>>n;
n%=10;
if(n==3)cout<<"bon\n";
else if(n==0||n==1||n==6||n==8)cout<<"pon\n";
else cout<<"hon\n";
return 0;
}


Measured memory_bytes: 3656
import sys
import itertools
input = sys.stdin.readline

N = int(input())
L = [int(v) for v in input().split()]
m = max(L)
NL = [0] * (m + 1)

for i in range(N):
    v = L[i]
    NL[v] += 1

nz = [i for i in range(len(NL)) if NL[i] != 0]
if len(nz) == 1:
    print(NL[nz[0]])
elif len(nz) == 2:
    if abs(nz[0] - nz[1]) <= 2:
        print(NL[nz[0]] + NL[nz[1]])
    else:
        print(max(NL[nz[0]], NL[nz[1]]))
else:
    t = NL[0] + NL[1] + NL[2]
    ans = max(1, t)
    for i in range(1, len(NL) - 2):
        t = t - NL[i - 1] + NL[i + 2]
        ans = max(ans, t)

    print(ans)

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

using namespace std;

const long long MOD = 1000000007;
const long long MAX = 200000;

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

long long fac[MAX], finv[MAX], inv[MAX];

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

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
   char x;
   cin>>x;
   cout<<(char)((int)x+1)<<endl;



}


Measured memory_bytes: 256
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()
point = [0]*K
flag = ["a"]*K
k = -1
#K本のリストを用意する　剰余系の中で、同じ手が連続するとき、１、３、５、...は別の手に変える
for i in range(N):
  k = (k+1)%K  #mod
  if T[i] == "r":
    if flag[k] == "r":
      flag[k] = "a"
    else:
      flag[k] = "r"
      point[k] += P
  elif T[i] == "s":
    if flag[k] == "s":
      flag[k] = "a"
    else:
      flag[k] = "s"
      point[k] += R
  if T[i] == "p":
    if flag[k] == "p":
      flag[k] = "a"
    else:
      flag[k] = "p"
      point[k] += S
print(sum(point))

Measured memory_bytes: 13064
# -*- coding: utf-8 -*-
# @Time    : 2020/3/1 19:59
# @Author  : DIRICHLET
# @File    : main.py
a=[]
def myin(fun=int):
    global a
    a=list(map(fun,input().split()))
#myin(int)
myin()
print(a[0]//(a[1]+a[2])*a[1]+min(a[0]%(a[1]+a[2]),a[1]))
#print(a)

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

namespace abc171_b
{
    class Program
    {
        static void Main(string[] args)
        {
            string line = Console.ReadLine();
            long N = long.Parse(line);
            string ans = "";
            while (N > 0)
            {
                if (N % 26 == 0)
                {
                    ans = (char)('z') + ans;
                    N = N - 26;
                }
                else
                {
                    ans = (char)('a' - 1 + (N % 26)) + ans;
                }

                N = N / 26;
            }

            Console.WriteLine(ans);
            Console.Read();
        }
    }
}

Measured memory_bytes: 27460
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int main(){

	int n;
	while(1){
        scanf("%d",&n);
        if(n == 0) break;
        int kubun[10] = {0};
        for(int i = 0; i < n; i++){
            int x;
            scanf("%d",&x);
            if(x < 10) kubun[0]++;
            if(x >= 10 && x < 20) kubun[1]++;
            if(x >= 20 && x < 30) kubun[2]++;
            if(x >= 30 && x < 40) kubun[3]++;
            if(x >= 40 && x < 50) kubun[4]++;
            if(x >= 50 && x < 60) kubun[5]++;
            if(x >= 60) kubun[6]++;
        }
        for(int i = 0; i < 7; i++){
            printf("%d\n",kubun[i]);
        }
	}

	return 0;
}

Measured memory_bytes: 1188
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
As = [ list(map(int, input().split())) for _ in range(N) ]

cnt = 0
for A in As:
    s = 0
    for a,b in zip(A,B):
        s += a*b
    if s+C>0:
        cnt += 1

print(cnt)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl
 
//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)
 
constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;
 
int main(){
 
    int a,b;
    cin>>a>>b;
    if((a*b)%2==0){
        cout<<"No"<<endl;
    }else{
        cout<<"Yes"<<endl;
    }
 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
	int n,i,j;
	double a[3000],dp[3000][3000]={0};
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i];
	dp[1][0]=1-a[1];
	dp[1][1]=a[1];
	for(i=2;i<=n;i++)
	{	dp[i][0]=dp[i-1][0]*(1-a[i]);
		dp[i][i]=dp[i-1][i-1]*a[i];
	}
	for(i=2;i<=n;i++)
		for(j=1;j<i;j++)
			dp[i][j]=dp[i-1][j]*(1-a[i])+dp[i-1][j-1]*a[i];
	int mt=n/2;
	double ans=0;
	for(i=mt+1;i<=n;i++)
		ans+=dp[n][i];
	cout<<fixed<<setprecision(10)<<ans<<endl;
	
	
}


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

using namespace std;

int main() {
	char a, b;
	cin >> a >> b;
	if (a == 'H' && b == 'H') {
		cout << b << endl;
		return 0;
	}
	if (a == 'D' && b == 'D') {
		cout << 'H' << endl;
		return 0;
	}
	cout << "D" << endl;
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)

int func(int a){
    if(a%2){
        return 3*a+1;
    }
    else{
        return a/2;
    }
}

int main(){
    set<int> s;
    int x;
    cin >> x;
    s.insert(x);

    int idx = 1;
    while(1){
        idx++;
        x = func(x);
        if(s.find(x) != s.end()) break;
        s.insert(x);
    }

    cout << idx << endl;
    return 0;
}


Measured memory_bytes: 256
/*input
6 15
6 5
5 6
6 4
6 6
3 5
7 2

3 8
3 30
4 50
5 60
*/
#include <bits/stdc++.h>
using namespace std;

const long long int inf = 1e17 + 5;

long long int dp[105][100005], w[105], v[105];
//dp[i][j] -> minimum weight to take from i items having total value j
int n;

int main(){
	ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
		
	for(int i = 0; i < 105; ++i){
		for(int j = 1; j < 100005; ++j){
			dp[i][j] = inf;
		}
		dp[i][0] = 0;
	}

	long long int W;
	cin >> n >> W;
	for(int i = 1; i <= n; ++i){
		cin >> w[i] >> v[i];
	}

	for(int i = 1; i <= n; ++i){
		for(int j = 1; j < 100005; ++j){
			if(j >= v[i])
				dp[i][j] = min(dp[i - 1][j], w[i] + dp[i - 1][j - v[i]]);
			else
				dp[i][j] = dp[i - 1][j];
		}
	}

	int ans = 0;
	
	for(int i = 100001; i >= 0; --i){
		if(dp[n][i] <= W){
			ans = i;
			break;
		}
	}

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


Measured memory_bytes: 82304
#include <bits/stdc++.h>
using namespace std;
int read();
int n, m, D;
int d[500005], f[500005], res[500005];
int main() {
    n = read(), D = read();
    for (int i = 1; i <= n; ++i) d[i] = read();
    f[n + 1] = 1;
    for (int i = n; i >= 1; --i)
        f[i] = (f[i + 1] <= d[i] / 2) ? f[i + 1] : f[i + 1] + d[i];
    for (int i = 1; i <= n; ++i)
        res[i] = f[i + 1] <= D, D = min(D, abs(D - d[i]));
    m = read();
    while (m--) puts(res[read()] ? "YES" : "NO");
    return 0;
}

int read() {
    int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') f = (c == '-') ? -1 : f, c = getchar();
    while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * f;
}


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

int main(void){
    int n;
    cin >> n;
    vector<int> v(n);
    for(int i=0; i<n; i++){
        int a;
        cin >> a;
        v.at(i) = a-1;
    }
    int ans = 0;
    for(int i=0; i<n; i++){
        if(v.at(i) == i){
            if(i == n-1){
                swap(v.at(i-1), v.at(i));
            }else{
                swap(v.at(i), v.at(i+1));
            }
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}

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

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

int main(){
    int a[3][3];
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            cin>>a[i][j];
        }
    }
    int n;
    cin>>n;
    int b;
    while(cin>>b){
        for(int i=0;i<3;i++){
            for(int j=0;j<3;j++){
                if(a[i][j]==b){
                    a[i][j]=0;
                }
            }
        }
    }
    int l=0;
    if(a[0][0]+a[0][1]+a[0][2]==0||a[1][0]+a[1][1]+a[1][2]==0||a[2][0]+a[2][1]+a[2][2]==0){
        l=1;
    }if(a[0][0]+a[1][0]+a[2][0]==0||a[0][1]+a[1][1]+a[2][1]==0||a[0][2]+a[1][2]+a[2][2]==0){
        l=1;
    }if(a[0][0]+a[1][1]+a[2][2]==0||a[0][2]+a[1][1]+a[2][0]==0){
        l=1;
    }
    if(l){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    return 0;
    
}

Measured memory_bytes: 256
import bisect
a = int(input())
b = [int(input()) for d in range(a)]
c = [b[0]]
for i in b[1:]:
    if c[-1] < i:
        c.append(i)
    else:
        c[bisect.bisect_left(c,i)] = i
        
print(len(c))


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

int main() {
  string S;
  cin >> S;
  vector<bool> n(26, false);
  for (int i = 0; i < S.size(); i++) {
    int j = S[i] - 'a';
    if (n[j]) {
      cout << "no" << endl;
      return 0;
    }
    n[j] = true;
  }
  cout << "yes" << endl;
}

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

int main() {
int N,M;
  cin >> N;
    cin >> M;
  if(N >= 0 && M <= 100 && 2 <= N+M <= 100){
    cout << (N-1)*N/2+(M-1)*M/2 << endl;
  }     
}


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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define REPRl(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < (int)n; i++)
#define FORl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define ALL(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}

int main() {
  int p,q,r;cin>>p>>q>>r;
  int mx=max(p, max(q,r));
  int ans=p+q+r-mx;
  cout << ans << endl;
}

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

int main() {
    ll h;
    cin >> h;
    ll cnt = 0;
    while (h != 1) {
        h /= 2;
        cnt++;
    }
    cout << (ll)pow(2, cnt + 1) - 1 << endl;
}


Measured memory_bytes: 256
n=int(input())
t,a=tuple(map(int,input().split()))
h=list(map(int,input().split()))

def tmp(y,x):
	return y-0.006*x
min=10**6
j=0
for i in range(len(h)):
	ze=abs(a-tmp(t,h[i]))
	if min>ze:
		min=ze
		j=i

print(j+1)

Measured memory_bytes: 3064
#include <stdio.h>
#define MAX 255

int tree[MAX], h;
void print();

int main(){
  int a;

  scanf("%d",&h);
  for(a = 1; a <= h; a++){
    scanf("%d",&tree[a]);
  }

  print();
  return 0;
}

void print(){
  int a=1;

  for(a = 1; a <= h; a++){
    printf("node %d: key = %d, ",a,tree[a]);
    if(a/2 > 0 && a/2 <= h) printf("parent key = %d, ",tree[a/2]);
    if(2*a > 0 && 2*a <= h) printf("left key = %d, ",tree[2*a]);
    if(2*a+1 > 0 && 2*a+1 <= h) printf("right key = %d, ",tree[2*a+1]);
    printf("\n");
  }
}



Measured memory_bytes: 2112
#include <bits/stdc++.h>
#define DAU  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PLEC exit(0);
using namespace std;
string s;
int main() {
    DAU
    cin >> s;
    if (s[0] == 'S')
        cout << "Cloudy";
    else if (s[0] == 'C')
        cout << "Rainy";
    else cout << "Sunny";
    PLEC
}


Measured memory_bytes: 3564
#include <iostream>
#include <fstream>
#define nmax 501
#define INF   100000000000000000LL

using namespace std;
ifstream fin("p.in");
ofstream fout("p.out");

long long int d[nmax];
long long int dp[nmax][nmax];
int n;

int main()
{
    long long sum=0,sum_part[nmax];
    int n;
    cin>>n;
    for(int i=0; i<n; i++)
        {
            cin>>d[i];
            sum+=d[i];
        }

    long long mat[nmax][nmax];
    for(int i=1; i<=n; i++)
        {
            mat[0][i]=mat[i][0]=0;
        }
    for(int i=1; i<=n; i++)
        {
            dp[i][i]=0;
            mat[i][i]=d[i-1];
            mat[i][i+1]=dp[i][i+1]=d[i-1]+d[i];
        }

    int i=1;
    int val=3;
    while(i<=n-2)
        {
            int j=val;
            int it=1;
            while(j<=n)
                {
                    //fout<<"linia "<<it<<endl;
                    //fout<<"coloana "<<j<<endl;
                    long long value=INF;
                    mat[it][j]=mat[it][j-1]+d[j-1];
                    for(int it2=it; it2<j; it2++)
                        {
                            //fout<<i<<" "<<it2<<" "<<j<<endl;
                            value=min(dp[it][it2]+dp[it2+1][j]+mat[it][j],value);
                        }
                    dp[it][j]=value;
                    j++;
                    it++;
                }
            val++;
            i++;
        }

    /*for(int i=1; i<=n; i++)
        {
            for(int j=1; j<=n; j++)
                {
                    fout<<dp[i][j]<<" ";
                }
            fout<<endl;
        }*/
    cout<<dp[1][n];

    return 0;
}



Measured memory_bytes: 3456
import sys
S=input()
T=input()
L=len(S)
f=0
"""
if(S===T):
    print("Yes")
    f=1
    """
for i in range(len(S)):
    if(T==S[L-i::]+S[0:L-i]):
        print("Yes")
        sys.exit()
if(f==0):
    print("No")

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

const int N = 2e5 + 9;

unordered_map<int, int>T, W;
int a[N], b[N], n, h[N], t, f[N], ret;

int find (int x) { return x == f[x] ? x : f[x] = find(f[x]); }

int main () {
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) scanf("%d", &a[i]), a[n] ^= a[i];
	for (int i = 0; i < n; ++i) scanf("%d", &b[i]), b[n] ^= b[i];
	for (int i = 0; i <= n; ++i) ++T[a[i]], --T[b[i]];
	for (auto u : T) if (u.second) return puts("-1"), 0;
	for (int i = 0; i <= n; ++i) if (i == n || a[i] != b[i]) h[t++] = a[i], h[t++] = b[i];
	sort(h, h + t);
	t = unique(h, h + t) - h;
	for (int i = 0; i <= n; ++i) if (i == n || a[i] != b[i]) {
		a[i] = lower_bound(h, h + t, a[i]) - h, b[i] = lower_bound(h, h + t, b[i]) - h;
		if (i < n) ++ret;
	}
	for (int i = 0; i < t; ++i) f[i] = i;
	for (int i = 0; i <= n; ++i) if (a[i] != b[i]) f[find(a[i])] = find(b[i]);
	for (int i = 0; i < t; ++i) if (find(i) == i) ++ret;
	printf("%d\n", ret - (bool)t);
	return 0;
}

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

int main(void)
{
    long long N;
    string sX;

    cin >> N;
    cin >> sX;
    
    long long origin_count = 0;

    for(auto s : sX){
        if(s=='1') origin_count += 1;
    }

    long long one_r_count = origin_count - 1;
    long long zero_r_count = origin_count + 1;

    long long one_mod = 0;
    long long zero_mod = 0;

    for(auto s : sX){
        if(one_r_count != 0) one_mod = ((long long)(one_mod * 2) + (long long)(s - '0')) % one_r_count;
        zero_mod = ((long long)(zero_mod * 2) + (long long)(s - '0') ) % zero_r_count;
    }

    long long f[220000]={0};
    long long pop[220000]={0};
    for(int i=1; i < 220000; ++i){
        pop[i] = pop[i/2] + i%2;
        f[i] = f[i % pop[i]] + 1;
    }

    long long onepow[220000]={1};
    long long zeropow[220000]={1};
    for(int i=1; i <220000; ++i){
        if(one_r_count != 0)onepow[i] = (long long)(onepow[i-1] * 2) % one_r_count;
        zeropow[i] = (long long)(zeropow[i-1] * 2) % zero_r_count;
    }

    for(int i=1; i <= N; ++i){
        long long Xi_n;
        if(sX[i-1] == '1'){
            if(one_r_count != 0){
                Xi_n = (one_mod - onepow[N-i]) % one_r_count;
                if(Xi_n < 0) Xi_n += one_r_count;
                Xi_n %= one_r_count;
                long long ans = (long long)(f[Xi_n] + 1);
                cout << ans << endl;  
            }else{
                cout << 0 << endl;  
            }
        }else{
            Xi_n = (zero_mod + zeropow[N-i] % zero_r_count);
            Xi_n %= zero_r_count;
            long long ans = (long long)(f[Xi_n] + 1);
            cout << ans << endl;  
        } 
    }
}

Measured memory_bytes: 10624