akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,n) for (int i = a; i < (int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define whole(f,x,...) ([&](decltype((x)) whole) { \
    return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
template<typename T> bool chmin(T &a, const T &b) {if (a > b) { a = b; return true; }return false;}
template<typename T> bool chmax(T &a, const T &b) {if (a < b) { a = b; return true; }return false;}

using ll = int_fast64_t;

constexpr ll INF = (1e9);
constexpr ll MOD = (1e9+7);

int main() {
  int d, n; cin >> d >> n;
  if (d == 0) cout << n + n/100 << endl;
  else if (d == 1) cout << n*(100+ n/100) << endl;
  else cout << (10000 + n/100 * 100 )*n << endl;
  return 0;
}


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

int main(void)
{
    int64_t x, y;
    scanf("%lld%lld", &x, &y);
    int64_t a = y / x;
    int i = 0;
    for (; a >> i; i++);
    printf("%d\n", i);
    return 0;
}


Measured memory_bytes: 128
import numpy as np

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

li.sort()

dist = 0
_li = np.zeros(m)

for i in range(len(li)-1):
    _li[i] = (li[i+1] - li[i])

ans = sorted(_li, reverse=True)

print(int(sum(ans[(n-1):])))


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

int main(){
  int n,k;
  int ans=0;
  cin>>n>>k;
  vector<int> a(n);
  rep(i,n) cin>>a[i];
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  rep(i,k){
    ans=ans+a[i];
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 384
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 02:12:27 2020

@author: liang
"""

n = int(input())
ans = 0
for num in range(1, n+1,2):
    cnt = 0
    for i in range(1,num+1):
        if num % i == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int dp[12][2017],n,k,a,b;
vector<int> v[12];
int main(){
	cin>>n>>k;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		v[b].push_back(a);
		for(int j=0;j<12;j++)dp[j][i]=-1;
	}dp[0][0]=0;
	for(int i=0;i<12;i++)sort(v[i].begin(),v[i].end(),greater<int>());

	for(int i=1;i<12;i++){
		for(int j=0;j<=k;j++){
			int cnt=0;dp[i][j]=dp[i-1][j];
			for(int r=0;r<v[i].size();r++){
				cnt+=v[i][r]+r*2;
				if(j-r-1>-1)if(dp[i-1][j-r-1]>-1)dp[i][j]=max(dp[i][j],dp[i-1][j-r-1]+cnt);
			}
		}
	}
	cout<<dp[11][k]<<endl;
	return 0;
}

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

#ifdef LOCAL
#include "../dump.hpp"
#else
#define dump(...)
#endif

using namespace std;

#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ROF(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define pb push_back
#define fst first
#define snd second
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;

const ll mod = 1e9+7;

int main(){
  int n; cin >> n;
  string s1,s2; cin >> s1 >> s2;
  
  ll ans, pos = 0;
  bool x;
  if(s1[pos] == s2[pos]){
    ans = 3;
    pos++;
    x = true;
  }else{
    ans = 6;
    pos += 2;
    x = false;
  }

  while(pos < n){
    dump(ans);
    if(s1[pos] == s2[pos]){
      if(x) (ans *= 2) %= mod;
      pos++;
      x = true;
    }else{
      if(x) (ans *= 2) %= mod;
      else (ans *= 3) %= mod;
      pos += 2;
      x = false;
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
string a;
int b[10005];
int main()
{
	int n;
	cin>>n;
	cin>>a;
	for(int i=0;i<a.size();i++)
	{
		b[i]=(int)a[i]-'A'+n;
	}
	for(int i=0;i<a.size();i++)
	{
		a[i]=(char)(b[i]%26)+'A';
	}
	cout<<a<<'\n';
	return 0;
}


Measured memory_bytes: 256
S = input()

a = S[0]
b = S[1]
c = S[2]
d = S[3]

i = 0

if a == b:
  i += 1
if a == c:
  i += 1
if a == d:
  i += 1
  
if b == c:
  i += 1
if b == d:
  i += 1
if c == d:
  i += 1

if i == 2:
  print('Yes')
else:
  print('No')


Measured memory_bytes: 3060
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((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 EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())
 
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const ll MOD = (ll)1000000007;//10^9+7
const ll INF2 = (ll)100000000000000000;//10^18


int main() {
    int N;
    cin>>N;
    int a[N];
    REP(i,N){
        cin>>a[i];
    }
    int ans=INF;
    for(int i= -100;i<=100;i++){
        int sum = 0;
        REP(j,N){
            sum += (a[j]-i)*(a[j]-i);
        }
        ans = (ans > sum) ? sum :ans;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String UpperAlpha = "abcdefghijklmnopqrstuvwxyz";
		String W;
		String line;
		String[] T;
		int count_Empty = 0;
		boolean judge_W = true;
		boolean judge_T = true;
		int count_W = 0;

		// 始:Wの入力とチェック
		W = sc.nextLine();

		if (W.length() > 10) {
			judge_W = false;
		}

		if (judge_W == true) {
			out: for (int i = 0; i < W.length(); i++) {
				if (UpperAlpha.indexOf("" + W.charAt(i)) == -1) {
					judge_W = false;
					break out;
				}
			}
		}
		// 終:Wの入力とチェック

		if (judge_W == true) {

			// 始: T入力とチェック
			out: while (true) {
				line = sc.nextLine(); // 入力された文章Tの1行を受け取る
				if (line.equals("END_OF_TEXT")) { // END_OF_TEXTと入力されたら
					break out; // whileからでる→入力終了

				}
				T = (line.toLowerCase()).split(" ");
				count_Empty += T.length - 1; // Tは半角で区切って要素を格納しているので-1をすることで空白数となる

				if (line.length() - count_Empty > 1000) {
					judge_T = false;
					break out;

				}

				for (int j = 0; j < T.length; j++) {

					if (T[j].equals(W)) {
						count_W++;
					}

				}// in:forここまで
			}// out: while ここまで

			if (judge_T == true) {
				System.out.println(count_W);

			}

		}

	}
}



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

using namespace std;

const int inf = 1e9;

const int MAXN = 1e5 + 10;

int dp[MAXN + 10][3];
int p[MAXN + 10][3];
int main() {
    #ifdef BLAT
        freopen("input", "r", stdin);
    #endif

    int n;
    cin >> n;

    for(int i = 1; i <= n; ++i) {
    	for(int j = 1; j <= 3; ++j) {
    		cin >> p[i][j];
    	}

    	for(int j = 1; j <= 3; ++j) {
    		for(int k = 1; k <= 3; ++k) {
    			if(j == k) continue;
    			dp[i][j] = max(dp[i][j], dp[i-1][k] + p[i][j]);
    		}
    	}
    }

    cout << max(dp[n][1], max(dp[n][2], dp[n][3])) << '\n';
}  

Measured memory_bytes: 2560
X, Y=map(int, input().split())

ans = 0
# x
if (X==1):
    ans += 300000
elif (X==2):
    ans += 200000
elif (X==3):
    ans += 100000

# y
if (Y==1):
    ans += 300000
elif (Y==2):
    ans += 200000
elif (Y==3):
    ans += 100000

if (X==1) and (Y==1):
    ans += 400000

print(ans)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int main(void) {
  int a, b, c;

  cin >> a;
  cin >> b;
  cin >> c;

  int res;

  if (a >= b && a >= c) {
    res = 10 * a + b + c;
  }
  else if (b >= a && b >= c) {
    res = 10 * b + a + c;
  }
  else {
    res = 10 * c + a + b;
  }

  cout << res << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <queue>
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <cctype>  // std::islower(), std::isupper(), std::tolower, std::toupper
#include <iomanip> // std::std::setprecision(X)
#include <limits>  //std::numeric_limits<int>::max(), min()

typedef long long ll;

int main (void) {

  int N, A; std::cin >> N >> A;
  int rest = N%500;
  if ( rest > A ) std::cout << "No" << std::endl;
  else std::cout << "Yes" << std::endl;
  return 0;
}


Measured memory_bytes: 256
import sys
from collections import defaultdict, deque

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    V, E = map(int, input().split())
    is_visited = [False] * V
    indeg = [0] * V  # 流入量
    # 隣接リスト
    G = defaultdict(lambda: [])

    for i in range(E):
        s, t = map(int, input().split())
        s -= 1
        t -= 1
        G[s].append(t)
        indeg[t] += 1

    # print(G, indeg, is_visited)
    out = []
    dp = [0] * V

    def bfs(s):
        q = deque()
        q.append(s)
        is_visited[s] = True
        while q:
            u = q.popleft()
            out.append(u)
            # print(u, out)
            for v in G[u]:
                indeg[v] -= 1
                # dp[v] = max(dp[v], dp[u] + 1)
                if indeg[v] == 0 and (not is_visited[v]):
                    q.append(v)
                    is_visited[v] = True

    def topological():
        for u in range(V):
            if indeg[u] == 0 and (not is_visited[u]):
                bfs(u)

        # print(max(dp))

    topological()

    for i in out:
        for dest in G[i]:
            dp[dest] = max(dp[dest], dp[i] + 1)

    print(max(dp))


if __name__ == "__main__":
    main()


Measured memory_bytes: 33176
import sys
input=sys.stdin.readline
N,K = map(int,input().split())
def kaisu(num):
  k = []
  cnt = 0
  while True:
    if num > 1:
      cnt+=1
      k.append(cnt)
      num = num/2
    else:
      return k

cnt = 1
z = []
for i in range(N,0,-1):
  if i >= K:
    z.append(1)
  else:
    while True:
      if K/(2**cnt) > i:
        cnt += 1
      else:
        z.append((1/2)**cnt)
        break
print((1/N)*sum(z))


Measured memory_bytes: 3864
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define dmp(x) cerr<<#x<<":"<<x<<endl
typedef pair<int,int> P;
typedef pair<int,P> PP; 
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
const int MOD = 1e9+7;

int dp1[2010][2010];
int dp2[2010][2010];
int dp3[2010][2010];
int dp4[2010][2010];
char s[2010][2010];

signed main(){
  int h,w;
  cin>>h>>w;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
	 cin>>s[i][j];

  for(int i=0;i<h;i++){
    int sum1=0;
    int sum2=0;
    for(int j=0;j<w;j++){
	 if(s[i][j]=='.')sum1++;
	 else sum1=0;
	 dp1[i][j]=sum1;
	 if(s[i][w-1-j]=='.')sum2++;
	 else sum2=0;
	 dp2[i][w-1-j]=sum2;
    }
  }
  
  for(int i=0;i<w;i++){
    int sum1=0;
    int sum2=0;
    for(int j=0;j<h;j++){
	 if(s[j][i]=='.')sum1++;
	 else sum1=0;
	 dp3[j][i]=sum1;
	 if(s[h-1-j][i]=='.')sum2++;
	 else sum2=0;
	 dp4[h-1-j][i]=sum2;
    }
  }

  int ans=0;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++){
	 if(s[i][j]=='.'){
	   chmax(ans,dp1[i][j]+dp2[i][j]+dp3[i][j]+dp4[i][j]-3);
	 }
    }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 130304
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn =1e5+10;
const int mod=1e9+7;

int dp[1010][5010];




int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin>>n>>m;
    for(int i=0;i<=1005;i++)
    {
        for(int j=0;j<=5005;j++)
            dp[i][j]=1e9;
    }
    dp[0][0]=0;
    for(int i=1;i<=m;i++)
    {
        int a,b;
        cin>>a>>b;
        int sum=0;
        for(int j=1;j<=b;j++)
        {
            int c;
            cin>>c;
            int x=1<<(c-1);
            sum+=x;
        }

        //cout<<sum<<" here"<<'\n';
        for(int j=0;j<=(1<<n)-1;j++)
        {
            int temp=0;
            for(int x=0;x<=12;x++)
            {
                if(((j>>x)&1)&&((sum>>x)&1)==0)
                {
                    temp+=(1<<x);
                }
            }
            /*if(i==2&&j==3)
                cout<<sum<<" here"<<'\n';*/
            //cout<<temp<<" here"<<'\n';
            dp[i][j]=min(dp[i-1][j],dp[i-1][temp]+a);

        }
    }
    /*for(int i=1;i<=3;i++)
    {
        for(int j=0;j<=3;j++)
        {
            cout<<dp[i][j]<<" ";
        }
        cout<<'\n';
    }*/
    if(dp[m][(1<<n)-1]==1e9)
        dp[m][(1<<n)-1]=-1;
    cout<<dp[m][(1<<n)-1]<<'\n';

}


Measured memory_bytes: 23304
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int sum(int a, int b){
    return (((a+b)/2)*(b-a+1));
}

int main(void){
    int a, b;
    cin >> a >> b;
    vector<int> lst(10000);
    lst[0] = 0;
    for(int i=1;i<=(b-a);i++){
        lst[i] = lst[i-1] + i;
    }
    for(int i=(b-a);i>0;i--){
        if(lst[b-a] - lst[i] == b-a){
            /*cout << "i: " << i << endl;
            cout << lst[i] << endl;
            cout << lst[i] - a << endl;*/
            //cout << lst[b-a] - b << endl;
            if((lst[i]-a) == (lst[b-a])-b){
                cout << lst[i] - a << endl;
            }
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 256
n = int(input())
x = input()
d = [0] * n
t = x.count('1')
a = 0
b = 0


if t == 1:
    for i in range(n):
        d[i] = (a + pow(2, n - i - 1, t + 1)) % (t + 1)
    for i in range(n):
        a *= 2
        if x[i] == '1':
            a += 1
        a %= t + 1
    for i in range(n):
        if x[i] == '1':
            print(0)
        else:
            p = d[i]
            ans = 1
            while p > 0:
                p %= bin(p).count('1')
                ans += 1
            print(ans)
else:
    for i in range(n):
        a *= 2
        b *= 2
        if x[i] == '1':
            a += 1
            b += 1
        a %= t + 1
        b %= t - 1
    for i in range(n):
        if x[i] == '1':
            d[i] = (b - pow(2, n - i - 1, t - 1)) % (t - 1)
        else:
            d[i] = (a + pow(2, n - i - 1, t + 1)) % (t + 1)
    for i in range(n):
        a *= 2
        b *= 2
        if x[i] == '1':
            a += 1
            b += 1
        a %= t + 1
        b %= t - 1
    for p in d:
        ans = 1
        while p > 0:
            p %= bin(p).count('1')
            ans += 1
        print(ans)


Measured memory_bytes: 81088
#include <bits/stdc++.h>
using namespace std;
#define all(V) V.begin(),V.end()
#define ll long long
#define MOD 1000000007

string st[200];

int main() {
	int N;
	cin >> N;
	cout << '?' << " ";
	for (int i = 1;i <= N;i++) {
		cout << i << " ";
	}
	cout << endl;
	string S, T;
	cin >> T;

	int same = N, oppo = 0, mid;
	while (same - oppo != 1) {
		mid = (same + oppo) / 2;

		cout << '?' << " ";
		for (int i = 1;i <= mid;i++) {
			cout << i << " ";
		}
		for (int i = N + mid + 1;i <= 2 * N;i++) {
			cout << i << " ";
		}
		cout << endl;

		cin >> S;
		if (S == T) {
			same = mid;
		}
		else {
			oppo = mid;
		}
	}
	

	for (int i = 1;i <= 2 * N;i++) {
		if (i <= oppo || i >= oppo + N + 2) {
			cout << '?' << " ";
			for (int j = oppo + 2;j <= oppo + N;j++) {
				cout << j << " ";
			}
			cout << i << endl;
		}
		else {
			cout << '?' << " ";
			for (int j = 1;j <= oppo;j++) {
				cout << j << " ";
			}
			for (int j = oppo + N + 2;j <= 2 * N;j++) {
				cout << j << " ";
			}
			cout << i << endl;
		}
		cin >> st[i];
	}

	cout << "! ";
	for (int i = 1;i <= 2 * N;i++) {
		cout << st[i][0];
	}
	cout << endl;
}

Measured memory_bytes: 724
N = list(i for i in input())
L = len(N)

if L == 1:
  answer = int(N[0])
else:
  if N[0] == '9' and len(set(N)) == 1:
    answer = 9*L
  else:
    if N[0] != '9' and '9' in N and len(set(N)) == 2:
      answer = 9*(L-1) + int(N[0])
    else:
      answer = 9*(L-1) + int(N[0]) - 1

print(answer)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;


int main() {


	long long a, b,big,sml,tmp;

	cin >> a >> b;

	if (a < b) {
		sml = a; big = b;
	}
	else
	{
		big = a;sml = b;
	}


	for (int i = 1; i < sml+1; i++)
	{
		tmp = big * i;
		if (tmp % sml == 0) {
			break;
		}

	}

	std::cout << tmp << endl;

	return 0;
}


Measured memory_bytes: 256
/*
 * atcoder/abc130/a.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>

using namespace std;

#define ll long long

#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

ll r, d, x;
ll acc[20];

void input() {
  cin >> r >> d >> x;
}

void solve() {
  acc[0] = x;
  for (int i=0; i<10; i++) {
    acc[i+1] = r * acc[i] - d;
    cout << acc[i+1] << endl;
  }
}

int main() {
  // cout.precision(15);
  input();
  solve();
  return 0;
}


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

int solve() {
  int L;
  scanf("%d", &L);

  double l3 = (double) L / 3;

  printf("%.12lf\n", l3*l3*l3);
  return 0;
}

int main() {
  int t = 1;
  // scanf("%d", &t);
  while (t--) solve();
  return 0;
}


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

typedef long long ll;
typedef long double ld;

#define pb push_back
#define sort(s) sort(s.begin(),s.end())
#define reverse(s) reverse(s.begin(),s.end())
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)

const ll mod = 1e9+7;

//最大公約数
ll gcd(ll a, ll b) {
    return b ? gcd(b, a%b) : a;
}

//最小公倍数
ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}

//素数判定
bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}

//桁和
int digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

//桁数
int dignum(ll n) {
    int res = 0;
    while(n > 0) {
        res++;
        n /= 10;
    }
    return res;
}

//文字列中の特定の文字カウント
ll stringcount(string s,char c){
    return count(s.cbegin(),s.cend(),c);
}

//階乗
ll ka(ll i){
    ll res=1;
    while(i>0){
        res=res*i;
        i--;
    }
    return res;
}
 
//ncr
ll ncr(ll x,ll y){
    ll a = x;
    ll b = 1;
    if(y>(x/2)){
        y=x-y;
    }
    for(ll i=1;i<y;i++){
        a*=x-i;
        b*=i+1;
    }
    return a/b;
}

//フィボナッチ数列 -92
ll f(ll x){
    ll dp[x+1];
    dp[1]=1;
    dp[2]=1;
    for(ll i=3;i<=x;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    return dp[x];
}



int main(){
    string s;
    cin >> s;
    int n = s.size();
    map<char,int> mp;

    for(int i=0;i<n;i++){
        mp[s[i]]++;
    }

    if(mp.size()==n){
        cout << "yes" << endl;
    }else{
        cout << "no" << endl;
    }
}

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

int main() {
    int n;
    cin >> n;
    int ne = 0, nee = 0;

    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        if (a % 4 == 0)
            nee++;
        else if (a % 2 == 0)
            ne++;
    }

    int no = n - ne - nee;

    if (nee - no >= 0)
        cout << "Yes" << endl;
    else if (nee + 1 == no && ne == 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
#include <cstdio>
#include <tuple>
#include <string>
#include <vector> 
#include <set>
#include <string.h>
#include <map>
#include <cmath>
#include <deque>
using ll = long long;
using Graph = vector<vector<int>>;
#include <queue>
#include <stack>
#include <math.h>  /* M_PI */

const ll MOD = 1000000007;
int main(){

    int N,C;
    cin >> N >> C;

    vector<int> s(N),t(N),c(N);

    for(int i=0;i < N;i++){
        cin >> s[i] >> t[i] >> c[i];
    }
    const int TIME = 200002;
    
    vector<int> sum(TIME,0);
    int max = 0;
    //チャンネル毎に録音機をカウント
    for(int i = 1;i <= C;i++){
        vector<int> table(TIME,0);
        for(int j=0;j < N;j++) {
            if(i == c[j]) {
                table[2 * s[j]]++;
                table[2 * t[j] + 1]--;
            }
        }

        //累積和
        for(int j = 2;j < TIME;j++){
            table[j + 1] += table[j];
        }

        //
        for(int j = 2;j < TIME;j++){
            if(table[j] > 0) sum[j]++;
            
        }
        

    }
    for(int i = 2;i < TIME;i++){
            
        if(max < sum[i]) max = sum[i];
    }

    cout << max << endl;
        

    return 0;
}

Measured memory_bytes: 2944
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());
    int[] val = new int[N];
    for(int i = 0; i < M; i++){
      int a = Integer.parseInt(sc.next());
      int b = Integer.parseInt(sc.next());
      val[a-1]++;
      val[b-1]++;
    }
    for(int i = 0; i < N; i++){
      System.out.println(val[i]);
    }
  }
}

Measured memory_bytes: 21844
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    int n, m;
	scanf("%d %d", &n, &m);
	scc_graph g(n);
	for(int i=0; i<m; i++){
		int a, b;
		scanf("%d %d", &a, &b);
		g.add_edge(a, b);
	}
	auto scc=g.scc();
	printf("%d\n", scc.size());
	for(auto v:scc){
		printf("%d", v.size());
		for(auto x:v) printf(" %d", x);
		printf("\n");
	}
    return 0;
}


Measured memory_bytes: 40076
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; 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);
    int N; cin >> N;
    int A[N];
    rep(i, N) cin >> A[i];
    int ans = 0;
    rep(i, 40) {
        rep(j, N) {
            if (A[j] % 2 != 0) {
                cout << ans << endl; 
                return 0;
            } else {
                A[j] /= 2;
            }
        }
        ans++; 
    }


    return 0;
}


Measured memory_bytes: 256
import sys
import math
# -*- coding: utf-8 -*-

def calc(operation,target,src):
    if operation == 0:
        return target - src
    return target + src

def operation(int_operation):
    if int_operation == 0:
        return "-"
    return "+"

nums=list(input())

#答え
answer=7

# 0:- 1:+
for i in [0,1]:
    for j in [0,1]:
        for k in [0,1]:
            chalange = int(nums[0])
            chalange = calc(i,chalange,int(nums[1]))
            chalange = calc(j,chalange,int(nums[2]))
            chalange = calc(k,chalange,int(nums[3]))
            if chalange == answer:
                print(nums[0] + operation(i) + nums[1] + operation(j) + nums[2] + operation(k) + nums[3] + "=7" )
                break
        else:
            continue
        break
    else:
        continue
    break

    

Measured memory_bytes: 9128
void main() {
	auto N = readAs!long;
	auto A = readAs!(long[]);

	long[long] m;
	auto arr = new long[](N);

	foreach(i, v; A) {
		if(i - v > 0) m[i - v]++;
		arr[i] = i + v;
	}

	ulong res;
	foreach(i; 0..N) if(arr[i] in m) res += m[arr[i]];
	res.writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

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

#define ll long long
typedef pair <int, int> ii;
typedef pair <ll, int> lli;
#define ar array
#define pb push_back
#define fi first
#define se second
#define sz size
#define mp make_pair
#define nl '\n'
#define all(x) (x).begin(), (x).end()
#define int_max numeric_limits<int>::max()
#define int_min numeric_limits<int>::min()
#define ll_max numeric_limits<ll>::max()
#define ll_min numeric_limits<ll>::min()

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define im(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// custom sort example
//sort(all(a), [ ]( const auto& c, const auto& d) {
	//if (c.fi.se != d.fi.se) {
		//return c.fi.se < d.fi.se; // lower first
	//}
	//if (c.fi.fi != d.fi.fi) {
		//return c.fi.fi > d.fi.fi; // higher first
	//}
	//return c.se > d.se; // higher first
//});

struct chash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

template <class T>
auto lbf(const std::set<std::pair<T, T>>& s, T first)
{
   static constexpr T min = std::numeric_limits<T>::min();

   return s.lower_bound({first, min});
}

int MOD = 1000000007;

ll pw(ll n, ll k) {
	ll r = 1;
	for(; k; k >>= 1) {
		if(k&1) r = r * n % MOD;
		n = n * n % MOD;
	}
	return r;
}
ll inv(ll n) { return pw(n, MOD-2); }

int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	string s;
	cin >> s;
	if (s[s.length() - 1] == 's') {
		cout << s << "es" << nl;
	} else {
		cout << s << "s" << nl;
	}
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define INF 1000000007
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define print(x) cout << x << "\n"
#define print2(x, y) cout << x << " " << y << "\n"
#define printv(vec) rep(i, vec.size()) cout << vec[i] << " "; print("");
#define ALL(v) v.begin(), v.end()
#define SUM(v) accumulate(ALL(v), 0)
#define MAX(v) *max_element(ALL(v))
#define MIN(v) *min_element(ALL(v))
#define SORT(v) sort(ALL(v))
#define REV(v) reverse(ALL(v))
typedef long long ll;
using namespace std;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vs = vector<string>;

void Main(){

	ll X, Y, A, B, C;
	cin >> X >> Y >> A >> B >> C;
	vl p(A);
	vl q(B);
	vl r(C);
	rep(i, A) cin >> p[i];
	rep(i, B) cin >> q[i];
	rep(i, C) cin >> r[i];
	
	SORT(p); SORT(q); SORT(r);
	REV(r);
	ll ans = 0;
	ll ind1 = A - X;
	ll ind2 = B - Y;
	rep2(i, ind1, A) ans += p[i];
	rep2(i, ind2, B) ans += q[i];
	ll ind3 = 0;
	ll ma, mb;
	rep(i, C){
		
		if(ind1 == A && ind2 == B) break;
		if(ind1 == A) ma = INF;
		else ma = p[ind1];
		if(ind2 == B) mb = INF;
		else mb = q[ind2];
		
		if(ma >= mb){
			if(mb < r[ind3]){
				ans -= mb;
				ans += r[ind3];
				ind2++;
				ind3++;
			}
		}
		else{
			if(ma < r[ind3]){
				ans -= ma;
				ans += r[ind3];
				ind1++;
				ind3++;
			}
		}
	}
	
	print(ans);
	
}

int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	Main();
    
	return 0;
	
}





Measured memory_bytes: 5576
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[200005];
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        for(int i=0; i<n; i++)
            scanf("%d",&a[i]);
        if(n==1) printf("%d\n",a[0]);
        else if(n==2) printf("%d %d\n",a[1],a[0]);
        else
        {
            printf("%d",a[n-1]);
            for(int i=n-3; i>=0; i-=2)
                printf(" %d",a[i]);
            if(n%2==1)
                for(int i=1; i<n-1; i+=2)
                    printf(" %d",a[i]);
            if(n%2==0)
                for(int i=0; i<n-1; i+=2)
                    printf(" %d",a[i]);
            printf("\n");
        }
    }
    return 0;
}


Measured memory_bytes: 2816
"""
A - Limited Insertion
"""
import numpy as np

N = input()
b_list = list(map(int, input().split()))
# N = 9
# b_list = [1, 1, 1, 2, 2, 1, 2, 3, 2]
# b_list = [1,1,1,2,2,1,2,3,2]
# b_list = [1,1,3,1,2]
# b_list = [2,2]


def make_idx(tmp_list):
    return np.arange(1, len(tmp_list)+1, 1)[::-1]

b_list = b_list[::-1]
idx_list = make_idx(b_list)
rm_list = []

while len(b_list):
    for idx, b in zip(idx_list, b_list):
        if idx==b:
            b_list = b_list[::-1]
            b_list.remove(b)
            rm_list.append(b)
            b_list = b_list[::-1]
            break
        elif idx-b<0:
            print(-1)
            exit()
    idx_list = make_idx(b_list)
    
for r in rm_list[::-1]:
    print(r)

Measured memory_bytes: 12496
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod=1e9+7;

int main(){
    int N, M, cnt=0, n_cnt;
    cin >> N >> M;
    vector<int> K(N);
    vector<int> A;
    int in;
    for(int i=0; i< N; i++){
        cin >> K[i];
        for(int j=0; j<K[i]; j++){
            cin >> in;
            A.push_back(in);
        }
    }
    for(int i=1; i<=M; i++){
        n_cnt = count(A.begin(), A.end(), i);
        if(n_cnt == N) cnt++;
    }

    cout << cnt;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
ll ara[200005],s[200005];
main()
{
    ll n,i,ans=0;
    cin>>n;
    for(i=1;i<=n;i++)cin>>ara[i];
    s[1]=ara[1];
    for(i=2;i<=n;i++)
    {
        s[i]=s[i-1]+ara[i];
    }
    for(i=1;i<=n-1;i++)
    {
        ll sum=s[n]-s[i];
        ll d=((sum%mod)*(ara[i]%mod))%mod;
        ans=ans+d;
        ans=ans%mod;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 6752
N, *L = map(int,open(0).read().split())
def check_different_length(a,b,c):
    if a == b or a == c or b == c:
        return False
    else:
        return True

def check_can_make(a,b,c):
    if a >= b+c or b >= a+c or c >= a+b:
        return False
    else:
        return True

cnt = 0
for a in range(N-2):
    for b in range(a+1,N-1):
        for c in range(b+1,N):
            if check_different_length(L[a],L[b],L[c]):
                if check_can_make(L[a],L[b],L[c]):
                    cnt += 1
print(cnt)                    

Measured memory_bytes: 9000
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
int n, m, k, ans = INT_MAX;
ll getBit(ll num, ll idx)
{
  	return (((num >> idx) & 1LL) == 1);
}
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> m >> k;
    char arr[n][m];
    for(int i = 0;i < n;++i)
        for(int j = 0;j < m;++j)
            cin >> arr[i][j];
    int msk = (1LL << n) - 1;
    while(msk >= 0)
    {
        int last_cut = 0;
        bool valid_msk = 1;
        int cuts = __builtin_popcount(msk);
        int cnt = 0, comp[n] = {0}, sum[n] = {0};
        for(int i = 0;i < n;++i)
            comp[i] = cnt, cnt += getBit(msk, i);
        for(int j = 0;j < m;++j)
        {
            bool valid = 1;
            for(int i = 0;i < n;++i)
            {
                sum[comp[i]] += arr[i][j] - '0';
                if(sum[comp[i]] > k)
                {
                    valid = 0;
                    break;
                }
            }
            if(!valid)
            {
                if(last_cut == j)
                {
                    valid_msk = 0;
                    break;
                }
                cuts++;
                last_cut = j;
                --j;
                memset(sum, 0, sizeof sum);
            }
        }
        if(valid_msk)   ans = min(ans, cuts);
        msk--;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
l = list(map(int, input().split()))

L = [i for i in l if i % 2 == 0]
K = [i for i in L if i % 3 != 0]
J = [i for i in K if i % 5 != 0]

if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")

Measured memory_bytes: 3060
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static Input in = new Input(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int N = in.nextInt();
        final BigInteger max = BigInteger.valueOf(1000000000000000000L);
        BigInteger ans = BigInteger.valueOf(1);
        for (int i = 0; i < N; i++) {
            if (ans.compareTo(max) <= 0) {
                ans = ans.multiply(in.nextBigInteger());
            } else if (in.nextLong() == 0) {
                ans = BigInteger.valueOf(0);
                break;
            }
        }
        if (ans.compareTo(max) > 0) {
            ans = BigInteger.valueOf(-1);
        }
        out.println(ans);

        out.flush();
    }

    static class Input {
        private BufferedReader br;
        private String[] buff;
        private int index = 0;

        Input(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }
        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }
        String next() {
            while (buff == null || index >= buff.length) {
                buff = nextLine().split(" ");
                index = 0;
            }
            return buff[index++];
        }
        byte nextByte() {
            return Byte.parseByte(next());
        }
        short nextShort() {
            return Short.parseShort(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        float nextFloat() {
            return Float.parseFloat(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
        BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }
    }
}



Measured memory_bytes: 58560
#include<iostream>
#include<algorithm>
using namespace std;
int a[50];
signed main(){
  char b;
  int n,c;
  while(1){
    c=0;
    for(int i=0;i<50;i++){
      a[i]=0;
    }
    cin>>n;
    if(n==0) break;
    for(int i=0;i<100;i++){
      cin>>b;
      if(b=='S'){
	c=c+a[i%n]+1;
	a[i%n]=0;
      }
      if(b=='M'){
	a[i%n]=a[i%n]+1;
      }
      if(b=='L'){
	a[i%n]=a[i%n]+c+1;
	c=0;
      }
    }
    sort(a,a+n);
    for(int i=0;i<n;i++){
      cout<<a[i]<<" ";
    }
    cout<<c<<"\n";
  }
  return(0);
}


Measured memory_bytes: 3164
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
#include<vector>
struct UF{
	int n;
	vector<int>parent,rank;
	UF(int n_=0):n(n_),parent(n_),rank(n_,0)
	{
		for(int i=0;i<n_;i++)parent[i]=i;
	}
	int find(int a)
	{
		return parent[a]!=a?parent[a]=find(parent[a]):a;
	}
	bool same(int a,int b)
	{
		return find(a)==find(b);
	}
	bool unite(int a,int b)
	{
		a=find(a),b=find(b);
		if(a==b)return false;
		if(rank[a]<rank[b])
		{
			parent[a]=b;
		}
		else
		{
			parent[b]=a;
			if(rank[a]==rank[b])rank[a]++;
		}
		return true;
	}
};
int n;
vector<int>G[44444];
int color[44444];
int d[5]={0,1,0,-1};
bool dfs(int u,int c)
{
	color[u]=c;
	bool flag=1;
	for(int v:G[u])
	{
		if(color[v])
		{
			flag&=color[v]==3-c;
		}
		else
		{
			flag&=dfs(v,3-c);
		}
	}
	return flag;
}
main()
{
	while(cin>>n,n)
	{
		map<pair<int,int>,int>M;
		vector<pair<pair<int,int>,char> >a;
		for(int i=0;i<n;i++)
		{
			int x,y;char c;cin>>x>>y>>c;
			M[make_pair(x,y)]=i;
			M[make_pair(x+(c=='x'),y+(c=='y'))]=i+n;
			a.push_back(make_pair(make_pair(x,y),c));
		}
		UF uf(2*n);
		for(int i=0;i<n;i++)
		{
			int x,y;char c;
			x=a[i].first.first,y=a[i].first.second,c=a[i].second;
			for(int j=0;j<2;j++)
			{
				int tx=x+(c=='x')*j,ty=y+(c=='y')*j;
				for(int r=0;r<4;r++)
				{
					int dx=tx+d[r],dy=ty+d[r+1];
					if(dx+tx==2*x+(c=='x')&&dy+ty==2*y+(c=='y'))continue;
					if(M.find(make_pair(dx,dy))!=M.end())
					{
						uf.unite(M[make_pair(tx,ty)],M[make_pair(dx,dy)]);
					}
				}
			}
		}
		map<int,int>mp;
		int sz=0;
		for(int i=0;i<2*n;i++)
		{
			int now=uf.find(i);
			if(mp.find(now)==mp.end())
			{
				mp[now]=sz++;
			}
		}
		for(int i=0;i<sz;i++)G[i].clear(),color[i]=0;
		for(int i=0;i<n;i++)
		{
			int x,y;char c;
			x=a[i].first.first,y=a[i].first.second,c=a[i].second;
			int X,Y;
			X=mp[uf.find(M[make_pair(x,y)])];
			Y=mp[uf.find(M[make_pair(x+(c=='x'),y+(c=='y'))])];
			G[X].push_back(Y);
			G[Y].push_back(X);
		}
		bool ans=1;
		for(int i=0;i<sz;i++)
		{
			if(!color[i])
			{
				ans&=dfs(i,1);
			}
		}
		cout<<(ans?"Yes":"No")<<endl;
	}
}



Measured memory_bytes: 11516
n,k=[int(x) for x in input().split()]

a=[]

for i in range(n+1):
	a.append(0)

for i in range(k):
	d=int(input())
	temp=[int(x) for x in input().split()]
	for j in range(d):
		a[temp[j]]=1

ans=0
for i in range(1,n+1):
	if a[i]==0:
		ans+=1

print(ans)

Measured memory_bytes: 9204
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    S = (input_raw[0])
    count = 0
    w_count = 0
    for i in range(len(S)):
        if S[i] == "W":
            count += (i - w_count)
            w_count += 1
    print count

if __name__ == '__main__':
    main()


Measured memory_bytes: 9516
l = list(list(map(int,input().split())) for i in range(3))
first = l[0][0]-l[0][1]
second = l[0][1]-l[0][2]
first1 = l[0][0]-l[1][0]
second2 = l[1][0]-l[2][0]

for k in range(3):
    if (l[k][0]-l[k][1] != first or l[k][1]-l[k][2] != second):
        print("No")
        exit()
for j in range(3):
    if (l[0][k]-l[1][k] != first1  or l[1][k]-l[2][k] != second2):
        print("No")
        exit()     
print("Yes")


Measured memory_bytes: 3064
day = input()
if day == 'SUN':
    print('7')
elif day == 'MON':
    print('6')
elif day == 'TUE':
    print('5')
elif day == 'WED':
    print('4')
elif day == 'THU':
    print('3')
elif day == 'FRI':
    print('2')
elif day == 'SAT':
    print('1')


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

using ll=long long;

int main(){
    int N; cin >> N;
    int res=N%10;
    if(res == 2 || res == 4 || res== 5 || res== 7 || res== 9 ){
        cout << "hon" << endl;
    }
    else if(res==0 || res==1 || res==6 || res==8){
        cout << "pon" << endl;
    }
    else cout << "bon" << endl;
    return 0;
}

Measured memory_bytes: 3636
#include<stdio.h>
#include<math.h>


int main(void){

  int x[10];
  int i;
  int n;
  int w;

  while(scanf("%d", &n)!=EOF){
    for(i=0; i<10; i++){
      x[i]=0;
    }

    w=512;
    for(i=9; i>=0; i--){
      if(n>=w){
	n-=w;
	x[i]=1;
      }

      w/=2;
      if(n==0) break;
    }

    w=0;
    for(i=0; i<10; i++){
      if(x[i]==1){
	if(w!=0){
	  printf(" ");
	}
	printf("%d", (int)pow(2, i));
	w++;
      }
    }
    printf("\n");

  }

  return(0);
}



Measured memory_bytes: 2068
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <set>

using namespace std;

typedef long long ll;

const ll M=1000000007;
const ll MAX=200001;

ll h, w, a, b;
ll f[MAX], invf[MAX];

ll binary_exp(ll x, ll y){
  ll ans = 1;
  while(y > 0){
    if(y & 1) ans = (x * ans) %M;
    x = (x*x) %M;
    y = (y >> 1);
  }
  return ans;
}

ll com(ll n, ll r){
  return (f[n]*(invf[r]*invf[n-r] %M)) %M;
}

int main(){
  cin >> h >> w >> a >> b;
  // compute factorial
  f[0]=1;
  for(ll i=1;i<=h+w-2;i++){
    f[i] = (i*f[i-1]) %M;
    //cout << f[i] << endl;
  }
  // cout << "finished computing factorial" << endl;
  // compute (x!)^(M-2)
  for(int i=0;i<=h+w;i++){
    invf[i] = binary_exp(f[i], M-2);
    //cout << invf[i] << endl;
  }
  ll sum=0;
  for(int i=b;i<=w-1;i++){
    sum = (sum + ((com(h-a+i-1, i)*com(w+a-i-2, a-1))) %M) %M;
  }
  cout << sum << endl;
}

Measured memory_bytes: 3328
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <queue>
#include <string>

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

int main(){
    int tmp;
    rep(i,5){
        cin >> tmp;
        if(tmp == 0){
            cout << i +1 <<endl;
            return 0;
        }
    }

    return 0;
}

Measured memory_bytes: 3548
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <bits/stdc++.h>
using namespace std;

int main(){
    int h, w; cin >> h >> w;
    
    for(int i = 0; i < w+2; i++){
        cout << "#";
    }
    cout << endl;

    
    for(int i = 0; i < h; i++){
        string s; cin >> s;
        cout << "#" << s << "#" << endl;
    }
    
    for(int i = 0; i < w+2; i++){
        cout << "#";
    }
    cout << endl;    
   
}



Measured memory_bytes: 256
//
//  main.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;


int main()
{
    
    int N;
    string S;
    cin >> N >> S;
    
    vector<P> rng(26);
    rng.assign(26, P(-1,-1));
    int alp;
    for(int i=0;i<N;i++)
    {
        alp = S[i] - 'a';
        if(rng[alp].first < 0) rng[alp].first = i;
        else rng[alp].second = i;
    }
    vector<int> dif(N + 1); // 末尾は意味なし
    for(auto p : rng)
    {
        if(p.second >= 0)
        {
            dif[p.first] += 1;
            dif[p.second + 1] -= 1;
        }
    }
    vector<int> kinds(N);
    kinds[0] = dif[0];
    for(int i=1;i<N;i++)
    {
        kinds[i] = kinds[i-1] + dif[i];
    }
    int m;
    m = *max_element(kinds.begin(), kinds.end());
    
    cout << m << endl;
    
    
    return 0;
}



Measured memory_bytes: 256
//By Zank100
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define din(t) long long t;cin>>t;
#define in(t) cin>>t;
ll mul(ll a, ll b)
{
    return(((a%mod)*(b%mod))%mod);
}
ll modexp(ll b, ll e){
	ll res = 1;
	for(; e; b = b * b % mod, e >>= 1) if(e & 1) res = res * b % mod;
	return res;
}
ll modinv(ll a){
    ll x=mod-2;
	return modexp(a,x);
}
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	din(n)din(k)
	ll a[n];
	for(ll i=0;i<n;i++)in(a[i]);
	sort(a,a+n);
	ll ans=0;
	for(ll i=0;i<k;i++)ans+=a[i];
	cout<<ans<<endl;
	/*while(t--)
	{
        din(d);

    }*/
	return 0;
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
    #include <ext/pb_ds/detail/standard_policies.hpp>
    using namespace std;
    using namespace __gnu_pbds;
    #define ll long long
    #define int long long
    #define pb push_back
    #define For(i,n) for(ll  i=0;i<n;i++)
    #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) ;clock_t clk = clock();
    #define f(a,b,c) for(ll a=b;a<c;a++)
    #define ld long double
    #define read(t) ll t;cin>>t;
    #define all(x) x.begin(),x.end()
    #define fi first
    #define se second
    #define pii pair<ll,ll>
    #define endl "\n"
    #define sz(x) (int)(x).size()
    #define what_is(x) cerr << #x << " is " << x << endl;
    #define time cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';
    const double pi=3.14159265358979323846264;
    typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
    typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
/*.....................................................................................................................*/

    ll mod =(ll)1e9+7;
    ll add(ll x,ll y) {return (x+y)%mod;}
    ll mult(ll x, ll y){return ((x%mod )* (y%mod)) % mod;}
    long long binpow(long long x, long long p) 
    {
        if (p == 0) return 1;
    	if (p == 2 || (p & 1)) return mult(x, binpow(x, p - 1));
    	return binpow(binpow(x, p / 2), 2);
    }
    ll modinv(ll a) {return binpow(a,mod-2);}
    // bool check(ll x){}
    ll binsearch(ll l,ll r)
    {
        while(l<r)
        {
            ll mid=(l+r)/2;
            // if(check(mid))r=mid;
            // else l=mid+1;
        }
        return l;
    }
    const ll man=(ll)1005;
    vector<ll>adj[man];
    bool vis[man][man];
    ll d[man],depth[man],par[man];
    void addedge(ll u,ll v){adj[u].pb(v);adj[v].pb(u);}
    ll dx[4]={1,-1,0,0};ll dy[4]={0,0,1,-1};
/*........................................................................................................................*/

signed main()/*Check flow...question galat mat padhna */
{
    fast;   
    char c;
    cin>>c;
    if(c<='Z'&&c>='A')cout<<"A"<<endl;
    else cout<<"a"<<endl;
}      


Measured memory_bytes: 3584
N, T = map( int, input().split() )
t = list( map( int, input().split() ) )
ans = 0
ptr = 0
while ptr < N:
  nxt = ptr + 1
  while nxt < N and t[ nxt ] <= t[ nxt - 1 ] + T:
    nxt += 1
  ans += t[ nxt - 1 ] + T - t[ ptr ]
  ptr = nxt
print( ans )


Measured memory_bytes: 86608