akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
#define inf 1e18+42
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971693993751058
#define maxn 100005

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define fori(it,A) for(auto it=A.begin();it!=A.end();it++)

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define all(x) (x).begin(),(x).end()
#define zero(x) memset(x,0,sizeof(x));
#define ceil(a,b) (a+b-1)/b
 
using namespace std;

int binpow(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

//START OF CODE ->->->->->->->

void solve()
{
    int l,r;
    cin>>l>>r;

    int x = l/2019;
    int y = r/2019;
    if ( l % 2019 == 0 || r % 2019 == 0 )
    {
        cout<<"0"<<endl;
        return;
    }
    if ( x != y )
    {
        cout<<"0"<<endl;
    }
    else
    {
        vector<int> a;
        rep(i,l,r+1)
        {
            a.pb(i%2019);
        }
        int ans = inf;
        rep(i,0,a.size())
        {
            rep(j,i+1,a.size())
            {
                ans = min((a[i]*a[j])%2019,ans);
            }
        }

        cout<<ans<<endl;
    }
    
}

//END OF CODE ->->->->->->->->

signed main()
{
    fast;
    int t = 1;
    // cin>>t;

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



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

//int main(int argc, const char * argv[]) {
int main() {
    int a, b;
    cin >> a >> b;
    
    if (a < b) {
        cout << "a < b" << endl;
    } else if (a > b) {
        cout << "a > b" << endl;
    } else if (a == b) {
        cout << "a == b" << endl;
    }
    
    return 0;
}

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

int main()
{
    int x,n,k;
    cin>>x>>n;
    vector<int>s(102),w(102);
    rep(i,102)
    s[i]=-1;
    rep(i,n)
    {
        cin>>k;
        s[k]=1;
    }
    rep(i,102)
    {
        if(s[i]==-1)
        w.pb(i);
    }
    auto it=lower_bound(w.begin(),w.end(),x);
    if(it==w.end())
    {
        cout<<abs(w[w.size()-1]-x);
    }
    else
    {
        int y=it-w.begin();
        if(y>0)
        {
            if(abs(w[y]-x)<(abs(w[y-1]-x)))
            cout<<w[y];
            else
            cout<<w[y-1];
        }
        else
        if(abs(w[0]-x)<x+1)
        cout<<w[0];
        else
        cout<<-1;
    }
   
		
}
	

Measured memory_bytes: 3632
import sys

sys.setrecursionlimit(1000000)

import bisect
import math
import collections
import heapq

cache = {}
M = 10**9 + 7
def solve(S):
    if S < 3:
        return 0
    if S < 6:
        return 1
    if S in cache:
        return cache[S]
    ans = 1
    for remaining in range(S - 3, 2, -1):
        ans += solve(remaining)
        ans %= M
    cache[S] = ans
    return ans


if __name__ == "__main__":
    S = int(input())
    print(solve(S))


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

int main(){
    double n, t, a;
    cin >> n >> t >> a;

    vector<pair<double, int>> h(n);
    for(int i=0; i<n; i++){
        int height;
        cin >> height;
        h[i] = make_pair(abs((t - 0.006 * height) - a), i);
    }

    sort(h.begin(),h.end());
    cout << h[0].second + 1 << endl;
    return 0;
}

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

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

    cin >> a >> b >> c;
    if (a < c && b > c) {
        cout << "Yes" << endl;
    }
    else if (a > c && b < c) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <ctime>
#include <algorithm>
#include <cstdlib>
#include <utility>
#include <vector>
#include <iostream>
#include <cstring>
#include <set>
#include <map>
#include <string>

namespace fastinput
{
	/** Interface */

	inline int readChar();
	template <class T = int> inline T readInt();
	template <class T> inline void writeInt(T x, char end = 0);
	inline void writeChar(int x);
	inline void writeWord(const char *s);

	/** Read */

	static const int buf_size = 16384;

	inline int getChar() {
		static char buf[buf_size];
		static int len = 0, pos = 0;
		if (pos == len)
			pos = 0, len = fread(buf, 1, buf_size, stdin);
		if (pos == len)
			return -1;
		return buf[pos++];
	}

	inline int readChar() {
		int c = getChar();
		while (c <= 32)
			c = getChar();
		return c;
	}

	template <class T>
	inline T readInt() {
		int s = 1, c = readChar();
		T x = 0;
		if (c == '-')
			s = -1, c = getChar();
		while ('0' <= c && c <= '9')
			x = x * 10 + c - '0', c = getChar();
		return s == 1 ? x : -x;
	}

	/** Write */

	static int write_pos = 0;
	static char write_buf[buf_size];

	inline void writeChar(int x) {
		if (write_pos == buf_size)
			fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
		write_buf[write_pos++] = x;
	}

	template <class T>
	inline void writeInt(T x, char end) {
		if (x < 0)
			writeChar('-'), x = -x;

		char s[24];
		int n = 0;
		while (x || !n)
			s[n++] = '0' + x % 10, x /= 10;
		while (n--)
			writeChar(s[n]);
		if (end)
			writeChar(end);
	}

	inline void writeWord(const char *s) {
		while (*s)
			writeChar(*s++);
	}

	struct Flusher {
		~Flusher() {
			if (write_pos)
				fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
		}
	} flusher;
}

using namespace fastinput;
using namespace std;

int main()
{
	::ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	string s;
	cin >> s;
	string ans;
	for (auto c : s)
		if (c == 'B')
		{
			if (!ans.empty())
				ans.pop_back();
		}
		else
			ans.push_back(c);
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
S = input()
ans = 0
i = 0
while i < len(S):
    if any(['01' in S[i:i+2],'10' in S[i:i+2]]):
        S = S[:i]+S[i+2:]
        ans += 2
        i -= 1
    else:
        i += 1
print(ans)

Measured memory_bytes: 3424
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;


class Main {
    public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    public static PrintWriter pw = new PrintWriter(System.out);
    public static String line;
    public static StringTokenizer st;
    public static ArrayList<ArrayList<Integer>> adjList;
    public static int[] dx = {-1, 0, 1, 0, -1, 1, 1, -1};
    public static int[] dy = {0, 1, 0, -1, 1, 1, -1, -1};
    public static int INF = 0x3f3f3f3f;
    public static long LINF = 0x3f3f3f3f3f3f3f3fL;
    public static int MOD = 1000000007;

    public static void main(String[] args) throws Exception{
        st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        HashSet<Integer> A = new HashSet<Integer>();
        HashSet<Integer> B = new HashSet<Integer>();
        for(int i = 0; i < M; i++){
            st = new StringTokenizer(br.readLine());
            int a = Integer.parseInt(st.nextToken());
            int b = Integer.parseInt(st.nextToken());
            if(a == 1){
                A.add(b);
            } else if(a == N){
                B.add(b);
            }

            if(b == 1){
                A.add(a);
            } else if(b == N){
                B.add(a);
            }
        }

        boolean f = false;
        for(int a : A){
            if(B.contains(a)){
                f = true;
                break;
            }
        }

        pw.print(f ? "POSSIBLE\n" : "IMPOSSIBLE\n");

        pw.close(); 
        br.close();
    }
}

class Pair implements Comparable<Pair>{
    public int a, b;

    Pair(int a, int b){
        this.a = a;
        this.b = b;
    }

    public int compareTo(Pair p){
        if(a != p.a) return a - p.a;
        return b - p.b;
    }
}

class Trie{
    private Node root;
    
    Trie(){
        root = new Node('$');            
    }
    
    private void insert(Node root, String word, int index){
        if(index >= word.length()) return;
        char c = word.charAt(index);
        if(!root.children.containsKey(c)){
            root.addChild(c);
        }
        Node next = root.children.get(c);
        insert(next, word, index+1);
    }
    
    public void insert(String word){
        insert(root, word, 0);
    }
    
    public String find(String word){
        return find(root, word, 0);
    }

    public String find(Node root, String word, int index){
        if(index >= word.length()) return "";
        char c = word.charAt(index);
        if(!root.children.containsKey(c)){
            return "";
        }
        Node next = root.children.get(c);
        return word.charAt(index) + find(next, word, index+1);
    }
}


class Node{
    public char c;
    public HashMap<Character, Node> children;
    
    Node(char c){
        this.c = c;
        this.children = new HashMap<Character, Node>();
    }
    
    public void addChild(char c){
        this.children.put(c, new Node(c));
    }
}

Measured memory_bytes: 57340
#include<cstdio>
#include<cmath>
#define f(i,a,b) for(register int i=(a);i<=(b);i=-(~(i)))
typedef long long ll;
ll n,x;
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
int main()
{
	scanf("%lld%lld",&n,&x);
	printf("%lld\n",3*(n-gcd(n,x)));
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
//#include <vector>
using namespace std;
 
 
int main(){
    int64_t n,ans=0;
    cin>>n;

    
    vector<int> l(n);
    for(int i=0;i<n;i++)cin>>l.at(i);
    sort(l.begin(),l.end());
    
   for(int i=0;i<n-2;i++){//1th smallest
       for(int j=i+1;j<n-1;j++){//2th smallest
           //3th <<1th + 2th
           for(int k=j+1;k<n;k++){
               if(l.at(k)<l.at(i)+l.at(j))ans++;
               else break;
           }
       }
   }
    cout<<ans<<endl;
    
   
    
}

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

using namespace std;

int S(int n) {
  string n_s = to_string(n);
  int sum = 0;
  for (int i = n_s.size() - 1; i >= 0; --i) {
    sum += n_s[i] - '0';
  }
  return sum;
}

int main()
{
  int N; cin >> N;
  if (N % S(N) == 0) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}

Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <math.h>
#include <list>
using namespace std;

int main()
{
  int N; cin >> N;
  vector<int> a(N); for(int i = 0; i< N; i++) cin >> a.at(i);
  
  int ans = 0;
  for(int i = 0 ; i < N ; i++){
  	if(a.at(i) % 2 == 0){
      int count = 0;
      int temp = a.at(i);
      while(temp > 0 && temp % 2 == 0){
        temp /= 2;
        count++;
      }
      ans += count;
    }
  }
  
  cout << ans << endl;
}

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

int main(){
//srandom((unsigned long)time(NULL));

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

bool sch = true;
for(int i=0;i<s.length();i++){
    if(s[i]!=t[i]) sch = false;
}

if(sch) cout<<"Yes"<<endl;
else    cout<<"No"<<endl;

return 0;
}



Measured memory_bytes: 3600
import sys
import numpy as np
N, M, K = [int(x) for x in input().split()]
A = [float(x) for x in input().split()]
B = [float(x) for x in input().split()]
a = [0]
b = [0]
for i in range(N):
  a.append(A[i] + a[i])
for i in range(M):
  b.append(B[i] + b[i])
ans, j = 0, M
for i in range(N+1):
  if(a[i]>K):
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i+j)
print(ans)
  

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

/*
,,,,
　　　　　　　　　　　　　　　　　　　　　　　　　　,.斗*''“i:i:{
　　　　　　　　　　　　　,.　｡. . . * : : : ''' : : : :” :”“ ''ｰ - 弋,,_
　　　　　 　 　 ,.斗*''“ : : : : : : : : : : : : : ' ' ' ' ' ' : : : : : : : : : : :”: '':* ｡ ,
　　　 ,.斗*''“ ” ＼：　　 ”・・． ' ' ' '　　　　　　　　 ' ' ' ' : : : : : : : : : : : : ”ミ*｡,,,,,,　　　　　　 　 　 　 ＿
　　く.　 ◎　 ﾞ:.ﾞ:..　ﾟ:,　:　───────────　　　--　　,,,,,,__ ' ' ' :.:.:.:.:.”≧s｡.　　＿,,,｡s*i:i:i:i:<
　　ﾏ*s｡ :,　 }　ﾟ:,　 :}　　　　　　　　　　　　　　　　　　　　　　　　　　　　”　''　-　”””：：”：：`*｡i:i:i:i:i:i:i;:’
　　　` .｡`　 ,　,ノ ／｡ ,,,_　　　　　　　　　　　　　　　　　　　　　　　　　　　　　＿＿`　　} }　　ﾉi:i:i:i:i:ﾂ
　　　　　 `　*　｡　　`*｡i:i:i::*=-　　　　　　　　　　　＿＿　　　　　　,,,....｡s*'i,:’　　　”`*｡＿,*’i:i:i:i:r’
　　　　　　　　　　　”　─ --　　　　｡｡｡｡｡　　 -　－`''''''''ヽ ─ '''”　　　｀ｰ“　　　　　　　`*｡i:i:i:i:i:i:
　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　`*｡i:i:::
　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　`*ﾟ:,
         fozubaoyou    no BUGs alive!
*/

typedef long long ll;
//{
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define dumo dump
//}

#define debug_interval ','
#define dump_interval endl
#define debug_toggle 0

//{
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();}
template<class...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cout<<endl;}
template<class...A> inline void debug_rest() {cout<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cout<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cout<<first,debug_rest(rest...);}
//}

int a,b,c,d,ans;
string s,t,u;

int main(){
  cin>>s;
  for(int i=0;i<4;i++){
    if(s[i]=='+')ans++;
    else ans--;
  }
  dump(ans);
}

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

int main(){
    string a, b;
    cin >> a >> b;
    string ans;
    if(a.size() > b.size()) ans = "GREATER";
    else if(a.size() < b.size()) ans = "LESS";
    else if(a > b) ans = "GREATER";
    else if(a < b) ans = "LESS";
    else ans = "EQUAL";
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
using namespace std;
#define lowbit(x) ((x)&(-x))
#define INF 0x3f3f3f3f
#define mem(a,b) memset(a,b,sizeof(a))
#define	GE() printf(">----------\n")
#define	IN() freopen("in.txt","r",stdin)
#define	OUT() freopen("out.txt","w",stdout)
#define MP pair<int, int>
typedef long long LL;
const int mod=1000000007;
const int inf=0x3f3f3f3f;
const double pi=acos(-1.0);
const double eps=1e-8;
const int maxn=105;

LL data[maxn], ans;
map<LL, int> vis;
int main()
{
    int n;
    while(~scanf("%d", &n)){
        for(int i=0;i<n;i++)scanf("%lld", &data[i]);
        ans=data[0];
        vis.clear();
        for(int i=1;i<n;i++){
            if(vis[data[i]])continue;
            vis[data[i]]++;
            LL gcd=__gcd(ans, data[i]);
            data[i]/=gcd;
            ans*=data[i];
        }
        printf("%lld\n", ans);
    }
    return 0;
}


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

inline void fastRead_int(int &x)
{
	register int c = getchar_unlocked();
	x=0;
	int neg = 0;
	for(;((c<48 || c>57) && c!='-'); c=getchar_unlocked());
	
	if(c=='-'){
		neg = 1;
		c = getchar_unlocked();
	}
	for(; c>47 && c<58;c=getchar_unlocked())
		x = (x<<1)+(x<<3)+c-48;
	if(neg)	x = -x;
	
}

int min_cost(int a[], int n)
{
	int cost[n];
	cost[n-1] = 0;
	cost[n-2] =abs(a[n-2]-a[n-1]);
	for(int i=n-3;i>=0;i--)
		cost[i] = min(abs(a[i]-a[i+1])+cost[i+1],abs(a[i+2]-a[i])+cost[i+2]);
	return cost[0];
}

int main()
{
	int n;fastRead_int(n);int a[n];for(int i=0;i<n;i++)	fastRead_int(a[i]);
	cout<<min_cost(a,n)<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    string s1=s;
    reverse(s.begin(),s.end());
    int l=s.size();
    int coun=0;
    for(int i=0;i<l;i++)
    {
        if(s1[i]!=s[i])
        {
            coun++;
        }
    }
    if(coun%2==0)
    {
        cout<<coun/2<<endl;
    }
    else
    {
        cout<<(coun/2)+1<<endl;
    }
}


Measured memory_bytes: 3628
N,Y = map(int,input().split(" "))

Y //= 1000

n = 0
y = 0
while y <= Y and n <= N:
    if (Y-y-(N-n))%4==0 and 0<=(Y-y-(N-n))//4<=N-n:
        print(y//10,(Y-y-(N-n))//4,N-n-(Y-y-(N-n))//4)
        exit()
    y += 10
    n += 1

print(-1,-1,-1)

Measured memory_bytes: 3064
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 1000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<eps)
int d[105][105];
int main()
{
	int n,p;
	cin >> n;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			d[i][j]=INF;
			if(i==j)d[i][j]=0;
		}
	}
	for(int i=0;i<n;i++)
	{
		int r,k;
		cin >> r >> k;
		r--;
		for(int j=0;j<k;j++)
		{
			int to;
			cin >> to;
			to--;
			d[r][to]=1;
		}
	}
	for(int k=0;k<n;k++)
	{
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
			}
		}
	}
	cin >> p;
	for(int i=0;i<p;i++)
	{
		int from,to,TTL;
		cin >> from >> to >> TTL;
		from--;to--;
		if(d[from][to]<TTL)cout << d[from][to]+1 << endl;
		else cout << "NA" << endl;
	}
	return 0;
}

Measured memory_bytes: 1208
n, m=gets.split.map &:to_i
a=(1..n).map{gets.split.map &:to_i}
b=(1..m).map{gets.split.map &:to_i}
a.each do |x, y|
	i=0
	p b.map{|s,t| [(x-s).abs+(y-t).abs, i+=1]}.sort[0][1]
end


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

using namespace std;

bool ordena(int &a, int &b) {
  return (a % 10 > b %10);
}

int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;

  vector<int> v;
  v.push_back(a);
  v.push_back(b);
  v.push_back(c);
  v.push_back(d);
  v.push_back(e);
  
  sort(v.begin(), v.end(), ordena);

  int soma = 0;
  int f = 0;
  for(int i = 4; i >= 0; i--) {
    if(v[i] % 10 == 0) soma += v[i];
    else if(f == 0) {
      soma += v[i];
      f++;
    } else {
      soma += v[i];
      soma += 10 - (v[i] % 10);
    }
  }

  cout << soma << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 200005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
	if(c == '-') f = -1;
	c = getchar();
    }
    while(c >= '0' && c <= '9') {
	res = res * 10 +c - '0';
	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
	out(x / 10);
    }
    putchar('0' + x % 10);
}
const int MOD = 1000000007;
int N;
int cnt[MAXN];
int inc(int a,int b) {
    return a + b >= MOD ? a + b - MOD : a + b;
}
int mul(int a,int b) {
    return 1LL * a * b % MOD;
}
int fpow(int x,int c) {
    int res = 1,t = x;
    while(c) {
	if(c & 1) res = mul(res,t);
	t = mul(t,t);
	c >>= 1;
    }
    return res;
}
void Solve() {
    read(N);
    int a;
    for(int i = 1 ; i <= N ; ++i) {
	read(a);cnt[a]++;
    }
    if(N & 1) {
	if(cnt[0] != 1) {puts("0");return;}
    }
    for(int i = N - 1 ; i >= 1 ; i -= 2) {
	if(cnt[i] != 2) {
	    puts("0");return;
	}
    }
    out(fpow(2,N / 2));enter;
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
    return 0;
}


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

int n,m,x; 
const int CMAX=10000000;
int c[13],a[13][13],d[13][4097]={};

int calc(int i,int k,int l,int sum){
    int l2=l+(i+1)*k;
    bool b=false;
    if(k==1){
        sum+=c[i];
        for(int j=0;j<m;j++){
            d[j][l2]=d[j][l]+a[i][j];
            if(d[j][l2]<x) b=true;
        }
    } else{
        b=true;
    }
    if(b){
        if(i==n-1) return CMAX;
        sum=min(calc(i+1,0,l2,sum),calc(i+1,1,l2,sum));
    } 
    return sum;
}

int main()
{
    cin >> n >> m >> x;
    
    for(int i=0;i<n;i++){
        cin >> c[i];
        for(int j=0;j<m;j++){
            cin >> a[i][j];
        }
    }
    int res=min(calc(0,0,0,0),calc(0,1,0,0));
    if(res==CMAX) res=-1;
    cout << res << endl;
    return 0;
}

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

int main() {
  int64_t A;
  double B;
  cin >> A >> B;
  double B2 = B * 100 + 0.5;
  int B3 = (int)B2;
  int64_t res = (A * B3) / 100;
  cout << res << endl;
}


Measured memory_bytes: 3704
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(container) container.begin(), container.end()
#define Cin(T, x) T x; cin >> x;
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i];
#define Cout(val) cout << (val) << "\n";
using namespace std;
using ll = long long;

int main(void){
    Cin(string, n1);
    Cin(string, n2);
    reverse(Range(n1));
    Cout(n1 == n2 ? "YES" : "NO");
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.lang.Math;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h =sc.nextInt();
        int a[] = new int[w];
        for(int i=0;i<a.length;i++){
            a[i]=i+1;
        }
        int l,m,n;
        for(int i=0;i<h;i++){
            String s= sc.next();
            String[] s1 =s.split(",");
            l = Integer.parseInt(s1[0])-1;
            m = Integer.parseInt(s1[1])-1;
            n = a[l];
            a[l]=a[m];
            a[m]=n;
        }
        for(int i=0;i<w;i++){
            System.out.println(a[i]);
        }
        sc.close();
    }
}


Measured memory_bytes: 26184
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#define MAX 5010

int r,g,b;
int main() {
	scanf("%d %d %d", &r, &g, &b);
	if((r * 100 + g * 10 + b)%4 ==0) {
		printf("YES\n");
		return 0;
	}
	printf("NO\n");
	return 0;
}


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

using ll = long long int;
using bigint = int64_t;

#define pll pair<ll, ll>
#define vll vector<ll>
#define vpll vector<pll>
#define lob lower_bound
#define upb upper_bound
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ins insert
#define mp make_pair
#define w(t) cin >> t;while(t--)
#define bitcount __builtin_popcount
#define endl "\n"
#define sz(s) (int)s.size()
#define mem(n,m) memset(n,m,sizeof(n))
#define deb(x) cout << #x << " = " << x << endl;
#define rep(i,n) for(ll i = 0; i < n; i++)
#define ren(i,n) for(ll i = n-1; i >= 0; i--)
#define all(x) x.begin(),x.end()
#define fo(i, a, b) for(ll i = a; i <= b; i++)
#define ffo(i, a, b) for(ll i = a; i >= b; i--)
#define ffi(i,a,b,c) for(ll i = a ; i <= b ; i += c)
#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
const int MOD = 1000000007;

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

void solve(){
   ll n, m;
   cin >> n >> m;
   if(m>=n){
   	cout << "Yes\n";
   }
   else{
   	cout << "No\n";
   }
}

int main(){
    IOS;
    //io_set();
    ll tt = 1;
    //cin >> tt;
    while(tt--){
        solve();
    }
    return 0;
} 

Measured memory_bytes: 256
import java.util.*;

public class Main {
  static int[][] rowLeftBlock;
  static int[][] rowRightBlock;
  static int[][] colUpperBlock;
  static int[][] colLowerBlock;
  static int H;
  static int W;
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    H = sc.nextInt();
    W = sc.nextInt();
    rowLeftBlock = new int[H][W];
    rowRightBlock = new int[H][W];
    colUpperBlock = new int[H][W];
    colLowerBlock = new int[H][W];
    sc.nextLine();
    String[] S = new String[H];
    for (int i = 0; i < H; i++) {
      S[i] = sc.nextLine();      
    }
    for (int i = 0; i < H; i++) {
      int left = -1;
      int right = W;
      for (int j = 0; j < W; j++) {
        if(S[i].charAt(j) == '#') left = j;
        if(S[i].charAt(W-1-j) == '#') right = W-1-j;
        rowLeftBlock[i][j] = left;
        rowRightBlock[i][W-1-j] = right;
      }
    }
   
    for (int j = 0; j < W; j++) {
      int lower = H;
      int upper = -1;
      for (int i = 0; i < H; i++) {
        if(S[i].charAt(j) == '#') upper = i;
        if(S[H-1-i].charAt(j) == '#') lower = H-1-i;
        colUpperBlock[i][j] = upper;
        colLowerBlock[H-1-i][j] = lower;
        
      }
    }
    int best = 0;
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {      
        if(S[i].charAt(j) == '#') {
          continue;
        } else {
          int candidate = rowRightBlock[i][j] - rowLeftBlock[i][j] - 1;
          candidate += colLowerBlock[i][j] - colUpperBlock[i][j] - 1;
          candidate--;
          best = Math.max(best, candidate);
        }
      }
    }
    System.out.println(best);    
  }
}

Measured memory_bytes: 142860
N = int(input())
a = list(int(i) for i in input().split())
A =[]
A.append(0)
A.extend(a)
A.append(0)
s = 0
for j in range(N+1):
    s += abs(A[j+1]-A[j])
for i in range(1, N+1):
    ans = s -(abs(A[i+1]-A[i])+abs(A[i]-A[i-1]))+abs(A[i+1]-A[i-1])
    print(ans)


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

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str = br.readLine();
		char c[] = str.toCharArray();

		for (int i = 0; i < c.length; i++) {
			int a = (c[i] + n);
			if (a >= 91)
				a -= 26;
			System.out.print((char) (a));
		}
		System.out.print("\n");
	}
}

Measured memory_bytes: 25300
package main

import (
	"fmt"
)

func main() {
	var s string
	_, _ = fmt.Scan(&s)
	
	fmt.Println(answer160A(s))
}

func answer160A(s string) string {
	c3, c4 := string(s[2]), string(s[3])
	c5, c6 := string(s[4]), string(s[5])

	if (c3 == c4) && (c5 == c6) {
		return "Yes"
	}
	return "No"
}


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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n;
  cin >> n;
  vector<int64_t> a(n);
  for (auto& e : a) {
    cin >> e;
  }
  sort(a.rbegin(), a.rend());
  int64_t width = -1;
  for (int i = 0; i < n - 1; ++i) {
    if (a[i] == a[i+1]) {
      if (width == -1) {
        width = a[i];
        ++i;
      } else {
        cout << width * a[i] << "\n";
        return 0;
      }
    }
  }
  cout << "0\n";
}


Measured memory_bytes: 1024
line = gets.chomp.split.map(&:to_i)

n = line[0]
m = line[1]

favorite_food = Array.new(m, 0)

n.times do
    line = gets.chomp.split.map(&:to_i)
    line.delete_at(0)
    line.each do |food|
        favorite_food[food - 1] += 1
    end
end

ans = 0
favorite_food.each do |num|
    ans += 1 if n == num
end

puts ans


Measured memory_bytes: 1788
#include<iostream>
#include<queue>
#include<algorithm>
#include<map>

using namespace std;

const int SIZE = 13;

struct Puzzle{
  short c[SIZE];
  
  void move(int d, int n){
    if(d == 0) moveUp(n);
    if(d == 1) moveDown(n);
    if(d == 2) moveLeft(n);
    if(d == 3) moveRight(n);
  }
  // n = choosed blank number 0(first one) or 1(second one)
  void moveUp(int n){
    int pos = findBlankPosition(n);
    int tmp[] = {-1,-1,0,-1,-1,1,2,3,-1,5,6,7,10};
    
    int npos = tmp[pos];
    if(npos != -1) swap(c[pos],c[npos]);
  }

  void moveDown(int n){
    int pos = findBlankPosition(n);
    int tmp[] = {2,5,6,7,-1,9,10,11,-1,-1,12,-1,-1};
    
    int npos = tmp[pos];
    if(npos != -1) swap(c[pos],c[npos]);
  }

  void moveLeft(int n){
    int pos = findBlankPosition(n);
    int tmp[] = {-1,-1,1,2,-1,4,5,6,7,-1,9,10,-1};
    
    int npos = tmp[pos];
    if(npos != -1) swap(c[pos],c[npos]);
  }

  void moveRight(int n){
    int pos = findBlankPosition(n);
    int tmp[] = {-1,2,3,-1,5,6,7,8,-1,10,11,-1,-1};
    
    int npos = tmp[pos];
    if(npos != -1) swap(c[pos],c[npos]);
  }

  int findBlankPosition(int n){
    for(int i = 0; i < SIZE; i++){
      if(c[i] == 0) n--;
      if(n < 0) return i;
    }
    return -1;
  }

  bool operator < (const Puzzle& p) const {
    for(int i = 0; i < SIZE; i++)
      if(c[i] != p.c[i]) return c[i] < p.c[i];
    return false;
  }
};

Puzzle puz;

bool input(){
  cin >> puz.c[0];
  if(puz.c[0] == -1) return false;
  for(int i = 1; i < SIZE; i++) cin >> puz.c[i];
  return true;
}

void solve(){
  map<Puzzle, int> M;
  M[puz] = 1;
 
  queue<Puzzle> Q;
  Q.push(puz);

  while(!Q.empty()){
    Puzzle now = Q.front(); Q.pop();
  
    for(int i = 0; i < 4; i++)
      for(int j = 0; j < 2; j++){
	Puzzle nex = now;
	nex.move(i,j);
	if(M[nex] > M[now]+1|| M[nex] == 0){
	  M[nex] = M[now]+1;
	  if(M[nex] < 11) Q.push(nex);
	}
      }
  }

  Puzzle tmp;
  for(int i = 0; i < SIZE; i++) tmp.c[i] = i%(SIZE-1);

 
  int ans = 25;
  Q.push(tmp);
  map<Puzzle,int> MG;
  MG[tmp] = 1;

  while(!Q.empty()){
    Puzzle now = Q.front(); Q.pop();
    if(M[now] != 0) ans = min(ans,M[now]+MG[now]-2);
    for(int i = 0; i < 4; i++)
      for(int j = 0; j < 2; j++){
	Puzzle nex = now;
	nex.move(i,j);
      
        if(MG[nex] > MG[now]+1 || MG[nex] == 0){
	  MG[nex] = MG[now]+1;
	  if(MG[nex] <= 11) Q.push(nex);
	}
      }
    }
    if(ans <= 20) cout << ans << endl;
    else cout << "NA" << endl;
}

int main(){
  while(input()) solve();
  return 0;
}

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

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;

#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()

int main(){
    ll n;
    cin >> n;
    vll a(n), b(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];

    priority_queue<pair<ll, ll>> q;
    rep(i, n) q.push({b[i], i});
    ll count = 0;
    while(!q.empty()){
        auto e = q.top();
        q.pop();
        ll c = e.second;
        ll l = (e.second-1+n) % n;
        ll r = (e.second+1) % n;
        if(b[c]>=a[c]+b[l]+b[r]){
            count += (b[c]-a[c])/(b[l]+b[r]);
            b[c] = a[c] + (b[c]-a[c])%(b[l]+b[r]);
            if(b[c]==a[c]) continue;
        }
        else if(b[c]==a[c]) continue;
        else{
            cout << -1 << endl;
            return 0;
        }
        q.push({b[c], c});
    }
    cout << count << endl;
}


Measured memory_bytes: 9456
#include<iostream>
using namespace std;
int main(){
  string S;
  cin >> S;
  bool flag = false;
  if(stoi(S.substr(0,4)) < 2019) flag=true;
  else if(stoi(S.substr(0,4)) == 2019){
    if(stoi(S.substr(5,2)) < 4) flag=true;
    else if(stoi(S.substr(5,2)) == 4){
      if(stoi(S.substr(8,2)) <=30) flag=true;
    }
  }
  if(flag == true) cout << "Heisei" << endl;
  else cout << "TBD" << endl;
  return 0;
} 

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)) {
			while(true) {
				String str = sc.next();
				if (str.equals("-"))	break;
				
				int m = sc.nextInt();
				for(int i=0; i<m; i++) {
					int h = sc.nextInt();
					
					String s = str.substring(h,str.length()) + str.substring(0,h);
					str = s;
			//		System.out.println(str);
				}
				System.out.println(str);
			}
			
			
			
		}
	}
}


Measured memory_bytes: 26544
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
using namespace std;

int main(void) {
	string o, e;
	char ans[100];
	cin >> o >> e;
	for (int i = 0; i < o.size() - 1; i++) {
		ans[2 * i] = o[i];
		ans[2 * i + 1] = e[i];
	}
	ans[2 * (o.size() - 1)] = o[o.size() - 1];
	if (o.size() == e.size())ans[2 * (o.size()-1)+1] = e[o.size() - 1];
	for (int i = 0; i < o.size() + e.size(); i++) {
		cout << ans[i];
	}
	
	return 0;
}

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

using namespace std;

int main(void)
{

  /* Variable_Proclamation */
  int N, M; // input

  int i, j; // subscript

  // int s_cnt, t_cnt;
  // int kinds;
  int ans; // output

  string s, t;
  // int point;

  /* Input, Array_Proclamation */
  ans = 0;
  cin >> N;
  map<string, int> score;

  for (i = 0; i < N; i++)
  {
    cin >> s;
    (score.count(s))? score[s]++: score[s] = 1;
  }

  cin >> M;

  for (i = 0; i < M; i++)
  {
    cin >> t;
    (score.count(t))? score[t]--: score[t] = -1;
  }

  for(auto p: score)
  {
    int value = p.second;
    ans = max(ans, value);
  }

  cout << ans << endl;
  return 0;



  // string types;
  // vector<int> money(N);

  /* Initialize */
  // kinds = 0;
  // max = 0;

  /* Calculation */

  // while(s.size() != 0)
  // {

  //   s_cnt = 0;
  //   t_cnt = 0;

  //   types = s.at(0);

  //   for(j=0; j<N; j++)
  //   {

  //     if(s.size() == 0)
  //     {
  //       break;
  //     }
  //     else if(types == s.at(j))
  //     {

  //       swap(s.at(j), s.at(N-1));
  //       s.pop_back();
  //       j--;
  //       N--;

  //       s_cnt++;

  //     }

  //   }

  //   for(j=0; j<M; j++)
  //   {

  //     if(t.size() == 0)
  //     {
  //       break;
  //     }
  //     else if(types == t.at(j))
  //     {

  //       swap(t.at(j), t.at(M-1));
  //       t.pop_back();
  //       j--;
  //       M--;

  //       t_cnt++;

  //     }

  //   }

  //   money.at(kinds) = s_cnt - t_cnt;
  //   kinds++;

  // }

  /* Output */
  // for (i = 0; i < kinds; i++)
  // {
  //   if (max < money.at(i))
  //   {
  //     max = money.at(i);
  //   }
  // }

  // cout << max << endl;

  // return 0;
}


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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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

template<typename T>
void print1(T begin, T end) {
	while (begin != end) {
		cerr << (*begin) << " ";
		*begin++;
	}
	cerr << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
	for (int i = 0; i < height; i++) {
		for (int j = 0; j < width; j++) {
			cerr << " " << Array[i][j];
		}
		cerr << endl;
	}
}

void print() { std::cerr << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
	std::cerr << head << " ";
	print(std::forward<Tail>(tail)...);
}

template<class T>
void Add(T &a, const T &b, const T &mod=1000000007) {
	int val = ((a % mod) + (b % mod)) % mod;
	if (val < 0) { val += mod; }
	a = val;
}

template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }

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

signed main() {
	int a,p;
	cin >> a>>p;
	int k = a*3 + p;
	cout << k / 2 << endl;

	return 0;
}

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

namespace Atcoder
{
    class AtCodeeeeeeeeeeeeeeeeeeeer
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] L = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int lMAX = L.Max();
            int lremain = L.Sum() - lMAX;
            Console.WriteLine(
                lMAX<lremain?"Yes":"No"
                );
        }
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    int N;
    cin >> N;
    vector<int> a( N );
    for( auto &x : a )
    {
        cin >> x;
    }
    cout << *max_element( ALL( a ) ) - *min_element( ALL( a ) ) << endl;
    return 0;
}

Measured memory_bytes: 256
n,m,c = map(int,input().split())
Bs = list(map(int, input().split()))
Aslist = [list(map(int, input().split())) for i in range(n)]

cnt = 0
for As in Aslist:
    total = 0
    for A,B in zip(As,Bs):
        total += A * B
    if total + c > 0:
        cnt += 1
        
print(cnt)

Measured memory_bytes: 3060
using System;
using static System.Console;
using static System.Math;
using System.Numerics;
using System.Collections.Generic;
using System.Linq;


namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var s = myRead.reatStr();
            int ans = 0;
            int num = 0;
            for (int i = 0; i < 3; i++)
            {
                if (s[i] == 'R')
                    num++;
                else
                    num = 0;
                if (num > ans)
                {
                    ans = num;
                }
            }
            WriteLine(ans);
        }
    }
    public static class myRead
    {
        public static int readInt() { return int.Parse(ReadLine()); }
        public static long readLong() { return long.Parse(ReadLine()); }
        public static string reatStr() { return ReadLine(); }
        public static int[] readIntArray() { return ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        public static long[] readLongArray() { return ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        public static string[] readStrArray() { return ReadLine().Split(' '); }
    }


    public static class MyMath
    {
        public static long Factorical(long n)
        { return n <= 1 ? 1L : n * Factorical(n - 1); }
        public static long Permutation(long n, long m)
        { return m == 0 ? 1L : (m == n) ? Permutation(n, m - 1) : n * Permutation(n - 1, m - 1); }
        public static long Combination(long n, long m)
        { return n - m > m ? Permutation(n, m) / Factorical(m) : Permutation(n, n - m) / Factorical(n - m); }
        public static long Gcd(long n, long m)
        { return n % m == 0 ? m : Gcd(m, n % m); }
        public static long Lcm(long n, long m)
        { return n * m / Gcd(n, m); }
        public static long Pow(long n, long m)
        { return m == 0 ? 1L : m == 1 ? n : n * Pow(n, m - 1); }
    }


}

Measured memory_bytes: 25960
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse4")

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

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const ld EPS = 1e-6;
const int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};
const char nl = '\n';

template <typename T> inline T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <typename T> inline T lcm(T a, T b) { return a / gcd(a, b) * b; }
template <class T> void ckmin(T& a, T b) { a = min(a, b); }
template <class T> void ckmax(T& a, T b) { a = max(a, b); }

// (Integer/Long).bitCount(x)
int pct(int x) { return __builtin_popcount(x); }
int pctll(ll x) { return __builtin_popcountll(x); }

void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
void setIO(string s = "") {
	unsyncIO();
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
}

// Binary Exponentiation
ll pow(ll b, ll e, ll m = 0LL, ll ans = 1LL) { while (e) { if (e & 1LL) { ans *= b; if (m) ans %= m; } b *= b, e >>= 1LL; if (m) b %= m; } return ans; }



void solve(int tcn) {
	int n, x, t;
	cin >> n >> x >> t;
	int ans = (n + x - 1) / x * t;
	cout << ans << nl;
}

int main() {
    setIO();

    int t = 1; //cin >> t;
	for (int i = 1; i <= t; ++i) {
		//cout << "Case #" << i << ": ";
		solve(i);
	}
	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <string.h>
int main() 
{ 
    string s;cin>>s;
    long int length=s.length();
    long long int sum=0;
    while(length--){
        //cout<<s[length]-48<<" ";
        sum+=s[length]-48;
    }
    if (sum%9==0)cout<<"Yes";
    else cout<<"No";
        
}         

Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    ll x;
    cin >> x;

    for (int i = -119; i <= 119; i++) {
        for (int j = -119; j <= 119; j++) {
            ll c = pow(i, 5) - pow(j, 5);
            if (c == x) {
                cout << i << ' ' << j << '\n';
                return 0;
            }
        }
    }
}


Measured memory_bytes: 4016
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr int inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
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;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
int main() {
    int a,b;cin >> a >> b;
    if(a%2==0||b%2==0)cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}

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

int main()
{
  int N, X, m;
  int min_m = 1000;
  int sum = 0;

  cin >> N >> X;
  for (int i = 0; i < N; i++)
  {
    cin >> m;
    min_m = min(m, min_m);
    sum += m;
  }
  X -= sum;
  cout << N + X / min_m << endl;;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
#define INF 1e18
#define MOD 1000000007
#define N 1000005
#define BB(V) V[V.size()-2]
#define ex(V) return printf(V),0
using namespace std;
int n,a[200005],b[600005];
int main(){
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d",a+i);
	for(int i=0;i<n;i++)scanf("%d",b+i);
	int ans=0;
	for(int i=28;i>=0;i--){
		ll t=0;
		sort(b,b+n);
		for(int j=0;j<2*n;j++)b[j+n]=b[j]+(2<<i);
		for(int j=0;j<n;j++){
			t+=lower_bound(b,b+3*n,(4<<i)-a[j])-lower_bound(b,b+3*n,(3<<i)-a[j]);
		}
		if(t%2)ans+=(1<<i);
		for(int j=0;j<n;j++)a[j]%=(1<<i),b[j]%=(1<<i);
	}
	printf("%d",ans);
}

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

#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

typedef tree<
ll,
null_type,
less<ll>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
// ordered_set X;
// *X.find_by_order(i) = ith largest element (counting from zero)
// X.order_of_key(k) = number of items in X < k (strict lt)
int main(){
    string S;
    int K;

    cin >> S;
    cin >> K;

    int N = S.length();

    vi dpr1(K+1, 0);
    vvi dpr2(N+1, dpr1);
    vector<vvi> dp(N+1, dpr2); // dp[i][j][k]

    for (int len=1;len<=N;len++) {
        for (int i=0;i+len<=N;i++) {
            for(int k=0;k<=K;k++) {
                int j = i+len;
                if (k > 0) dp[i][j][k] = max(dp[i][j][k], dp[i][j][k-1]);

                if (S[i] == S[i+len-1]) {
                    if (len == 1) dp[i][j][k] = max(dp[i][j][k], 1 + dp[i+1][j-1][k]);
                    else dp[i][j][k] = max(dp[i][j][k], 2 + dp[i+1][j-1][k]);
                }

                dp[i][j][k] = max(dp[i][j][k], dp[i][j-1][k]);
                dp[i][j][k] = max(dp[i][j][k], dp[i+1][j][k]);

                if (k > 0) {
                    if (len == 1) dp[i][j][k] = max(dp[i][j][k], 1 + dp[i+1][j-1][k-1]);
                    else dp[i][j][k] = max(dp[i][j][k], 2 + dp[i+1][j-1][k-1]);
                }
            }
        }
    }

    cout << dp[0][N][K] << endl;
    
}


Measured memory_bytes: 110336
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

int main ()
{
    int k, a, b;
    cin >> k >> a >> b;
    if (a <= (b / k) * k)
        cout << "OK";
    else
        cout << "NG";
}


Measured memory_bytes: 3632