akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>

typedef long long ll;

#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())

using namespace std;

const int N = 100100;
const ll inf = (long long) 1.01e18;
const ll mod = 1e9 + 7;
vector<pair<int,int> > g[N];
bool used[N];



void solve(){
    int a;
    cin >> a;
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= 9; j++) {
            if (i * j == a) {
                puts("Yes");
                return;
            }
        }
    }
    puts("No");
}
int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    int t;

    solve();
    return (0);
}


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

typedef long long ll;

int main(){
    string s;
    cin>>s;
    ll n=s.size();
    ll k;
    ll ans=0;
    rep(i,n){
        if(s[i]=='>') k++;
        else break;
    }
    ans+=k*(k+1)/2;
    ll l=0,m=0;
    rept(i,k,n){
        if(s[i]=='<'&&m==0){
            l++;
            continue;
        }
        else if(s[i]=='>'){
            m++;
            continue;
        }
        if(l<m) swap(l,m);
        ans+=l*(l+1)/2+m*(m-1)/2;
        m=0;l=1;
    }
    if(l<m) swap(l,m);
    ans+=l*(l+1)/2+m*(m-1)/2;
    std::cout<<ans<<endl;


    return 0;

}

Measured memory_bytes: 900
def main():
    n,a,b = map(int,input().split())

    tmp = a+b
    ans = 0
    if n>=tmp:
        d = n // tmp
        m = n % tmp
        ans += d * a
        ans += min(a,m)
    else:
        ans += min(a,n)

    print(ans)
if __name__=='__main__':
    main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end() 
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define INF 1000000000
using namespace std;
typedef long long ll;

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

    pair<pair<string, int>, int> p[N];
    vector<tuple<string, int, int>> V;
    REP(i, N){
        string S;
        int R;
        cin >> S >> R;

        p[i] = make_pair(make_pair(S, -R), i);
    }

    sort(p, p+N);
    REP(i, N){
        cout << p[i].second+1 << endl;
    }
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
int n,s,ans;

void func(int c,int b,int sum){
  int ctr=c+1,a;
  for(a=b+1;a<10;a++){
    if(ctr==n){
      if(sum+a==s){
        ans++;
        break;
      }else if(sum+a>s){
        break;
      }
    }else{
      func(ctr,a,sum+a);
    }
  }
  return;
}
int main(){
  cin >> n >> s;
  int a,b,c;
  while(n||s){
    ans=0;
    func(0,-1,0);
    cout << ans << endl;
    cin >> n >> s;
  }
  return 0;
}   


Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
   
public class Main {
     
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
     
    public void exec() throws IOException {
        SimpleInputUtil in = new SimpleInputUtil();
        PrintWriter out = new PrintWriter(System.out);
        int n = in.readInt();
        int[] S = in.readIntArray(new int[n+1],n);
        int q = in.readInt();
        int[] T = in.readIntArray(new int[q],q);
        int C = 0;
        for(int i=0; i<q; i++) {
        	C += binarySearch(S, T[i], 0, n);
        }
        out.println(C);
        out.flush();
    }
    
    private int binarySearch(int[] S, int key, int from, int to) {
    	if(from == to) return 0;
		int mid = (from + to) /2;
		if (key < S[mid]) 
    		return binarySearch(S,key,from,mid);
		if (S[mid] < key)
			return binarySearch(S,key,mid+1,to);
		return 1;
    }
}

class SimpleInputUtil {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
    public int readInt() throws NumberFormatException, IOException{
        return Integer.parseInt(br.readLine());
    }
     
    public int[] readIntArray(int[] a, int num) throws NumberFormatException, IOException{
        int i=0;
        while(i<num) {
            for(String s: br.readLine().split(" ")){
                if(i<num) {
                    a[i++] = Integer.parseInt(s);
                }
            }
        }
        return a;
    }
 
     
}

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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;

const int N = 110;
const double eps = 1e-6;

int n;
int x[N], y[N], h[N];

int main()
{
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i] >> h[i];
        if(h[i] > 0)
        {
            swap(x[0], x[i]);
            swap(y[0], y[i]);
            swap(h[0], h[i]);
        }
    }

    for(int i = 0; i <= 100; i++)
        for(int j = 0; j <= 100; j++)
        {
            int H = h[0] + abs(x[0] - i) + abs(y[0] - j);
            bool flag = true;

            for(int k = 1; k < n; k++)
                if(max(H - abs(x[k] - i) - abs(y[k] - j), 0) != h[k])
                {
                    flag = false;
                    break;
                }

            if(flag)
            {
                cout << i << ' ' << j << ' ' << H << endl;
                return 0;
            }
        }

    return 0;
}


Measured memory_bytes: 256
N = int(input())
A = [int(a) for a in input().split()]

mod = 10**9+7
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

t = 1
for a in A:
    t = a*t//gcd(a, t)

ans = 0
for a in A:
    ans += t//a

print(ans%mod)

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

namespace ABC133A
{
    class Program
    {
        static void Main(string[] args)
        {

            int n, a, b, x;

            var word = Console.ReadLine().Split(' ');
            n = int.Parse(word[0]);
            a = int.Parse(word[1]);
            b = int.Parse(word[2]);

            x = n * a;

            if (x > b)
                Console.WriteLine(b);
            else if (b > x)
                Console.WriteLine(x);
            else
                Console.WriteLine(x);

            Console.ReadKey();

        }
    }
}

Measured memory_bytes: 11092
#include<set>
#include<map>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<math.h>
#include<time.h>
#include<vector>
#include<bitset>
#include<memory>
#include<utility>
#include<fstream>
#include<stdio.h>
#include<sstream>
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
using namespace std;
int fa[705];
int c[705];
int a[705][705];
int return_col;
int findroot(int x)
{
    int root;
    int col=0;
    for (root=x;fa[root]!=-1;)
    {
        col=col^c[root];
        root=fa[root];
    }
    return_col=col;
    int tempx,tempc;
    for (;fa[x]!=-1;)
    {
        tempx=fa[x];
        tempc=c[x]^col;
        fa[x]=root;
        c[x]=col;
        x=tempx;
        col=tempc;
    }
    return root;
}
int size[705][2];
void u(int x,int y)
{
    int now=1;
    x=findroot(x);
    now^=return_col;
    y=findroot(y);
    now^=return_col;
    if (x==y)
    {
        if (now!=0)
        {
            puts("-1");
            exit(0);
        }
        return;
    }
    fa[x]=y;
    c[x]=now;
    size[y][0]+=size[x][now];
    size[y][1]+=size[x][now^1];
}
bool dp[705];
bool newdp[705];
int main()
{
    #ifdef absi2011
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n,m;
    scanf("%d%d",&n,&m);
    int i;
    memset(fa,-1,sizeof(fa));
    memset(c,0,sizeof(c));
    for (i=0;i<n;i++)
    {
        size[i][0]=1;
        size[i][1]=0;
    }
    for (i=0;i<m;i++)
    {
        int x,y;
        scanf("%d%d",&x,&y);
        x--;
        y--;
        a[x][y]=true;
        a[y][x]=true;
    }
    for (i=0;i<n;i++)
    {
        int j;
        for (j=0;j<n;j++)
        {
            if (i==j) continue;
            if (!a[i][j]) u(i,j);
        }
    }
    dp[0]=true;
    int cnt=0;
    for (i=0;i<n;i++)
    {
        if (fa[i]==-1)
        {
            int j;
            for (j=n;j>=0;j--)
            {
                if (!dp[j]) continue;
                newdp[j+size[i][0]]=true;
                newdp[j+size[i][1]]=true;
            }
            cnt+=size[i][0]+size[i][1];
            for (j=n;j>=0;j--)
            {
                dp[j]=newdp[j];
                newdp[j]=false;
            }
        }
    }
    int ans=n*n;
    for (i=0;i<=n;i++)
    {
        if (dp[i])
        {
            ans=min(ans,i*(i-1)/2+(n-i)*(n-i-1)/2);
        }
    }
    printf("%d\n",ans);
    return 0;
} 


Measured memory_bytes: 2176
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

int main() {
    int n, m;
    cin >> n >> m;
    vector<pair<int, int> > tasks;
    for(int i = 0; i < n; i++){
        int a,b;
        cin >> a >> b;
        tasks.push_back(make_pair(a,b));
    }
    tasks.push_back(make_pair(m+1, 0));
    sort(tasks.begin(), tasks.end());
    vector<int> rewards(m+1,0);
    priority_queue<int> q;
    int index = 0;
    for(int i = 1; i <= m; i++){
            while(tasks[index].first <= i){
                q.push(tasks[index].second);
                index++;
            }
            if(!q.empty()){
                rewards[i] = q.top();
                q.pop();
            }
    }
    ll ans = 0;
    for(int i = 1; i <= m; i++){
        ans += rewards[i];
    }
    cout << ans << endl;
}

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

using namespace std;

int main(){
    int n,count = 0;
    cin >> n;set<string> s;
    map<string, int> dict;
    for (string x; n--; ++dict[x]){
        cin >> x;
        s.insert(x);
        if(dict[x] == false)dict[x] = 0;
        count = max(count,dict[x]);
    }
    for(auto x : s) {
        if(dict[x] == count+1){
        cout << x << "\n";
        }
    }
    return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<int> b(0);
  vector<int> c(0);
  for(int i=0;i<n;i++){
    int a;
    cin >> a;
    if(i%2) b.push_back(a);
    else c.push_back(a);
  }
  if(n%2==0){
    reverse(b.begin(),b.end());
    for(int i=0;i<b.size();i++) cout << b.at(i) << " ";
    for(int i=0;i<c.size();i++) cout << c.at(i) << " ";
  }
  else{
    reverse(c.begin(),c.end());
    for(int i=0;i<c.size();i++) cout << c.at(i) << " ";
    for(int i=0;i<b.size();i++) cout << b.at(i) << " ";
  }
}

Measured memory_bytes: 3188
n = int(input())
s = list(input())
len = len(s)
for i in range(len):
    if ord(s[i]) + n > 90:
        s[i] = chr(ord(s[i])+n-26)
    else:
        s[i] = chr(ord(s[i])+n)
for i in s:
    print(i,end="")

Measured memory_bytes: 4596
#include<bits/stdc++.h>
#define eps 1e-8
#define pr pair<int,int>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int maxx = 200;
int a[maxx];
int main()
{
	int n, len = 0;
	int b[maxx];
	while(cin >> n)
	{
		for(int i = 0; i < n; i ++)
		{
			a[i] = 0;
			b[i] = 0;
		}
		for(int i = 0; i < n; i ++)
		{
			cin >> a[i];
			if(a[i] % 2 == 0)
				b[len ++] = a[i];	
		} 
		int flag = 0;
		for(int i = 0; i < len; i ++)
		{
			if((b[i] % 3 == 0) || (b[i] % 5 == 0))
				flag ++;
		}
		if(flag == len)
			cout << "APPROVED" << endl;
		else cout << "DENIED" << endl; 
	}
	

	return 0;
}



Measured memory_bytes: 256
import Control.Applicative ((<$>))
import Control.Monad (replicateM)
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.List (sort, delete)

main :: IO ()
main = do
  n <- readi B.readInt <$> B.getLine
  solve <$> replicateM n (readi B.readInt <$> B.getLine) >>= print

solve :: [Int] -> Int
solve xs = (!!2) . sort . f . take 4 . sort $ xs
  where f :: [Int] -> [Int]
        f xs = do
          x <- xs
          y <- delete x xs
          return . read $ show x ++ show y

readi :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> a
readi f s = let Just (n, _) = f s in n



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

int main()
{
    int n;
    cin>>n;
    
    long long A[n];
    int i,f=0;
 
    for(i=0;i<n;++i)
    {
        cin>>A[i];
       
    }
    
    
        long long tot=0;
        for(i=1;i<n;++i)
        {
            if(A[i-1]>A[i])
            {
                tot+=A[i-1]-A[i];
                A[i]=A[i-1];
            }
        }
        
        cout<<tot<<endl;
    
}

Measured memory_bytes: 5192
H, W = gets.split.map(&:to_i)
field = []
H.times do
  field << gets.chomp.split("")
end

failed = false
H.times do |y|
  W.times do |x|
    if field[y][x] == "#"
      flag = false
      [[x, y-1], [x-1, y], [x+1, y], [x, y+1]].each do |array|
        c_x = array[0]
        c_y = array[1]
        next if !c_y.between?(0, H-1) || !c_x.between?(0, W-1)
        if field[c_y][c_x] == "#"
          flag = true
        end
        break if flag
      end # of each
      failed = true unless flag
    end # of if field[x][y] == "#"
    break if failed
  end
  break if failed
end
puts failed ? "No" : "Yes"


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

#define FOR(a, b, c) for(int a = b; a <= c; ++a)
#define FORW(a, b, c) for(int a = b; a >= c; --a)
#define fi first
#define se second
#define pb push_back
#define int long long

typedef pair<int, int> ii;
typedef pair<int, ii> iii;

const int N = 1e6 + 100;
const int oo = 1e18;
const int mod  = 1e9 + 7;

int pcnt = 0, maxn = 1e6, n;

bool ncheck(int x) {
    if(x == 1) return 0;
    int tmp = n;
    while(tmp % x == 0) tmp /= x;
    if((tmp - 1) % x == 0) return 1;
    return 0;
}
set<int> ans;
signed main()  {
//    freopen("test.inp", "r", stdin);
//    freopen("test.out", "w", stdout);
    ios_base::sync_with_stdio(false); cout.tie(0);
    cin >> n;

    FOR(i, 1, sqrt(n)) if(n % i == 0) {
        if(ncheck(i)) ans.insert(i);
        if(ncheck(n / i)) ans.insert(n/i);
    }

    //cout << div.size() << '\n';
    FOR(i, 1, sqrt(n - 1)) if((n - 1) % i == 0) {
        if(ncheck(i)) ans.insert(i);
        if(ncheck((n - 1) / i)) ans.insert((n - 1)/i);
    }
    cout << ans.size();
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/






string g;
int y, m, d;
//---------------------------------------------------------------------------------------------------
void _main() {
    while (cin >> g) {
        if (g == "#") return;
        cin >> y >> m >> d;

        if (31 < y) {
            g = "?";
            y -= 30;
        }
        else if (y == 31) {
            if (4 < m) {
                g = "?";
                y -= 30;
            }
        }

        printf("%s %d %d %d\n", g.c_str(), y, m, d);
    }
}



Measured memory_bytes: 3280
#include <cstdio>
#include <algorithm>
#include <functional>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int n, k, x, y;

int main() {
	scanf(" %d %d", &n, &k);
	rep(i,k) {
		scanf(" %d %d", &x, &y);
		int a = x;
		int b = y;
		int c = n - x + 1;
		int d = n - y + 1;
		int minv = min(min(a, b), min(c, d));
		int ans = minv % 3;
		if(ans == 0) ans = 3;
		printf("%d\n", ans);
	}
	return 0;
}

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

typedef long long ll;

int main() {
    int N, A, B, K;
    cin >> A >> B >> K;
    if (B - A + 1 < 2 * K) {
        for (int i = A; i <= B; i++) {
            cout << i << "\n";
        }
    } else {
        for (int i = A; i < A + K; i++) {
            cout << i << "\n";
        }
        for (int i = B - K + 1; i <= B; i++) {
            cout << i << "\n";
        }
    }
}

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

using namespace std;

int M[3][3];

bool bf(int a1, int b1)
{
    int as[] { a1, M[1][0] - b1, M[2][0] - b1 };
    int bs[] { b1, M[0][1] - a1, M[0][2] - a1 };

    for (int i = 0; i < 3; ++i) 
        for (int j = 0; j < 3; ++j)
            if (M[i][j] != (as[i] + bs[j]))
                return false;

    return true;
}

int main()
{
    for (int i = 0; i < 3; ++i)
        for (int j = 0; j < 3; ++j)
            cin >> M[i][j];

    for (int a1 = -100; a1 <= 100; ++a1)
    {
        int b1 = M[0][0] - a1;

        if (bf(a1, b1))
        {
            cout << "Yes\n";
            return 0;
        }
    }

    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int n;
    string s;
    std::cin >> n >>s;
    char lastc=s[0];
    int ans=1;
    for (int i = 1; i < n; i++) {
        if(lastc!=s[i]){
            ans++;
            lastc=s[i];
        }
    }
    std::cout << ans << std::endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int x;
  cin >> x;

  int ans = 0;
  rep(i, 1, 1001) {
    rep(j, 2, 1001) {
      int exp = pow(i, j);
      if (exp <= x)
        chmax(ans, exp);
      else
        break;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>


int p(int x)
{
  return x/2;
}

int r(int x)
{
  return x*2+1;
}

int l(int x)
{
  return x*2;
}


int main(){
  int A[200005],n,i;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d",&A[i+1]);
  }
  for(i=0;i<n;i++){
    printf("node %d: key = %d, ",i+1,A[i+1]);
    
    if(p(i+1)>=1){
      printf("parent key = %d, ",A[p(i+1)]);
    }
    if(l(i+1)<=n){
      printf("left key = %d, ",A[l(i+1)]);
    }
    if(r(i+1)<=n){
      printf("right key = %d, ",A[r(i+1)]);
    }
    printf("\n");
  }
  return 0;
}



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

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()

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

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

#define MAX_N 100009

int N, T;
int A[MAX_N];
int min_A[MAX_N];
int max_A[MAX_N];
map<int, vector<p> > ans;
unordered_map<int, int> cnt;
int main(){
    ios::sync_with_stdio(false);
    cin >> N >> T;
    REP(i,N) cin >> A[i];
    int min_a = INF;
    int max_a = 0;
    REP(i,N) {
        min_a = min(min_a,A[i]);
        max_a = max(max_a,A[i]);
        min_A[i] = min_a;
        max_A[i] = max_a;
    }
    REP(i,N) {
        ans[A[i]-min_A[i]].pb( p(i,min_A[i]) );
    }
    
    auto itr = ans.end();
    cout << (*(--itr)).second.size() << endl;
    
    return 0;
}

Measured memory_bytes: 12416
import math


def is_prime(x):
    for i in range(2, int(math.sqrt(x)) + 1):
        if x % i == 0:
            return False
    else:
        return True


x = int(input())
while (True):
    if (is_prime(x)):
        print(x)
        exit()
    else:
        x += 1


Measured memory_bytes: 3060
N, M = map(int, input().split())
L_l = []
R_l = []

for i in range(M):
    L, R = map(int, input().split())
    L_l.append(L)
    R_l.append(R)

cont = min(R_l) - max(L_l) + 1
if cont <= 0:
    print(0)
else:
    print(cont)

Measured memory_bytes: 10996
#include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init)                                          \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T> using VEC = std::vector<T>;
template <class T> using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail> void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec)
    os << v << ",";
  os << "}";
  return os;
}
template <typename T> ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
  string S;
  cin>>S;
  bool good = 1;
  REP(i,0,3){
    if(S[i]==S[i+1])good=0;
  }
  if(good)cout<<"Good"<<endl;
  else cout<<"Bad"<<endl;

  return 0;
}


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

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template <typename T> using pq = priority_queue<T>;
template <typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for (auto &i : mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template <class T> ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}

template <class T> istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template <class T> ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    ll n;
    cin >> n;
    vl a(n);
    cin >> a;

    rep(i, n) {
        if (a[i]%2) continue;
        if (a[i]%3 && a[i]%5) {
            cout << "DENIED" << '\n';
            return;
        }
    }
    cout << "APPROVED" << '\n';
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) ((y)<0||(x)<0||(y)>=(h)||(x)>=(w))
#define dump(...)
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(0); ios::sync_with_stdio(false);
        cout << setprecision(15) << fixed;
        #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int n, m;
    cin >> n >> m;
    vector<vi> g(n);
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        g[b].push_back(a);
    }
    set<int> se;
    se.insert(0);
    int ans = 0;
    REP(i, n - 1) {
        FORE(t, g[i + 1]) {
            if (CONTAIN(se, t)) {
                se.clear();
                ans++;
                break;
            }
        }
        se.insert(i + 1);
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 6520
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Measured memory_bytes: 5144
#include<stdio.h>
int main() {
	int n;
	int a[100];
	scanf("%d",&n); 
	for (int i = 0; i < n; i++) {
		int x;
		scanf("%d",&x);
		a[i] = x;
	}
	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		if ((i+1)% 2 != 0 && a[i] % 2 != 0) {
			sum = sum + 1;
		}
	}
	printf("%d",sum);
	return 0;
}


Measured memory_bytes: 2152
#include <iostream>
#include <stdio.h>
using namespace std;

int main(void) {
    int a[4], b[4], i, j, hit, blow;
    while (1) {
        hit = 0;
        blow = 0;
        for (i = 0; i < 4; i++) {
            cin >> a[i];
            if (cin.eof()) {
                goto END;
            }
        }
        for (i = 0; i < 4; i++) {
            cin >> b[i];
        }
        for (i = 0; i < 4; i++) {
            if (a[i] == b[i]) {
                hit++;
            }
        }
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 4; j++) {
                if (i != j && a[i] == b[j]) {
                    blow++;
                }
            }
        }
        cout << hit << " " << blow << endl;
    }
    END:
    return 0;
}

Measured memory_bytes: 3052
#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)


signed main(){

	lli k,x;

	cin>>k>>x;

	if(500*k >= x)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

	return 0;

}

Measured memory_bytes: 256
#include<cmath> 
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int s[2005][2005][5],f[2005][2005][3],f1[5],f2[5];
int main()
{
	//freopen("D.in","r",stdin);
	//freopen("D.out","w",stdout);
	int n,k;
	scanf("%d%d",&n,&k);
	for (int i=1; i<=n; i++)
	{
		char ch[5];
		int x,y;
		scanf("%d%d%s",&x,&y,ch);
		x%=k+k; y%=k+k;
		x++; y++;
		if (ch[0]=='B') s[x][y][1]++;
		else s[x][y][2]++;
	}
	for (int i=1; i<=k+k; i++)
		for (int j=1; j<=k+k; j++)
			for (int c=1; c<=2; c++)
			{
				f[i][j][c]=f[i-1][j][c]+f[i][j-1][c]-f[i-1][j-1][c]+s[i][j][c];
				//printf("f[%d][%d][%d]=%d\n",i,j,c,f[i][j][c]);
			}
	int ans=0;
	for (int x=0; x>=1-k; x--)
	{
		for (int y=k; y>=1-k; y--)
		for (int c=1; c<=2; c++)
		{
			int s1=0,s2=0,col=0;
			bool flag1=0,flag2=0;
			if (y>0) 
			{
				if (x==1-k) flag1=1;
				if (y==1) flag2=1;
				if (flag1 && !flag2 || !flag1 && flag2) col=2;
				else col=1;
				if (y>1) f2[++s1]=y-1;
			}
			else
			{
				if (x==1-k) flag1=1;
				if (y==1-k) flag2=1;
				if (flag1 && !flag2 || !flag1 && flag2) col=1;
				else col=2;
			}
			if (k==1) col=3-col;
			if (c==2) col=3-col;
			int i=x+k-1,j=y+k-1;
			while (i<=k+k)
			{
				f1[++s2]=i;
				if (i==k+k) break;
				i+=k;
				if (i>k+k) f1[++s2]=k+k;
			}
			while (j<=k+k)
			{
				f2[++s1]=j;
				if (j==k+k) break;
				j+=k;
				if (j>k+k) f2[++s1]=k+k;
			}
			int sum=0;
			for (i=1; i<=s1; i++)
			{
				for (j=1; j<=s2; j++)
				{
					int t;
					if ((i+j)&1) t=3-col;
					else t=col;
					//if (f1[1]==2 && f2[1]==1 && col==1) printf("%d %d %d %d\n",i,j,t,f[f1[i]][f2[j]][t]-f[f1[i]][f2[j-1]][t]-f[f1[i-1]][f2[j]][t]+f[f1[i-1]][f2[j-1]][t]);
					sum+=f[f1[i]][f2[j]][t]-f[f1[i]][f2[j-1]][t]-f[f1[i-1]][f2[j]][t]+f[f1[i-1]][f2[j-1]][t];
				}
			}
			/*
			printf("x=%d y=%d col=%d\n",x,y,col);
			if (x==-1 && y==0) 
			{
				for (int i=1; i<=s1; i++) printf("%d ",f1[i]);
				printf("\n");
				for (int i=1; i<=s2; i++) printf("%d ",f2[i]);
				printf("\n");
			}
			*/
			ans=max(ans,sum);
		}
	}
	printf("%d\n",ans);
	return 0; 
}
/*
7 7
0 1 W
5 7 B
10 11 W
6 8 B
7 7 B
14 14 B
21 21 W
*/

Measured memory_bytes: 125696
line = input()
 
data = line.split()
 
import math
a =int(data[0])
b =int(data[1])
c =int(data[2])
if c-a-b>0:
  if(-a-b+c)*(-a-b+c) >a*b*4:
    print("Yes")
  else:
    print("No")
else:
  print("No")



Measured memory_bytes: 3060
H,W = map(int, input().split())

inf = float("inf")
ans = inf

if H % 3 == 0 or W % 3 == 0:
    print(0)
    exit(0)

case1 = [(H//3)  * W, (H-(H//3))*(W//2), (H-(H//3))*(W-W//2)]
case2 = [(H//3 + 1)  * W, (H-(H//3)-1)*(W//2), (H-(H//3)-1)*(W-W//2)]

case3 = [(W//3)  * H, (W-(W//3))*(H//2), (W-W//3) * (H-H//2)]
case4 = [(W//3 + 1)  * H, (W-(W//3)-1)*(H//2), (W-W//3 - 1) * (H-H//2)]

case5 = [H//3 * W, (H-H//3)//2 * W, (H- H//3 - (H-H//3)//2) * W] 
case6 = [W//3 * H, (W-W//3)//2 * H, (W- W//3 - (W-W//3)//2) * H] 

ans = min(ans,  max(case1) - min(case1))
ans = min(ans,  max(case2) - min(case2))
ans = min(ans,  max(case3) - min(case3))
ans = min(ans,  max(case4) - min(case4))
ans = min(ans,  max(case5) - min(case5))
ans = min(ans,  max(case6) - min(case6))

print(ans)


Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,flag = 0;
    cin >> n;
    for(int i = 1; i <= n; i++){
        if(i * 108 / 100 == n){
            cout << i << endl;
            flag = 1;
            break;
        }
    }
    if(flag == 0)
        cout << ":(" <<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
int n,d[10];
int x[10],y[10],tmp;
long double ans;
int sqr(int a) { return a*a; }
int main() {
//	freopen("1.txt","r",stdin);
	read(n);
	for (int i=1;i<=n;i++) read(x[i]),read(y[i]);
	for (int i=1;i<=n;i++) d[i]=i;
	do {
		for (int i=1;i<n;i++)
			ans+=sqrt((long double)(sqr(x[d[i]]-x[d[i+1]])+sqr(y[d[i]]-y[d[i+1]])));
		tmp++;
	} while (next_permutation(d+1,d+n+1));
	printf("%.10Lf\n",ans/tmp);
	return 0;
}
/*
  REMEMBER:
  1. Think TWICE, Code ONCE!
  Are there any counterexamples to your algo?
    
  2. Be careful about the BOUNDARIES!
  N=1? P=1? Something about 0?
    
  3. Do not make STUPID MISTAKES!
  Array size? Integer overflow? Time complexity? Memory usage? Precision error?
*/

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
import collections as cl


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    target = input()
    if target[-1] == "s":
        print(target+"es")
        return

    print(target+"s")


main()


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

#define pb push_back
#define mp make_pair
#define ll long long int
int main()
{
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL);    

    int n;
    cin >> n;
    int h[n];
    for (int i=0;i<n;i++)
    	cin >> h[i];

    int p1=0,p2=0;
    int ans=0;
    for (int i=0;i<n-1;i++)
    {
    	if (h[i+1]<=h[i])
    		p2=i+1;
    	else
    	{
    		if (p2-p1>ans)
    			ans=p2-p1;
    		p1=i+1;
    		p2=i+1;
    	}
    //	printf("p1=%d p2=%d\n",p1,p2);
    }
    
    if (p2-p1>ans)
    	ans=p2-p1;
    cout << ans << endl;

	return 0;
}

Measured memory_bytes: 640
n = int(input())
B = list(map(int,input().split()))

A = [0 for i in range(n)]

A[0]=B[0]
A[n-1]=B[n-2]
for i in range(1,n-1):
    A[i]=min(B[i-1],B[i])

print(sum(A))

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader reader = new BufferedReader(isr);
		String str, s[];
		
		int n, q, date[];
		x : while(!(str = reader.readLine()).equals("0 0")){
			s = str.split(" ");
			n = Integer.valueOf(s[0]);
			q = Integer.valueOf(s[1]);
			
			date = new int[100];
			for(int i = 0; i < n; i++){
				s = reader.readLine().split(" ");
				for(int j = 1; j <= Integer.valueOf(s[0]); j++){
					date[Integer.valueOf(s[j])]++;
				}
			}
			for(int i = n; i >= q; i--)
				for(int j = 1; j < date.length; j++){
					if(date[j] == i){
						System.out.println(j);
						continue x;
					}
				}
			System.out.println(0);
		}
		reader.close();
	}
}

Measured memory_bytes: 36852
#include <iostream>
#include <regex>

using namespace std;

int main()
{
    int a, b; cin >> a >> b;
    string s; cin >> s;
    regex regex(R"(\d+)");

    // for (int i = 0; i < s.length(); i++) {
    //     cout << *(s.begin() + i) << endl;
    // }


    if (regex_match(s.begin(), s.begin() + a, regex) && *(s.begin() + a) == '-' && regex_match(s.begin() + (a + 1), s.end(), regex)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main( void )
{
  int a, b, c;
  scanf( "%d %d %d", &a, &b, &c );

  if ( a < b && b < c ) {
    printf( "Yes\n" );
  }
  else {
    printf( "No\n" );
  }

  return 0;
}


Measured memory_bytes: 2580
n, k = [int(x) for x in input().split()]
seq = [int(x) for x in input().split()]
dp = [0]*n
k = min(k, n)
for i in range(1, k):
    dp[i] = abs(seq[i] - seq[0])
# print(dp)
for i in range(k, n):
    a = dp[i-1] + abs(seq[i] - seq[i-1])
    for j in range(k-1):
        a = min(a, dp[i-2-j] + abs(seq[i] - seq[i-2-j]))
    dp[i] = a
# print(dp)
print(dp[-1])

Measured memory_bytes: 52448
{-# LANGUAGE ScopedTypeVariables #-}
-- extension section
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-} 
-- not supported extension
--{-# LANGUAGE Strict, StrictData #-}


module Main where

-- @@@@@@@@@@@@@@@@@--
-- import section   --
-- @@@@@@@@@@@@@@@@@--
--    import A.B.C( function name )  ...
-- or import A.B.C 

--
import Prelude hiding(
  getLine,
  getContents,
  lines,
  words,
  read
  )

--
import Data.Either 
import Control.Monad

-- bytestring


-- containers


-- deepseq


-- regex-posix


-- text
import Data.Text.IO as TIO
import Data.Text as T
import Data.Text.Read as TR
-- unordered-containers


-- vectors
import Data.Vector.Unboxed as UV
import Data.Vector.Unboxed.Mutable as MV

-- mtl
import Control.Monad.ST


-- @@@@@@@@@@@@@@@@@--
-- main section     --
-- @@@@@@@@@@@@@@@@@--

main :: IO ()
main = do
  input <- getInput
  Prelude.putStr . show . getAnswer $ input 
 
-- main :: IO()
-- main = do
--   answer <- getInputandanser
--   putStr . show $ answer


-- @@@@@@@@@@@@@@@@@@@@@--
-- I/O DataType section --
-- @@@@@@@@@@@@@@@@@@@@@--
data Input = I (Int,[Int] )
  deriving(Show)

type Answer = Int

-- instance Show Answer where
--   show = undefined


-- @@@@@@@@@@@@@@@@@--
-- answerSection    --
-- @@@@@@@@@@@@@@@@@--
getInput :: IO Input
getInput = do
  Right (n, _) <- getLine >>= ( return . TR.decimal )
  text2 <- getLine 
  let
    numTexts = fmap textToInt $ words text2 
  return (I (n, numTexts) )
  where 
    textToInt t = case TR.decimal t of
      Right (m , _) -> m

getAnswer :: Input -> Answer 
getAnswer ( I (_ , nums) ) = runST $ do  
  vec <- UV.thaw v
  _ <- Control.Monad.forM nums $ \num -> do
    MV.modify vec (+1) (num + 1)
    MV.modify vec (+1) (num-1 + 1)
    MV.modify vec (+1) (num+1 + 1)
    return num
  returnV <- freeze vec  
  return ( UV.maximum returnV  )
  where v = UV.replicate (100000 + 2)  0 :: UV.Vector Int

getInputAndAnser :: IO Answer
getInputAndAnser = undefined


-- @@@@@@@@@@@@@@@@@@@@@@@@@@--
-- question unique section    --
-- @@@@@@@@@@@@@@@@@@@@@@@@@@--





-- @@@@@@@@@@@@@@@@@--
-- util section     --
-- @@@@@@@@@@@@@@@@@--

-- standard Input Function
gLine :: IO Text
gLine = getLine

gContents :: IO Text
gContents = getContents



Measured memory_bytes: 10236
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include<math.h>
#include<bitset>
#include<iomanip>
#include<queue>
using namespace std;

int X[12] = { 0,2,5,5,4,5,6,3,7,6};

int main() {
	string s; cin >> s;
	bool x = 0;
	for (int i = 1; i < s.size(); i++) {
		if (s[i] == s[i - 1])x = 1;
	}
	if (x)cout << "Bad" << endl;
	else cout << "Good" << endl;
}




Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	ls := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&ls[i])
	}

	used := make(map[[3]int]bool)
	ans := 0
	for i := 0; i < n-2; i++ {
		for j := i + 1; j < n-1; j++ {
			for k := j + 1; k < n; k++ {
				a := ls[i]
				b := ls[j]
				c := ls[k]
				kx := []int{a, b, c}
				sort.Ints(kx)
				key := [3]int{kx[0], kx[1], kx[2]}

				if a != b && b != c && a != c {
					if a+b > c && b+c > a && c+a > b {
						ans++
						used[key] = true
					}
				}
			}
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 19760
#include<stdio.h>
#include<iostream>
using namespace std;

int main() {
  char ch;

  while (1) {
    scanf("%c", &ch);

    if ('a' <= ch && ch <= 'z') ch -= 32;
    else if ('A' <= ch && ch <= 'Z') ch += 32;

    cout << ch;

    if (ch == '\n') break;
  }

  return 0;
}



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

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

  if (a < b) {
    cout << "a < b" << endl;
  } else if (a > b) {
    cout << "a > b" << endl;
  } else {
    cout << "a == b" << endl;
  }
}

Measured memory_bytes: 3100
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
const ll INF = 1LL << 60;

int main(){
	set<char> st;
	string s; cin >> s;
	for(int i = 0; i < s.size(); ++i){
		if(st.count(s[i]) > 0) {
			puts("no");
			return 0;
		}
		else st.insert(s[i]);
	}
	puts("yes");
}


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

int main() {
  int X,Y;
  cin >> X >> Y;
  bool flag = false;
  rep(i,X){
    if(i*2 + (X - i)*4 == Y){
      flag = true;
      break;
    }
  }
  if(Y == 2 * X){ 
    flag = true;
  }
  if(flag){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <string.h>

int main(void)
{
  char S[101], T[101], new[101], mask[101];
  int n,i;
  scanf("%s", S);
  scanf("%s", T);
  
  if(strcmp(S,T) == 0){ puts("Yes"); return 0;}
  
  n = strlen(S);
  i=n;
  while(i--){
    strncpy(mask, S, n-1);
    strncpy(new,  S+(n-1), 1);
    strcat(new, mask);
    new[strlen(new)] = '\0';
    if(strcmp(new, T)==0){puts("Yes"); return 0;}
    strcpy(S, new);
    memset(new, '\0', sizeof(new));
    memset(mask, '\0', sizeof(mask));
  }
  puts("No");
  return 0;
}

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

const int maxn = 1e5 + 10;
int a[maxn][3];
int DP[maxn][3];
int N;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> N;
    for(int i = 1; i <= N; ++i){
        for(int j = 0; j < 3; ++j){
            cin >> a[i][j];
        }
    }
    for(int i = 1; i <= N; ++i){
        for(int j = 0; j < 3; ++j){
            for(int k = 0; k < 3; ++k){
                if(j != k){
                    DP[i][j] = max(DP[i - 1][k] + a[i][j] , DP[i][j]);
                }
            }
        }
    }
    cout << max(DP[N][0] , max(DP[N][1] , DP[N][2])) << endl;
}


Measured memory_bytes: 2560
// AtCoder template
// sabaより胡蝶しのぶさんの方が可愛いのではないか？
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < n; ++i)



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string s; cin >> s;
    int q; cin >> q;
    int isEven = 1;
    string prestr = "", poststr = "";
    rep(i,q){
        int t; cin >> t;
        if(t == 1) isEven ^= 1;
        else{
            int f; string c; cin >> f >> c;
            if(isEven){
                if(f == 1) prestr += c;
                else poststr += c;
            }else{
                if(f == 1) poststr += c;
                else prestr += c;
            }
        }
    }
    reverse(prestr.begin(),prestr.end());
    string ans = prestr + s + poststr;
    if(!isEven) reverse(ans.begin(),ans.end());
    cout << ans << endl;
}

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

int tmp = -1;

bool count_2(long long x){
    int count = 0;
    while(1){
        if(x%2 == 0){
            count++;
        } else {
            break;
        }
        x /= 2;
    }
    
    if(tmp == -1){
        tmp = count;
    }
    if(tmp == count){
        return false;
    }
    return true;
}

long long gcd(long long y, long long x){
    return x ? gcd(x,y%x) : y;
}

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

int main(void){
    long long n, m, x, count = 0;
    
    cin >> n >> m;
    
    vector<long long> a(n);
    
    rep(i, n){
        cin >> a.at(i);
        a.at(i) /= 2;
        if(count_2(a.at(i))){
            cout << 0 << endl;
            return 0;
        }
    }

    rep(i, n-1){
        a.at(i+1) = lcm(a.at(i), a.at(i+1));
    }

    count = (m/a.at(n-1)+1)/2;

/*
    while(1){
        x = a.at(n-1)*((2*count)+1);
        if(x > m){
            break;
        }
        count++;
    }
*/
    cout << count << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ps push_back
#define LL long long
using namespace std;
string name;
int main()
{
    int n, i, j;
    LL a, v, b, w, t;
    cin>>a>>v>>b>>w>>t;
    if(v-w<=0 && a!=b)return 0*printf("NO\n");
    if(abs(a-b)<=(v-w)*t)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}


Measured memory_bytes: 3636
function Main(input) {
    input = input.split("\n");
    
    var n = Number(input[0]);
    var rengaArr = input[1].split(" ");
    
    var res = 0;
    var ord = 1;
    for(var i=0; i<n; i++){
        if(Number(rengaArr[i])==ord){
            ord++;
        }else{
            res++;
        }
    }
    if(ord == 1){
        console.log(-1);
    }else{
        console.log(res);
    }
    
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21324
#include<bits/stdc++.h>
using namespace std;
const int nmax=100005;
typedef long long ll;

struct edge{int to;ll cost;};
vector<edge> tree[nmax];
ll d[nmax];
int n;

void dijkstra(int s){
  priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>> pq;
  fill(d,d+n,1e18);
  d[s]=0;
  pq.push(make_pair(0,s));
  while(!pq.empty()){
    pair<ll,ll> p=pq.top();
    pq.pop();
    int v=p.second;
    if(d[v]<p.first){
      continue;
    }
    for(int i=0;i<tree[v].size();i++){
      edge e=tree[v][i];
      if(d[e.to]>d[v]+e.cost){
        d[e.to]=d[v]+e.cost;
        pq.push(make_pair(d[e.to],e.to));
      }
    }
  }
}

int main(){
  int a,b,c,q,k,x,y;
  cin >> n;
  for(int i=0;i<n-1;i++){
    cin >> a >> b >> c;
    a--,b--;
    tree[a].push_back(edge{b,c});
    tree[b].push_back(edge{a,c});
  }
  cin >> q >> k;
  k--;
  dijkstra(k);
  for(int i=0;i<q;i++){
    cin >> x >> y;
    x--,y--;
    cout << d[x]+d[y] << endl;
  }
}

Measured memory_bytes: 11120
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1e9+100;
const ll MOD = 1e9+7;
const bool debug = 0;

int N;
int d[212345];
ll sum[212345];

int main() {
	cin >> N;
	REP(i, N) scanf("%d", d + i);
	
	REP(i, N) sum[i + 1] = sum[i] + d[i];
	
	int ans = 0;
	map<ll, int> m;
	REP(i, N + 1) {
		if (!m.count(sum[i])) m[sum[i]] = i;
		if (m.count(sum[i])) chmax(ans, i - m[sum[i]]);
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 18012