akhauriyash/Code-Regression huggingface dataset:
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define PB push_back
#define MP make_pair
#define FST first
#define SND second
#define SZ(a) (signed)((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int MOD = 1000000007;
const char ENDL = '\n';

#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"  << " " << __FILE__ << endl;

signed main(void) {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(10);
    cin.tie(0);

    int n, a;
    cin >> n >> a;
    VI x(n);
    REP(i, n) {
        cin >> x[i];
    }

    vector<VVI> dp(n,VVI(n+1, VI(a * n + 1, 0)));
    dp[0][1][x[0]] = 1;
    FOR(i, 1, n) {
        dp[i][1][x[i]] = 1;
        FOR(j,1, i+2) {
            REP(k,a * n + 1){
                dp[i][j][k] += dp[i - 1][j][k];
                if (k - x[i] >= 0) {
                    dp[i][j][k] += dp[i - 1][j-1][k - x[i]];
                }
            }
        }
    }

    int ans = 0;
    FOR(i,1,n+1){
        ans += dp[n-1][i][i*a];
    }

    cout << ans << ENDL;

    return 0;
}

Measured memory_bytes: 51200
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include <climits>
#include<fstream>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
typedef long long ll;
typedef long double ld;
#define str string
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct E {//辺の情報を入れる変数
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
struct LS {
	ll num, cost;
	//値、遅延配列
};
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad＝座標上の2点間の距離
ll ari(ll a, ll b, ll c) {
	return (a + b)*c / 2;
}//等差数列の和
ll fact(ll x, ll k, ll p) {//最大値、個数、あまり
	ll sum = 1;
	for (int i = 0; i < k; i++) {
		sum *= (x--);
		sum %= p;
	}
	return sum;
}//階乗(正）
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x%p;
		x = x * x%p;
		n >>= 1;
	}
	return res;
}//x^n%p
short ctos(char a) {
	return (int)(a - '0');
}
const ll Inf = 4523372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
signed main() {
	string s;
	cin >> s;
	int sum = 0, ans = 0;
	for (int i = s.size() - 1; i >= 0; i--) {
		if (s[i] == 'B') {
			ans += sum;
		}
		else {
			sum++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 1336
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;


vector<int>  dx = {1,-1,0,0};
vector<int>  dy = {0,0,1,-1};


int main() {

	string str; cin >> str;
	if (str.find("AC") != std::string::npos){
		cout << "Yes" << endl;
	}else {
		cout << "No" << endl;
	}
	return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> p(N);
  for (int i=0; i<N; i++){
    cin >> p[i];
  }
  // 昇順って綺麗に並んでるってことなので
  int flag = 0;
  for (int i=0; i<N; i++){
    if (p[i] != i+1){
      if (flag == 0){
        if (p[p[i]-1] != i+1){
          cout << "NO" << endl;
          return 0;
        } else{
          flag = i + 1;
        }
      } else{
        if (flag != p[i]){
          cout << "NO" << endl;
          return 0;
        }
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}


Measured memory_bytes: 256
N=int(input())
A=[]
for i in range(N):
    n=int(input())
    A.append(n)
A.sort()
if N%2==1:
    ans1=0
    B=A[int(N/2)]
    for j in range(int(N/2)):
        ans1+=abs(B-A[j])
        B=A[j]
        ans1+=abs(B-A[N-1-j])
        B=A[N-1-j]
    ans2=0
    C=A[int(N/2)]
    for k in range(int(N/2)):
        ans2+=abs(C-A[N-1-k])
        C=A[N-1-k]
        ans2+=abs(C-A[k])
        C=A[k]
    print(max(ans1,ans2))
else:
    ans1=0
    B=A[int(N/2)]
    for j in range(int(N/2)-1):
        ans1+=abs(B-A[j])
        B=A[j]
        ans1+=abs(B-A[N-1-j])
        B=A[N-1-j]
    ans1+=abs(B-A[int(N/2)-1])
    ans2=0
    C=A[int(N/2)-1]
    for k in range(int(N/2)-1):
        ans2+=abs(C-A[k])
        C=A[k]
        ans2+=abs(C-A[N-1-k])
        C=A[N-1-k]
    ans2+=abs(C-A[int(N/2)])
    print(max(ans1,ans2))

Measured memory_bytes: 7500
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)
 
int N, M;
deque<int>q;
vector<int>E[101010];
set<int>visited;
void pr() {
	puts(q.size());
	fore(x, q)cout << x+1 << " ";
	cout << endl;
	exit(0);
}
void dfs(int now){
	int st = q.front();
	int en = q.back();
		fore(x, E[st]) {
			if (!visited.count(x)) {
				visited.insert(x);
				q.push_front(x);
				dfs(x);
			}
		}
	fore(x, E[en]) {
		if (!visited.count(x)) {
			visited.insert(x);
			q.push_back(x);
			dfs(x);
		}
	}
	pr();
}
 
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
 
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;
		A--, B--;
		E[A].pb(B);
		E[B].pb(A);
	}
	q.push_back(0);
	visited.insert(0);
	dfs(0);
 
	return 0;
}

Measured memory_bytes: 14592
#include <iostream>
using namespace std;
int calc(int x) {
	int ret = 0;
	while(x % 100 == 0) {
		x /= 100;
		++ret;
	}
	return ret;
}
int main() {
	int D, N;
	cin >> D >> N;
	int cnt = 0, val = 0;
	while(cnt < N) {
		++val;
		if(calc(val) == D) ++cnt;
	}
	cout << val << '\n';
	return 0;
}

Measured memory_bytes: 3640
#include <stdio.h>
#include <string.h>
#define NUMBER 210

int A_snake(char snake[]);
int B_snake(char snake[]);

int main(void) {
    int quantity, i;
    char snake[NUMBER] = {0};
    
    scanf("%d", &quantity);
    
    for(i = 0; i < quantity; i++) {
            scanf("%s", snake);
        
        if(snake[0] != '>' ) {
            puts("NA");
        } else if(snake[1] == '\'') {
            if(snake[2] == '=') {
                if(A_snake(snake)) {
                    puts("A");
                } else {
                    puts("NA");
                }
            } else {
                puts("NA");
            }
        } else if(snake[1] == '^') {
            
            if(B_snake(snake)) {
                puts("B");
            } else {
                puts("NA");
            }
            
        } else {
            puts("NA");
        }
    }

    return(0);
}

int A_snake(char snake[]) {
    int j, idx = 0, count = 0;
    
    for(j = 3; j < NUMBER; j++) {
        if(snake[j] != '=' && snake[j] != '#')
            if(snake[j] != '~')
                return(0);
        if(snake[j] == '=') {
            count++;
        } else if(snake[j] == '#') {
            idx = j;
            break;
        }
    }
    
    for(j = idx + 2; j < NUMBER; j++) {
        if(snake[j] == '=') {
            count--;
        } else if(snake[j] == '~') {
            idx = j;
            break;
        } else {
            return(0);
        }
    }
    if(count == 0) {
        if(snake[idx] == '~' && snake[idx + 1] == '\0')
            return(1);
        else
            return(0);
    } else {
        return(0);
    }
    
}

int B_snake(char snake[]) {
    int j, idx, count = 0;
    char *str;
    
    str = &snake[2];
    for(j = 2; j < NUMBER; j += 2) {
        if(strncmp(str, "Q=", 2) != 0 && strncmp(str, "~~", 2) != 0)
            count++;
        if(!(strncmp(str, "~~",2)) && j > 3) {
            idx = j;
            break;
        }
        str += 2;
    }
    
    if(count == 0 && (snake[idx] == '~' && snake[idx + 1] == '~')) {
        if(snake[idx + 2] == '\0') {
            return(1);
        } else {
            return(0);
        }
    } else
        return(0);
    
    return(0);
}

Measured memory_bytes: 584
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S; cin >> S;
    int ans = 0;
    rep(i, S.length() - 1) {
        if (S[i] != S[i + 1]) ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 512
#include <iostream>
    #include <vector>
    #define REP(i, n) for (int i = 0; i < n; ++i)
    using namespace std;
    using ll = long long;
     
    int main() {
        int n; cin >> n;
        vector<int> a(n);
        REP(i,n) cin >> a[i];
     
        ll res = 0;
        int right = 0, sum = 0;
        REP(left,n) {
            while (right < n && (sum ^ a[right]) == (sum + a[right])) {
                sum ^= a[right];
                ++right;
            }
            res += right - left;
            {
                sum ^= a[left];
            }
        }
     
        cout << res << endl;
    }

Measured memory_bytes: 1152
// practice with Dukkha
#include <algorithm>
#include <iostream>

using namespace std;

const int N = 10000, A = 1000000, MD = 1000000007;

int aa[N], kk[A];

int power(long long a, int k) {
	long long p = 1;
	while (k) {
		if (k & 1)
			p = p * a % MD;
		a = a * a % MD;
		k >>= 1;
	}
	return p;
}

int main() {
	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		aa[i] = a;
		for (int p = 2; p <= a / p; p++)
			if (a % p == 0) {
				int k = 0;
				while (a % p == 0) {
					k++;
					a /= p;
				}
				kk[p] = max(kk[p], k);
			}
		if (a > 1)
			kk[a] = max(kk[a], 1);
	}
	long long m = 1;
	for (int a = 2; a < A; a++)
		if (kk[a])
			m = m * power(a, kk[a]) % MD;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int a = aa[i];
		long long b = m;
		for (int p = 2; p <= a / p; p++)
			if (a % p == 0) {
				int k = 0;
				while (a % p == 0) {
					k++;
					a /= p;
				}
				b = b * power(p, MD - 1 - k) % MD;
			}
		if (a > 1)
			b = b * power(a, MD - 1 - 1) % MD;
		ans = (ans + b) % MD;
	}
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 6032
n = int(input())
F = [int(input().replace(' ',''), 2) for _ in range(n)]
P = [list(map(int, input().split())) for _ in range(n)]
ans=-10**7*n
for sp in range(1, 2**10):
  total = 0
  for i in range(n):
    total += P[i][bin(F[i] & sp).count('1')]
  ans = max(ans, total)
print(ans)


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

int main() {

    int N, A, B;
    cin >> N >> A >> B;

    int ans = 0;
    for(int i = 1; i <= N; i++) {
        string s = to_string(i);
        int sum = 0;
        for(char c : s) sum += c - '0';
        if(A <= sum && sum <= B) ans += i;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
N = int(input())
ps = list(map(int,input().split()))
# p_swap = [-1]*N
ans = 0
for i in range(N-1):
    if i+1 == ps[i]:
        p1,p2 = ps[i:i+2]
        ps[i] = p2
        ps[i+1] = p1
        ans += 1
if ps[N-1] == N:
    ans += 1
print(ans)

Measured memory_bytes: 14008
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define Return(ans) { cout << (ans) << endl; return 0; }
#define pb push_back
#define fi first
#define se second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using v_bool = vector<bool>;
using v_Pii = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;



signed main(){

    string S; cin >> S;
    Out(S.substr(0, 3));

    return 0;
}


Measured memory_bytes: 3612
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define all(c) begin(c), end(c)
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1e9 + 7;
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x, y;
    cin >> x >> y;
    int ans = INF;

    if (y - x >= 0) chmin(ans, y - x);
    if (y - (-x) >= 0) chmin(ans, y - (-x) + 1);
    if (-y - x >= 0) chmin(ans, -y - x + 1);
    if (-y - (-x) >= 0) chmin(ans, -y - (-x) + 2);

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

Measured memory_bytes: 256
LL=[]
RR=[]
N,M=map(int,input().split())
for i in range(M):
    L,R=map(int,input().split())
    LL.append(L)
    RR.append(R)
    
L1=max(LL)
R1=min(RR)
if L1>R1:
    print(0)
else:
    print(R1-L1+1)

Measured memory_bytes: 10984
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];

		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);

		List<String> ans = new ArrayList<>();
		int maxNum = 0;

		//同じ文字列がいくつ連続するのかを判定。連続数が最大値に一致していればlistに追加。最大値を上回ったらlistを空にしてから追加。
		for (int i = 0; i < n - 1;) {
			int j = i + 1;
			int num = 1;

			while (s[i].equals(s[j])) {
				num++;
				j++;
				if(j == n) {
					break;
				}
			}

			if (num > maxNum) {
				ans.clear();
				ans.add(s[i]);
				maxNum = num;
			} else if (num == maxNum) {
				ans.add(s[i]);
			}

			i = j;
		}

		if (maxNum == 1) {
			ans.add(s[n - 1]);
		}

		Collections.sort(ans);

		for(int i = 0; i < ans.size(); i++) {
			System.out.println(ans.get(i));
		}
	}

}


Measured memory_bytes: 73384
// Why am I so dumb? :c
#include<bits/stdc++.h>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()

#define fi first
#define se second

using namespace std;

typedef long long ll;

const int INF = (int)1e9;

int dp[6][30005];

bool p[6][30005];

vector<int> ans;

int n;

void solve() {
    scanf("%d", &n);

    if (n == 3) {
        printf("2 5 63\n");
        return;
    }

    if (n == 4) {
        printf("2 5 20 63\n");
        return;
    }

    for (int i = 2; i <= 3; ++i) {
        for (int j = 0; j < 6; ++j) {
            dp[j][i] = -INF;
        }
    }

    dp[5][3] = 2;
    dp[2][2] = 1;

    p[5][3] = 1;
    p[2][2] = 1;

    for (int i = 4; i <= 30000; ++i) {
        for (int cur = 0; cur < 6; ++cur) {
            dp[cur][i] = dp[cur][i - 1];
            p[cur][i] = 0;
        }

        if (i % 2 && i % 3) {
            continue;
        }

        for (int cur = 0; cur < 6; ++cur) {
            int val = dp[cur][i - 1] + 1;
            int nxt = (cur + i) % 6;

            if (val <= n && val > dp[nxt][i]) {
                dp[nxt][i] = val;
                p[nxt][i] = 1;
            }
        }
    }

    for (int i = 30000, s = 0; i > 1; --i) {
        if (p[s][i]) {
            s = (s - (i % 6) + 6) % 6;
            printf("%d ", i);
        }
    }
}

int main() {
    int tt = 1;

    while (tt--) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 1280
n, k = ([int(i) for i in input().split(' ')])
r, s, p = ([int(i) for i in input().split(' ')])
t = list(input())

score = {'r': p, 's': r, 'p': s, 'l': 0}

ans = 0
for i in range(n):
    ans += score[t[i]]
    if i + k < n and t[i] == t[i + k]:
        t[i + k] = 'l'

print(ans)
    


Measured memory_bytes: 4084
n,k,c = map(int,input().split())
s = list(input())

l = []
r = []

cnt = 0
for i in range(n):
    if cnt == 0 and s[i] == 'o':
        cnt = c
        l.append(i)
    else:
        cnt = max(0,cnt-1)
    if len(l) == k:
        break
cnt = 0
for i in range(n-1,-1,-1):
    if cnt == 0 and s[i] == 'o':
        cnt = c
        r.append(i)
    else:
        cnt = max(0,cnt-1)
    if len(r) == k:
        break
r.reverse()

#print(l,r)

for i in range(k):
    if l[i] == r[i]:
        print(l[i]+1)

Measured memory_bytes: 64968
# -*- coding: utf-8 -*-
n, x = map(int,input().split())
a = [int(i) for i in input().split()] 

a.sort()
su = 0
ans = 0
for i in range(n - 1):
    su += a[i]
    if su <= x:
        ans += 1
    if su > x:
        break
if su + a[-1] == x:
    ans += 1
print(ans)


Measured memory_bytes: 3060
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.NoSuchElementException;

class Main {

  public static void main(String[] args) {
    final FastScanner scanner = new FastScanner();
    final PrintWriter writer = new PrintWriter(System.out);
    int x = scanner.nextInt();
    while (true) {
      BigInteger i = new BigInteger(x + "");
      if (i.isProbablePrime(1)) {
        break;
      }
      if (x % 2 == 0) {
        x++;
      } else {
        x += 2;
      }
    }
    writer.println(x);
    writer.flush();
    writer.close();
  }

  // FastScanner --
  static class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    public FastScanner() {
    }

    private boolean hasNextByte() {
      if (ptr < buflen) {
        return true;
      } else {
        ptr = 0;
        try {
          buflen = in.read(buffer);
        } catch (IOException e) {
          e.printStackTrace();
        }
        if (buflen <= 0) {
          return false;
        }
      }
      return true;
    }

    private int readByte() {
      if (hasNextByte())
        return buffer[ptr++];
      else
        return -1;
    }

    private boolean isPrintableChar(int c) {
      return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
      while (hasNextByte() && !isPrintableChar(buffer[ptr]))
        ptr++;
      return hasNextByte();
    }

    public String next() {
      if (!hasNext())
        throw new NoSuchElementException();
      StringBuilder sb = new StringBuilder();
      int b = readByte();
      while (isPrintableChar(b)) {
        sb.appendCodePoint(b);
        b = readByte();
      }
      return sb.toString();
    }

    public long nextLong() {
      if (!hasNext())
        throw new NoSuchElementException();
      long n = 0;
      boolean minus = false;
      int b = readByte();
      if (b == '-') {
        minus = true;
        b = readByte();
      }
      if (b < '0' || '9' < b) {
        throw new NumberFormatException();
      }
      while (true) {
        if ('0' <= b && b <= '9') {
          n *= 10;
          n += b - '0';
        } else if (b == -1 || !isPrintableChar(b)) {
          return minus ? -n : n;
        } else {
          throw new NumberFormatException();
        }
        b = readByte();
      }
    }

    public int nextInt() {
      long nl = nextLong();
      if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
        throw new NumberFormatException();
      return (int) nl;
    }

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

Measured memory_bytes: 25044
n, q = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
b = (0..n).map{|x|x&-x}
c = []
d = Array.new(n){[]}
q.times{|i|
	l, r = gets.split.map(&:to_i)
	d[r - 1] << [l - 1, i]
}
e = []
u = 0
n.times{|i|
	t = c[a[i]]
	while t && t <= n
		b[t] -= 1
		t += t & -t
	end
	t || u+=1
	c[a[i]] = i+1

	d[i].each{|x, y|
		s = u
		while x > 0
			s -= b[x]
			x &= x-1
		end
		e[y] = s
	}
}
puts e


Measured memory_bytes: 107568
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define MOD 1000000007
#define MAX 100005
#define INF 1000000000000000000
using Graph=vector<vector<int>>;

int main(){
  int N,M;
  ll L;
  cin>>N>>M>>L;
  vector<int> A(M),B(M);
  vector<ll> C(M);
  vector<vector<pair<int,ll>>> G(N);
  for(int i=0;i<M;i++){
    cin>>A.at(i)>>B.at(i)>>C.at(i);
    A.at(i)--;
    B.at(i)--;
    G.at(A.at(i)).push_back(make_pair(B.at(i),C.at(i)));
    G.at(B.at(i)).push_back(make_pair(A.at(i),C.at(i)));
  }
  int Q;
  cin>>Q;
  vector<int> s(Q),t(Q);
  for(int i=0;i<Q;i++){
    cin>>s.at(i)>>t.at(i);
    s.at(i)--;
    t.at(i)--;
  }

  vector<vector<ll>> dist(N,vector<ll>(N,INF));
  for(int i=0;i<N;i++){
    dist.at(i).at(i)=0;
  }
  for(int i=0;i<M;i++){
    dist.at(A.at(i)).at(B.at(i))=C.at(i);
    dist.at(B.at(i)).at(A.at(i))=C.at(i);
  }
  for(int k=0;k<N;k++){
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        dist.at(i).at(j)=min(dist.at(i).at(j),dist.at(i).at(k)+dist.at(k).at(j));
      }
    }
  }

  vector<int> AA,BB;
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      if(dist.at(i).at(j)<=L){
        AA.push_back(i);
        BB.push_back(j);
      }
    }
  }
  vector<vector<ll>> d(N,vector<ll>(N,INF));
  for(int i=0;i<N;i++){
    d.at(i).at(i)=0;
  }
  for(int i=0;i<AA.size();i++){
    d.at(AA.at(i)).at(BB.at(i))=1;
    d.at(BB.at(i)).at(AA.at(i))=1;
  }

  for(int k=0;k<N;k++){
    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++){
        d.at(i).at(j)=min<ll>(d.at(i).at(j),d.at(i).at(k)+d.at(k).at(j));
      }
    }
  }

  for(int i=0;i<Q;i++){
    ll ans=d.at(s.at(i)).at(t.at(i));
    if(ans==INF){
      cout<<-1<<endl;
    }else{
      cout<<ans-1<<endl;
    }
  }
}


Measured memory_bytes: 6388
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <iomanip>

using namespace std;

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

  vector<double> v;
  double temp;

  for(int i = 0; i < n; ++i){
    cin >> temp;
    if(i == 0){
      v.push_back((temp + 1)/2);
    }else{
      v.push_back(v[i - 1] + (temp + 1)/2);
    }
  }

  double res = v[k - 1];
  for(int i = 0; i < n - k; ++i){
      double sum_i = v[k + i] - v[i];
      res = max(res, sum_i);
  }

  cout << setprecision(7) << res << endl;

  return 0;
}


Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    string s;
    cin>>s;
    int cnt=0,mx=0;
    for(int i=0; i<s.length(); i++)
    {
        if(s[i]=='A' || s[i]=='C' || s[i]=='T' || s[i]=='G')
            cnt++;
        else{
            mx=max(mx,cnt);
            cnt=0;
        }
    }
    mx=max(mx,cnt);
    cout<<mx<<endl;

    return 0;
}


Measured memory_bytes: 3656
'use strict';
const m=Math.max;
(function(input){
  input=input.trim().split(/\s+/);
  const N=input[0]-0,
        K=input[1]-0,
        R=input[2]-0,
        S=input[3]-0,
        P=input[4]-0,
        str=input[5].split('');
  
  let score = 0;
  
  for(let k=0;k<K;k++){
    const arr=[];
    let l=0,s=k;
    while(s<N){
      arr[l]=str[s];
      l++;
      s+=K;
    }
    
    const dpr=[],dps=[],dpp=[];
    dpr[-1]=dps[-1]=dpp[-1]=0;
    arr.forEach(function(c,l){
      if(c==='s'){
        dpr[l]=m(dps[l-1],dpp[l-1])+R;
        dps[l]=m(dpp[l-1],dpr[l-1]);
        dpp[l]=m(dpr[l-1],dps[l-1]);
      }else if(c==='p'){
        dpr[l]=m(dps[l-1],dpp[l-1]);
        dps[l]=m(dpp[l-1],dpr[l-1])+S;
        dpp[l]=m(dpr[l-1],dps[l-1]);
      }else{
        dpr[l]=m(dps[l-1],dpp[l-1]);
        dps[l]=m(dpp[l-1],dpr[l-1]);
        dpp[l]=m(dpr[l-1],dps[l-1])+P;
      }
    });
    score+=Math.max(dpr.pop(),dps.pop(),dpp.pop());
  }
  console.log(score);
})(require('fs').readFileSync('/dev/stdin','utf8'));


Measured memory_bytes: 26132
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define N 100005
#define MOD 1000000007
#define dd double
#define vi vector<int>
#define vll vector<ll>
#define forr(i, n) for(ll i=0;i<n;i++)
#define revf(i,n) for(ll i=n-1;i>=0;i++)
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep1(i,b) for(ll i=1;i<=b;i++)
#define inp(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define outp(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" "
#define outp1(a,n) for(ll i=1;i<n;i++)cout<<a[i]<<" "
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) (((a)*(b))/gcd((a),(b)))
#define pb push_back
#define mp make_pair
#define mem(x,n) memset(x,n,sizeof(x))
#define BINSC binary_search
#define BITOUT __builtin_popcount
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test ll t; cin>>t; while(t--)
#define cn cout<<"\n";
int main()
{
     fast;
     int x;
     cin>>x;
     if(x>=30)
     cout<<"Yes";
     else
     cout<<"No";
     cn
}

Measured memory_bytes: 3648
//author Forsaken
#define Hello the_cruel_world!
#pragma GCC optimize(2)
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<utility>
#include<cmath>
#include<climits>
#include<deque>
#include<functional>
#include<numeric>
#define max(x,y) ((x) > (y) ? (x) : (y))
#define min(x,y) ((x) < (y) ? (x) : (y))
#define lowbit(x) ((x) & (-(x)))
#define FRIN freopen("C:\\Users\\Administrator.MACHENI-KA32LTP\\Desktop\\1.in", "r", stdin)
#define FROUT freopen("C:\\Users\\Administrator.MACHENI-KA32LTP\\Desktop\\1.out", "w", stdout)
#define FAST ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define outd(x) printf("%d\n", x)
#define outld(x) printf("%lld\n", x)
#define memset0(arr) memset(arr, 0, sizeof(arr))
#define il inline
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
const int maxn = 10;
const int INF = 0x7fffffff;
const int mod = 1e9 + 7;
const double eps = 1e-7;
const double Pi = acos(-1.0);
il int read_int() {
	char c;
	int ret = 0, sgn = 1;
	do { c = getchar(); } while ((c < '0' || c > '9') && c != '-');
	if (c == '-') sgn = -1; else ret = c - '0';
	while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
	return sgn * ret;
}
il ll read_ll() {
	char c;
	ll ret = 0, sgn = 1;
	do { c = getchar(); } while ((c < '0' || c > '9') && c != '-');
	if (c == '-') sgn = -1; else ret = c - '0';
	while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
	return sgn * ret;
}
il ll quick_pow(ll base, ll index) {
	ll res = 1;
	while (index) {
		if (index & 1)res = res * base % mod;
		base = base * base % mod;
		index >>= 1;
	}
	return res;
}
int arr[maxn + 5][maxn + 5], n, d, res;
bool check(int i, int j) {
	int dis = 0;
	for (int k = 1; k <= d; ++k)dis += (arr[i][k] - arr[j][k]) * (arr[i][k] - arr[j][k]);
	int up = sqrt(dis) + 0.5;
	if (up * up == dis)return true;
	else return false;
}
int main()
{
	cin >> n >> d;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= d; ++j)
			cin >> arr[i][j];
	for (int i = 1; i < n; ++i)
		for (int j = i + 1; j <= n; ++j) {
			if (check(i, j))++res;
		}
	cout << res << endl;
	//system("pause");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
vector<int> vc[100];
typedef pair<int,int> P;
int main(){
	while(true){
		int N,D;
		cin>>N>>D;
		if(N==0) break;
		rep(i,N) vc[i].clear();
		set<P> st;
		set<P>::iterator it,it2;
		int m[100]={},s[100]={};
		rep(i,N) s[i]=0;
		rep(i,N){
			cin>>m[i];
			rep(j,m[i]){
				int c;
				cin>>c;
				s[i]+=c;
				vc[i].pb(c);
			}
			m[i]--;
			st.insert(P(s[i],i));
		}
		bool update=1;
		while(update){
			update=0;
			rep(i,N){
				if(m[i]<0) continue;
				it=st.end();
				it--;
				it2=st.lower_bound(P(s[i],i));
				if(it==it2) it--;
				if(it2->fs - vc[i][m[i]] +D >= it->fs ){
					update=1;
					st.erase(P(s[i],i));
					s[i]-=vc[i][m[i]];
					m[i]--;
					st.insert(P(s[i],i));
				}
			}
		}
		bool can=1;
		rep(i,N) if(m[i]>=0) can=0;
		if(can) puts("Yes");
		else puts("No");
	}
}

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

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    y /= gcd(x,y);
    return (x*y);
}

int main()
{
    ll n,m;
    cin >> n >> m;
    vll a(m),b(m),sum(n);
    rep(i,m){
        cin >> a[i] >> b[i];
        sum[a[i]-1]++;
        sum[b[i]-1]++;
    }
    rep(i,n)cout << sum[i] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <algorithm>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <cstdlib>
#include <iomanip>
using namespace std;

int main(){
   int n;
   cin >> n;
   cout << (n&1?2*n:n) << endl;
}


Measured memory_bytes: 256
<?php
// C
fscanf(STDIN, '%d %d %d %d %d', $a, $b, $c, $x, $y);
$ans = 0;
// A B 1枚ずつ用意
$num = min($x, $y);
$cost = min($a + $b, $c * 2);
$ans += $cost * $num;
// 残りのピザを用意
$num = abs($x - $y);
$cost = $x > $y ? min($a, $c * 2) : min($b, $c * 2);
$ans += $cost * $num;
echo $ans;

Measured memory_bytes: 4604
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")

#include<bits/stdc++.h>

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

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


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int N;
  cin >> N;
  vector< int > A(N);
  cin >> A;
  sort(begin(A), end(A));
  int ret = 0;
  for(int a = 0; a < N; a++) {
    for(int b = a + 1; b < N; b++) {
      for(int c = b + 1; c < N; c++) {
        ret += A[a] + A[b] > A[c];
      }
    }
  }
  cout << ret << endl;
}


Measured memory_bytes: 256
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll
const long double pi = 3.14159265358979323846;

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

template<class T>
bool chmax(T &a, T b){if(a < b){a = b; return true;} return false;}
template<class T>
bool chmin(T &a, T b){if(a > b){a = b; return true;} return false;}
void YES(bool ok){
    cout << (ok ? "Yes" : "No") << endl;
}
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    bool ok = false;
    ll tmp = 0;
    ll n; cin >> n;
    rep(i,0,n){
        ll a,b; cin >> a >> b;
        if (a == b) tmp++;
        else
            tmp = 0;
        ok |= tmp >= 3;
    }

    YES(ok);
}

Measured memory_bytes: 3652
N = int(input())
ls = list(map(int, input().split(' ')))
rst = 0
for i in range(1, N):
    if ls[i - 1] > ls[i]:
        rst += ls[i - 1] - ls[i]
        ls[i] += ls[i - 1] - ls[i]
print(rst)

Measured memory_bytes: 32328
<?php
  
while ($line = fgets(STDIN)) {
   $stdin[] = trim($line);
}
$v2 = str_split($stdin[0]);
#$v2 = explode(" ", $stdin[0]);

#dream dreamer erase eraser

#var_dump($v2);

$cnt = 0;
for($i=1; $i<=$stdin[0]; $i++){

  $char = strlen($i);
  
  if($char % 2 != 0){
    $cnt++;
  }
  
}

$ans = $cnt;


echo $ans . PHP_EOL;

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

typedef long long ll;

#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18


int main() {
    int x1,y1,x2,y2; cin >> x1 >> y1 >> x2 >> y2;
    int dx = x2-x1;
    int dy = y2-y1;
    cout << x2-dy << " " << y2+dx << " " << x1-dy << " " << y1+dx << endl;
    return 0;
}

Measured memory_bytes: 3576
#include<stdio.h>
#include<string.h>
int main(){
   char str[30];
   scanf("%s",str);
   int length=strlen(str);
   int i,j,flag=1;
   for(i=0;i<length;i++){
      for(j=i+1;j<length;j++){
        if(str[i]==str[j]){
            flag=0;
            break;
        }
      }
      if(flag==0)break;
   }
   if(flag)printf("yes\n");
   else printf("no\n");
   return 0;
}

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

int main()
{
    int list[27] = {0};
    for(int i = 0; i < 3; ++i) {
        ++list[fgetc(stdin) - 'a'];
    }
    if(list[0] == 1 && list[1] == 1 && list[2] == 1) 
        cout << "Yes" << endl;
    else cout << "No" <<endl;
    return 0;
}

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

namespace AtCoder.Contest.B
{
	class Program
	{
		public static void Main(string[] args)
		{
			var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
			Console.SetOut(sw);

			Scanner cin = new Scanner();

			string s = cin.next();
			string ans = "";

			for (int i = 0; i < s.Length; i++)
			{
				if (i % 2 == 0) ans += s[i];
			}

			Console.WriteLine(ans);

			Console.Out.Flush();
		}
	}

	class Scanner
	{
		string[] s;
		int i;

		char[] cs = new char[] { ' ' };

		public Scanner()
		{
			s = new string[0];
			i = 0;
		}

		public string next()
		{
			if (i < s.Length) return s[i++];
			string st = Console.ReadLine();
			while (st == "") st = Console.ReadLine();
			s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			if (s.Length == 0) return next();
			i = 0;
			return s[i++];
		}

		public int nextInt()
		{
			return int.Parse(next());
		}

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = nextInt() + add;
			}
			return Array;
		}

		public long nextLong()
		{
			return long.Parse(next());
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = nextLong() + add;
			}
			return Array;
		}

		public double nextDouble()
		{
			return double.Parse(next());
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++)
			{
				Array[i] = nextDouble() + add;
			}
			return Array;
		}
	}
}

Measured memory_bytes: 41480
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

using namespace std;

#define fori(x) for (int i = 0; i < x; ++i)
#define forj(x) for (int j = 0; j < x; ++j)

typedef long long ll;

const int INF = 2e9 + 5;
const int alength=100100;

int main() {
	int n;ll a[alength],b[alength];
	cin>>n;
	fori(n+1){cin>>a[i];}
	fori(n){cin>>b[i];}
	ll c=0;
	fori(n){
		if(a[i]<b[i]){
			c+=a[i];
			b[i]-=a[i];
			a[i]=0;
			if(a[i+1]<b[i]){
				c+=a[i+1];
				b[i]-=a[i+1];
				a[i+1]=0;
			}else{
				c+=b[i];
				a[i+1]-=b[i];
				b[i]=0;
			}
		}else{
			c+=b[i];
			a[i]-=b[i];b[i]=0;
		}
	}
	cout<<c;
}

Measured memory_bytes: 1792
#include<stdio.h>
#include<string.h>
main(){
  char a[1000][2],s;
  int n,i,j,m,flg;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf(" %c %c",&a[i][0],&a[i][1]);
    }
    scanf("%d",&m);
    for(i=0;i<m;i++){
      scanf(" %c",&s);
      for(j=0,flg=0;j<n;j++){
	if(a[j][0]==s){
	  printf("%c",a[j][1]);
	  flg=1;
	  break;
	}
      }
      if(flg==0) printf("%c",s);
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 572
#include <iostream>
#include <ctype.h>


using namespace std;


int main()
{
  char s1[10], s2[10], s3[10];

  cin >> s1 >> s2 >> s3;
  cout << (char)toupper(s1[0]) << (char)toupper(s2[0]) << (char)toupper(s3[0]) << endl;;
  
  return 0;
}


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

int main() {
  int n, m;
  cin >> n >> m;
  priority_queue<int> q;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    q.push(a);
  }
  for (int i = 0; i < m; i++) {
    int a = q.top();
    q.pop();
    q.push(a / 2);
  }
  long s;
  while (!q.empty()) {
    s += q.top();
    q.pop();
  }
  cout << s << endl;
}


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

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

int main(){
    string s;
        cin >> s;
    int cnt=0, ans=0;
        for(int i=0; i<s.size(); i++){
            if(s[i]=='A' || s[i]=='T' || s[i]=='G' || s[i]=='C'){
                cnt += 1;
                continue;
            }
            ans = max(cnt, ans);
            cnt = 0;
        }
    cout << max(cnt, ans) << endl;
}

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

long long int N, W, w, v, w0, t, a, b;
vector<long long> V[4] = {{0}, {0}, {0}, {0}};

int main(){
    scanf("%lld%lld%lld%lld", &N, &W, &w, &v);
    w0 = w;
    V[0].push_back(v);
    for(int i = 1; i < N; ++i){
        scanf("%lld%lld", &w, &v);
        V[w - w0].push_back(v);
    }
    for(auto& k : V){
        sort(k.begin() + 1, k.end());
        reverse(k.begin() + 1, k.end());
        partial_sum(k.begin() + 1, k.end(), k.begin() + 1);
    }
    for(int i = V[0].size(); --i >= 0;){
        t = i * w0;
        b = i ? V[0][i] : 0;
        if(t > W)continue;
        for(int j = V[1].size(); --j >= 0;){
            t += j * (w0 + 1);
            b += j ? V[1][j] : 0;
            if(t > W){
                t -= j * (w0 + 1);
                b -= j ? V[1][j] : 0;
                continue;
            }
            for(int k = V[2].size(); --k >= 0;){
                t += k * (w0 + 2);
                b += k ? V[2][k] : 0;
                if(t > W){
                    t -= k * (w0 + 2);
                    b -= k ? V[2][k] : 0;
                    continue;
                }
                b += (W - t) / (w0 + 3) >= 0 ? V[3][min<long long>(V[3].size() - 1, (W - t) / (w0 + 3))] : 0;
                a = max(a, b);
                b -= (W - t) / (w0 + 3) >= 0 ? V[3][min<long long>(V[3].size() - 1, (W - t) / (w0 + 3))] : 0;
                t -= k * (w0 + 2);
                b -= k ? V[2][k] : 0;
            }
            t -= j * (w0 + 1);
            b -= j ? V[1][j] : 0;
        }
    }
    cout << a << endl;
    return 0;
}


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

/*******  All Required define Pre-Processors and typedef Constants *******/
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define Dcout(a) cout << setprecision(20) << a << endl
#define MP make_pair
#define PB push_back
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
using ll = long long;
using PAIR = pair<int, int>;
using Graph = vector<vector<int>>;
//const ll INF = (1LL << 60);
//const double pi=acos(-1.0);
#define debug cout << "line : " << __LINE__ << " debug" << endl
/****** Template of some basic operations *****/
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; }
/**************************************/

/******** User-defined Function *******/




/**************************************/

/********** Main()  function **********/
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  string s,t; cin >> s >> t;

  int ans = 0;
  rep(i,s.size()){
    if(s[i]!=t[i]) ans++;
  }

  cout << ans << endl;


  return 0;
}
/********  Main() Ends Here *************/


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

using namespace std;

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

	int answer = 0;
	if (B <= C) {
		answer = 0;
	} else if (A < C && C < B && B <= D) {
		answer = (B - C);
	} else if (C <= A && B <= D) {
		answer = (B - A);
	} else if (A <= C && D <= B) {
		answer = (D - C);
	} else if (A < D && C <= A) {
		answer = (D - A);
	} else if (A >= D) {
		answer = 0;
	}

	cout << answer << endl;
	return 0;
}


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

typedef long long ll;
typedef pair<int,int> p_int;
typedef pair<ll,ll> p_ll;
typedef tuple<ll,ll,ll> t3_ll;
int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
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};
const ll inf = 1000000007;

int main() {
	int n;
	cin >> n;
	int h[n];
	for (int i = 0;i < n;i++) {
		cin >> h[i];
	}
	ll ans = h[0];
	for (int i = 1;i < n;i++) {
		if (h[i-1] <= h[i]) {
			ans += h[i]-h[i-1];
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256