akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef int sign;
typedef long long ll;
#define For(i,a,b) for(register sign i=(sign)a;i<=(sign)b;++i)
#define Fordown(i,a,b) for(register sign i=(sign)a;i>=(sign)b;--i)
const int N=1e5+5,inf=0x3f3f3f3f;
bool cmax(sign &a,sign b){return (a<b)?a=b,1:0;}
bool cmin(sign &a,sign b){return (a>b)?a=b,1:0;}
template<typename T>T read()
{
	T ans=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)&&ch!='-')ch=getchar();
	if(ch=='-')f=-1,ch=getchar();
	while(isdigit(ch))ans=(ans<<3)+(ans<<1)+(ch-'0'),ch=getchar();
	return ans*f;
}
void file()
{
	#ifndef ONLINE_JUDGE
		freopen("a.in","r",stdin);
		freopen("a.out","w",stdout);
	#endif
}
char s[N],s1[N],s2[N];
int n,m;
void input()
{
	scanf("%s",s+1);
	n=strlen(s+1);
}
void work()
{
	int cnt=0,ans=0;
	For(i,1,n)if(s[i]!='x')s1[++m]=s[i];
	For(i,1,m)s2[i]=s1[m-i+1];
	For(i,1,m)
	{
		if(s1[i]!=s2[i])
		{
			printf("-1\n");
			return;
		}
	}
	For(i,1,(n-cnt)/2)
	{
		if(s[i]!=s[n-cnt-i+1])
		{
			if(s[i]=='x')++ans,++n;
			else if(s[n-cnt-i+1]=='x')++ans,++cnt,i--;
		}
	}
	printf("%d\n",ans);
}
int main()
{
	//file();
	input();
	work();
	return 0;
}



Measured memory_bytes: 512
n=list(input())
x=len(n)-1
ans=0

for i in range(2**x):
    v=[0]*x
    for j in range(x):
        if (i>>j)&1==1:
            v[j]='+'

    w=n[0]
    for k in range(x):
        if v[k]=='+':
            w+=('+'+str(n[k+1]))
        else:
            w+=str(n[k+1])

    ans+=eval(w)


print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef pair<long long, long long> P;
#define override_rep(i, l, r, mes, ...) mes
#define rep1(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = l; i < r; i++)
#define rep(...) override_rep(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
#ifdef DEBUG
std::ostream& dout = cout;
#else
stringstream dout;
#endif
template<typename T, typename U>
istream& operator>>(istream& in, pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}
signed main(signed argc, char* argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    const int MOD = 1000000007;
    int n,r;
    cin>>n>>r;
    cout<<r+max(0,10-n)*100<<endl;
}


Measured memory_bytes: 256
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);


int main() {
    int n;
    string a, b, c;
    cin >> n >> a >> b >> c;
    int ans = 0;
    rep(i, n) {
        set<char> s;
        s.insert({a[i], b[i], c[i]});
        ans += s.size() - 1;
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;
using ll = long long;

int main()
{
  ios_base::sync_with_stdio (0);
  cin.tie (0);
  int n, m;
  cin >> n >> m;
  vector<int>v[m + 1];
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    if (x > m) {
      continue;
    }
    v[x].push_back (y);
  }
  for (int i = 0; i <= m; i++) {
    if (v[i].size() == 0) {
      continue;
    }
    sort (v[i].begin(), v[i].end(), greater<int>() );
  }
  priority_queue<int>q;
  int ans = 0;
  for (int i = 0; i <= m; i++) {
    for (auto j : v[i]) {
      q.push (j);
    }
    if (q.empty() ) {
      continue;
    }
    ans += q.top();
    q.pop();
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 5632
box = []
elem = input().split()
for i in elem:
    if i == '+' or i == '-' or i =='*':
        v = '{0} {1} {2}'.format(box[-2],i,box[-1])
        box.pop()
        box.pop()
        box.append(eval(v))
    else:
        box.append(i)
print (box[0])

Measured memory_bytes: 7444
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		int k = sc.nextInt(), a = sc.nextInt(), b = sc.nextInt();
		long ans = 1L;
		if(k >= a-1){
			k -= a-1;
			ans += a-1;
		}
		if(b > a+1 && k > 0){
			ans += 1l*(b-a)*(k/2);
			k %= 2;
		}
		ans += k;
		out.println(ans);
		out.close();
	}
	
	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		public Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}
	}

}


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

int main(){
  ll k,n;
  cin>>k>>n;
  vector<ll>a(n);
  for(ll i=0;i<n;i++){
    cin>>a[i];
  }
  ll m =0;
  for(ll i=1;i<n;i++){
    m  = max(m,a[i]-a[i-1]);
  }
  m = max(m,k+a[0]-a[n-1]);
  cout<<k-m<<endl;
}

Measured memory_bytes: 1792
n,k=map(int,input().split())
lists=list(map(int,input().split()))
gcd=lists[0]
import fractions
for i in range(n-1):
    gcd=fractions.gcd(gcd,lists[i+1])
if k%gcd==0 and k<=max(lists):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Measured memory_bytes: 14252
#include <set>
#include <map>
#include <list>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)

signed main(void){
  int i;
  scanf("%d", &i);

  if(i>=1000){
    printf("ABD\n");
  }else{
    printf("ABC\n");
  }
  return 0;
}

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

const int MODULO = (int) 1e9 + 7;
const int N = 5005;
int f[N][N], n;
string s;

long long power(long long a, long long n) {
    if (n == 0) return 1;
    long long res = power(a, n / 2);
    res = res * res % MODULO;
    if (n % 2 != 0) res = res * a % MODULO;
    return res;
}

long long inverse(long long a) {
    return power(a, MODULO - 2);
}

int F(int length, int nkey) {
    if (nkey == 0) return length == (int) s.size() ? 1 : 0;
    int &res = f[length][nkey];
    if (res != -1) return res;
    return res = (F(max(0, length - 1), nkey - 1) + F(length + 1, nkey - 1) * 2LL) % MODULO;
}

int main() {
    ios::sync_with_stdio(false);
    cin >> n >> s;
    memset(f, -1, sizeof f);
    cout << 1LL * F(0, n) * inverse(power(2, s.size())) % MODULO << '\n';
    return 0;
}


Measured memory_bytes: 98304
#!/usr/bin/env python3
import sys
class mystack:
  v = [0 for i in range(222)]
  t = 0

  def push(self,a):
    self.t += 1
    self.v[self.t] = a
  def pop(self):
    self.t -= 1
  def top(self):
    return self.v[self.t]
  def pr(self):
    for i in range(1, self.t+1):
      sys.stdout.write(self.v[i] + " ")
    sys.stdout.write('\n')

s = mystack()
l = sys.stdin.readline().split()

for i in l:
  if not i.isdigit():
    a = s.top()
    s.pop()
    b = s.top()
    s.pop()
    if i == '+':
      s.push(b+a)
    if i == '-':
      s.push(b-a)
    if i == '*':
      s.push(b*a)
  else:
    s.push(int(i))

print(s.top())

Measured memory_bytes: 7784
using System;
using System.Collections.Generic;


namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);
            int c = int.Parse(str[2]);

            int count = 0;
            for (int x = a; x <= b; x++){
                if (c % x == 0 ){
                    count++;
                }
  
            }
            Console.WriteLine(count);

            }
        }
    }

Measured memory_bytes: 9212
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);

  int h,w;
  cin >> h >> w;

  vector<vector<char>> a(h, vector<char>(w));
  REP(i,h) {
    REP(j,w){
      cin >> a[i][j];
    } 
  }

  queue<vector<int>> q;

  vector<vector<bool>> f(h, vector<bool>(w,false));

  int pre_t_cnt = 0;
  int t_cnt = 0;
  //queueに#の座標を追加
  REP(i,h){
    REP(j,w){
      if(a[i][j] == '#'){
        q.push({i,j});
        f[i][j] = true;
        pre_t_cnt++;
      }
    }
  }

  int cnt = 0;
  while(!q.empty()){
    
    vector<int> tmp = q.front();
    q.pop();

    if(tmp[0] > 0 && !f[tmp[0] - 1][tmp[1]]){
      q.push({tmp[0] - 1,tmp[1]});
      f[tmp[0] - 1][tmp[1]] = true;
      t_cnt++;
    }
    if(tmp[0] < h - 1 && !f[tmp[0] + 1][tmp[1]]) {
      q.push({tmp[0] + 1,tmp[1]});
      f[tmp[0] + 1][tmp[1]] = true;
      t_cnt++;
    }
    if(tmp[1] > 0 && !f[tmp[0]][tmp[1] - 1]) {
      q.push({tmp[0], tmp[1] - 1});
      f[tmp[0]][tmp[1] - 1] = true;
      t_cnt++;
    }
    if(tmp[1] < w - 1 && !f[tmp[0]][tmp[1] + 1]){
      q.push({tmp[0], tmp[1] + 1});
      f[tmp[0]][tmp[1] + 1] = true;
      t_cnt++;
    }

    pre_t_cnt--;
    if(pre_t_cnt == 0){
      pre_t_cnt = t_cnt;
      if(t_cnt > 0)cnt++;
      t_cnt = 0;
    }
  }

  cout << cnt << endl;

  return 0;
}

Measured memory_bytes: 56884
n, m = list(map(int, input().split()))
ans = 0

if n == 1 and m == 1:
    ans = 1
elif n == 1:
    ans = m-2
elif m == 1:
    ans = n-2
elif n == 2 or m == 2:
    ans = 0
else:
    ans = (n-2)*(m-2)

print(ans)


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

using ll = long long;

ll solve(int A, int B, int C)
{
    if (A % 2 == 0 || B % 2 == 0 || C % 2 == 0) return 0;
    else
    {
        auto v = vector<ll>{A, B, C};
        sort(begin(v), end(v));
        return v[0] * v[1];
    }
}

int main()
{
    int A, B, C; cin >> A >> B >> C;
    cout << solve(A, B, C) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <utility>
#include <algorithm>

using namespace std;

typedef long long ll;
const ll mod=1000000007;
#define rep(i,n) for(ll i=0;i<n;i++)

int main(){
    ll N,K;
    cin>>N>>K;
    vector<pair<ll,ll>> p;
    ll t;
    bool kind[100000];
    ll d;
    rep(i,N){
        cin>>t>>d;
        t--;
        kind[t]=true;
        p.push_back(make_pair(d,t));
    }
    sort(p.begin(),p.end());
    ll ans=0;
    ll s[100000],ss[100000];
    ll use_num=0,num=0;
    rep(i,K){
        ans+=p[N-1-i].first;
        if(kind[p[N-1-i].second]){
            use_num++;
            kind[p[N-1-i].second]=false;
        }else{
            num++;
            s[num-1]=p[N-1-i].first;
        }
    }
    ss[0]=s[num-1];
    rep(i,num-1) ss[i+1]=ss[i]+s[num-2-i];
    rep(i,K) p.pop_back();
    vector<ll> vec;
    while(!p.empty()){
        if(kind[p.back().second]){
            vec.push_back(p.back().first);
            kind[p.back().second]=false;
        }
        p.pop_back();
    }
    sort(vec.begin(),vec.end());
    ll S[100000];
    ll ind=-1;
    while(!vec.empty()){
        ind++;
        if(ind==0) S[ind]=vec.back();
        else S[ind]=S[ind-1]+vec.back();
        vec.pop_back();
    }
    d=0;
    rep(i,min(ind+1,num)){
        d=max(d,S[i]+2*(i+1)*use_num+(i+1)*(i+1)-ss[i]);
    }
    cout<<ans+d+use_num*use_num<<endl;
    return 0;
}

Measured memory_bytes: 4848
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;

public class Main {

	/* several useful subroutines */
	private static final BigDecimal BD1000000007 = new BigDecimal(1000000007);
	private static BufferedReader brStdin = new BufferedReader(new InputStreamReader(System.in));
	private static String[] readBuf = null;
	private static int readPtr = 0;
	private static String getString() throws IOException {
		while ( readBuf == null || readPtr >= readBuf.length ) {
			readBuf = brStdin.readLine().split(" ");
			readPtr = 0;
		}
		return readBuf[readPtr++];
	}
	private static int getInt() throws IOException {
		return Integer.parseInt(getString());
	}
	private static long getLong() throws IOException {
		return Long.parseLong(getString());
	}
	private static BigDecimal getBD() throws IOException {
		return new BigDecimal(getString());
	}
	@SuppressWarnings("unused")
	private static String[] getStringArray(int size) throws IOException {
		String stringArray[] = new String[size];
		for (int i = 0; i < stringArray.length; i++) {
			stringArray[i] = getString();
		}
		return stringArray;
	}
	@SuppressWarnings("unused")
	private static int[] getIntArray(int size) throws IOException {
		int intArray[] = new int[size];
		for (int i = 0; i < intArray.length; i++) {
			intArray[i] = getInt();
		}
		return intArray;
	}
	@SuppressWarnings("unused")
	private static long[] getLongArray(int size) throws IOException {
		long longArray[] = new long[size];
		for (int i = 0; i < longArray.length; i++) {
			longArray[i] = getLong();
		}
		return longArray;
	}
	@SuppressWarnings("unused")
	private static BigDecimal[] getBDArray(int size) throws IOException {
		BigDecimal bdArray[] = new BigDecimal[size];
		for (int i = 0; i < bdArray.length; i++) {
			bdArray[i] = getBD();
		}
		return bdArray;
	}
	private static BigDecimal mod1000000007(BigDecimal bd) {
		return bd.subtract(BD1000000007.multiply(bd.divide(BD1000000007, BigDecimal.ROUND_DOWN))) ;
	}
	@SuppressWarnings("unused")
	private static BigDecimal mod1000000007(int i) {
		return mod1000000007(new BigDecimal(i)) ;
	}
	@SuppressWarnings("unused")
	private static BigDecimal mod1000000007(long l) {
		return mod1000000007(new BigDecimal(l)) ;
	}

	
	/* main routine */
	public static void main(String args[]) throws IOException {
		long l = getLong();
		long r = getLong();
		if ( l/2019L != r/2019L ) {
			System.out.println( 0 ) ;
		} else {
			if ( l+2019L < r ) {
				r = l+2019L ;
			}
			long min = 2020L;
			for ( long i = l ; i < r ; i++ ) {
				for ( long j = i+1 ; j <= r ; j++ ) {
					long mod = (i*j) % 2019L ;
					if ( min > mod ) {
						min = mod ;
					}
				}
			}
			System.out.println( min ) ;
		}
	}
}


Measured memory_bytes: 24532
/* be name khoda */

// #define stream_enable
#define long_enable
#include <iostream>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;

#ifdef stream_enable
#define cin sss
#endif
#ifdef long_enable
typedef long long int ll;
#else
typedef int ll;
#endif

typedef pair<ll, ll> pii;
typedef pair<pii, ll> ppi;
typedef pair<ll, pii> pip;
typedef vector<ll> vi;
typedef vector<pii> vpii;

const ll MOD = 1000000007;
const long long BIG = 1446803456761533460;
const int Big = 336860180;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()

#define debug(x) cout << #x << " -> " << (x) << endl
#define debug2(x, y) cout << #x << ' ' << #y << " -> " << (x) << ' ' << (y) << endl
#define debug3(x, y, z) cout << #x << ' ' << #y << ' ' << #z << " -> " << (x) << ' ' << (y) << ' ' << (z) << endl
#define debug4(x, y, z, t) cout << #x << ' ' << #y << ' ' << #z << ' ' << #t << " -> " << (x) << ' ' << (y) << ' ' << (z) << ' ' << (t) << endl
#define debugp(x) cout << #x << " -> " << "(" << (x).F << ", " << (x).S << ")" << endl
#define debuga(x, n) cout << #x << " -> "; fori (i1_da, n) { cout << (x)[i1_da] << ' '; } cout << endl
#define debugap(x, n) cout << #x << " ->\n"; fori (i1_dap, n) { cout << "(" << (x)[i1_dap].F << ", " << (x)[i1_dap].S << ")\n"; } cout << endl
#define debugaa(x, n, m) cout << #x << " ->\n"; fori (i1_daa, n) { fori (i2_daa, m) { cout << (x)[i1_daa][i2_daa] << ' '; } cout << '\n'; } cout << endl
#define debugav(x, n) cout << #x << " ->\n"; fori (i1_dav, n) { fori (i2_dav, (x)[i1_dav].size()) { cout << (x)[i1_dav][i2_dav] << ' '; } cout << '\n'; } cout << endl
#define debugia(x, n) cout << #x << " ->\n"; fori (i1_dia, n) { cout << i1_dia << " : " << (x)[i1_dia] << '\n'; } cout << endl

#define forifrom(i, s, n) for(ll i = (s); i < (n); ++i)
#define forirto(i, n, e) for(ll i = (n) - 1; i >= (e); --i)
#define fori(i, n) forifrom (i, 0, n)
#define forir(i, n) forirto (i, n, 0)

#define smin(a, b) a = min(a, (b))
#define smax(a, b) a = max(a, (b))

#define Add(a, b) a = ((a) + (b)) % MOD
#define Mul(a, b) a = (1LL * (a) * (b)) % MOD

stringstream sss;

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

const ll maxn = 100010;

ll n;
ll ar[maxn];

void MAIN() {

    cin >> n;
    ll s = 0;
    fori (i, n) {
        cin >> ar[i];
        s += ar[i];
    }
    ll t = (n * (n + 1) / 2);
    if (s % t) {
        cout << "NO\n";
        return;
    }
    ll m = s / t;
    ll c = 0;
    fori (i, n) {
        ll d = ar[i] + m - ar[(i + 1) % n];
        if (d < 0 || d % n != 0) {
            cout << "NO\n";
            return;
        }
        c += d / n;
    }
    cout << (c == m ? "YES\n" : "NO\n");

}

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

int main() {
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(10);
    sss << R"(
5
6 9 12 10 8

    )";
    MAIN();
    return 0;
}


Measured memory_bytes: 1152
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
using namespace std;
const long long N = 1e10 + 7;
typedef long long ll;
int main()
{
	int n,m;
	cin >> n >> m;
	ll x = 0;
	for(int i = 0;i < m;i++)
    {
        int y;
        cin >> y;
        x += y;
    }
    if(n - x < 0)
        cout << -1 << endl;
    else
        cout << n-x << endl;

    return 0;
}


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

// GCD, LCM
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
 
int main()
{
    int a,b;
    cin>>a>>b;

    cout<<a*b<<" "<<a*2+b*2<<endl;
 
    return 0;
}


Measured memory_bytes: 3076
nn, mm = gets.split.map(&:to_i)
lr =
  readlines.map do |i|
    i.chomp.split.map(&:to_i)
  end

l_max = lr.sort{|a,b|b<=>a}[0][0]
r_min = lr.sort_by!{|a|a[1]}[0][1]
puts l_max>r_min ? 0 : (r_min - l_max + 1)

Measured memory_bytes: 23432
package main
 
import (
    "bufio"
    "fmt"
    "os"
    "strconv"
)

func main(){
    
    var a int
	var sum int
 
	for i := 0; i < 3; i++ {
        a = nextInt()
		if a != 5 && a != 7 {
			fmt.Println("NO")
			os.Exit(0)
		}
		sum += a
	}
	if sum == 17 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}

}
 
/* templates */
 
func Max(a []int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r < a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Min(a []int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r > a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Sum(a []int) (r int) {
    for i := range a {
        r += a[i]
    }
    return r
}
 
func Abs(a float64) float64 {
    if a < 0 {
        return -a
    }
    return a
}
 
type Pair struct {
    a, b int
}
 
type Pairs []Pair
 
func (p Pairs) Len() int {
    return len(p)
}
 
func (p Pairs) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}
 
func (p Pairs) Less(i, j int) bool {
    return p[i].b < p[j].b
}
 
var nextReader func() string
 
func init() {
    nextReader = NewScanner()
}
 
func NewScanner() func() string {
    r := bufio.NewScanner(os.Stdin)
    r.Buffer(make([]byte, 1024), int(1e+11))
    r.Split(bufio.ScanWords)
    return func() string {
        r.Scan()
        return r.Text()
    }
}
 
func nextString() string {
    return nextReader()
}
 
func nextInt64() int64 {
    v, _ := strconv.ParseInt(nextReader(), 10, 64)
    return v
}
 
func nextInt() int {
    v, _ := strconv.Atoi(nextReader())
    return v
}
 
func nextInts(n int) []int {
    r := make([]int, n)
    for i := 0; i < n; i++ {
        r[i] = nextInt()
    }
    return r
}
 
func nextFloat64() float64 {
    f, _ := strconv.ParseFloat(nextReader(), 64)
    return f
}

Measured memory_bytes: 640
#include <stdio.h>

int main(void)
{
    int p;
    int i;
    int sum;
    
    sum = 0;
    for (i = 0; i < 5; i++){
        scanf("%d", &p);
        if (p < 40){
            p = 40;
        }
        sum += p;
    }
    
    printf("%d\n", sum / 5);

    return (0);
}

Measured memory_bytes: 600
x=int(input())
ans=False
for i in range(x,10**9):
    if ans==True:
        break
    else:
        cnt=0
        for j in range(2,i+1):
            if i%j==0 and j!=i:
                continue
            else:
                cnt+=1
                if cnt==i-1:
                    print(i)
                    ans=True
            



Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double eps=1e-8;
const int inf=0x3f3f3f3f;
ll gcd(ll a,ll b){ return b==0?a:gcd(b,a%b); }
int num[1005]; 
int main()
{
	int n,k;
	cin>>n>>k;
	int i,sum=0;
	for(i=1;i<=n;i++) cin>>num[i];
	sort(num+1,num+1+n);
	for(i=1;i<=k;i++) sum+=num[i];
	cout<<sum;
	return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cassert>
#include <cmath>
using namespace std; typedef long long ll; ll an=0; const ll INF = 1e18; const ll MOD = 1e9+7;
typedef pair<int,int> P;

int main(){
  int n; cin>>n; int a[n],b[n],c[n];
  for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n);
  for(int i=0;i<n;i++) cin>>b[i]; sort(b,b+n);
  for(int i=0;i<n;i++) cin>>c[i]; sort(c,c+n);

  //for(int i=0;i<n;i++) cout<<a[i]<<" ";cout<<endl;
  //for(int i=0;i<n;i++) cout<<b[i]<<" ";cout<<endl;
  //for(int i=0;i<n;i++) cout<<c[i]<<" ";cout<<endl;
  int d[n]; 
  for(int i=0;i<n;i++) d[i] = lower_bound(a,a+n,b[i])-a;
  //for(int x:d) cout<<x<<" "; cout<<endl;
  for(int i=0;i<n;i++) {
    an += d[i] * (n - (upper_bound(c,c+n,b[i])-c)); //cout<<(n - (upper_bound(c,c+n,b[i])-c))<<" ";
  };
  cout<<an<<endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <queue>
#include <iomanip>
#include <algorithm>
using namespace std;

int main(){
  int N,K,T,U,V,L;
  cin >> N >> K >> T >> U >> V >> L;
  queue<int> caro;
  for(int i=0; i<N; i++){
    int tmp;
    cin >> tmp;
    caro.push(tmp);
  }

  double time = 0;
  int now = 0;
  int stock = 0;
  while(1){
    //printf("now %d, time: %f, stock:%d\n", now, time, stock);
    if(stock==0){
      if(!caro.empty() && now+U >= caro.front()){
        time += (caro.front()-now)/(double)U;
        now = caro.front();
        caro.pop();
        stock++;
      }else if(now+U >= L){
        time += (L-now)/(double)U;
        now = L;
        break;
      }else{
        time += 1;
        now += U;
      }
    }else{
      stock--;
      if(now + T*V >= L){
        time += (L-now)/(double)V;
        now = L;
        break;
      }
      else{
        time += T;
        now += T*V;
        int last;
        bool over=false;
        while(!caro.empty() && caro.front()<=now){
          stock++;
          if(stock>K){
            stock=K;
            over=true;
            last = caro.front();
          }
          caro.pop();
        }
        if(over){
          time -= (now-last)/(double)V;
          now = last;
          stock++;
        }
      }
    }
  }

  cout << fixed;
  cout << setprecision(10);
  cout << time << endl;
  return 0;
}

Measured memory_bytes: 3280
#include <bits/stdc++.h>
typedef long long i64;
using std::cout;
using std::endl;
using std::cin;

int h, w;
std::vector<std::vector<i64>> a, s;

i64 dp[1010][1010] = {};
i64 solve(int x = 0, int y = 0) {
	if(dp[x][y] != 1LL << 60) return dp[x][y];
	if(x == h and y == w) return 0;
	
	i64 ret = 0;
	int f = (x + y) % 2;
	if(!f) {
		ret = -(1LL << 60);
		if(x != h) ret = std::max(ret, solve(x + 1, y));
		if(y != w) ret = std::max(ret, s[y][x] + solve(x, y + 1));
	} else {
		ret = (1LL << 60);
		if(x != h) ret = std::min(ret, solve(x + 1, y));
		if(y != w) ret = std::min(ret, s[y][x] + solve(x, y + 1));
	}
	return dp[x][y] = ret;
}

int main() {
	cin >> w >> h; a.resize(h, std::vector<i64>(w)); s.resize(w, std::vector<i64>(h + 1, 0));
	for(int i = 0; i < h; i++) for(int j = 0; j < w; j++) cin >> a[i][j];
	for(int i = 0; i < w; i++) for(int j = 0; j < h; j++) s[i][j + 1] = s[i][j] + a[j][i];
	
	i64 sum = 0;
	for(int i = 0; i < h; i++) for(int j = 0; j < w; j++) sum += a[i][j];
	for(int i = 0; i <= h; i++) for(int j = 0; j <= w; j++) dp[i][j] = 1LL << 60;
	
	i64 ma = std::abs(sum - 2 * solve());
	cout << ma << endl;
	return 0;
}



Measured memory_bytes: 26668
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    s = IS()
    t = IS()
    len_s = len(s)
    len_t = len(t)
    minv = 10**5
    for i in range(0, len_s - len_t + 1):
        cnt = 0
        for j in range(len_t):
            if s[i+j] != t[j]:
                cnt += 1
        minv = min(minv, cnt)
    print(minv)


if __name__ == '__main__':
    main()

Measured memory_bytes: 9140
#include "bits/stdc++.h"
using namespace std;

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(i = 0; i < n; i++)

const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

typedef long long ll;


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

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

	for (int i = 0; i <= N / 4; i++)
	{
		for (int j = 0; j <= N / 7; j++)
		{
			if (4 * i + 7 * j == N)
			{
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {		
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int arr[] = new int[n];
		long sum[] = new long[n];
		int mod = (int)Math.pow(10, 9)+7;
		for(int i=0;i<n;i++)
		{
			arr[i] = scn.nextInt();
		}
		for(int j=n-1;j>0;j--) {
			if(j<n-1)
				sum[j] = (sum[j+1]+arr[j])%mod;
			else
				sum[j] = arr[j];
		}
		long result = 0;
		for(int i=0;i<n-1;i++)
		{
			long temp = (sum[i+1]*arr[i])%mod;
			result = (result+temp)%mod;
		}
		//result = (result+arr[n-1])%mod;
		System.out.println(result);
		
		/*String s = scn.next();
		String t = scn.next();
		int min = t.length();
		for(int i=t.length()-1;i>=0;i--)
		{
			if(s.contains(t.substring(0,i))) {
				int val = t.length()-i;
				System.out.println(t.substring(0,i)+" "+val);
				if(min>val)
					min= val;
			}
		}
		for(int i=0;i<t.length();i++)
		{
			if(s.contains(t.substring(i))) {
				int val = i;
				System.out.println(t.substring(i)+" "+val);
				if(min>val)
					min= val;
			}
		}
		System.out.println(min);*/
	}

}


Measured memory_bytes: 52008
s=input()
t=input()

cnt=0
while True:
    if s==t:
        print("Yes")
        break
    
    elif cnt==len(s)-1:
        print("No")
        break
    
    ans1=s[-1]
    ans2=s[:-1]
    ans=ans1+ans2
    s=ans
    cnt+=1


Measured memory_bytes: 2940
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <chrono>
#include <random>
#include <tuple>
#include <utility>
#include <fstream>
 
const long INF = (1l << 30);
const long LINF = (1l << 60);

long n;
std::string s;
long a, b, c, d;

bool check_1(long x, long y){
	long ret = 0;
	long tmp = 0;
	for(int i = x; i <= y; i++){
		if(s[i] == '#'){
			tmp++;
			ret = std::max(ret, tmp);
		}else{
			tmp = 0;
		}
	}
	//printf("%ld\n", ret);
	if(ret >= 2){
		return false;
	}else{
		return true;
	}
}

bool cnt_maxrange(long x, long y){
	long ret = 0;
	long tmp = 0;
	for(int i = x; i <= y; i++){
		if(s[i] == '.'){
			tmp++;
			ret = std::max(ret, tmp);
		}else{
			tmp = 0;
		}
	}
	//printf("ret %ld\n", ret);
	if(ret >= 3){
		//printf("pass1\n");
		return true;
	}else if(s[x-1] == '.' && s[x+1] == '.'){
		//printf("pass2\n");
		return true;
	}else if(s[y-1] == '.' && s[y+1] == '.'){
		//printf("pass3 %ld %ld\n", y-1, y+1);
		return true;
	}
	return false;
}

int main(){
	scanf("%ld%ld%ld%ld%ld", &n, &a, &b, &c, &d);
	a--, b--, c--, d--;
	std::cin >> s;
	if(c < d){
		if(check_1(a, c) && check_1(b, d)){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}else{
		if(check_1(a, c) && check_1(b, d) && cnt_maxrange(b, d)){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}
	return 0;
}
		


Measured memory_bytes: 760
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define DEBUG
#ifdef DEBUG
#define debug_printf printf
#else
#define debug_printf 1 ? 0 : printf
#endif

using namespace std;
typedef long long int ll;
typedef vector<ll> Vl;
typedef vector<int> Vi;
typedef pair<int, int> Pi;

#define INF   (1e9 + 7)
#define MAX_N (10000000)

int A, B;

int main() {
  scanf("%d %d", &A, &B);

  int C = (A + B) % 24;

  printf("%d\n", C);

  return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for(int i =0 ; i < n; ++i)
#define Rep(i,a,b) for(int i=a;i<=b;i++)
#define pii pair < int, int >
typedef vector<int> vi;
typedef  unsigned long long ll;
const int mod =1e9+7;
const int N = (int)2e5 + 5;

void solve(){
	int n;
	cin>>n;
	int d=n;
	int s=0,c=0;
	vi v;
	while(d--){
		int x;
		cin>>x;
		v.pb(x);
		s+=x;
		if(x%10==0){
			c++;
		}
	}	
	if(c==n){
		cout<<0;
	}
	else{
		if(s%10!=0)cout<<s;
		else{
			sort(all(v));
			for(int i=0;i<n;i++){
				if(v[i]%10!=0){
					cout<<s-v[i];
					return;
				}
			}
		}
	}


}

int main(){
	Red;
	int t=1;
	//cin>>t;
	while(t--)
	solve();
	return 0;
}

Measured memory_bytes: 256
Str = list(input())
q = int(input())

for i1 in range(q):
    Input = input().split()
    Order = Input[0]
    
    if Order == "print":
        a = int(Input[1])
        b = int(Input[2])
        for i2 in range(a, b + 1):
            print(Str[i2], end = '')
        print()
        continue
    
    if Order == "reverse":
        a = int(Input[1])
        b = int(Input[2])
        work = Str[a: b + 1]
        work.reverse()
        Str[a: b + 1] = work
        continue

    if Order == "replace":
        a = int(Input[1])
        b = int(Input[2])
        p = Input[3]
        Str[a: b + 1] = p
        continue

Measured memory_bytes: 7836
#include<bits/stdc++.h>
using namespace std;
namespace FAST_IO
{
	template<typename T> void read(T &a)
	{
		a=0;
		int f=1;
		char c=getchar();
		while(!isdigit(c))
		{
			if(c=='-')
			{
				f=-1;
			}
			c=getchar();
		}
		while(isdigit(c))
		{
			a=a*10+c-'0';
			c=getchar();
		}
		a=a*f;
	}
	template <typename T> void write(T a)
	{
		if(a<0)
		{
			a=-a;
			putchar('-');
		}
		if(a>9)
		{
			write(a/10);
		}
		putchar(a%10+'0');
	}
	template <typename T> void writeln(T a)
	{
		write(a);
		puts("");
	}
}
bool have[101];
int main()
{
	int n,k,ans=0;
	cin>>n>>k;
	while(k--)
	{
		int p;
		cin>>p;
		while(p--)
		{
			int tmp;
			cin>>tmp;
			have[tmp]=true;
		}
	}
	for(int i=1;i<=n;i++)
	{
		if(!have[i])
		{
			ans++;
		}
	}
	cout<<ans;
}


Measured memory_bytes: 3624
#include"bits/stdc++.h"

#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)

using namespace std;

#define del ' '
#define x first
#define y second
#define ll long long


class union_find {
public:
   union_find(int n)
      : par_(n, -1)
   {}
   void init(int n) {
      par_.assign(n, -1);
   }

   int root(int x) {
      return par_[x] < 0 ? x : par_[x] = root(par_[x]);
   }

   bool unite(int x, int y) {
      x = root(x); y = root(y);
      if (x == y) {
         return false;
      }
      else {
         if (par_[x] < par_[y]) {
            par_[x] += par_[y];
            par_[y] = x;
         }
         else {
            par_[y] += par_[x];
            par_[x] = y;
         }
         return true;
      }
   }

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

   int size(int x) {
      return -par_[root(x)];
   }

private:
   std::vector<int> par_;
};


void solve();

int main() {

   solve();
   return 0;

}

void solve() {

   union_find u(13);
   u.unite(1,3);
   u.unite(1,5);
   u.unite(1,7);
   u.unite(1,8);
   u.unite(1,10);
   u.unite(1,12);
   u.unite(4,6);
   u.unite(4,9);
   u.unite(4,11);

   int a,b;
   cin >> a>>b;
   u.same(a,b)?cout <<"Yes":cout <<"No";
   cout << endl;


}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int a, b;
  while(1){
    scanf("%d %d", &a, &b);
    if(a==0||b==0) break;
    for(int i = 0; i<a; i++){
      for(int j = 0; j<b; j++){
        if(i==0 || j==0 || i==a-1||j==b-1)
          printf("#");
        else printf(".");
      }
       printf("\n");
    }
    printf("\n");
  } 
  return 0;
}


Measured memory_bytes: 2604
# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]

from heapq import heappush, heappop
N, M = [int(i) for i in input().split(" ")]
As = [int(i) for i in input().split(" ")]
pq = []
for a in As:
  heappush(pq, -a)

for _ in range(M):
  i = heappop(pq)
  heappush(pq, -(-i // 2))
ans = sum(-i for i in pq)
print(ans)


Measured memory_bytes: 14180
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <stack>
#include <queue>
using namespace std;
int main() {
    int k;
    string s;
    cin>>k>>s;
    if(s.size()<=k)cout<<s;
    else cout<<s.substr(0,k)<<"...";
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int mod = 998244353;

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

    ll N;
    cin>>N;

	ll a, b, c;

	ll A[N][3];
	for(ll i=0; i<N; i++){
		cin>>A[i][0]>>A[i][1]>>A[i][2];
	}

	vector<vector<ll>> dp(N, vector<ll>(3, 0));

	for(ll i=0; i<N; i++){
		for(ll j=0; j<3; j++){
			if(!i)
				dp[i][j] = A[i][j];
			else{
				for(ll k=0; k<3; k++){	
					if(j!=k){
						dp[i][j] = max(dp[i][j], dp[i-1][k]+A[i][j]);
						// cout<<dp[i][j]<<endl;
					}
				}
			}
		}
		// for(ll j=0; j<3 ; j++){
		// 	cout<<dp[i][j]<<" ";
		// }
		// cout<<endl;
	}

	cout<<max({dp[N-1][0], dp[N-1][1], dp[N-1][2]});

	return 0;
}		


Measured memory_bytes: 8064
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >> N;

    int ans;

    while(true){
        int min;
        if(N < 10){
            cout << N <<endl;
            break;
        }
        for (int i = 0; i < 9; i++){
            ans += 1;
        }

        if(N < 100){
            cout << ans << endl;
            break;
        }
        
        if(N < 999){
            min = N;
        }
        else{
            min = 999;
        }

        for (int i = 99; i < min; i++){
            ans += 1;
        }

        if(N < 10000){
            cout << ans << endl;
            break;
        }
        if(N < 99999){
            min = N;
        }
        else{
            min = 99999;
        }
        
        for (int i = 9999; i < min; i++){
            ans += 1;
        }

        cout << ans << endl;
        break;
    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
long long int maxi(long long int a,long long int b,long long int c,long long int d)
{
    long long int largest;
    largest= (a>b)?(a>c)?(a>d)?a:d:(c>d)?c:d:(b>c)?(b>d)?b:d:(c>d)?c:d;
    return largest;
}
int main()
{
  long long int a,b,c,d,x,y;
  cin>>a>>b>>c>>d;
cout<<maxi(a*c,a*d,b*c,b*d)<<endl;
 
  return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define range(i, l, r) for(int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    lint N;
    cin >> N;
    cout << N / 3 << "\n";
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    int H,W;
    cin>>H>>W;
    char s[H][W];
    for(int i=0;i<H;i++)
    {
        cin>>s[i];
    }
    for(int i=0;i<H;i++)
    {
        for(int j=0;j<W;j++)
        {
            if(s[i][j]!='#')
                {
                    int c=0;
                    if(i>0&&j>0&&s[i-1][j-1]=='#')c++;
                    if(j>0&&s[i][j-1]=='#')c++;
                    if(i<H-1&&j>0&&s[i+1][j-1]=='#')c++;
                    if(i>0&&s[i-1][j]=='#')c++;
                    if(i<H-1&&s[i+1][j]=='#')c++;
                    if(i>0&&j<W-1&&s[i-1][j+1]=='#')c++;
                    if(j<W-1&&s[i][j+1]=='#')c++;
                    if(i<H-1&&j<W-1&&s[i+1][j+1]=='#')c++;
                    cout<<c;
                }
            else cout<<'#';
        }
        if(i<H-1)cout<<endl;
    }
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define REP1(i, n) for(int i=1; i<=(n); i++)
#define RREP1(i, n) for(int i=(n); i>=1; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define out(...) printf(__VA_ARGS__)
#if DEBUG
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...) /* ... */
#endif
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}
void _OUT() {}; template<class H, class... T> void _OUT(H &h, T &... t) { cout<<' '<<h; _OUT(t...); };
template<class H, class... T> void _P(H &h, T &... t) { cout<<h; _OUT(t...); };
#define _PN(...) _P(__VA_ARGS__); cout << endl;

void solve();
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 100
#else
#define SIZE 2234560
#endif

string N;
// i桁目/繰り下がりあり→最小の枚数
int DP[SIZE][2];

void solve() {
    cin>>N;
    REP(i,SIZE)REP(j,2)DP[i][j]=INT_MAX;
    int n = N[0]-'0';
    DP[0][1]=1+(10-n);
    DP[0][0]=n;
    REP1(i,N.size()-1) {
        int n = N[i]-'0';
        chmin(DP[i][0], DP[i-1][0]+n);
        chmin(DP[i][1], DP[i-1][0]+1+(10-n));
        chmin(DP[i][0], DP[i-1][1]+n);
        chmin(DP[i][1], DP[i-1][1]+(10-n)-1);
    }
    int i = N.size()-1;
    _PN(min(DP[i][0],DP[i][1]));
}




Measured memory_bytes: 39216
/*
	|\    /|        |       |
	| \  / |  ____  |___  . |
	|  \/  | |    | |   | | |_
	|	   | |    | |   | | |
	|	   | |____| |   | | |____|

*/


#include <bits/stdc++.h>
using namespace std;
#define printint(v) copy(begin(v), end(v), ostream_iterator<int>(cout," "))
#define printintv(s,e) copy(s,e, ostream_iterator<int>(cout," "))
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define clz(a) __builtin_clz(a) // count leading zeroes
#define ctz(a) __builtin_ctz(a) // count trailing zeroes
#define popc(a) __builtin_popcount(a) // count set bits (for ints only diff for ll)
//https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html for other in built
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
//#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef pair<int,int> p32; 
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
typedef map<int,int> m32;
#pragma GCC optimize ("-O2")
const int LIM = 5e5+5, MOD = 1e9+7;
int t,n,m,k,x,y;
multiset<int> ss;
int arr[200005];
ll p2[40];

int main()
{
	IOS;
	cin>>n;
	p2[0]=1;
	forsn(i,1,40){
		p2[i]=2*p2[i-1];
	}
	forn(i,n){
		cin>>arr[i];
		ss.insert(arr[i]);
	}
	int ans=0;
	while(!ss.empty()){
		ll curr=*ss.rbegin();
		ss.erase(ss.find(curr));
		ll grt;
		forn(i,40){
			if(p2[i]>curr)
				{grt=p2[i];break;}
		}
		//dbg(grt),dbg(curr);
		if(ss.find(grt-curr)==ss.end())
			continue;
		ans++;
		ss.erase(ss.find(grt-curr));
	}
	cout<<ans<<ln;
}

Measured memory_bytes: 10368
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  string a, b, c;
  in3(a, b, c);
  out('A');
  out(b[0]);
  out('C');
  memi;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Console;
using static System.Math;

namespace Atcoder
{
    class Program
    {
        static StreamWriter sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false };
        static void Main(string[] args)
        {
            try
            {
                SetOut(sw);
                Solve.Answer();
                Out.Flush();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
                Out.Flush();
            }
        }
    }

    public class Solve
    {
        public static void Answer()
        {
            var nd = IO.RSLong;
            var n = nd[0];
            var d = nd[1];

            long ans = 0;
            for (int i = 0; i < n; i++)
            {
                var xy = IO.RSLong;
                double dis = Sqrt(xy[0] * xy[0] + xy[1] * xy[1]);
                if ((double)d >= dis) ans++;
            }
            WriteLine(ans);
        }
    }

    public class IO
    {
        #region Input
        public static int RInt => int.Parse(ReadLine());
        public static long RLong => long.Parse(ReadLine());
        public static double RDouble => double.Parse(ReadLine());

        public static string[] RSString => ReadLine().Split();
        public static int[] RSInt => ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        public static long[] RSLong => ReadLine().Split().Select(s => long.Parse(s)).ToArray();
        public static double[] RSDouble => ReadLine().Split().Select(s => double.Parse(s)).ToArray();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        public static void WriteLineYes_or_No(bool flag) => WriteLine(flag ? "Yes" : "No");
        public static void WriteLineYES_or_NO(bool flag) => WriteLine(flag ? "YES" : "NO");
        #endregion
    }

    public class Mod
    {
        #region
        private readonly static long M = 1000000007;

        public static long Add(long a, long b) => (a * b) % M;
        public static long Sub(long a, long b) => (a - b) % M >= 0 ? (a - b) % M : (a - b) % M + M;
        public static long Multi(long a, long b) => (a * b) % M;
        #endregion
    }
}

Measured memory_bytes: 23208