akhauriyash/Code-Regression huggingface dataset:
from sys import stdin
from itertools import permutations
from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse.csgraph import csgraph_from_dense
def main():
    #入力
    readline=stdin.readline
    inf=10**9
    n,m,r=map(int,readline().split())
    targets=list(map(lambda x:int(x)-1,readline().split()))
    G=[[inf]*n for _ in range(n)]
    for _ in range(m):
        a,b,c=map(int,readline().split())
        a-=1
        b-=1
        G[a][b]=min(G[a][b],c)
        G[b][a]=min(G[b][a],c)

    #ワーシャルフロイド
    G=csgraph_from_dense(G,null_value=10**9)
    li=floyd_warshall(G)
    li=[list(map(int,li[i])) for i in range(n)]
    
    #順列全探索
    ans=inf
    for p in permutations(targets,r):
        tmp=0
        for i in range(r-1):
            now=p[i]
            nex=p[i+1]
            tmp+=li[now][nex]
        ans=min(ans,tmp)

    print(ans)

if __name__=="__main__":
    main()

Measured memory_bytes: 21284
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

int N;

bool check(int k)
{
    int mx = k % 10;
    k /= 10;
    while (k > 0)
    {
        if (k % 10 != mx - 1)
            return false;
        mx = k % 10;
        k /= 10;
    }
    return true;
}

int main()
{
    cin >> N;
    vector<int> v(N);
    for (int i = 0; i < N; i++)
        cin >> v[i];
    vector<int> sub;
    for (int i = 0; i < N; i++)
    {
        for (int j = i + 1; j < N; j++)
        {
            sub.push_back(v[i] * v[j]);
        }
    }
    sort(sub.rbegin(), sub.rend());
    for (auto &M : sub)
    {
        if (check(M) == true)
        {
            cout << M << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}


Measured memory_bytes: 4948
#include <stdio.h>

struct group {
    int val[8];
    int len;
};

int has(int v, struct group g)
{
    for (int i = 0; i < g.len; ++i) {
        if (g.val[i] == v) {
            return 1;
        }
    }
    return 0;
}

int main(int argc, char **argv)
{
    int x, y;
    scanf("%d %d", &x, &y);

    struct group g1 = {{1, 3, 5, 7, 8, 10, 12}, 7};
    struct group g2 = {{4, 6, 9, 11}, 4};

    if ((has(x, g1) && has(y, g1))
        || (has(x, g2) && has(y, g2))
    ) {
        puts("Yes");
    } else {
        puts("No");
    }
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#define MAX 101

using namespace std;

bool flag[MAX][MAX];
int t[MAX][2];
int n;

void dfs(int num){
	static int cnt = 1;
	
	if(t[num][0] == 0)t[num][0] = cnt++;
	else return;
	for(int i=1;i<=n;++i){
		if(flag[num][i] == true){
			dfs(i);
		}
	}
	t[num][1] = cnt++;
}

int main(){
	int u, k, v, i, j; 
	
	cin >> n;
	for(i=1;i<=n;++i){
		cin >> u >> k;
		for(j=0;j<k;++j){
			cin >> v;
			flag[u][v] = true;
		}
		 
	}
	for(int i=1;i<=n;++i)dfs(i);
	for(int i=1;i<=n;++i)cout << i << " " << t[i][0] << " " << t[i][1] << endl;
	
	return 0;
}


Measured memory_bytes: 3128
# include <cstring>
# include <cstdio>
# include <iostream>
# include <queue>
# define N 100050 //N为顶点个数 
# define M 200050 //N为顶点个数 
# define WQD 0x7f7f7f7f//无穷大 
int n;//图的顶点个数
int m;//图的边数 
struct Edge{int next,to, w;}  e[M<<1];//不用0号单元 
int head[N+1]; 
int dis[N+1];//存放源点到其他点的路径
bool vis[N+1];
bool book[N+1];
bool spfa(int s);//差分约束判断 
using namespace std;
int main()
{
	ios::sync_with_stdio ( false ) ;
	int u,v,w;
	memset(head,-1,sizeof(head));
	cin>>n>>m;
	for(int i=1; i<=m; i++)  //本题约束关系为=，要添加两条边 
	{
		cin>>u>>v>>w;//输入第i条边 ,i为编号 
		e[i]=(Edge){head[u],v,w};head[u]=i;
		e[m+i]=(Edge){head[v],u,-w};head[v]=m+i;
	}
	memset(book,0,sizeof(book));
	memset(dis,0x7f,sizeof(dis));
	for(int i=1; i<=n; i++)//每一片的连通区域都要判断 
		if(!vis[i]) 
		{
			vis[i]=1;
			if(spfa(i)==false)  {cout<<"No";return 0;}//有约束自相矛盾 
		}
	cout<<"Yes";//所以的点都符合条件 
	return 0;
}
bool spfa(int s)
{
 	queue<int>q;
 	//memset(book,0,sizeof(book));
	//memset(dis,0x7f,sizeof(dis));
	dis[s]=0;
	q.push(s);book[s]=1;
	while(q.size()>0)//如果没松弛就松弛，如果松弛过就判断是否符合约束条件，如果自相矛盾就是不可能的数据 
	{
		int k=q.front();q.pop();//对头元素出队 
		book[k]=0;
		for(int i=head[k]; i!=-1; i=e[i].next)
		{
			int v=e[i].to;
			if(dis[v]==WQD && dis[k]<WQD)//如果v点没松弛过，就松弛更新dis[v]的值 				
			{	//题目的约束条件是= 			
				dis[v]=dis[k]+e[i].w;//更新 
				if(book[v]==0)	{q.push(v);	book[v]=1;}//入队标记
				vis[v]=1;//标记该点已经松弛过 
			}
			else if(dis[v]<WQD && dis[k]<WQD && dis[v]!=dis[k]+e[i].w)	return false;//据题意理解差分系统约束条件，不相等，自相矛盾 
		}		
    }
	return true;//别掉了这句 
}

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

int main() {
  int n;
  ll x;
  cin >> n >> x;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  ll cnt = 0;
  for (int i = 0; i < n; i += 2) {
    if (a[i] > x) {
      cnt += a[i] - x;
      a[i] -= a[i] - x;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i + 1 >= n) continue;
    if (a[i] + a[i + 1] > x) {
      cnt += a[i] + a[i + 1] - x;
      a[i + 1] = x - a[i];
      // cout << cnt << endl;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 1024
from collections import deque
N = int(input())
ans = deque()
for i in range(N):
    command = input().split()
    if command[0] == 'insert':
        ans.appendleft(command[1])
    elif command[0] == 'delete':
        if command[1] in list(ans):
            ans.remove(command[1])
    elif command[0] == 'deleteFirst':
        ans.popleft()
    else:
        ans.pop()
print(' '.join(list(ans)))


Measured memory_bytes: 69728
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

void make_table(vector<int>& t) {
  for (auto i = 1; i <= 1000; ++i) {
    t[i] += t[i - 1] + i;
  }
  // for (auto e : t) {
  //   cout << e << " ";
  // }
  // cout << endl;
}

int main() {
  vector<int> t(1001);
  make_table(t);
  int a, b;
  cin >> a >> b;
  cout << t[b - a] - b << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
    int n, k;
    cin >> n >> k;
    vector<char>d(k);
    bool flg = 0;
    for(int i=0; i<k; i++) cin >> d[i];
    for(int i=n;;i++){
        string t = to_string(i);
        for(int j=0; j<t.size(); j++){
            for(int h=0; h<k; h++){
                if(t[j]==d[h]){
                    flg = 1;
                    break;
                }
            }
            if(flg) break;
        }
        if(!flg){
            cout << i << endl;
            return 0;
        }
        flg = 0;
    }
    return 0;
}

Measured memory_bytes: 3644
def examA():
    N = DI()/dec(7)
    ans = N
    print(N)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    N, K = LI()
    A = LI()
    A.sort()
    mask = (1 << K) - 1

    noneed = -1; need = N
    while(need-noneed>1):
        #print(noneed,need)
        i = (need+noneed)//2
        if A[i]>=K:
            is_need = True
        else:
            dp = 1
            for j in range(N):
                a = A[j]
                if a>K:
                    break
                if i == j:
                    continue
                dp |= ((dp << a) & mask)
            # print(dp,mask)

            is_need = (dp > mask>>A[i])

            # print(is_need,i)

        if is_need:
            need = i
        else:
            noneed = i

    ans = noneed + 1

    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examD()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 84008
#include<stdio.h>

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

	a = num/100;
	b = num%100;

	if ( 1 <= a && a <= 12 ) {
		if ( 1 <= b && b <= 12 ) {
			printf("AMBIGUOUS");
	} else {
		printf("MMYY");
	}
	} else {
		if ( 1<=b && b <= 12 ) {
			printf("YYMM");
		} else {
			printf("NA");
		}
	}
    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		while(true) {
			int H = scan.nextInt();
			int W = scan.nextInt();
			if(H == 0 && W == 0) {
				break;
			}
			StringBuilder sb = new StringBuilder();
			for(int i = 0; i < W; i++) {
				sb.append("#");
			}
			for(int i = 0; i < H; i++) {
				System.out.println(sb.toString());
			}
			System.out.println();
		}
		scan.close();
	}
}


Measured memory_bytes: 27524
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn=305;
const int mod=1e9+7;
vector<pair<int,int> >vec[maxn];
int n,m,dp[305][305][305],d[4];
void add(int &x,int y)
{
	x+=y;
	if(x>=mod)x-=mod;
}
bool check(int a,int b,int c)
{
	d[1]=a;d[2]=b;d[3]=c;
	sort(d+1,d+4);
	for(int i=0;i<vec[d[3]].size();++i)
	{
		pair<int,int>p=vec[d[3]][i];
		int now=1;
		if(p.first<=d[2])now++;
		if(p.first<=d[1])now++;
		if(now!=p.second)return 0;
	}return 1;
}
signed main()
{
	 scanf("%lld%lld",&n,&m);
	 for(int i=1;i<=m;++i)
	 {
	 	int l,r,x;
	 	scanf("%lld%lld%lld",&l,&r,&x);
	 	vec[r].push_back(make_pair(l,x));
	 }
	 dp[0][0][0]=1;
	 for(int i=0;i<n;++i)
	 {
	 	for(int j=0;j<n;++j)
	 	{
	 		for(int k=0;k<n;++k)
	 		{
	 			int mx=max(max(i,j),k);
	 			if(check(mx+1,j,k))add(dp[mx+1][j][k],dp[i][j][k]);
	 			if(check(i,mx+1,k))add(dp[i][mx+1][k],dp[i][j][k]);
	 			if(check(i,j,mx+1))add(dp[i][j][mx+1],dp[i][j][k]);
			}
		}
	 }
	 int res=0;
	 for(int i=0;i<=n;++i)
	 {
	 	for(int j=0;j<=n;++j)
	 	{
	 		for(int k=0;k<=n;++k)
	 		{
	 			if(i==n||j==n||k==n)add(res,dp[i][j][k]);
			 }
		 }
	 }
	 cout<<res<<endl;
}

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

int main()
{
    int n;
    cin >> n;
    int x[n],y[n];
    for(int i=0;i<n;i++) cin >> x[i];
    for(int i=0;i<n;i++) cin >> y[i];
    int total=0;
    for(int i=0;i<n;i++)
    {
        if(x[i]>y[i]) total+=x[i]-y[i];
    }
    cout << total;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
#define f(i,a,b) for(int i=a;i<=b;i++)

using namespace std;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef pair<int,int> pii;
typedef map<int,int> mii;
typedef set<int> si;


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	string str,a;
	cin >> str;

	for(char i : str){
		if(i == '9') {
			a.push_back('1');
		}
		else if(i == '1'){
			a.push_back('9');
		}else{
			a.push_back(i);
		}
	}
	cout << a << endl;
	return 0;
}


Measured memory_bytes: 256
"""

https://atcoder.jp/contests/arc095/tasks/arc095_c

列、行の文字の組み合わせは変わらない
→対応する列・行の組み合わせがなければだめ

→では、各組み合わせが2こずつちゃんとあれば必ず可能か…？
→だとしたら制約小さすぎない？？

ab
ba

abc
aba
cba

→多分十分条件ではないけど少なくとも各組み合わせが2こない場合は絶対×
→かつ、端数の文字が1こ以下でないとだめ
ダメな場合はなんだーーー

分からないけど探索すればよさそう
→ペアになる列・行さえ決まればいい

(11*9*7*5*3*1)**2　→ 10^8ぐらい　最大12**2回探索するので…ア
1ms解法は何…

あらかじめありうるペアだけ列挙しておく？
→あとの入れ替えは探索

→最大になるような場合は全部同じ場合なのですぐ答えが見つかる…と信じたい

1234
2341
3412
4123 →このパターンの場合最悪計算量になってしまう…

1234
2341
4123
3412

1243
2314
4132
3421→ok…？

必要十分条件なのか…？　700点だし…？

反例:
12Z34
23Y41
ZYXYZ
41Y23
34Z12


どうやら現実的な時間で解けるらしい
ちゃんと考えよう
→入れ替えた際に保持されるパラメータを考える…？

答えに対し、対称な列と行を入れ替えても問題ない
& 対称な列のset/行のsetを入れ替えても問題ない
→すなわち列・行の対応以外は全く関係ない

=====答えを見た=====
片側だけペアにするのか…
→確かに片側全探索したらもう片方は簡単に判定できる…(裏返しがあるか判定するだけなので)

具体的な実装は…
まずペアを列挙→再帰で適当にやる
→列を入れ替えたとする

次に横で見てって、各ペアの数字が全て対になってる物があるか調べればいい
→ペア通り数 * H * H * W
"""

def pair(end,lis):
    if len(lis) == 0:
        p.append(end)
        return
    else:
        end.append(lis[0])
        del lis[0]
        for j in range(len(lis)):
            pair( end+[lis[j]] , lis[:j]+lis[j+1:])

from sys import stdin
import sys

H,W = map(int,stdin.readline().split())

S = []
for i in range(H):
    s = stdin.readline()
    S.append(s[:-1])
#print (S)

#ペア列挙
p = []
if W % 2 == 0:
    pair([],[i for i in range(W)])
else:
    tmp = [i for i in range(W)]
    for i in range(W):
        pair([i,i] , tmp[:i] + tmp[i+1:])

#print (p)

for pl in p:
    able = [True] * H
    flag = 0

    for i in range(H):
        if able[i]:
            for j in range(i+1,H):
                if not able[j]:
                    continue

                tmpf = True
                for w in range((W+1)//2):
                    if S[i][pl[2*w]] != S[j][pl[2*w+1]] or S[j][pl[2*w]] != S[i][pl[2*w+1]]:
                        tmpf = False
                        break
                if tmpf:
                    able[i] = False
                    able[j] = False
                    break
            else:
                if H % 2 == 0 or flag == 1:
                    flag = 2
                    break
                for w in range((W+1)//2):
                    if S[i][pl[2*w]] != S[i][pl[2*w+1]]:
                        flag = 2
                        break
                else:
                    flag = 1
                    able[i] = False
                if flag == 2:
                    break
                
    if flag != 2:
        print ("YES")
        break
else:
    print ("NO")

Measured memory_bytes: 73256
#include <iostream>
#include <algorithm>
using namespace std;
 
int wayn,maxt;
struct way{
    int c,t;
}ways[100];
bool cmp(way a,way b){
    if(a.c==b.c){return a.t<b.t;}
    return a.c<b.c;
}
int main(){
    cin>>wayn>>maxt;
    for(int i=0;i<wayn;i++){
        cin>>ways[i].c>>ways[i].t;
    }
    sort(ways,ways+wayn,cmp);
    for(int i=0;i<wayn;i++){
        if(ways[i].t>maxt)continue;
        cout<<ways[i].c<<endl;
        return 0;
    }
    cout<<"TLE"<<endl;
    return 0;
}

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

using namespace std;

#define sqr(x) ((x) * (x))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<char> vc;
typedef pair<int, int> pii;
typedef long long ll;

const int MOD = 1000000007;

void solve() {
  int N;
  cin >> N;
  vi P(N, 0);
  for (int i = 0; i < N; i++) {
    cin >> P[i];
  }
  vi Pmin(N, P[0]);
  for (int i = 1; i < N; i++) {
    Pmin[i] = min(Pmin[i - 1], P[i]);
  }
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (P[i] <= Pmin[i]) ans++;
  }
  cout << ans << endl;
}

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

  solve();

  return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

int N, K;
VL a;
VL asump, asumm, asum;

int main(void) {
    scanf("%d%d", &N, &K);
    a.resize(N);
    for_each(ALL(a), [](LL &e){scanf("%lld", &e);});
    asump.resize(N + 1, 0);
    asumm.resize(N + 1, 0);
    asum.resize(N + 1, 0);
    FOR(i, 1, N + 1) {
        asum[i] = asum[i - 1] + a[i - 1];
        asump[i] = asump[i - 1] + (a[i - 1] >= 0 ? a[i - 1] : 0);
        asumm[i] = asumm[i - 1] + (a[i - 1] < 0 ? a[i - 1] : 0);
    }
    LL ans = 0;
    REP(i, N - K + 1) {
        LL buf = asum[i + K] - asum[i];
        buf = max(buf, 0ll);
        buf = buf + asump[N] - asump[i + K] + asump[i];
        ans = max(ans, buf);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3328
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<iomanip>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
#define LINF (long long)4e18

using ll = long long;

int calc(int i){
  int res = 0;
  while(i % 2 == 0){
    i /= 2;
    res++;
  }
  return res;
}

int main(){
   int N; cin >> N;
   vector<int> a(N);
   rep(i,N) cin >> a[i];
   int ans = 0;
   rep(i,N){
     int cnt = calc(a[i]);
     ans += cnt;
   }
  cout << ans << endl;


}


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

template<typename T, typename U>
using pv=vector<pair<T,U>>;
template<typename T>
using matrix=vector<vector<T>>;
template<typename T>
using pque=priority_queue<T>;
template<typename T>
using lpque=priority_queue<T,vector<T>,greater<T>>;

using ll=long long;
using intpair=pair<int,int>;
using llpair=pair<ll,ll>;
using ilpair=pair<int,ll>;
using lipair=pair<ll,int>;
using intvec=vector<int>;
using llvec=vector<ll>;
using intq=queue<int>;
using llq=queue<ll>;
using intmat=vector<intvec>;
using llmat=vector<llvec>;

#define PI 3.141592653589793
#define INTINF ((1<<30)-1)
#define LLINF ((1LL<<62)-1)
#define MPRIME 1000000007
#define MPRIME9 998244353
#define MMPRIME ((1ll<<61)-1)

#define len length()
#define pushb push_back
#define fi first
#define se second

#define setpr fixed<<setprecision(15)
#define all(name) name.begin(),name.end()
#define rall(name) name.rbegin(),name.rend()
#define gsort(vbeg,vend) sort(vbeg,vend,greater<>())

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

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

template<class T>
inline void init(T& v) {
	for(auto &a: v) cin>>a;
}
template<class T, class U>
inline void init(vector<pair<T,U>>& v) {
	for(auto &a: v) cin>>a.first>>a.second;
}
template<class T, class N>
inline void init(T& v, N n) {
	v.resize(n);
	for(auto &a: v) cin>>a;
}
template<class T, class U, class N>
inline void init(vector<pair<T,U>>& v, N n) {
	v.resize(n);
	for(auto &a: v) cin>>a.first>>a.second;
}

inline void out() {
	cout<<endl;
}
template<class T, class... U>
inline void out(T a, U... alist) {
	cout<<a<<" ";
	out(forward<U>(alist)...);
}

template<class N>
void resiz(N n) {
	//empty
}
template<class N, class T, class... U>
void resiz(N n, T&& hd, U&&... tl) {
	hd.resize(n);
	resiz(n,forward<U>(tl)...);
}

bool isout(int h, int w, int H, int W) {
	return ( h<0 || h>=H || w<0 || w>=W );
}

ll binpow(ll a, ll ex, ll p) {
	ll result=1;
	while(ex>0) {
		if(ex&1) result=result*a%p;
		ex>>=1;
		a=a*a%p;
	}
	return result;
}


int M;

void input() {
	cin>>M;
}

void solve() {
	cout<<48-M<<endl;
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout<<fixed<<setprecision(15);
	int t=1;
	while(t) {
		input();
		solve();
		t--;
	}
}


Measured memory_bytes: 3568
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;




int main(){
    ll n,a,b,c;
    cin>>n>>a>>b>>c;
    vector<ll> A(n);
    for(auto &I:A){cin>>I;}
    ll ans=E;
    ll K=(1LL<<n)-1;
    for(ll i=1;i<(1LL<<n);i++){
        ll ref=K^i;
        for(ll t=ref;t>0;t=(t-1)&ref){
            ll ref2=ref^t;
            for(ll h=ref2;h>0;h=(h-1)&ref2){
                if(t==0 || h==0){continue;}
                ll cul=0;
                ll cnt=0;
                bool f=true;
                for(ll k=0;k<n;k++){
                    if(i>>k&1){
                        if(f){f=false;}
                        else{cul+=10;}
                        cnt+=A[k];
                    }
                }
                cul+=abs(cnt-a);
                cnt=0; f=true;
                for(ll k=0;k<n;k++){
                    if(t>>k&1){
                        if(f){f=false;}
                        else{cul+=10;}
                        cnt+=A[k];
                    }
                }
                cul+=abs(cnt-b);
                cnt=0; f=true;
                for(ll k=0;k<n;k++){
                    if(h>>k&1){
                        if(f){f=false;}
                        else{cul+=10;}
                        cnt+=A[k];
                    }
                }
                cul+=abs(cnt-c);
                ans=min(ans,cul);
            }
        }
    }
    cout<<ans<<endl;
    
    
    return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc171/tasks/abc171_d

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define DEBUG 1
#if DEBUG
  #define _GLIBCXX_DEBUG
  #define DUMP(a) REP(_i, a.size()) cout << a[_i] << (_i + 1 == a.size() ? "\n" : " ")
  #define DUMP2D(b) REP(_j, b.size()) DUMP(b[_j]); cout << endl
#else
  #define DUMP(a)
  #define DUMP2D(b)
#endif

const int N_MAX = 1e5;
const int Q_MAX = 1e5;
const int A_I_MAX = 1e5;
const int B_I_MAX = 1e5;
const int C_I_MAX = 1e5;

int N;
vector<ll> A;
int Q;

ll S;
map<ll, ll> h;

int main() {
  cin >> N;
  A = vector<ll>(N);
  S = 0;
  REP(i, N) {
    cin >> A[i];
    S += A[i];
    h[A[i]]++;
  }

  cin >> Q;
  REP(i, Q) {
    int B, C;
    cin >> B >> C;
    S += (C - B) * h[B];
    h[C] += h[B];
    h[B] = 0;
    cout << S << endl;
  }
}


Measured memory_bytes: 9988
#include <iostream>
#include <climits>

using namespace std;

int main() {
  int n , bt;
  cin >> n >> bt;
  int ans = INT_MAX;
  int c, t;
  while (cin >> c >> t)
    if (t <= bt)
      ans = min(ans, c);

  if (ans == INT_MAX)
    cout << "TLE" << endl;
  else
    cout << ans << endl;
}


Measured memory_bytes: 3636
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main {
 
    public static void main(String[] args) throws NumberFormatException,
            IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(
                System.in));
 
        String[] strs = reader.readLine().split(" ");
        int[] nums = new int[strs.length];
        int top = 0;
        for (int i = 0; i < strs.length; i++) {
            switch (strs[i].charAt(0)) {
            case '+':
                top--;
                nums[top-1] = nums[top - 1] + nums[top];
                break;
            case '-':
                top--;
                nums[top-1] = nums[top - 1] - nums[top];
                break;
            case '*':
                top--;
                nums[top-1] = nums[top - 1] * nums[top];
                break;
            default:
                 
                nums[top] = Integer.parseInt(strs[i]);
                top++;
                break;
            }
        }
        System.out.println(nums[0]);
 
    }
}


Measured memory_bytes: 24436
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define rrep(i,m,n) for(int i = m; i >= n; i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define printp(x,n) for(int i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e18)
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
typedef struct{
    ll to;
    ll cost;
} edge;
typedef pair<ll, ll> lpair;
double dp[3010][6010] = {};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    double p[3010];
    cin >> N;
    rep(i,0,N){
        cin >> p[i];
    }
    rep(i,0,N+1){
        rep(j,0,6010){
            dp[i][j] = 0.0;
        }
    }
    dp[0][3000] = 1.0;
    rep(i,0,N){
        rep(j,0,6010){
            dp[i+1][j] += dp[i][j-1] * p[i];
            dp[i+1][j] += dp[i][j+1] * (1 - p[i]);
        }
    }
    // rep(j,0,2*N){
    //     cout << dp[i+1][3000 - j] << " ";
    // }
    // cout << endl;
    // rep(i,0,N){
    //     rep(j,0,N){
    //         if(j != 0){
    //             dp[i+1][j] += dp[i][j-1] * p[i];
    //         }
    //         dp[i+1][j] += dp[i][j+1] * (1 - p[i]);
    //         if(j == 0){
    //             dp[i+1][]
    //         }
    //         // if(j <= i+1){
    //         //     dp[i+1][j] += dp[i][j-1] * p[i];
    //         // }
    //         print2(i,j);
    //         print(dp[i+1][j]);
    //     }
    // }
    double ans = 0.0;
    rep(j,0,6010){
        if(j > 3000){
            ans += dp[N][j];
        }
    }
    cout << setprecision(12) << ans << endl;

}


Measured memory_bytes: 141568
# https://atcoder.jp/contests/abc047/tasks/arc063_a
# 連長圧縮すれば簡単
# 圧縮後の文字列長-1となる


# def run_length_encoding(s):
#     '''連長圧縮を行う
#     s ... iterable object e.g. list, str
#     return
#     ----------
#     s_composed,s_num,s_idx
#     それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx'''
#     s_composed, s_sum = [], []
#     s_idx = [0]
#     pre = s[0]
#     cnt = 1
#     for i, ss in enumerate(s[1:], start=1):
#         if pre == ss:
#             cnt += 1
#         else:
#             s_sum.append(cnt)
#             s_composed.append(pre)
#             s_idx.append(i)
#             cnt = 1
#             pre = ss
#     s_sum.append(cnt)
#     s_composed.append(pre)
#     # assert len(s_sum) == len(s_composed)
#     return s_composed, s_sum, s_idx


def run_length_encoding(s):
    '''連長圧縮を行う
    s ... iterable object e.g. list, str
    return
    ----------
    s_composed,s_num,s_idx
    それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx'''
    from itertools import groupby
    s_composed, s_sum = [], []
    s_idx = [0]
    for k, v in groupby(s):
        s_composed.append(k)
        n = len(list(v))
        s_sum.append(n)
        s_idx.append(s_idx[-1] + n)

    # assert len(s_sum) == len(s_composed)
    return s_composed, s_sum, s_idx


S_composed, _, _ = run_length_encoding(input())
print(len(S_composed) - 1)


Measured memory_bytes: 84352
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
 
main() {
  ll N, A, B, C, D;
  cin >> N >> A >> B >> C >> D;
 
  bool ans = false;
  ll X = B - A;
  rep(i, N) {
    ll minX = (N - 1 - i) * C - i * D;
    ll maxX = (N - 1 - i) * D - i * C;
    if (minX <= X && X <= maxX) {
      ans = true;
      break;
    }
  }
  cout << (ans ? "YES" : "NO") << endl;
}

Measured memory_bytes: 256
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif

struct Graph{
    struct Edge{
        int cost, from, dest;
        Edge(int cost, int dest): cost(cost), from(-1), dest(dest){ }
        Edge(int cost, int from, int dest): cost(cost), from(from), dest(dest){ }
        bool operator < (const Edge& e) const { return cost < e.cost; }
        ostream& operator >> (ostream& out){
            return out << '(' << cost << ':' << from << ' ' << dest << ')';
        }
    };
    struct Node{
        vector<Edge> edges;
        ll height = 0;
    };
    vector<Node> nodes;
    Graph(int num): nodes(num){ }
    void addEdge(int from, int dest, int cost = 1){
        nodes[from].edges.emplace_back(cost, dest);
    }
    void addEdge2(int from, int dest, int cost = 1){
        addEdge(from, dest, cost);
        addEdge(dest, from, cost);
    }
    void dfs(int idx, ll height, int from = -1){
        nodes[idx].height = height;
        for(auto& e : nodes[idx].edges){
            if(e.dest == from){ continue; }
            dfs(e.dest, height + e.cost, idx);
        }
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    Graph g(n);
    for(int i = 0; i < n - 1; i++){
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        g.addEdge2(a, b, c);
    }
    int q, k;
    cin >> q >> k;
    k--;
    g.dfs(k, 0);
    for(int i = 0; i < q; i++){
        int x, y;
        cin >> x >> y;
        x--; y--;
        cout << g.nodes[x].height + g.nodes[y].height << '\n';
    }
}


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

int main() {
    int n;
    cin >> n;
    int ans = 0;
    vector<int> coin = {25,10,5,1};
    rep(i, coin.size()) {
        if (n >= coin[i]) {
            ans += n / coin[i];
            n %= coin[i];
        }
    }
    // if (n >= 25) {
    //     ans += n / 25;
    //     n %= 25;
    // }
    // if (n >= 10) {
    //     ans += n / 10;
    //     n %= 10;
    // }
    // if (n >= 5) {
    //     ans += n / 5;
    //     n %= 5;
    // }
    // if (n >= 1) {
    //     ans += n / 1;
    // }
    cout << ans << endl;
}


Measured memory_bytes: 3128
#include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
using namespace std;
int main(){
int a,b,c;
while(cin>>a>>b>>c,a||b||c){
vector<int>in;
pb(in,a);
pb(in,b);
pb(in,c);
sort(all(in));
int n;
cin>>n;
rep(i,n){
int a;
cin>>a;
if(a>hypot(in[0]/2,in[1]/2))cout<<"OK"<<endl;
else cout<<"NA"<<endl;
}
}
}

Measured memory_bytes: 1220
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin>>s;
	vector<int> mps(10, 0);
	for(char c: s){
		int pos = c - '0';
		mps[pos]++;
		if(mps[pos] == 9) mps[pos] = 0;
	}
	long long ans = 0;
	for(int i = 0;i < 10;i++){
		ans += (long long) (i * mps[i]);
	}
	printf("%s\n", ans % 9 == 0 ? "Yes" : "No");
	return 0;
}
//ios_base::sync_with_stdio(false);
//cin.tie(0);
//tod-ngen


Measured memory_bytes: 3740
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  int a[n],b[n];
  rep(i,n){
    cin>>a[i]>>b[i];
  }
  sort(a,a+n);
  sort(b,b+n);
  int medl,medh;
  if(n%2==1){
    cout<<b[n/2]-a[n/2]+1<<endl;
  }else{
    cout<<b[n/2]+b[(n-1)/2]-a[n/2]-a[(n-1)/2]+1<<endl;
  }


  return 0;
}


Measured memory_bytes: 6804
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> ts(n + 1, 0);
    vector<pair<int, int>> dists(n + 1);
    dists[0] = {0, 0};
    for (int i = 1; i <= n; ++i) {
        int t, x, y;
        cin >> t >> x >> y;
        ts[i] = t;
        dists[i] = make_pair(x, y);
    }
    for (int i = 0; i <= n - 1; ++i) {
        ///マンハッタン距離を計算
        int diff = abs(dists[i + 1].first - dists[i].first) + abs(dists[i + 1].second - dists[i].second);
        int t_diff = ts[i + 1] - ts[i];
        if(diff > t_diff)
        {
            cout << "No" << endl;
            return 0;
        }else{
            if(diff != t_diff)
            {
                int rest = t_diff - diff;
                if(rest % 2 != 0)
                {
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}


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

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define pb push_back
#define odd(x) ((x)&1)
#define even(x) (!odd(x))
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(auto i=0;i<n;++i)
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define TEST_CASE int tc;cin>>tc;while(tc--)

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

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

#ifdef LOCAL
#define cerr cout
#else
#endif

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}


template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define JD



int main(int argv, char* argc[])
{
    FASTIO

    #ifndef JD
        freopen("in.txt","r",stdin);
        //freopen("out.txt","w",stdout);
    #endif

    ll ans=0,n;cin>>n;for(ll i=1;i<=n;++i) {ll m = n/i;ll k = ((m*(m+1))/2)*i;ans+=k;}cout<<ans;

    return 0;
}


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

class Main{
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));
		String str="";
		str=bfr.readLine();
		int mojisu=str.length();
		String kekka=str.charAt(0)+""+(mojisu-2)+""+str.charAt(mojisu-1);
		System.out.println(kekka);
	}
}

Measured memory_bytes: 21332
#[allow(unused_imports)]
use itertools::Itertools;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        _a: i64, _b: i64, _c: i64, d: i64,
    }
    if d == 1 {
        println!("1");
    } else {
        println!("0");
    }
}


Measured memory_bytes: 2088
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mod = 1000000007;
const ll INF = 1001001001;
const ll LINF = 1001001001001001001;

void prvec(vector<ll> vec){ //for debug
    ll n = vec.size();
    cout << "------------------------------------\n" ;
    rep(i,n) cout << i << " " << vec.at(i) << "\n";
    cout << "------------------------------------\n" ;
}

void pr2d(vector<vector<ll>> vec){ // for debug
    ll h = vec.size();
    ll w = vec.at(0).size();
    cout << "------------------------------------\n" ;
    rep(i,h){
        rep(j,w){
            cout << vec.at(i).at(j) << " ";
        }
        cout << "\n";
    }
    cout << "------------------------------------\n" ;
}

int main(){
    ll n , d, a; cin >> n >> d >> a;
    vector<pair<ll,ll>> xh(n);
    rep(i,n){
        cin >> xh.at(i).first >> xh.at(i).second;
    }
    sort(xh.begin(),xh.end());
    ll ans = 0;

    vector<ll> lst_place(0),lst_damage(0);
    lst_place.push_back(0);
    lst_damage.push_back(0);

    rep(i,n){
        //あらかじめHPから引いておく数を計算する
        auto it1 = lower_bound(lst_place.begin(),lst_place.end(),xh.at(i).first);
        auto it2 = lower_bound(lst_place.begin(),lst_place.end(),xh.at(i).first + 2*d);
        ll x = it1 - lst_place.begin() -1;
        ll y = it2 - lst_place.begin() -1;
        ll damage = lst_damage.at(y) - lst_damage.at(x);
        xh.at(i).second -= damage * a;


        //補正したHPのモンスターを倒すのに必要な爆弾の個数を求める
        ll bomb = 0;
        if(xh.at(i).second>=0){
            if(xh.at(i).second%a==0){
                bomb = xh.at(i).second/a;
            }else{
                bomb = (xh.at(i).second/a)+1;
            }
        }
        ans += bomb;
        

        //爆弾の数をlstに反映させる
        lst_place.push_back(xh.at(i).first + (2*d));
        lst_damage.push_back(lst_damage.at(i) + bomb);
    }
    cout << ans << endl;
    return 0;
}


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

int main() 
{
    int s, w;
    cin >> s >> w;

    if (w>= s) cout << "unsafe" << endl;
    else cout << "safe" << endl;
    return 0;
}


Measured memory_bytes: 3580
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma warning(disable:4996)
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
#include <map>
#include <iomanip> 
#include <ctime>
#include <numeric>
#include <cassert>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Graph;

const double PI = 3.14159265358979323846;
const int mod = 1000000007;


int main(int argc, char *args[]) {
	string s; cin >> s;
	if (s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <iterator>
#include <queue>
#include <stack>
#include <deque>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <string>
#include <cmath>
#include <complex>
#include <functional>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cstdlib>
#include <cctype>

#define REP(i,m,n) for(int i=m;i<(int)n;i++)
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rrep(i,n) for(int i = 1; i <= n; i++)
#define drep(i,n) for(int i = n; i >= 0; i--)
#define rp(i,c) rep(i,(int)c.size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(u) (u).rbegin(),(u).rend()
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl
#define v_delete(a,b) (a).erase(remove((a).begin(), (a).end(), b), (a).end())
#define v_unique(a) (a).erase(unique((a).begin(), (a).end()), (a).end())
#define VV(T) vector<vector< T > >
#define init(a,b) memset((a), (b), sizeof((a)))
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int inf=1<<28;
const double INF=1e10,EPS=1e-9;


template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}

template <class T> void input(T& a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
template <class T> void input(T* a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }

int chmax(int& a,int b){
	if(b > a){
		a=b;
	}
	return a;
}
int chmin(int& a,int b){
	if(b < a){
		a=b;
	}
	return a;
}


int dp[50000+10000+10]={0};
int main(){
	int N,M;
	cin >> N >> M;
	fill(dp,dp+50000+10000+10,inf);
	rep(w,M){
		int n;
		cin >> n;
		dp[n]=1;
		for(int i=0;i<=N;i++){
			dp[i+n]=min(dp[i+n],dp[i]+1);
		}
	}
	cout << dp[N] << endl;

	return 0;
}

Measured memory_bytes: 1396
#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
struct Edge{
    int to,id;
};

vector<vector<Edge>> g;
void dfs(int v,int c = -1,int p = -1){//c は親
    int k = 1;
    for(int i=0;i<g[v].size();i++){
        int u =g[v][i].to,ei = g[v][i].id;
        if(u==p) continue;
        if(k==c)k++;
        ans[ei] = k; k++;
        dfs(u,ans[ei],v);
    }
}
int main(void){
    // Your code here!
    int n;cin>>n;
    g.resize(n);
    ans.resize(n-1);
    for(int i=0;i<n-1;i++){
        int a,b;cin>>a>>b;
        a--;b--;
        //dfs
        g[a].push_back((Edge){b,i});
        g[b].push_back((Edge){a,i});
    }
    dfs(0);
    int mx = 0;
    for(int i=0;i<n;i++){
        mx = max(mx, int(g[i].size()));
    }
    cout<<mx<<endl;
    for(int i=0;i<n-1;i++){
        cout<<ans[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 8320
#include<bits/stdc++.h> 
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp> 
#define mod 1000000007
#define mod2 998244353
#define int long long
#define endl "\n"
#define p_b push_back
#define m_p make_pair
#define fastIO ios_base::sync_with_stdio(false),cin.tie(NULL)
using namespace std;
using namespace __gnu_pbds;
template <class T> 
using _ost = tree<
		T, 
		null_type, 
		less<T>, 
		rb_tree_tag, 
        tree_order_statistics_node_update>;

// char alphabet[26] = {'a','b','c','d','e','f','g','h','i',
//        'j','k','l','m','n','o','p','q','r','s','t','u','v',
//        'w','x','y','z'};

/* x power y */

int power(int x, unsigned int y) 
{ 
    int res = 1;     // Initialize result 
   
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = res*x; 
   
        // y must be even now 
        y = y>>1; // y = y/2 
        x = x*x;  // Change x to x^2 
    } 
    return res; 
}

int32_t main(){
 	fastIO;
 	int x;cin>>x;
 	int mx=3983;
 	for(int i=sqrt(sqrt(sqrt(x)));i<mx;i++){
 		if(power(i,5)<x)continue;
 		for(int j=0;j<i;j++){
 			if(power(i,5)-power(j,5)==x){
 				cout<<i<<" "<<j<<endl;
 				return 0;
 			}
 		}
 	}

 	for(int i=1;i<sqrt(sqrt(x));i++){
 		for(int j=0;j<i;j++){
 			if(power(i,5)+power(j,5)==x){
 				cout<<i<<" "<<0-j<<endl;
 				return 0;
 			}
 		}
 	}
} 			



Measured memory_bytes: 3672
#include <cstdio>
#define min(x,y) ((x<=y)?(x):(y))
char map[50][51];
int  dp[50][50];
int main() {
	int H,W;
	scanf("%d %d",&H,&W);
	for(int i=0;i<H;i++)
		scanf("%s",map[i]);
	for(int i=0;i<H;i++)
		for(int j=0;j<W;j++)
			dp[i][j]=(1<<30);
	dp[0][0]=0;
	for(int i=0;i<H;i++) {
		for(int j=0;j<W;j++) {
			if(i-1>=0) dp[i][j]=min(dp[i][j],dp[i-1][j]);
			if(j-1>=0) dp[i][j]=min(dp[i][j],dp[i][j-1]);
			dp[i][j]+=map[i][j]-'0';
		}
	}
	printf("%d\n",dp[H-1][W-1]);
}

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

int main(){
  int n,k;
  cin >> n >> k;
  
  int beki = k;
  int keta = 1;
  while( n >= beki ){
    beki *= k;
    keta += 1;
  }
  cout << keta << endl;
  return 0;
}

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

#define INF  						1e15
#define EPS   						1e-9
#define MOD 						1000000007
#define Pi 							3.14159265358979323846264338327950288419716939937510

#define umap 						unordered_map
#define uset 						unordered_set
#define fi 							first
#define se 							second
#define ll 							long long 
#define vi 							vector<int>
#define pii 						pair<int,int>
#define vll 						vector<ll>
#define pll							pair<ll,ll>
#define pb 							push_back
#define pob 						pop_back
#define pf 							push_front
#define pof 						pop_front
#define maxE(a,n) 					*max_element(a,a+n);
#define minE(a,n) 					*min_element(a,a+n);
#define all(x) 						x.begin(), x.end()

#define fast 						ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define fori(i,a,n) 				for (ll  i=a;i<n;i++)
#define ford(i,a,n) 				for (ll  i=n-1;i>=a;i--)

ll gcd(ll a, ll b){ll temp;while (b > 0){temp = a%b;a = b;b = temp;} return a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
ll power(ll x, ll b,ll m) {ll p = 1;while (b > 0) {if(b&1) {p = p * x; p %= m;} b >>= 1; x *= x; x %= m;} return p % m;}

using namespace std;


void solve(){

	ll n,x,t;
	cin>>n>>x>>t;

	if(n <= x){
		cout<<t<<endl;
		return;
	}

	ll op = (n/x)*t;

	ll rem = n%x;

	if(rem == 0){
		cout<<op<<endl;
	}
	else{
		cout<<op+t<<endl;
	}

	
	return;

}


int main(){

	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	fast;
	ll t = 1;
	// cin>>t;

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


Measured memory_bytes: 3648
using System;
using System.Collections.Generic;
using System.Linq;

namespace CSharpSample01
{
	class Program
	{

		static void Main(string[] args)
		{
			var inputNum = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

			var N = inputNum[0];
			var X = inputNum[1];
			var T = inputNum[2];

			var answer = T;
			var num = X;

			while(num < N)
			{
				answer += T;
				num += X;
			}

			Console.WriteLine(answer);

		}
	}
}

Measured memory_bytes: 18996