akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
using namespace std;
int main(){
    int n;

    while(scanf("%d",&n),n){
        int cnt = 0;
        for(;;){
            if(n == 1)break;
            if(n%2 == 0)n /= 2;
            else n = (n*3)+1;
            cnt++;
        }
        printf("%d\n",cnt);
    }
    return 0;
}

Measured memory_bytes: 1028
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
#define MOD (long long)1000000007
using namespace std;

int main(void){
    int n;
    string s;
    cin >> n >> s;
    vector<int> black(n+1,0),white(n+1,0);
    for(int i=0; i<n; i++){
        black[i+1]=black[i];
        white[i+1]=white[i];
        if(s[i]=='#')black[i+1]++;
        else white[i+1]++;
    }
    int ans=black[n];
    for(int i=0; i<=n; i++){
        ans=min(ans,black[i]+(white[n]-white[i]));
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2180
#include<bits/stdc++.h>
using namespace std;
char s1[5],s2[5];
int main(){
	scanf("%s%s",s1+1,s2+1);
	int ans=0;
	if(s1[1]==s2[1])ans++;
	if(s1[2]==s2[2])ans++;
	if(s1[3]==s2[3])ans++;
	cout<<ans;
}

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

int main()
{
    int a,b,c,d,e;
    while(~scanf("%d %d",&a,&b))
    {
        c=a+b;d=a-b;e=a*b;
        if(c>=d&&c>=e)
            printf("%d\n",c);
        else if(d>=c&&d>=e)
            printf("%d\n",d);
        else
            printf("%d\n",e);
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 20000;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    Yes(n/10 == 9 || n%10 == 9);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define qwq(x) cerr<<" #"<<#x<<" = "<<x<<endl;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;
 
template<class T> inline void read(T &x){
	int f=0;x=0;char ch=getchar();
	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');
	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';
	if(f)x=-x;
}

const int N=1000005;
ll f[N],g[N],x[N],E,T;
int n;

int main(){
	read(n),read(E),read(T);
	rep(i,1,n)read(x[i]);
	memset(f,0x3f,sizeof f);
	memset(g,0x3f,sizeof g);
	f[0]=0;
	rep(i,1,n){
		int t=lower_bound(x+1,x+n+1,x[i]+(T+1)/2)-x;
//		printf("%d  ->  %d\n",i-1,t);
		g[t]=min(g[t],f[i-1]+x[i]-x[i-1]+3ll*(x[t]-x[i]));
		f[t-1]=min(f[t-1],f[i-1]+x[i]-x[i-1]+T+(x[t-1]-x[i]));
		g[i]=min(g[i],g[i-1]+3ll*(x[i]-x[i-1]));
		f[i]=min(f[i],g[i]);
//		printf("%d   %lld  %lld\n",i,f[i],g[i]);
	}
	printf("%lld\n",f[n]+E-x[n]);
	return 0;
}


Measured memory_bytes: 18304
#include <stdio.h>

int main() {

  int i, n, a[100];
  scanf("%d", &n);
  for (i = 0; i < n; i++){
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++){
    printf("%d", a[n - i - 1]);
    if (i < n - 1)
      printf(" ");
  }
  printf("\n");

  return 0;

}

Measured memory_bytes: 600
#include<bits/stdc++.h>
#define mod 1000000009
#define int long long
#define garou ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
int pow(int p,int r){
	int ans=1;
	while(r>0){
     if(r&1){
		 ans=((ans%mod)*(p%mod))%mod;
	 }
	 r=r>>1;
     p=((p%mod)*(p%mod))%mod;
	}
	return ans;
}
signed main() {
	 garou;
    int x,y,z;
	cin>>x>>y>>z;
	swap(x,y);
	swap(x,z);
	cout<<x<<' '<<y<<' '<<z;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

int main() {
  string s,t;
  cin>>s>>t;
  bool ok = false;
  rep(i,sz(s)){
    if(s == t)ok = true;
    char c = s.back();s.pop_back();
    s = c+s;
  }
  puts(ok?"Yes":"No");
  return 0;
}

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

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

void fastIO()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

}

int main()
{

    textIO();
    fastIO();

    long long n;
    cin >> n;
    string ans;

    while(n){
        n--;
        ans+=(char('a'+(n%26)));
        n/=26;

    }
    reverse(ans.begin(), ans.end());

    cout << ans << '\n';

    return 0;
}


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

int main(){
  multimap<string, int> M;
  int q, query, x;
  string key, L, R;
  cin >> q;
  for(int i = 0; i < q; i++){
    cin >> query;
    if(query == 0){
      cin >> key >> x;
      M.insert(make_pair(key, x));
    }else if(query == 1){
      cin >> key;
      for(auto it = M.lower_bound(key); it != M.end() && it->first == key; it++){
         cout<<it->second<<endl;
       }
    }else if(query == 2){
      cin >> key;
      M.erase(key);
    }else{
      cin >> L >> R;
      auto lb = M.lower_bound(L);
      auto ub = M.upper_bound(R);
      for(auto it = lb; it !=  ub; it++){
        cout<< it->first << " " << it->second << endl;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 24756
#include <bits/stdc++.h>
using i64 = long long;

template <class T = int>
class UF {
    T *par;

    public:
    UF(T n) : par(new T[n]) {
        for (T i = 0; i < n; i++) par[i] = i;
    }
    ~UF() { delete[] par; }

    T root(T x) {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    bool same(T x, T y) {
        return root(x) == root(y);
    }

    void unite(T x, T y) {
        x = root(x);
        y = root(y);
        if (x != y) par[x] = y;
    }
};

int main() {
    i64 n, m;
    std::cin >> n >> m;
    std::vector<int> a(m), b(m);
    for (int i = 0; i < m; i++) {
        std::cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
    }

    std::deque<i64> q { n * (n - 1) / 2 };
    UF<> uft(n);
    std::vector<i64> size(n, 1);
    for (int i = m - 1; i > 0; i--) {
        if (uft.same(a[i], b[i])) {
            q.push_front(q.front());
            continue;
        }
        auto c = size[uft.root(a[i])], d = size[uft.root(b[i])];
        uft.unite(a[i], b[i]);
        size[uft.root(a[i])] = c + d;
        q.push_front(q.front() - c * d);
    }
    for (auto el : q) std::cout << el << std::endl;

    return 0;
}


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

//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (n - 1); i > (a - 1); --i)
#define arep(i, x) for (auto && (i) : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define rirep(i, x) for (auto i = (x).rbegin(); i != (x).rend(); ++i)
//降順はgreater<T>()
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
// gcd lcmはそのままok
#define gcd(a, b) __gcd(a, b)
#define bits(n) (1LL << (n))
#define pcnt(x) __builtin_popcountll(x)
//配列内等要素削除
#define Unique(x) (x).erase(unique((x).begin(), (x).end()), (x).end())
#define Fixed(n) fixed << setprecision(n)
//総和
#define sowa(n) (((n) * ((n) + 1)) / 2)
#define updiv(a, b) ((a + b - 1) / b)
#define cauto const auto &
using P = pair<int, int>;
using Graph = vector<vector<P>>;
template <class T>  //昇順
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T>  //降順
using max_heap = priority_queue<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class A>
using uset = unordered_set<A>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {  //多次元初期化
  std::fill((T *)array, (T *)(array + N), val);
}
template <class A, class B>
bool chmax(A &a, const B &b) {  //最大値更新 返り値はbool
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class A, class B>
bool chmin(A &a, const B &b) {  //最小値更新 返り値はbool
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, 1, 1, -1, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9 + 7;
constexpr int mod2 = 998244353;
//} END

signed main(void) {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  string s;
  cin >> s;
  if (s[s.size() - 1] != 's')
    s.push_back('s');
  else
    s.push_back('e'), s.push_back('s');
  cout << s << '\n';
  return 0;
}

Measured memory_bytes: 3640
N=int(input())
T=list(map(int,input().split()))
M=int(input())
P=[list(map(int,input().split())) for _ in range(M)]

T_sum=sum(T)
drink_result=0
for i in range(M):
    print(T_sum-T[P[i][0]-1]+P[i][1])

Measured memory_bytes: 3064
// In the name of Allah the Lord of the Worlds.

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

typedef long long ll;

struct s{
    string name;
    int score , idx;
    s(string _name , int _score , int _idx){
        name = _name;
        score = _score;
        idx = _idx;
    }
};

bool cmp(s A , s B)
{
    if(A.name==B.name){
        return A.score>B.score;
    }
    return A.name<B.name;
}

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

    int n;
    cin >> n;
    vector
v;
    for(int i=0;i<n;i++){
        string name;
        int score;
        cin >> name >> score;
        v.push_back(s(name, score , i+1));
    }
    sort(v.begin() , v.end() , cmp);
    for(int i=0;i<n;i++){
        cout << v[i].idx << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//(a+b-1)/b

signed main(){
	string s; cin>>s;
	int a=0,b=0;
	rep(i,0,s.size()){
		if(s[i]=='1')a++;
		else b++;
	}
	cout<<min(a,b)*2<<endl;
	
}

Measured memory_bytes: 3764
import math
import decimal
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

class Library():
    @staticmethod
    def Swap(a,b):
        return [b,a]

    @staticmethod
    def myRound(a,dig=0): # 四捨五入
        p = 10 ** dig
        return (a * p * 2 + 1) // 2 / p

    @staticmethod
    def Roundup(a,dig=0): # 切り上げ
        if a < 0:
            return int(a)
        else:
            return int(a + 0.9)

    @staticmethod
    def Gcd(a,b): #最大公約数
        if (a<b):
            a,b = Library.Swap(a,b)
        if (b==0):
            return a
        else:
            return Library.Gcd(b,a%b)

    @staticmethod
    def Lcm(a,b): #最小公倍数
        return a//Library.Gcd(a,b)*b

    @staticmethod
    def Divisors(a): # 約数列挙
        divisors = []
        for i in range(1,int(a**0.5)+1):
            if a%i==0:
                divisors.append(i)
                if i!=a//i:
                    divisors.append(a//i)
        divisors.sort()
        return divisors

class Prime():
    # コンストラクタ
    # エラストテネスの篩
    def __init__(self,num):
        self.num = num
        self.sieve = [0] * (self.num + 1)
        self.sieve[0] = -1
        self.sieve[1] = -1
        for i in range(2,self.num + 1):
            if not self.sieve[i]:
                self.sieve[i] = i
                for j in range(i * i,self.num + 1,i):
                    if self.sieve[j]:
                        self.sieve[j] = i
    
    # 素数判定
    def isPrime(self,num = None):
        if num is None:
            num = self.num
        if self.sieve[num] == num:
            return True
        else:
            return False
    
    # 素数列挙
    def PrimeNum(self,num = None):
        if num is None:
            num = self.num
        prime = []
        for i in range(2,num):
            if self.sieve[i] == i:
                prime.append(i)
        return prime
    
    # 素因数分解
    def PrimeFact(self,num = None):
        if num is None:
            num = self.num
        fact = []
        while self.sieve[num] != num:
            fact.append(self.sieve[num])
            num //= self.sieve[num]
        fact.append(num)
        return fact

def main():
    h = int(input())
    ans = 0
    enemy = 1
    while h != 0:
        ans += enemy
        if h == 1:
            h -= 1
        else:
            h //= 2
        enemy *= 2
    print(ans)
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 60396
import collections

n=int(input())
a=list(map(int,input().split()))

sums=[0]*(len(a)+1)
for i in range(len(a)):
  sums[i+1]=sums[i]+a[i]
  
counter=collections.Counter(sums)
cnt=0
for val in counter.values():
  if val>1:
    cnt+=(val*(val-1))//2

print(cnt)

Measured memory_bytes: 41672
#include <iostream>
#include <vector>

int main()
{
    int n; std::cin >> n;
    std::vector<int> v(n);
    for (int i = 0; i < n; i++)
    {
        std::cin >> v[i];
        v[i]--;
    }
    int cnt = 0;
    for (int i = 0; i < n; i++)
    {
        if (i == v[v[i]])
        {
            cnt++;
        }
    }
    std::cout << (cnt/2) << std::endl;
    return 0;
}


Measured memory_bytes: 640
N = int(input())
L = []
for i in range(1,N+1):
    if i %3 ==0:
        L.append(i)
    elif '3' in str(i):
        L.append(i)

word = ""
for i in range(len(L)):
    word =  word + " "+str(L[i])

print(word)



Measured memory_bytes: 5848
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
typedef long long ll;

int main(void) {
  ll x;
  scanf("%lld", &x);
  ll rem = x % 11;
  printf("%lld\n", rem == 0 ? x/11*2 : rem < 7 ? x/11*2+1 : x/11*2+2);
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String t = scan.next();
		boolean ok = true;
		for(int i = 0;i < s.length(); ++i){
			if (s.charAt(i) != t.charAt(i)){
				ok = false;
			}
		}

		System.out.print(ok?"Yes":"No");

	}

}


//end

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

int main(){
    int way[15] = {0,1,2,3,4,5,6,7,8,9,5,4,3,2,1};

    int n, from, to, ansf, anst;
    cin >> n;

    for(int i = 0; i < n; i++){
        int length = 20;
        cin >> from >> to;
        for(int start = 0; start < 15; start++){
            if(way[start] == from){
                int tmp = 1;
                int now = start;
                while(way[now] != to){
                    tmp++;
                    now = (now+1)%15;
                }

                if(length > tmp){
                    ansf = start;
                    anst = now;
                    length = tmp;
                }

            }
        }

        for(int i = 0; i < length; i++){
            if(i)   cout << " ";
            cout << way[(ansf+i)%15];
        }
        cout << endl;

    }

    return 0;
}


Measured memory_bytes: 3028
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);i++)
#define erep(i,a,b) for(int i=a;i<=(int)(b);i++)
#define per(i,a,b) for(int i=(b)-1;i>(a);i--)
#define eper(i,a,b) for(int i=((int)(a));i>=b;i--)
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
const int INF=(1<<30)-1;
const int MOD=1000000007;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}

vector<int> v(100005);
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    int n; cin >> n;
    rep(i, 0, n) {
        int x; cin >> x;
        v[x]++;
    }
    ll ans = 1LL;
    rep(i, 0, 100005) {
        if (v[i] % 2) {
            if (i == 0 && n%2) continue;
            ans = 0; 
            break;
        } else {
            if (v[i] == 0) continue;
            ans = ans * v[i] % MOD;
        }
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 640
#include <cstdio>
#include <cmath>
#include <limits>
#include <algorithm>
#include <cassert>
#include <vector>
#include <utility>
#include <string>
#include <iostream>

int main()
{
	using namespace std;
    int r,g,b;
	cin >> r >> g >> b;
    int n = g*10 + b;
    if (n%4==0) cout << "YES" << endl;
    else cout << "NO" << endl;
	return 0;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

ll h, w;

int main() {
    fastio();

    cin >> h >> w;

    if (h == 1 || w == 1) {
        cout << 1 << endl;
        return 0;
    }

    ll a = ((h + 1) / 2) * ((w + 1) / 2);
    ll b = (h / 2) * (w / 2);

    cout << a + b << endl;

    return 0;
}

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

int main() {
	
	int n;
	cin >> n;
	if(n % 2 == 0) cout << n << endl;
	else cout << n * 2 << endl;
	
	return 0;
}

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

int compare(const void *a, const void *b) {
    return *(int*)b-*(int*)a;
}

int main(void) {
    int n, i, a=0, b=0;
    int array[999];
    scanf("%d", &n);
    for (i=0;i<n;i++)scanf("%d", &array[i]);
    qsort(array, n, 4, compare);
    for (i=0;i<n;i++) {
        if (i%2==0)a+=array[i];
        else b+=array[i];
    }
    printf("%d\n", a-b);
    return 0;
}

Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define inf 20021225
#define ll long long
using namespace std;
int a[(1<<18)|1];
int mx[1<<18][2];
int ans[1<<18];
bool cmp(int x,int y){return a[x]<a[y];}
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<(1<<n);i++)
	{
		scanf("%d",&a[i]);
		mx[i][0] = i;
		mx[i][1] = (1<<n);
	}
	for(int i=0;i<(1<<n);i++)
	{
		int tmp[4]={0};
		for(int j=0;j<n;j++)
			if((i>>j)&1)
			{
				int _i = i^(1<<j);
				tmp[0] = mx[i][0]; tmp[1] = mx[i][1];
				tmp[2] = mx[_i][0]; tmp[3] = mx[_i][1];
				sort(tmp,tmp+4,cmp);
				mx[i][0] = tmp[3]; mx[i][1] = tmp[2]==tmp[3]?tmp[1]:tmp[2];
				//printf("%d %d\n",mx[i][0],mx[i][1]);
			}
		ans[i] = a[mx[i][0]] + a[mx[i][1]];
	}
	for(int i=1;i<(1<<n);i++)	ans[i] = max(ans[i],ans[i-1]);
	for(int i=1;i<(1<<n);i++)	printf("%d\n",ans[i]);
	return 0;
}

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

int main()
{
    string s, t;
    int ans = 0;
    cin >> s >> t;
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] == t[i])
            ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<string>K(N);
  vector<int>K_(N);
  for (int i = 0; i < N; i ++) cin >> K[i] >> K_[i];
  string X;
  cin >> X;
  int ans = 0;
  int i = N - 1;
  while(X != K[i]) {
    ans += K_[i];
    i --;
  }
  cout << ans << endl;
}

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

int main() {
  int N,M;
  cin>>N>>M;
  vector<string> A(N);
  rep(i,N) cin>>A[i];
  vector<string> B(M);
  rep(i,M) cin>>B[i];
  
  rep(i,N-M+1){
    rep(j,N-M+1){
      bool flag=true;
      for(int x=0;x<M;x++){
        for(int y=0;y<M;y++){
          if(A[i+x][j+y]!=B[x][y]) flag=false;
        }
      }
      if(flag) {
        puts("Yes");
        return 0;
      }
    }
  }
  puts("No");  
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#pragma warning(disable:4996)
using namespace std;

int coins[4] = { 10,50,100,500 };

int  getans(const int money, const vector<int>&nums) {
	int turi = -money;
	for (int i = 0; i < 4; ++i) {
		turi += coins[i] * nums[i];
	}
	if (turi < 0)return 99999999;

	vector<int>turicoins(4);
	for (int i = 3; i >= 0; --i) {
		turicoins[i] = turi / coins[i];
		turi -= turicoins[i] * coins[i];
	}
	for (int i = 0; i < 4; ++i) {
		if (turicoins[i] && nums[i])return 99999999;
	}

	return accumulate(turicoins.begin(), turicoins.end(), 0);
}

int main() {
	bool a = false;
	while (1) {
		int N; cin >> N;
		if (!N)break;
		if (a) {

			cout << endl;
		}
		a = true;

		vector<int>nums;
		int sum = 0;
		for (int i = 0; i < 4; ++i) {
			int a; cin >> a;
			sum += a;
			nums.push_back(a);
		}

		int minans = 99999999;
		vector<int>ans;
		for (int i = 0; i <= nums[0]; ++i) {
			for (int j = 0; j <= nums[1]; ++j) {
				for (int k = 0; k <= nums[2]; ++k) {
					for (int l = 0; l <= nums[3]; ++l) {
						vector<int>nums(4);
						nums[0] = i; nums[1] = j; nums[2] = k; nums[3] = l;
						int nans = sum - i - j - k - l + getans(N, nums);
						if (nans < minans) {
							minans = nans;
							ans = nums;
						}
					}
				}
			}
		}
		for (int i = 0; i < 4; ++i) {
			if (ans[i]) {
				cout << to_string(coins[i])<<" " << ans[i] << endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3280
#include <bits/stdc++.h>
using namespace std;
char A, B;
int main() {
    cin >> A >> B;
    if(A == 'H') {
        cout << B << endl;
    }else {
        if(B == 'H') {
            cout << 'D' << endl;
        }else {
            cout << 'H' << endl;
        }
    }
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

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

//main code

int main(int argc, char const* argv[])
{
    int k;
    cin >> k;
    if (k % 2 == 0) {
        cout << (k/2)*(k/2) << endl;
    }
    else {
        cout << (k/2)*(k/2+1) << endl;
    }
    return 0;
}


Measured memory_bytes: 384
a = gets.chomp.to_i
b = gets.chomp.to_i
c = gets.chomp.to_i
x = gets.chomp.to_i

count = 0

(0..a).each do |i|
  (0..b).each do |j|
    (0..c).each do |k|
      y = 500 * i + 100 * j + 50 * k
      if x == y then
        count += 1
      end
    end
  end
end

puts count.to_s

Measured memory_bytes: 1788
#include<bits/stdc++.h>
typedef long long ll;
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
int W[4010],n,K,fir[4010],dis[8010],nxt[8010],id;
void link(int a,int b){
	nxt[++id]=fir[a],fir[a]=id,dis[id]=b;
	nxt[++id]=fir[b],fir[b]=id,dis[id]=a;
}
int DFS(int x,int k,int fa=-1){
	if(k<0)return 0;
	int ret=x<=n;
	for(int i=fir[x];i;i=nxt[i])if(dis[i]!=fa)ret+=DFS(dis[i],k-1,x);
	return ret;
}
int main(){
#ifdef XZZSB
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	n=gi(),K=gi();int u,v;
	for(int i=1;i<n;++i)u=gi(),v=gi(),link(u,i+n),link(i+n,v);
	int ans=0;
	for(int i=1;i<n+n;++i)ans=std::max(ans,DFS(i,K));
	printf("%d\n",n-ans);
	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
#define INF 1000000007
#define fori for(int i=0;i<3;i++)

int main(){
	int x,y;
	cin>>x>>y;
	if(4*x-y<0||(4*x-y)%2||2*x>y)cout<<"No";
	else cout<<"Yes";
	return 0;
}

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


int main(){
        int c, g, l, r;
        cin >> c >> g;

        int min = 1;
        int max = c;

        for (int i = 0; i < g; ++i){
                cin >> l >> r;
                if (l > min){
                        min = l;
                }
                if (r < max){
                        max = r;
                }
        }
        if (max < min){
                cout << 0 << endl;
        }else{
                cout << max - min + 1  << endl;
        }
}

Measured memory_bytes: 256
A,B,C,D = list(input())

try:
	for op1 in "+-":
		for op2 in "+-":
			for op3 in "+-":
				f = A+op1+B+op2+C+op3+D
				if eval(f) == 7:
					raise f
except:
	print(f + "=7")


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
int x[5];
int main(){
	ios::sync_with_stdio(0);
	int ans=0;
	rep(i,5){
		cin>>x[i];
		if(x[i]==0)
		ans=i;
	}
	cout<<ans+1;
	re 0;
}

Measured memory_bytes: 3604
// https://www.geeksforgeeks.org/find-number-of-triangles-possible/

// C++ implementation of the above approach 
#include<bits/stdc++.h> 
using namespace std; 

void CountTriangles(vector <int> A){ 

   int n=A.size(); 

   sort(A.begin(), A.end()); 

   int count = 0; 
   
   for( int i = n-1; i >= 1; i--){ 
      int l = 0, r = i-1; 
      while( l < r){ 
         if( A[l] + A[r] > A[i]){ 

            // If it is possible with a[l], a[r] 
            // and a[i] then it is also possible 
            // with a[l+1]..a[r-1],a[r] and a[i] 
            count += r - l ; 

            //checking for more possible solutions 
            r--; 
         } 
         else

            // if not possible check for 
            // higher values of arr[l] 
            l++; 
      } 
   } 
   cout<<count;
   // cout<<"No of possible solutions: "<<count; 
} 
int main(){ 
   
   int n;
   cin >> n;

   vector<int> v(n);
   for(auto &i: v){
      cin >> i;
   }

   CountTriangles(v);
}   


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	int n; string s; cin >> s;
	for (int h = 0; h < s.size(); h++) {
		if (s[h] == 'D') { cout << 'A'; }
		if (s[h] == 'E') { cout << 'B'; }
		if (s[h] == 'F') { cout << 'C'; }
		if (s[h] == 'G') { cout << 'D'; }
		if (s[h] == 'H') { cout << 'E'; }
		if (s[h] == 'I') { cout << 'F'; }
		if (s[h] == 'J') { cout << 'G'; }
		if (s[h] == 'K') { cout << 'H'; }
		if (s[h] == 'L') { cout << 'I'; }
		if (s[h] == 'M') { cout << 'J'; }
		if (s[h] == 'N') { cout << 'K'; }
		if (s[h] == 'O') { cout << 'L'; }
		if (s[h] == 'P') { cout << 'M'; }
		if (s[h] == 'Q') { cout << 'N'; }
		if (s[h] == 'R') { cout << 'O'; }
		if (s[h] == 'S') { cout << 'P'; }
		if (s[h] == 'T') { cout << 'Q'; }
		if (s[h] == 'U') { cout << 'R'; }
		if (s[h] == 'V') { cout << 'S'; }
		if (s[h] == 'W') { cout << 'T'; }
		if (s[h] == 'X') { cout << 'U'; }
		if (s[h] == 'Y') { cout << 'V'; }
		if (s[h] == 'Z') { cout << 'W'; }
		if (s[h] == 'A') { cout << 'X'; }
		if (s[h] == 'B') { cout << 'Y'; }
		if (s[h] == 'C') { cout << 'Z'; }
	}
	cout << endl;
	cin >> n;
}


Measured memory_bytes: 3168
#include <bits/stdc++.h>
using intl = long long;
using itnl = long long;
using itn = int;
using ld = long double;
using namespace std;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define rrep(i, n) for(intl i = (intl)(n) - 1; i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define rrepi(i, a, b) for(intl i = (intl)(a); i > (intl)(b); i--)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,1,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define alength(a) (sizeof(a) / sizeof(a[0]))
#define cin(i, a) rep(i, alength(a))cin >> a[i]
#define ccin(i, j, a) rep(i, alength(a))rep(j, alength(a[i]))cin >> a[i][j]
#define debug(x) cout << #x << ":" << x << endl
#define rdebug(i,x) rep(i, alength(x))cout << #x << "[" << i << "]:" << x[i] << endl
#define sqrt sqrtl
#define itn int
#define double ld
#define pb push_back
#define mp make_pair
#define pii pair<intl,intl>
const intl INF = 1e9;
const intl MOD = 1e9+7;
const ld eps = 1.0e-14;//-9
void fp(bool f){cout << (f ? "Yes" : "No") << endl;}
void fp(bool f, string s, string t){cout << (f ? s : t) << endl;}
intl kai(intl k){
    intl a = 1;
    for(int i = 2; i <= k; i++){
        a *= i;
    }
    return a;
}
intl gcd(intl a, intl b){
    if(!b)return a;
    return gcd(b, a % b);
}
intl lcm(intl a,intl b){
    return a / gcd(a, b) * b;
}
intl digit10(intl a){
    intl b = 0;
    do{
        a /= 10;
        b++;
    }while(a);
    return b;
}
signed main(){
    cout << fixed << setprecision(10);
    string s;
    cin >> s;
    bool f = true;
    rep(i,s.length()){
        if(!(i%2))if(s[i] == 'L')f = false;
        if(i%2)if(s[i] == 'R')f = false;
    }
    fp(f);
    return 0;
}

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

int main() {
  int N,ans=0,light=0;
  cin>>N;
  int a[N];
  for(int i=0;i<N;i++){
    cin>>a[i];
    a[i]--;
  }
  while(light!=1){
    light=a[light];
    ans++;
    if(ans==N){
      cout<<-1;
      break;
    }
    else if(light==1){
      cout<<ans;
    }
    
  }
  
    
}


Measured memory_bytes: 640
#include<iostream>
#include<string>

using namespace std;

int main() {
	int N, M, ten = 0, max = 0;
	string s[110], t[110];

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> s[i];
	}
	cin >> M;
	for (int i = 0; i < M; i++) {
		cin >> t[i];
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (s[i] == s[j]) {
				ten++;
			}
		}
		for (int j = 0; j < M; j++) {
			if (s[i] == t[j]) {
				ten--;
			}
		}
		if (ten > max) {
			max = ten;
		}
		ten = 0;
	}
	cout << max << endl;



	return 0;
}

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

int main(){
    ll x;
    cin >> x;
    ll ans = x/11;
    ll rem = x - ans*11;
    ans *= 2;
    if(rem > 6) ans += 2;
    else if(rem == 0) ;
    else ans++;
    cout << ans << endl;
    return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
  int N, M;
  
  cin >> N >> M;
  
  vector<ll> A;
  ll sum = 0;
  
  for (int i = 0; i < N; i++) {
    ll _in;
    
    cin >> _in;
    
    sum += _in;
    A.push_back(_in);
  }
  
  sort(A.begin(), A.end());
  
  // point, count
  vector<pair<ll, ll>> B;
  
  for (int i = 0; i < M; i++) {
    ll in_count, in_point;
    
    cin >> in_count >> in_point;
    
    B.push_back(make_pair(in_point, in_count));
  }
  
  sort(B.begin(), B.end());
  
  int A_i = 0;
  
  for (int i = 0; i < M; i++) {
    if (A_i < N) {
      pair<ll, ll> b = B[M - 1 - i];
      
      for (int j = 0; j < b.second; j++) {
        if (A_i < N && A[A_i] < b.first) {
          sum += b.first - A[A_i];
          A_i++;
        } else {
          break;
        }
      }
    } else {
      break;
    }
  }
  
  cout << sum << endl;
  
  return 0;
}

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

int main(){
    ll n;
    cin >> n;
    ll a[n+1],b[n+1],c[n+1];
    a[0]=0;b[0]=0;c[0]=0;
    ll sum=0,sumx=0;
    for(int i=1;i<=n;++i){
        cin >> a[i];
        sum+=a[i];
        sumx^=a[i];
        b[i]=sum;
        c[i]=sumx;
    }
    ll ans=0;
    rep(i,n){
        ll j=i;
        ll k=n+1;
        while(j+1!=k){
            ll md=(j+k)/2;
            
            ll x=c[md];
            if(i)x^=c[i];
            ll s=b[md];
            if(i)s-=b[i];

            if(x==s){
                j=md;
            }else k=md;
        }
        ans+=j-i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
using ll= long long ;
using P = pair<ll,ll>;
#define rep(i,n) for (ll i = 0; i<(ll)(n); i++)
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<ll> vcl;

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a, ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t =rep_jijo(n,x/2);
        return t*t%mod;
  }
  return n*rep_jijo(n,x-1)%mod;
}
ll c2(ll n){
    return n*(n-1)/2;
}
  struct UnionFind {
  vector<int> d;
  UnionFind(int n=0): d(n,-1) {}
  int find(int x) {
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y) {
    x = find(x); y = find(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y);}
  int size(int x) { return -d[find(x)];}
};
int main(){
    ll n,m;
    cin>>n>>m;
    UnionFind uf(n);
    rep(i,m){
        ll a,b;
        cin>>a>>b;
        a--;
        b--;
        uf.unite(a,b);
    }

int ans = 0;
rep(i,n) ans = max(ans,uf.size(i));
cout<<ans<<endl;
}



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

const int modi = 998244353;

int main(){
	int n,s;

	cin >> n >> s;
	ll a[n];
	for(int i =0;i<n;i++){
		cin >> a[i];
	}
	ll dp[n+1][s+1];
	memset(dp,0,sizeof(dp));
	dp[0][0] = 1;
	for(int i = 0;i<n;i++){
		for(int j =0;j<=s;j++){
			dp[i+1][j] += 2*dp[i][j];
			dp[i+1][j]%=modi;
			if(j+a[i]<=s)
			{
				dp[i+1][j+a[i]] += dp[i][j];
				dp[i+1][j+a[i]]%=modi;
			}
		}
	}

	cout << dp[n][s] << endl;
}

Measured memory_bytes: 73888
package main

import "fmt"

func main(){
	var H, W int
	var C[1000] string
	fmt.Scan(&H, &W)

	for i := 0 ; i < 2*H ; i+=2 {
		fmt.Scan(&C[i])
	}

	for i := 0 ; i < 2 * H ; i+=2 {
		C[i+1] = C[i]
	}

	for i := 0 ; i < 2 * H ; i++ {
		fmt.Println(C[i])
	}
}

Measured memory_bytes: 512
n = int(input())
a = 0
while 10 ** a <= n:
    a = a + 1
b = (n + 1) // (10 ** (a -1))
c = b * (10 ** (a - 1)) - 1
d = 0
for i in range(len(str(c))):
    d = d + int(str(c)[i])
print(d)

Measured memory_bytes: 3060
#include <stdio.h>

int main (void) {
    int h, w;

    for (;;) {
        scanf ("%d %d", &h, &w);

        if (h==0 && w==0) break;

        for (int i=0; i<h; i++) {
            for (int j=0; j<w; j++) {
                printf ("#");
            }
             printf ("\n");
        }
        printf ("\n");
    }

    return 0;
}


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

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

    int C0 = 0;
    int C1 = 0;
    int C2 = 0;
    int C3 = 0;
    for(int i=0; i < N; i++) {
        string s;
        cin >> s;
        if(s == "AC") C0++;
        if(s == "WA") C1++;
        if(s == "TLE") C2++;
        if(s == "RE") C3++;
    }

    cout << "AC x " << C0 << endl;
    cout << "WA x " << C1 << endl;
    cout << "TLE x " << C2 << endl;
    cout << "RE x " << C3 << endl;
}

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

int main() {
  string a;
  cin >> a;
  if(a[1]!='7'&&a[2]!='7'&&a[0]!='7') cout << "No" << endl;
  else cout << "Yes" << endl;
}

Measured memory_bytes: 3596
// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF (1 << 29) * 2
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }

int main()
{
  char s[6];
  scanf("%s", s);
  printf("%s\n", (s[2] == s[3]) && (s[4] == s[5]) ? "Yes" : "No");
}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
#define CONTAINS_SET(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }

bool f[1000];

signed main()
{
	int N, M, X;

	cin >> N >> M >> X;
	REP(i, M)
	{
		int a;
		cin >> a;
		f[a] = true;
	}

	int cnt1 = 0;
	for (int i = X; i <= N; i++)
	{
		if (f[i]) cnt1++;
	}
	int cnt2 = 0;
	for (int i = X; i >= 0; i--)
	{
		if (f[i]) cnt2++;
	}

	cout << min(cnt1, cnt2) << endl;
}



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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    int a, b;
    cin >> a >> b;
    if (a + b == 15) cout << "+" << endl;
    else if (a*b == 15) cout << "*" << endl;
    else cout << "x" << endl;
}


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

using namespace std;

#define LL long long
#define ULL unsigned LL
#define LD long double

#define int LL

const int N = 2e5 + 2137;
int cnt[N];
int w[N];

int32_t main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	int a[n];
	for(int i=0; i<n; i++) {
		cin>>a[i];
		cnt[a[i]]++;
	}
	int suma = 0;
	for(int i=1; i<=n; i++) {
		w[i] = (cnt[i] * (cnt[i]-1)) / 2;
		suma+=w[i];
		//cout<<w[i]<<endl;
	}
	for(int i=0; i<n; i++) {
		int wx = suma - w[a[i]];
		int wy = ((cnt[a[i]]-1) * (cnt[a[i]]-2)) / 2;
		int wz = wx + wy;
		cout<<wz<<"\n";
	}
}


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

int main() {
  int H, W;
  cin >> H >> W;
  vector< vector<char> > data(H, vector<char>(W));
  // 入力
  for (int i = 0; i < H; i++) {
    string rowText;
    cin >> rowText;
    // i番目の状態を読む
    for (int j = 0; j < W; j++) {
      data.at(i).at(j) = rowText.at(j);
    }
  }
  vector<int> shouldVec(H);
    // 削除するべき列を探す
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (data.at(i).at(j) == '#') {
        shouldVec.at(i) = 1;
        break;
      }
    }
    if (shouldVec.at(i) == 1) {
      continue;
    } else {
      shouldVec.at(i) = 0;
    }
  }
  
  // 削除するべき列を削除する
  int removeHCount = 0;
  for (int i = 0; i < H; i++) {
    if (shouldVec.at(i) == 0) {
      data.erase(data.begin() + i - removeHCount);
      removeHCount += 1;
    }
  }
  
  vector<int> shouldWVec(W);
  for (int i = 0; i < W; i++) {
    for (int j = 0; j < data.size(); j++) {
      if (data.at(j).at(i) == '#') {
        shouldWVec.at(i) = 1;
        break;
      }
      if (data.size() == j + 1) {
        // 削除するべき列
        shouldWVec.at(i) = 0;
      }
    }
  }
  int dataSize = data.size();
  // 削除するべき列を削除する
  bool ifBeforeDeleted = false;
  int removeCount = 0;
  for (int i = 0; i < shouldWVec.size(); i++) {
    if (shouldWVec.at(i) == 0) {
      for (int j = 0; j < dataSize; j++) {
        data.at(j).erase(data.at(j).begin() + i - removeCount);
      }
      removeCount += 1;
    }
  }
  
  // 答えを出力する
  for (int i = 0; i < data.size(); i++) {
    for (int j = 0; j < data.at(i).size(); j++) {
      cout << data.at(i).at(j);
    }
    cout << endl;
  }
}
                           

Measured memory_bytes: 256
import java.util.*;


public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int K = sc.nextInt();
        int S = sc.nextInt();
        for(int i =0;i < N;i++){
            if(i < K){
                System.out.print(S + " ");
            } else {
                if(S == 1000000000){
                    System.out.print((S-1) + " ");
                } else {
                    System.out.print((S+1) + " ");
                }

            }

        }
    }
}






Measured memory_bytes: 42960
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))

int n,w;
lli dat[205];

#define MOD 1000000007 
lli dp[205][10005]={};

int main(void){
	scanf("%d%d",&n,&w);
	rep(i,n)scanf("%lld",&dat[i]);
	sort(dat,dat+n);
	dat[n]=IINF;
	
	dp[n][0]=dp[n+1][0]=1;
	ireg(i,0,n-1){
		rep(j,10005){
			dp[i][j]=(
				dp[i+1][j]+
				((j-dat[i])>=0?dp[i+1][j-dat[i]]:0) )%MOD;
		}
	}
	
	/*
	rep(i,n){
		rep(j,40)printf("%d ",dp[i][j]);
		printf("\n");
	}*/
	
	lli ws=0;
	lli ans = 0;
	reg(i,0,n){
		lli to = w-ws;
		lli fr = max(0LL,to-dat[i]+1);
		//printf("add %d %lld %lld , %lld\n",i,fr,to,ans);
		reg(j,fr,to){
			ans = (ans+dp[i+1][j])%MOD;
		}
		ws+=dat[i];
		if(ws>w)break;
	}
	
	bool isz=true;
	rep(i,n)if(dat[i]<=w)isz=false;
	if(isz)ans=1;
	printf("%lld\n",ans);
		
	return 0;
}

Measured memory_bytes: 16844
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
const long long mod = 1000000007;

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

  vector<int> oks(N+1, true);
  for(int i = 0; i < M; i++){
    int a;
    cin >> a;
    oks[a] = false;
  }

  vector<long long int> dp(N+1);
  dp[0] = 1;
  for(int now = 0; now < N; ++now){
    for(int next = now+1; next <= min(N, now+2); ++next){
      if(oks[next]){
        dp[next] += dp[now];
        dp[next] %= mod;
      }
    }
  }

  cout << dp[N] << endl;
  return 0;

  return 0;
}


Measured memory_bytes: 1408