akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  while(cin>>a>>b){
    int cnt=0,sum=a+b;
    while(1){if(sum==0) break; sum/=10,cnt++;}
    cout<<cnt<<endl;
  }
  return 0;
}

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

int main()
{
  int a, b;
  cin >> a >> b;
  int v_min = ceil(max(a * 12.5, b * 10.0)), v_max = ceil(min(a * 12.5 + 12.5, b * 10.0 + 10));
  if (v_min < v_max)
    cout << v_min << endl;
  else
    cout << -1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int ai[10005];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&ai[i]);
    }
    sort(ai,ai+n);
    printf("%d\n",ai[n-1]-ai[0]);
    return 0;
}


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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef long long LL;
#define REP(i,N) for (int i=0; i<N; i++)

int main() {
  int X, t;
  cin >> X >> t;
  if (t >= X) cout << 0 << endl;
  else cout << X - t << endl;
}


Measured memory_bytes: 256
N = int(input())
s = [input() for _ in range(N)]
M = int(input())
t = [input() for _ in range(M)]

s2 = set(s)

ans = 0

for i in s2:
    ans = max(s.count(i) - t.count(i), ans)

print(max(ans, 0))


Measured memory_bytes: 3060
#include "bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define repf(i, x, n) for (int i = (int)(x); i < (int)(n); i++)
#define repfr(i, x, n) for (int i = (int)(x)-1; i >= (int)(n); i--)
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline void in(T &a) { cin >> a; }
template <class T, class U> inline void in(T &a, U &b) { cin >> a >> b; }
template <class T, class U, class V> inline void in(T &a, U &b, V &c) {
  cin >> a >> b >> c;
}
template <class T> inline void out(T a) { std::cout << a << endl; }
template <class T, class U> inline void out(T a, U b) {
  cout << a << ' ' << b << endl;
}
template <class T, class U, class V> inline void out(T a, U b, V c) {
  cout << a << ' ' << b << ' ' << c << endl;
}
#define inf 1e9
using ll = int64_t;

void Main() {
  ll a, b;
  in(a, b);
  if (abs(a + b) % 2) {
    out("IMPOSSIBLE");
  } else {
    out(abs(a + b) / 2);
  }

  return;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <functional>
//#include <bits/stdc++.h>

using namespace std;
typedef long long unsigned int ll;	//10^18
typedef unsigned long ul;

typedef map<ll, ll> m;
typedef multimap<ll, ll> mm;
typedef set<ll> s;
typedef multiset<ll> ms;
typedef priority_queue<ll> pq;
typedef queue<ll> q;
typedef deque<ll> dq;
typedef list<ll> lst;
typedef pair<ll, ll> p;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

//#define and &&
//#define or ||
//#define not !
//#define neq !=
//#define eq ==

#define REP(i, n) for(int i=0;i<n;i++)	// from 0 to n
#define REPR(i, n) for(int i = n;i >= 0;i--)	// from n to 0
#define FOR(i, m, n) for(int i = m;i < n;i++)	// from m to n
#define DBG(a) cout << #a << " : " << a << "\n";
#define MSG(a) cout << a << "\n";
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())

#define pb push_back	//配列などの最後に要素を追加
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define F first
#define S second

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; }

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

//swap(a, b);
//sort(arr, arr + n);	//昇順
//sort(arr, arr+n, greater<int>());	//降順
//max(a, b);
//min(a, b);

//upper_bound(a, a+n, k)	//配列aの中で、kより大きい値が初めて現れる位置へのポインタ
//upper_bound(ALL(v), k)	//STLvの中で、kより大きい値が初めて現れる位置へのポインタ
//lower_bound(a, a+n, k)
//lower_bound(ALL(v), k)	//STLvの中で、kの以上値が初めて現れる位置へのポインタ
//lower_bound(ALL(v),k) - upper_bound(ALL(v),k)	//二分探索を用いて、ある列aに含まれる数kの個数を求める


// index が条件を満たすかどうか
bool isOK(vector<ll>& v, int index, int key) {
	if (v[index] >= key) return true;
	else return false;
}

// 汎用的な二分探索	
int bs(vector<ll>& v, int key) {
	int ng = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int ok = (int)v.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

	/* ok と ng のどちらが大きいかわからないことを考慮 */
	while (abs(ok - ng) > 1) {
		int mid = (ok + ng) / 2;

		if (isOK(v, mid, key)) ok = mid;
		else ng = mid;
	}
	return ok;
}

// 最大公約数
ll gcd(ll a, ll b) {
	if (a < b)	swap(a, b);
	ll r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;

}

// 素因数分解
vector<ll> prime_factorization(ll n) {
	vector<ll> cnt_pf(sqrt(n)+2, 0);
	FOR(i, 2, SZ(cnt_pf)) {
		while (n % i == 0) {
			cnt_pf[i]++;
			n /= i;
		}
		if (n == 1)	break;
	}
	if (n != 1) {
		cnt_pf[0]++;
	}
	return cnt_pf;
}

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

	//string s;
	//cin >> s;
	
	ll n, m;
	int ans = 1;
	cin >> n >> m;

	n = gcd(n, m);

	vector<ll> a(sqrt(n)+2);
	a = prime_factorization(n);
	REP(i, SZ(a)) {
		if (a[i] != 0) {
			ans++;
		}
	}


	printf("%d", ans);

	return 0;
}


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

class Program
{
	//Main
	static void Main(string[] args)
	{
		//読み込む
		int N = int.Parse(Console.ReadLine());
		string S = Console.ReadLine();
		char[] RGB = S.ToCharArray();

		//個数をカウント
		long cntR = 0;
		long cntG = 0;
		long cntB = 0;

		for(int i=0; i<N; i++){
				if(RGB[i] == 'R'){
						cntR ++;
				}
				else if(RGB[i] == 'G'){
						cntG ++;
				}
				else{
						cntB ++;
				}
		}

		//暫定解
		//全てバラバラの並びの個数
		long ans = cntR * cntG * cntB;

		//ループ処理
		//等間隔かつ全てバラバラのものを除外
		for(int i=0; i<N; i++){
				int j = 1;
				while((i-j) >= 0 && (i+j) <= N-1){
						if(RGB[i] != RGB[i-j] && RGB[i] != RGB[i+j] && RGB[i-j] != RGB[i+j]){
									ans --;
						}

						j++;
				}
		}

		Console.WriteLine(ans);

	}
}


Measured memory_bytes: 17644
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define endl "\n"
#define f(i, a, b) for(ll i=a; i<b; i++)
#define fb(i, a, b) for(ll i=a; i>=b; i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define vi vector <int>
#define vl vector <long long>
#define pi pair <int, int>
#define sz(x) (int) x.size()
#define M 100005
#define mod 1000000007
using namespace std;

void solve()
{
	int n;
	cin>>n;
	int a[n], b[n], c[n], dp[n][3];
	f(i, 0, n) cin>>a[i]>>b[i]>>c[i];
	dp[0][0] = a[0]; dp[0][1] = b[0]; dp[0][2] = c[0];
	f(i, 1, n)
	{
		dp[i][0] = max(dp[i-1][1]+a[i], dp[i-1][2]+a[i]);
		dp[i][1] = max(dp[i-1][2]+b[i], dp[i-1][0]+b[i]);
		dp[i][2] = max(dp[i-1][0]+c[i], dp[i-1][1]+c[i]);
	}
	cout<<max({dp[n-1][0], dp[n-1][1], dp[n-1][2]});
}

int main()
{
    IOS
    int t = 1;
    //cin>>t;
    f(tno, 1, t+1)
    {
        solve();
    }
    return 0;
}

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

using namespace std;

int main(){
	
    string s1, s2;
    int n;
    
    cin >> n;
    
    while( n-- ) {
    	
	cin >> s1 >> s2;
	
	if( s1.length() > 80 || s2.length() > 80)
  	cout << "overflow\n";
  	
  	else {
  	
  	int i1 = s1.length();
  	int i2 = s2.length();
  	
  	string ans;
    int tmp = 0;
    int up = 0;
  	
  	while( i1 > 0 && i2 > 0 ) {
  		
  		tmp = (s1[i1 - 1] + s2[i2 - 1]) - 2 * '0' + up;
  		
        up = tmp / 10;
        tmp %= 10;
        ans = char(tmp + '0') + ans;
  	
  		i1--;
  		i2--;
  		
	  }
	  if (i1 > 0) {
        while( i1 > 0  ) {
            tmp = s1[i1 - 1] - '0' + up;
            
            up = tmp / 10;
            tmp %= 10;
            ans = char(tmp + '0') + ans;
            
            i1--;
        }
    }
        else if (i2 > 0) {
            while( i2 > 0  ) {
            tmp = s2[i2 - 1] - '0' + up;
                
            up = tmp / 10;
            tmp %= 10;
            ans = char(tmp + '0') + ans;
                
            i2--;
        }
    }
 
        if (up > 0)
        ans = char(up + '0') + ans;
 
        if (ans.size() > 80)
        cout << "overflow" << endl;
        
        else
        cout << ans << endl;
  }
}
  return 0;
}


Measured memory_bytes: 2960
//#define _GLIBCXX_DEBUG

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T1, typename T2>bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++){cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++){for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>vector<vector<T>>vec(ll x, ll y, T w){vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v(ts...))>(a,make_v(ts...));}
template<typename T1, typename T2>ostream &operator<<(ostream &os, const pair<T1, T2>&p){return os << p.first << " " << p.second;}
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v){for(auto &z:v)os << z << " ";cout<<"|"; return os;}
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<vector<ll>>g(n);
  rep(i,0,n-1){
    ll x,y,a;cin>>x>>y>>a;
    g[x].PB(a);
    g[y].PB(a);
  }
  ll sz=16;
  vector<ll>v(sz);
  rep(i,0,n){
    ll k=0;
    for(auto x:g[i])k^=x;
    if(!k)continue;
    if(v[k])res++;
    v[k]^=1;
  }
  auto dp=vec(1<<sz,sz,INF);
  ll start=0;
  rep(i,0,sz)if(!v[i])start^=1<<i;
  dp[start][0]=0;
  rep(i,0,1<<sz){
    rep(j,0,sz){
      rep(o,0,sz){
        if(i&1<<o)continue;
        chmin(dp[i^1<<o][j^o],dp[i][j]+((j^o)!=0));
      }
    }
  }
  cout<<res+*min_element(ALL(dp[(1<<sz)-1]))<<endl;
  return 0;
}

Measured memory_bytes: 20152
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		long x = Long.parseLong(sc.next());
		long count = (b/x) - (a/x);
		if(a % x == 0) count++;
		
		System.out.println(count);
	}
}

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

int main(){
  string s;
  cin >> s;
  ll l = s.length();
  vector<int> sa = suffix_array(s);
  vector<int> la = lcp_array(s,sa);
  ll ans = l * (l+1) / 2;
  for(int x: la) ans -= x;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 15612
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#define maxn 10005
using namespace std;
typedef long long ll;
ll x,y;
int main()
{
	scanf("%lld%lld",&x,&y);
	ll ans=1;
	while(x*2<=y)
		x*=2,ans++;
	printf("%lld\n",ans);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000010;
constexpr ll INF= 1000000000000000000;
constexpr ll MOD = 998244353;
const double PI = 3.1415926535897;
typedef pair<ll,ll> P;

template<typename T>
T Pow(T a,T b) {
    T ret = 1;
    for(int i = 0;i < b;i++) {
        ret *= a;
    }
    return ret;
}

ll mod(ll val) {
    ll res = val % MOD;
    if(res < 0) {
        res += MOD;
    }
    return res;
}

ll RS(ll N, ll P, ll M){
    if(P==0) return 1;
    if(P < 0) {
        return 0;
    }
    if(P%2==0){
        ll t = RS(N, P/2, M);
        return t*t % M;
    }
    return N * RS(N, P-1, M) % M;
}

int main() {
    char A;
    cin >> A;
    if('A' <= A && A <= 'Z') {
        cout << "A" << endl;
    }
    else {
        cout << "a" << endl;
    }
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

ll max(ll a, ll b) {
    if (a < b) return b;
    return a;
}
ll min(ll a, ll b) {
    if (a > b) return b;
    return a;
}
int main() {
    int x; cin >> x;
    vector<bool> a(1e+6,true);
    a[0] = a[1] = false;
    for (int i = 2; i < 1e+6; i++) {
        for (int j = 2*i; j < 1e+6; j+=i)
        {
            a[j] = false;
        }
    }
    for (int i = x; i < 1e+6; i++)
    {
        if (a[i]) {
            cout << i << endl;
            return 0;
        }
    }
    
    return 0;
}

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

using namespace std;

#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define ws(x) cerr << #x << " is " << x << endl;
#define pb(x) push_back(x)
#define ats(x) cout << x << "\n";

typedef long long ll;
typedef vector<int> vi;
typedef pair <int, int> pii;
typedef vector<pii> vii;

const int INF = INT_MAX;


int main()
{
    FAST_IO;
    int n;
    cin >> n;
    int curr = 1;
    ll ans = 0;
    for (ll i = 1; i < n; i++){
       ans += (i);
       curr++;
    }
    ats(ans);
    return 0;
}



Measured memory_bytes: 256
/*********************************************
* c++ template
* 
*********************************************/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define et "\n"

const int PROBLEM_NUM = 1;

/*********************************************
20.06.09 AtCoder Beginner Contest 151. C - Welcome to AtCoder
N問の問題がある
M回の提出で、正解数とペナルティは？
*********************************************/
void solve1()
{
    int numProbs;
    cin >> numProbs;
    int numSubmits;
    cin >> numSubmits;
    
    bool arrFlagAC[numProbs + 1];
    memset(&arrFlagAC, 0, sizeof(arrFlagAC));
    int arrCntWA[numProbs + 1];
    memset(&arrCntWA, 0, sizeof(arrCntWA));
    int cntAC = 0;
    int cntWA = 0;
    
    while (numSubmits-- > 0)
    {
        int p; 
        cin >> p;
        string submitResult;
        cin >> submitResult;
        if (arrFlagAC[p] == true)
        {
            continue;
        }
        if (submitResult == "AC")
        {
            arrFlagAC[p] = true;
            cntAC++;
            cntWA += arrCntWA[p];
            continue;
        }
        if (submitResult == "WA")
        {
            arrCntWA[p]++;
        }
    }
    
    cout << cntAC << " " << cntWA << et;
}

/*********************************************

*********************************************/
void solve2()
{
    
}

/*********************************************

*********************************************/
void solve3()
{
    
}

/*********************************************

*********************************************/
void solve4()
{
    
}

/*********************************************

*********************************************/
void solve5()
{
    
}

/*********************************************

*********************************************/
void solve6()
{
    
}

void IOfaster()
{
    ios::sync_with_stdio(0); cin.tie(NULL);
}

int main()
{
    switch (PROBLEM_NUM) 
    {
        case 1 : solve1();
        case 2 : solve2();
        case 3 : solve3();
        case 4 : solve4();
        case 5 : solve5();
        case 6 : solve6();
    }
}




Measured memory_bytes: 768
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <set>
#include <queue>
#include <stack>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define drep(i, n) for(int i = n - 1; i >= 0; i--)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

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() {
  string s;
  cin >> s;
  stack<int> q;
  rep (i, s.size()) {
    if (s[i] == '0') q.push(0);
    else if (s[i] == '1') q.push(1);
    else if (!q.empty()) q.pop();
  }
  vector<int> v;
  while (!q.empty()) {
    v.push_back(q.top());
    q.pop();
  }

  reverse(v.begin(), v.end());
  rep (i, v.size()) {
    cout << v[i];
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using lint = long;
using llint = long long;
using namespace std;

int main() {
    fastIO;
    int W, H, N;
    cin >> W >> H >> N;

    int o_x = 0, o_y = 0;

    while (N--) {
        int x, y, a;
        cin >> x >> y >> a;
        if (a == 1) {
            if (o_x <= x)
                o_x = x;
        } else if (a == 2) {
            if (W >= x)
                W = x;
        } else if (a == 3) {
            if (o_y <= y)
                o_y = y;
        } else if (a == 4) {
            if (H >= y)
                H = y;
        }
    }
    if (o_x <= W && o_y <= H)
        cout << (W - o_x) * (H - o_y) << endl;
    else
        cout << 0 << endl;
}


Measured memory_bytes: 3612
def main():
    a = input()
    if a in ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']:
        print('A')
    else:
        print('a')

if __name__ == "__main__":
    main()


Measured memory_bytes: 9108
#include "iostream"
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
using namespace std;
using ll=long long;
#define mod  1000000007

int main(int argc, char const *argv[]) {
  int m,n;
  std::cin >> n >> m;
  int a[100],b[100],ans[100];
  for(int i=0; i<100; i++) ans[i]=0;

  for(int i=0; i<m; i++) std::cin >> a[i] >> b[i];

  for(int i=0; i<m; i++){
      ans[a[i]]++;
      ans[b[i]]++;
  }

  for(int i=1; i<=n; i++ ) std::cout << ans[i] << '\n';
  return 0;
}


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

const int INF = 1000000;

char maze[100][100];
int d[100][100];
int H, W;

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

int bfs(){
    queue<pair<int, int> > Q;
    Q.push(make_pair(1, 1));
    d[1][1] = 0;

    while(Q.size()){
        pair<int, int> p = Q.front(); Q.pop();
        if(p.first == H && p.second == W) break;

        for (int i = 0; i < 4; i++){
            int nx = p.first + dx[i], ny = p.second + dy[i];
            if(nx >=1 && nx <= H && ny >= 1 && ny <= W && maze[nx][ny] == '.' && d[nx][ny] == INF){
                Q.push(make_pair(nx, ny));
                d[nx][ny] = d[p.first][p.second] + 1;
            }
        }
    }
    return d[H][W];
}

int main() {
    cin >> H >> W;
    int b = 0;
    for (int i = 1; i <= H; i++){
        for (int j = 1; j <= W; j++){
            cin >> maze[i][j];
            if (maze[i][j] != '.') b++;
            d[i][j] = INF;
        }
    }

    int dis = bfs();
    if (dis == INF){
        cout << -1 << endl;
    } else {
        cout << H*W - b - dis - 1 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy 2333333
#define bql 2147483647
using namespace std;
int n,k;
int main()
{
	fast;
	cin>>n>>k;
	if (k==1)
	   cout<<0<<endl;
	else
	   cout<<n-k<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define vll vector<ll>
#define sz size()
#define pb emplace_back
#define mp make_pair
#define MOD 1000000007
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL))
const int N = 100005;

int main()
{
   ll n;
   cin>>n;
   string s;
   cin>>s;
   //cout<<s;
   for(ll i=0;i<s.size();i++)
   {
   	 s[i]=(s[i]-65+n)%26+65;
   	 cout<<s[i];
   }
  // cout<<s;
}
   

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

int main(){
    int n;
    cin >> n;
    string s,t;
    cin >> s >> t;
    string ans = "";
    rep(i,n){
        ans += s[i];
        ans += t[i];
    }
    cout << ans << endl;
    
    
    return 0;
}

Measured memory_bytes: 256
#133c
N = int(input()) #偶数
d_list = list(map(int, input().split()))

d_list.sort()
#print(d_list)
#print(d_list[int(N/2)-1],d_list[int(N/2)])

if d_list[int(N/2)-1]==d_list[int(N/2)]:
    print("0")
else:
    print(d_list[int(N/2)]-d_list[int(N/2)-1])

Measured memory_bytes: 14428
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
using namespace std;
typedef long long LL;
inline LL merge(LL a,LL b,LL c,LL d) {
	return b-a+1+d-c+1-max(0LL,min(b,d)-max(a,c)+1);
}
int main()
{
	LL a,b;int i,j;
	scanf("%lld%lld",&a,&b);
	if (a==b) return puts("1"),0;
	for (i=59;(a>>i&1)==(b>>i&1);i--);
	a&=(1LL<<i)-1;
	b&=(1LL<<i)-1;
	for (j=0;b>=1LL<<j;j++);
	printf("%lld\n",merge(a,(1LL<<i)+(1LL<<j)-1,a+(1LL<<i),(1LL<<(i+1))-1));
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

int main() {
    string s;
    cin >> s;
    ll n = s.size();

    ll x = 0;
    rep(i, n) {
        x += s[i] - '0';
        x %= 9; 
    }

    if(x == 0) {
        out("Yes");
    }
    else {
        out("No");
    }
    
    re0;
}

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

int main(void) {
  long long N, M;
  cin >> N >> M;
  for (long long i = M / N; i >= 1; i--) {
    if (M % i == 0) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}

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

int main() {
	int h, w, s, t;
	cin >> h >> w >> s >> t;
	if (h % 2 == 1 && w % 2 == 1) {
		if ((t % 2 == 1 && s % 2 == 1)||(t % 2 == 0 && s % 2 == 0)) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	else {
		cout << "Yes" << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3096
import java.util.*;

public class Main {
    static Scanner sc;
    public static void main(String[] args) {
        sc=new Scanner(System.in);
        //A();
        //B();
        //C();
        D();
    }
    public static void A(){
        int n=sc.nextInt();
        int m=sc.nextInt();
        System.out.println((n-2*m>0)?n-2*m:0);
    }
    public static void B(){
        int n=sc.nextInt();
        int a[]=new int[n];
        for(int i=0;i<n;i++)a[i]=sc.nextInt();
        int sum=0;
        for(int i=0;i<n-1;i++)
            for(int j=i+1;j<n;j++)
                sum+=a[i]*a[j];
        System.out.println(sum);
    }
    public static void C(){
        int n=sc.nextInt();
        char []po=sc.next().toCharArray();
        char c=po[0];
        String a=""+c;
        for(int i=1;i<n;i++)
            if(c!=(c=po[i]))
                a+=c;
        System.out.println(a);
    }
    public static void D(){
        int n=sc.nextInt();
        int []a=new int[n];
        for(int i=0;i<n;i++)
            a[i]=sc.nextInt();
        Arrays.sort(a);
        long ans=0;
        for(int i=0;i<n-2;i++){
            int kk=i+1;
            for(int j=i+1;j<n-1;j++){
                for(int k=(Math.max(kk,j));k<n;k++)
                    if(!(a[i]+a[j]>a[k]))
                        break;
                    else kk=k;
                ans+=kk-j;
            }
        }
        System.out.println(ans);
    }
}


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

int main(){
  int n;
  map<string, int> mp;
  string s;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> s;
    mp[s]++;
  }
  cout << mp.size() << endl;
  return 0;
}


Measured memory_bytes: 19256
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

k=int(input())
if k%2==0 or k%5==0:
    print(-1)
    exit()
r=7%k
for i in range(1,10**7):
    if r==0:
        print(i)
        exit()
    r+=(7*pow(10,i,k))
    r%=k
print(-1)


Measured memory_bytes: 72864
#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define endl '\n'
#define pb push_back
#define mod 10000007
#define mp make_pair
#define pi acos(-1)
#define line cout<<"----------------------------"<<endl
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
int  main()
{
    string str;
    cin>>str;
    for(int i=0;i<str.size();i++)cout<<'x';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define DEC(i, a, b) for (int i = (a); i > (b); --i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
typedef long long ll;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
const ll LINF = (int)1e18;
const double EPS = 1e-9;

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

  int n,i;
  cin>>n>>i;
  cout << n - i + 1 << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#define N 1000000
#define L 14

int getChar(char);
long long getKey(char*);
int h1(int);
int h2(int);
int search(char*);
int insert(char*);

char H[N][L];
int main()
{
  int i,n,h;
  char str[L],c[L];
  for (i=0;i<N;i++)
    {
      H[i][0]='\0';
    }
  scanf("%d",&n);
  for (i=0;i<n;i++)
    {
      scanf("%s %s",c,str);
      if (c[0]=='i')   insert(str);
      else
        {
          if (search(str))  printf("yes\n");
          else printf("no\n");
        }
    }
  return 0;
}
int getChar(char ch)
{
  if(ch=='A') return 1;
  else if(ch=='C') return 2;
  else if(ch=='G') return 3;
  else if(ch=='T') return 4;
}
long long getKey(char str[])
{
  long long sum=0,p=1,i;
  for (i=0;i<strlen(str);i++)
    {
      sum+=p*(getChar(str[i]));
      p*=5;
    }
  return sum;
}

int h1(int key)
{
  return key%N;
}
int h2(int key)
{
  return 1+(key%(N-1));
}

int search(char str[])
{
  long long key,i,h;
  key=getKey(str);
  for(i=0;;i++)
    {
      h=(h1(key)+i*h2(key))%N;
      if(strcmp(H[h],str)==0) return 1;
      else if (strlen(H[h])==0) return 0;
    }
  return 0;
}

int insert(char str[])
{
  long long key, i, h;
  key=getKey(str);
  for(i=0;;i++)
    {
      h=(h1(key)+i*h2(key))%N;
      if(strcmp(H[h],str)==0) return 1;
      else if (strlen(H[h])==0)
        {
          strcpy(H[h],str);
          return 0;
        }
    }
  return 0;
}

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

using namespace std;  

const int maxn = 1e5 + 10;

long long n;
long long a[maxn];
int main() {
	long long sum = 0;
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
		sum += a[i];
	}
	a[n] = a[0];
	if(sum % (n * (n + 1) / 2) != 0) {
		printf("NO\n");
		return 0;
	}
	long long cnt = sum / (n * (n + 1) / 2);
	for(int i = 0; i < n; i++) {
		long long tmp = cnt + a[i] - a[i + 1];
		if(tmp < 0 || tmp % n != 0) {
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	return 0;
} 

Measured memory_bytes: 1024
#include<stdio.h>

int main() {
  int n, m, i;
  scanf("%d %d", &n, &m);
  int a[200010] = {};
  int b[200010] = {};
  int onetime[200010] = {};
  int possible[200010] = {};
  onetime[1] = 1;
  possible[n] = 1;
  for (i = 0; i < m; i++) {
    scanf("%d %d",&a[i], &b[i]);
    if (a[i] == 1) {
      onetime[b[i]] = 1;
    }
    if (b[i] == n) {
      possible[a[i]] = 1;
    }
  }
  int flag = 0;
  for (i = 1; i < n+1; i++) {
    if (onetime[i] == 1 && possible[i] == 1) {
      flag = 1;
    }
  }
  if (flag == 0) {
    printf("IMPOSSIBLE\n");
  } else {
    printf("POSSIBLE\n");
  }
  return 0;
}


Measured memory_bytes: 3328
#include<iostream>
#include<algorithm>
#include<queue>
#include<climits>
#include<vector>
using namespace std;

static const int MAX=10000;
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;

int n;
vector<pair<int,int> > adj[MAX];

void dijkstra(){
  priority_queue<pair<int,int> > PQ;
  int color[MAX];
  int d[MAX];

  for(int i=0;i<n;i++){
    d[i]=INT_MAX;
    color[i]=WHITE;
  }

  d[0]=0;
  PQ.push(make_pair(0,0));
  color[0]=GRAY;

  while(!PQ.empty()){
    int u;
    pair<int,int> f=PQ.top();
    PQ.pop();
    u=f.second;

    color[u]=BLACK;

    for(int i=0;i<adj[u].size();i++){
      int v=adj[u][i].first;
      if(color[v]==BLACK) continue;
      if(d[u]+adj[u][i].second<d[v]){
	d[v]=d[u]+adj[u][i].second;
	PQ.push(make_pair(d[v]*(-1),v));
	color[v]=GRAY;
      }
    }
  }

  for(int i=0;i<n;i++) cout<<i<<" "<<d[i]<<endl;

}

int main(){
  int k,u,v,c;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>u>>k;
    for(int j=0;j<k;j++){
      cin>>v>>c;
      adj[u].push_back(make_pair(v,c));
    }
  }

  dijkstra();
  
  return 0;
}

Measured memory_bytes: 6304
//
//  main.c
//  B
//
//  Created by s1262004 on 2019/07/16.
//  Copyright © 2019 s1262004. All rights reserved.
//

#include <stdio.h>
#include <limits.h>

int q,count = 0;
int p[105];
int m[100][100] = {0};

void matrixChainOrder();
int min(int, int);

int main(int argc, const char * argv[]) {
    int temp;
    // insert code here...
    scanf("%d", &q);
    
    for (int i = 1; i <= q; i++) {
        scanf("%d %d", &p[i-1], &temp);
        if (i == q) p[i] = temp;
    }
    matrixChainOrder();
    printf("%d\n", m[1][q]);
    return 0;
}

void matrixChainOrder(){
    for (int i = 1; i <= q; i++) m[i][i] = 0;
    
    for (int l = 2; l <= q; l++){
        for (int i = 1; i <= q-l+1; i++){
            int j = i + l - 1;
            m[i][j] = INT_MAX;
            for (int k = i; k < j; k++){
                int x = m[i][k] + m[k+1][j] + p[i-1] * p[k] * p[j];
                m[i][j] = min(m[i][j], x);
            }
        }
    }
}

int min(int a, int b){
    return ((a < b)? a : b);
}



Measured memory_bytes: 2112
h, w, d = map(int, input().split())
A = [list(map(int, input().split())) for i in range(h)]
q = int(input())
B = [list(map(int, input().split())) for i in range(q)]

g = h * w

D = [[0, 0] for i in range(g+1)]
for i in range(h) :
    for j in range(w) :
        D[A[i][j]] = [i, j]
    

#print(D)
C = [0 for i in range(g+1)]


for i in range(1, (g+1)//d+2):
    for j in range(1, d+1) :
        if i*d+j <= g :
            #print(i*d+j)
            C[i*d+j] += C[i*d+j-d] + abs(D[i*d+j][0]-D[i*d+j-d][0]) + abs(D[i*d+j][1]-D[i*d+j-d][1])
        
#print(C)

for i in range(q) :
    print(C[B[i][1]] - C[B[i][0]])


Measured memory_bytes: 42224
# B
n, m = map(int, input().split())

k = [[int(i) for i in input().split()] for i in range(n)]
v = [0]*31
for i in range(n):
    for j in range(k[i][0]):
        v[k[i][j + 1]] += 1
count = 0
for i in range(len(v)):
    if v[i] == n:
        count += 1
print(count)

Measured memory_bytes: 3064
#include<cstdio>
const int inf=1<<30,N=100;
int A,B,d[11][11],f[11][11],c[111][111];
void cmax(int&a,int b){b>a?a=b:1;}
void cmin(int&a,int b){b<a?a=b:1;}
int main(){
	scanf("%d%d",&A,&B);
	for(int i=1;i<=A;i++)
		for(int j=1;j<=B;j++)scanf("%d",d[i]+j),f[i][j]=inf;
	for(int i=0;i<=100;i++){
		for(int j=0;j<=100;j++){
			for(int x=1;x<=A;x++)
				for(int y=1;y<=B;y++)cmax(c[i][j],d[x][y]-i*x-j*y);
			for(int x=1;x<=A;x++)
				for(int y=1;y<=B;y++)cmin(f[x][y],i*x+j*y+c[i][j]);
		}
	}
	for(int x=1;x<=A;x++)
		for(int y=1;y<=B;y++)if(f[x][y]!=d[x][y])return puts("Impossible"),0;
	puts("Possible");
	printf("%d %d\n",N+1<<1,(N+1)*(N+1)+N*2);
	for(int i=1;i<=N;i++)printf("%d %d X\n",i,i+1);
	for(int i=N;i>=1;i--)printf("%d %d Y\n",i+N+2,i+N+1);
	for(int i=0;i<=N;i++)
		for(int j=0;j<=N;j++)printf("%d %d %d\n",i+1,j+N+2,c[i][j]);
	printf("%d %d\n",1,N+2);
}

Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
double dot(complex<double> a, complex<double> b) {
	return a.real() * b.real() + a.imag() * b.imag();
}
double gyaku_dot(complex<double> a, complex<double> b) {
	return a.real() * b.imag() - a.imag() * b.real();
}
double leng(complex<double> a) {
	return sqrt(a.real()*a.real() + a.imag()*a.imag());
}
double angles(complex<double> a, complex<double> b) {
	double cosine = dot(a, b) / (leng(a) * leng(b));
	double sine = gyaku_dot(a, b) / (leng(a) * leng(b));
	double kaku = acos(cosine);
	if (sine <= 0) {
		kaku = 2 * Ma_PI - kaku;
	}
	return kaku;
}
vector<int> convex_hull(vector<complex<double>> a) {
	vector<int> ans;
	double now_minnest = a[0].real();
	int now_itr = 0;
	REP(i, a.size()) {
		if (now_minnest > a[i].real()) {
			now_minnest = a[i].real();
			now_itr = i;
		}
	}
	ans.push_back(now_itr);
	complex<double> ba(0, 1);
	while (true) {
		int now_go = 0;
		double now_min = 0;
		int starter = ans[ans.size() - 1];
		for (int i = 0; i < a.size(); ++i) {
			if (i != starter) {
				double goa = angles(ba, a[i] - a[starter]);
				if (goa > now_min) {
					now_min = goa;
					now_go = i;
				}
			}
		}
		if (now_go == ans[0]) break;
		ans.push_back(now_go);
		ba = complex<double>(a[now_go] - a[starter]);
	}
	return ans;
}
#include <bits/stdc++.h>
using namespace std;


void solve(long long n){
	string s = to_string(n);
	REP(i, s.length()) {
		if (s[i] == '1') s[i] = '9';
		else if (s[i] == '9') s[i] = '1';
		cout << s[i];
	}
	cout << endl;
}

int main(){
    long long n;
    scanf("%lld",&n);
    solve(n);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define loop(k) rep(author_is_masa,k)
#define chmin(a,b) if((a)>(b)) (a)=(b);
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
#define pii pair<int,int>
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define pb push_back
#define pf push_front
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={1,0,-1,0,1,-1,-1,1};
int dy[]={0,1,0,-1,1,1,-1,-1};
const int MOD = 1e9+7;
const long long INF = 1e18+10;

/*--------------------------------------------------------------------*/

signed main(){
	int n;
	cin>>n;
	vi h(n);
	rep(i,n) cin>>h[i];
	int ans=0;
	int cnt=0;

	rep(i,n-1){
		if(h[i]>=h[i+1]) cnt++;
		else{
			chmax(ans,cnt);
			cnt=0;
		}

	}
	chmax(ans,cnt);
	cout<<ans<<endl;

	return 0;
}



Measured memory_bytes: 4028
S = input()
a = int(S[:2])
b = int(S[2:])

if 1<=a<=12 and 1<=b<=12:
    print("AMBIGUOUS")
elif 1<=a<=12:
    print("MMYY")
elif 1<=b<=12:
    print("YYMM")
else:
    print("NA")

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

int main()
{
    int x;
    cin >> x;
    if (x == 3 || x == 5 || x == 7)
    {
        cout << "YES\n";
    }
    else
    {
        cout << "NO\n";
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#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, a, b) for(int i = (a); i < (b); i++)
#define all(S) (S).begin(), (S).end()
#define pb push_back
#define mk make_pair
#define S second
#define F first
typedef long long ll;
typedef long double lf;
typedef pair<int, int> ii;

int main(int argc, char ** argv) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    printf("%d\n", (a+b)*(c/2));
    return 0;
}


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

const long long int MOD = 1000000007;
//N!を 10^9 + 7 で割った余りを求める
int main() {
    int n;
    cin >> n;
    
    long long int ans = 1;
    for(int i = 1; i <= n; ++i) {
        ans *= i;
        ans %= MOD;
    }
    
    cout << ans << endl;
}


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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int64_t n, a, b;
	std::cin >> n >> a >> b;
	a--;
	b--;
	if ((b - a) % 2 == 0) {
		std::cout << (b - a) / 2 << std::endl;
	} else {
		int64_t l = a;
		int64_t r = n - 1 - b;
		int64_t r0 = b + l;
		int64_t r1 = n - 1 - a + (n - 1 - b);
		std::cout << std::min((r0 + 1) / 2, (r1 + 1) / 2) << std::endl;
		
	}
	
	return 0;
}




Measured memory_bytes: 256
def main():
    n = int(input())
    p = list(map(float, input().split()))

    dp = [[0.0 for i in range(n + 1)] for j in range(n + 1)]
    dp[0][0] = 1.0
    for i in range(n):
        for j in range(n):
            dp[i + 1][j + 1] += dp[i][j] * p[i]
            dp[i + 1][j] += dp[i][j] * (1.0 - p[i])

    ans = 0.0
    for i in range(n // 2+1, n+1):
        ans += dp[n][i]
    print(ans)


if __name__ == '__main__':
    main()

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

int main(){
    int N, A;
    bool All_Even = true;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A;
        if (A % 2 != 0) {
            All_Even = false;
        }
    }
    
    cout << ((All_Even) ? "second" : "first") << endl;
    return 0;
}

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

template <typename T, typename _ = void>
struct is_container : std::false_type {};
template <typename T>
struct is_container<T, std::void_t<decltype(std::declval<T>().begin()),
                                   decltype(std::declval<T>().end())>>
    : std::true_type {};
template <typename T, typename _ = void>
struct is_pair : std::false_type {};
template <typename T>
struct is_pair<T, std::void_t<decltype(std::declval<T>().first),
                              decltype(std::declval<T>().second)>>
    : std::true_type {};
template <typename T>
void debug(const T& v) {
  if constexpr (is_pair<T>::value) {
    std::cerr << "{";
    debug(v.first);
    std::cerr << ", ";
    debug(v.second);
    std::cerr << "}";
  } else if constexpr (is_container<T>::value) {
    std::cerr << "{";
    for (auto it = v.begin(); it != v.end(); ++it) {
      if (it != v.begin()) std::cerr << ", ";
      debug(*it);
    }
    std::cerr << "}";
  } else {
    std::cerr << v;
  }
}
template <typename T, typename... Ts>
void debug(const T& value, const Ts&... args) {
  debug(value);
  std::cerr << ", ";
  debug(args...);
}
#if DEBUG
#define dbg(...)                        \
  do {                                  \
    cerr << #__VA_ARGS__ << ": ";       \
    debug(__VA_ARGS__);                 \
    cerr << " (L" << __LINE__ << ")\n"; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define rd(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  if constexpr (std::is_same<T, bool>::value) {
    std::cout << (value ? "Yes" : "No");
  } else {
    std::cout << value;
  }
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  write_to_cout(value);
  std::cout << ' ';
  write_to_cout(args...);
}
#define wt(...)                 \
  do {                          \
    write_to_cout(__VA_ARGS__); \
    cout << '\n';               \
  } while (0)

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; --i)

template <typename T>
std::istream& operator>>(std::istream& is, std::vector<T>& v) {
  for (T& vi : v) is >> vi;
  return is;
}

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

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

#include <boost/hana/functional/fix.hpp>
auto Fix = boost::hana::fix;

using ll = long long;

template <typename T>
using low_priority_queue =
    std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <typename T>
using V = std::vector<T>;
template <typename T>
using VV = V<V<T>>;

using namespace std;

int main() {
  rd(int, a, b, c, d);
  wt(min(a, b) + min(c, d));
}


Measured memory_bytes: 3676
# ABC086-C

awk '
BEGIN {
    t = 0; x = 0; y = 0; ans = 1;
}
(NF >= 3) {
    dt = $1 - t;
    dx = ($2 > x) ? $2 - x : x - $2;
    dy = ($3 > y) ? $3 - y : y - $3;
    if (dx + dy > dt || (dx + dy) % 2 != dt % 2) {
        ans = 0;
        exit;
    }
    t = $1; x = $2; y = $3;
}
END {
    print ans ? "Yes" : "No";
}
'


Measured memory_bytes: 552
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner sc = null;

		try {

			sc = new Scanner(System.in);

			String s = null;

			while (sc.hasNext()) {

				s = sc.nextLine();

				s = s.replaceAll("apple", "thinG");
				s = s.replaceAll("peach", "apple");
				s = s.replaceAll("thinG", "peach");

				System.out.println(s);

			}

		} finally {
			sc.close();
		}

	}

}

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

using namespace std;

#define umap std::unordered_map
#define uset std::unordered_set
#define _all(container) std::begin(container), std::end(container)
#define _in(container, value) (std::find(_all(container), value) != std::end(container))
#define _in_if(container, predicate) (std::find_if(_all(container), predicate) != std::end(container))
#define _count(container, value) (std::count(_all(container), value))
#define _count_if(container, predicate) (std::count(_all(container), predicate))
#define _odd(value) (value & 1)
#define _even(value) !(value & 1)
#define _for(i, n) for (int i = 0; i < n; ++i)
#define _FOR(i, k, n) for (int i = k; i <= n; ++i)
#define _FORR(i, k, n) for (int i = n; i >= k; --i)

template <typename DATA_TYPE> using V = std::vector<DATA_TYPE>;
template <typename DATA_TYPE> using VV = std::vector<std::vector<DATA_TYPE>>;
template <typename DATA_TYPE> using C = const DATA_TYPE;
using vint = V<int>;
using pint = std::pair<int, int>;
using vpint = V<pint>;
using vdouble = V<double>;
using cint = C<int>;
using cdouble = C<double>;
using Integer = long long;

void solve()
{
    int N, M;
    cin >> N >> M;

    const int inf = std::numeric_limits<int>::max();

    vint status(1 << N, inf);

    // cannot open any keys so price is 0
    status[0] = 0;

    while (M--) {
        int a, b;
        cin >> a >> b;
        int can_open = 0;

        while (b--) {
            int c;
            cin >> c;
            c--;
            can_open |= 1 << c;
        }

        vint copied = status;

        for (int i = 0; i < status.size(); ++i) {
            if (status[i] < inf) {
                int new_status = i | can_open;
                copied[new_status] = std::min(copied[new_status], status[i] + a);
            }
        }
        std::swap(copied, status);
    }

    if (status.back() < inf) {
        cout << status.back() << "\n";
    } else {
        cout << -1 << "\n";
    }
}

int main(int argc, char**)
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    solve();
}


Measured memory_bytes: 256
import sys

def PrimeNumber(max_number):
    # エラトステネスの篩
    is_prime = [True] * (max_number + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(max_number**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, max_number + 1, i):
            is_prime[j] = False

    return is_prime
#    return [i for i in range(max_number + 1) if is_prime[i]]

prime_checker = PrimeNumber(10**5)

# for i in range(11):
#     print(prime_checker[i])

like_2017 = [0] * (10**5+1)

for i in range(1, 10 ** 5 +1, 2):
    if prime_checker[i] == True and prime_checker[(i + 1) // 2]:
        like_2017[i]=1

# print("")
# for i in range(11):
#     print(like_2017[i])


sum_like_2017 = [0] * (10**5+1)

# 累積和
for i in range(10 ** 5):
    sum_like_2017[i+1] = sum_like_2017[i] + like_2017[i]

# print("")
# for i in range(11):
#     print(sum_like_2017[i])

Q = int(input())
for i in range(Q):
    start, end = map(int, input().split())
    print(sum_like_2017[end+1] - sum_like_2017[start])


Measured memory_bytes: 7892