akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<cassert>
#include<complex>//real().imag().
#include<cctype>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<queue>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<string>
#include<utility>
#include<iterator>
#define pii pair<int,int>
#define make_pair mp
using namespace std;
typedef long long ll;
int a[100005];
int main()
{
    // freopen("D:\\in.txt","r",stdin);
    // freopen("D:\\out.txt","w",stdout);
    //ios::sync_with_stdio(false);
    //system("pause");
    int n,x;
    ll cnt=0;
    cin>>n>>x;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(int i=0;i<n-1;i++)
    {
        if(a[i+1]+a[i]>x)
        {
            int c=a[i+1]+a[i]-x;
            if(a[i+1]>=c)
            {
                a[i+1]-=c;
                cnt+=c;
            }else
            {

                cnt+=c;
                a[i+1]=0;
            }

        }
    }
    cout<<cnt<<endl;
   return 0;
}



Measured memory_bytes: 640
#include <iostream>

using namespace std;

int main() {
    int a, b;
    
    cin >> a >> b;
    
    if(a < 9 && b < 9)
    {
        cout << "Yay!" << endl;
        
    }else{
        cout << ":(" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using loop = int;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(loop (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(loop (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(loop (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(loop (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause") //comment out this on AOJ.
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int n, k; cin >> n >> k;
    VI a(n); cin >> a;
    SORT(a);

    function<bool(int)> check = [&](int x) {
        vector<bitset<5001>> dp(2);
        dp[0][0] = true;
        FOR(i, 0, n){
            eFOR(j, 0, k)dp[(i + 1) & 1][j] = false;
            eFOR(j, 0, k) {
                if (!dp[i & 1][j])continue;
                dp[(i + 1) & 1][j] = true;
                if (i != x && j + a[i] <= k) {
                    dp[(i + 1) & 1][j + a[i]] = true;
                }
            }
        }

        FOR(j, max(k - a[x], 0), k)if (dp[n & 1][j])return true;
        return false;
    };

    int ok = n, ng = -1;
    while (ok - ng > 1) {
        int mid = (ok + ng) / 2;
        if (check(mid))ok = mid;
        else ng = mid;
    }

    cout << ok << "\n";
}

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

typedef long double ld;

int main()
{
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
	string s;
	cin>>s;
	
	if(s[2]==s[3])
	{
		if(s[4]==s[5])
		{
			cout<<"Yes";return 0;
		}
	}
	
	cout<<"No";
	return 0;
		
	
}


Measured memory_bytes: 256
from math import sin, cos, sqrt, pi
side_a, side_b, angle = map(int, input().split())                                                                      
angle = angle * pi / 180
side_c = sqrt(side_b**2 + side_a**2 - 2 * side_a * side_b * cos(angle))
area = 0.5 * side_a * side_b * sin(angle)
circum = side_a + side_b + side_c
height = side_b * sin(angle)
print(area, circum, height)

Measured memory_bytes: 5704
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <limits.h>
#include <math.h>

int main(int argc, char *argv[])
{
    int n;
    int a, b;
    int ans;

    scanf("%d", &n);

    a = n / 100;
    b = n % 100;

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

    return 0;
}


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

const int N = 2e5 + 10, mod = 1e9 + 7;



int main() {
    // ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int tc = 1; 
    //scanf("%d", &tc);
    while(tc--) {
        int n; cin >> n;
        int ans = (n / 500) * 1000;
        n -= (n / 500) * 500;
        ans += (n / 5) * 5;
        cout << ans << '\n';
    }    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(vec) vec.begin(), vec.end()
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7;
ll GCD(ll x, ll y) {if (x % y == 0) return y;else return GCD(y, x % y);}
ll LCM(ll x, ll y) { return x * y / GCD(x, y);}

int main(){
  ll ans=0,t=0;
  rep(i,5){
  ll a; cin>>a;
    if(a%10!=0){
       t=max(t,10-a%10); a+=10-a%10;
    }
    ans+=a;
  }
  cout<<ans-t<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long  K, A, B, result = 0;
    cin >> K >> A >> B;
    long long temp=0,cnt=0;

    for (int i = 0 ; result <= B ; i++ ) {
        result += K;
        if (A <= result && result <= B ) {
            cout << "OK" << endl;
            return 0;
        }
    }


    cout << "NG" << endl;

    return 0;
}


Measured memory_bytes: 3592
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
const ll LL_MAX=LLONG_MAX;

struct In{
    template<typename T>
    operator T(){
        T x;
        cin >> x;
        return x;
    }
};
In in;

template <typename T,typename U>
void forin(T* x,U n){
    for (U i=0;i<n;i++) cin >> x[i];
}

template <typename T>
int div1(T x) {
    return x%1000000007;
}

template <typename T>
void out(T x){
    cout << x << endl;
}

template <typename T>
T gcd(T x,T y){
    if (y == 0) return x;
    return gcd(y,x%y);
}

template <typename T>
T lcm(T x,T y){
    return x*y/gcd(x,y);
}

int main(){
    int n=in,a[n],b[n];
    b[0]=0;
    for (int i=1;i<n;i++){
        a[i]=in;
        b[i]=0;
    }
    for (int i=1;i<n;i++){
        b[a[i]-1]++;
    }
    for (int i=0;i<n;i++){
        out(b[i]);
    }
}

Measured memory_bytes: 5156
//変数名を長くしても伝わらなければ意味がないのじゃ
#include <iostream>
#include <algorithm>
#define int long long
using namespace std;
 
int ______________________________________;
int kokoropyonpyonmatchi[100000];
int kangaerufurisite[100001];
int l;
int q;
int mutyotthikaduityaeeeeeeeeee, thikaduityaeeeeeeeeee;
 
int unkonokoun[20][100000];
int nyanyanyanyanyanyanyanyanyanya[20][100000];
 
int dist(int l, int r) {
	if (l > r) swap(l, r);
	return kokoropyonpyonmatchi[r] - kokoropyonpyonmatchi[l];
}
 
bool checkL(int mid) {
	int i = 19;
	int pos = mutyotthikaduityaeeeeeeeeee;
	
	while (i >= 0) {
		if ((mid >> i) % 2 == 1) pos = nyanyanyanyanyanyanyanyanyanya[i][pos];
		i--;
	}
	return (pos <= thikaduityaeeeeeeeeee);
}
 
bool checkR(int mid) {
	int i = 19;
	int pos = mutyotthikaduityaeeeeeeeeee;
	
	while (i >= 0) {
		if ((mid >> i) % 2 == 1) pos = unkonokoun[i][pos];
		i--;
	}
	return (pos >= thikaduityaeeeeeeeeee);
}
 
bool check(int mid) {
	if (mutyotthikaduityaeeeeeeeeee >= thikaduityaeeeeeeeeee) return checkL(mid);
	return checkR(mid);
}
 
signed main() {
	int i, j;
	
	cin >> ______________________________________;
	for (i = 0; i < ______________________________________; i++) cin >> kokoropyonpyonmatchi[i];
	cin >> l;
	
	j = 0;
	for (i = 0; i < ______________________________________; i++) {
		for (j = max(j, i); j < ______________________________________ && dist(i, j) <= l; j++); j--;
		unkonokoun[0][i] = j;
	}
	for (i = 1; i < 20; i++) {
		for (j = 0; j < ______________________________________; j++) {
			unkonokoun[i][j] = unkonokoun[i-1][unkonokoun[i-1][j]];
		}
	}
	
	j = ______________________________________ - 1;
	for (i = ______________________________________ - 1; i >= 0; i--) {
		for (j = min(j, i); j >= 0 && dist(i, j) <= l; j--); j++;
		nyanyanyanyanyanyanyanyanyanya[0][i] = j;
	}
	for (i = 1; i < 20; i++) {
		for (j = 0; j < ______________________________________; j++) {
			nyanyanyanyanyanyanyanyanyanya[i][j] = nyanyanyanyanyanyanyanyanyanya[i-1][nyanyanyanyanyanyanyanyanyanya[i-1][j]];
		}
	}
	
	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> mutyotthikaduityaeeeeeeeeee >> thikaduityaeeeeeeeeee;
		mutyotthikaduityaeeeeeeeeee--;
		thikaduityaeeeeeeeeee--;
		
		int stastasta = 0, toritter = ______________________________________ + 5, mendou;
		while (toritter - stastasta >= 2) {
			mendou = (stastasta + toritter) / 2;
			if (check(mendou)) { toritter = mendou; }
			else { stastasta = mendou; }
		}
		cout << toritter << endl;
	}
	return 0;
}

Measured memory_bytes: 32896
package main

import "fmt"

func main() {
	A := make([]int, 5)
	for i := 0; i < 5; i++ {
		fmt.Scanf("%d", &A[i])
	}

	mini := -1
	min := 10
	for i := 0; i < 5; i++ {
		if A[i]%10 != 0 && A[i]%10 < min {
			min = A[i] % 10
			mini = i
		}
	}
	sum := 0
	for i := 0; i < 5; i++ {
		if A[i]%10 == 0 {
			sum += A[i]
		} else {
			if mini == i {
				sum += A[i]
			} else {
				sum += A[i] - A[i]%10 + 10
			}
		}
	}
	fmt.Println(sum)

}


Measured memory_bytes: 512
A = [[int(i) for i in input().split()] for i in range(3)]
diff1 = []
diff2 = []

for i in range(3):
    diff1.append(A[0][i] - A[1][i])
    
for i in range(3):
    diff2.append(A[1][i] - A[2][i])
    
if len(set(diff1)) == 1 and len(set(diff2)) == 1:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
import Data.List
import Data.Array
import Data.Array.IO
import Data.Maybe
import Data.Bits
import qualified Data.Map as Map 
import Control.Monad
import Control.Applicative

modifyArray arr i f = readArray arr i >>= \x -> writeArray arr i (f x)

listToTuple2 (a:b:_) = (a,b)
listToTuple3 (a:b:c:_) = (a,b,c)
listToTuple4 (a:b:c:d:_) = (a,b,c,d)

main :: IO ()
main = do
  (n:m:_) <- getLine >>= return . map read . words :: IO [Integer]
  as <- getLine >>= return . map read . words :: IO [Integer]

  let
    buildHashmap [] = Map.empty
    buildHashmap (x:xs) = if isNothing lkup then Map.insert x 1 next else Map.insert x (fromJust lkup + 1) next
      where
        next = buildHashmap xs
        lkup = Map.lookup x next


  print $ sum $ map (\a -> a*(a-1)`div`2) (Map.elems $ buildHashmap (map (`mod` m) (scanl (+) 0 as)))



Measured memory_bytes: 60796
#include<bits/stdc++.h>
#define jaldi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main() {
    jaldi

    int n;
    cin>>n;
    if(n>=400 && n<=599) {
        cout<<8<<'\n';
    }
    else if(n>=600 && n<=799) {
         cout<<7<<'\n';
    }
    else if(n>=800 && n<=999){
        cout<<6<<'\n';
    }
    else if(n>=1000 && n<=1199) {
        cout<<5<<'\n';
    }
    else if(n>=1200 && n<=1399) {
        cout<<4<<'\n';
    }
    else if(n>=1400 && n<=1599) {
        cout<<3<<'\n';
    }
    else if(n>=1600 && n<=1799) {
        cout<<2<<'\n';
    }
    else {
        cout<<1<<'\n';
    }
}


Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>
#define endl '\n'
#define ll long long
#define mod 1000000007
#define NCONS 1000000000
//#define NCONS 100001
//#define NCONS 1001
//#define NCONS 101
#define MCONS 2001
#define LIMIT 1000000000
#define TRUE 1
#define FALSE 0
#define toRadian(degree) ((degree) * (M_PI / 180.))
#define toDegree(radian) ((radian) * (180. / M_PI))
using namespace std;
struct Point{int x; int y;};

bool visited[101];

int main(void)
{
    cin.tie(NULL); ios_base::sync_with_stdio(false);
    int N; cin >> N;
    vector<Point> r, b;
    for(int i = 0; i < N; i++)
    {
        int a, b; cin >> a >> b; r.push_back(Point{a, b});
    }
    for(int i = 0; i < N; i++)
    {
        int c, d; cin >> c >> d; b.push_back(Point{c, d});
    }
    
    sort(b.begin(), b.end(), [](Point a, Point b) { return a.x < b.x; });
    sort(r.begin(), r.end(), [](Point a, Point b) { return a.y > b.y; });
    
    int ret = 0;
    
    for(auto v : b)
    {
        for(int i = 0; i < r.size(); i++)
        {
            if(visited[i]) continue;
            if(r[i].x > v.x || r[i].y > v.y) continue;
            visited[i] = true;
            ret += 1;
            break;
        }
    }
    
    cout << ret << endl;
    return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <map>
#include <list>
using namespace std;
typedef long long ll;
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define mp make_pair
#define pb push_back
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9+7;

int main() {
	int N;
	cin >> N;
	int p[N];
	for(int i = 0; i < N; i++) cin >> p[i];

	int cnt = 0;
	for (int i = 0; i < N; i++) {
		if (p[i] != (i+1)) cnt++;
	}

	if (cnt > 2) cout << "NO" << endl;
	else cout << "YES" << endl;
    return 0;
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < n; ++i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define stl_repr(itr, x) for (auto itr = x.rbegin(); itr != x.rend(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()

using llong = long long int;

const static int MOD = 1000000007;
const static int inf = INT_MAX;
const static llong INF = LLONG_MAX;
const static int dx[4] = {1, 0, -1, 0};
const static int dy[4] = {0, 1, 0, -1};

template<typename T> T my_gcd(T a, T b) {
    return (a ? my_gcd(b % a, a) : b);
}

template<typename T> T my_lcm(T a, T b){
    return a * b / my_gcd(a, b);    
}

void solve();

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

    solve();

    return 0;
}

void solve() {
    int n;
    string s, t;
    cin >> n >> s >> t;
    rep(i, n) {
        cout << s[i] << t[i];
    }
    cout << endl; 
}

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

using namespace std;

# define REP(i, a, b) for(int i = a; i <= b; ++ i)
# define CLR(i, a) memset(i, a, sizeof(i))
# define REPD(i, a, b) for(int i = a; i >= b; -- i)
# define REPG(i, h, x) for(int i = h[x]; ~i; i = edge[i].next)

const int N = 1e5 + 5;
typedef long long LL;

int q[N], he, ta;
int n, t, e, var;
LL d[N], f[N];

# define gc getchar
inline int rd() {
	char ch = gc();int ret = 0;
	while(ch < '0' || ch > '9') ch = gc();
	while(ch >= '0' && ch <= '9') ret = ret * 10 + ch - '0', ch = gc();
	return ret;
}

void solve() {
	CLR(f, -1);
	int lm = 0;
	f[0] = 0;
	var = -1;
	he = 1;
	q[++ ta] = 0;
	REP(i, 1, n) {
		while(he <= ta && (d[i] - d[q[he] + 1]) * 2 >= t) ++ he;
		for(lm; lm < q[he]; ++ lm) if(var == -1 || (f[lm] - 2 * d[lm + 1] < f[var] - 2 * d[var + 1])) var = lm;
		if(~var) f[i] = f[var] + 2 * (d[i] - d[var + 1]);//, printf("1[%d %d+%d], ", var, f[var], 2 * (d[i] - d[var + 1])); 
		if(he <= ta) { 
			if(~f[i]) f[i] = min(f[i], f[q[he]] + t);
			else f[i] = f[q[he]] + t;
//			printf("2[%d %d],", q[he], f[q[he]]);
		}
		while(he <= ta && f[q[ta]] > f[i]) -- ta;
		q[++ ta] = i; 
//		printf("%lld\n", f[i]);
	}
	printf("%lld\n", e + f[n]);
}

int main() {
	n = rd(), e = rd(), t = rd();
	REP(i, 1, n) d[i] = rd();
	solve();
	return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <queue>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
typedef long long ll;
typedef pair <int,ll> pii;
vector<ll> a(10005);
vector<ll> b(10005);
int n;
ll maxope=0,needope=0;

int main(void)
{
  cin >> n;
  for(int i=0;i<n;i++)
    {
      cin >> a[i];
    }
  for(int i=0;i<n;i++)
    {
      cin >> b[i];
    }
  for(int i=0;i<n;i++)
    {
      if(a[i]>b[i]) needope+=a[i]-b[i];
      else if(a[i]<b[i]) maxope+=(b[i]-a[i])/2;
    }
  if(maxope>=needope)
    {
      cout << "Yes" << endl;
    }
  else
    {
      cout << "No" << endl;
    }
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
using lint = long long;
template<typename T = lint>inline T in() { T x; cin >> x; return x; }
#define INF           1e9
#define INFL          static_cast<lint>(INF)
#define REP(i,n)      for(lint i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)     for(lint i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)     for(lint i=n-1;i>=0;--i)
#define REPR1(i,n)    for(lint i=n;i>0;--i)
#define REPI(i,ini,n) for(lint i=(ini),i##_len=(n);i<i##_len;++i)
#define REPC(i,obj)   for(auto i:obj)
#define R_UP(a,b)     (((a)+(b)-1)/(b))
#define ALL(obj)      (obj).begin(),(obj).end()
int main()
{
	int q = in();
	set<int>s;
	REP(i, q)
	{
		int n = in();
		int x = in();
		switch (n)
		{
		case 0:
			s.insert(x);
			cout << s.size() << endl;
			break;
		case 1:
			cout << (s.find(x) == s.end() ? 0 : 1) << endl;
			break;
		}
	}
}


Measured memory_bytes: 12368
#include <bits/stdc++.h>
using namespace std;
#define inf 999999999
#define loop(i, a, b) for (int i = (a), i##len = (b); i < i##len; ++i)
#define rep(i, n) loop(i, 0, n)
#define lin long long
#define lfl long double

lin n, x0, x[100001];

lin _lcm(lin a, lin b)
{
    lin c = a % b;

    if(c == 0)
        return b;

    return _lcm(b, c);
}

lin lcm(lin a, lin b)
{
    if(a > b)
        return _lcm(a,b);
    else
        return _lcm(b,a);
}

int main(void)
{
    cin >> n >> x0;
    rep(i,n)
    {
        cin >> x[i];
    }

    lin res = abs(x0 - x[n-1]);

    rep(i,n-1)
    {
        lin ax = abs(x0 - x[i]);
        res = lcm(ax, res);
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 1024
package main

import (
	"fmt"
)

func main() {

	var nums [][]int
	for i := 0; ; i++ {
		var x, y int
		fmt.Scan(&x, &y)

		if x+y == 0 {
			break
		}

		var xy []int
		xy = append(xy, x)
		xy = append(xy, y)

		nums = append(nums, xy)
	}

	for _, v := range nums {

		for i := 0; i < v[0]; i++ {
			for i := 0; i < v[1]; i++ {
				fmt.Printf("#")
			}
			fmt.Printf("\n")
		}
		fmt.Printf("\n")
	}
}



Measured memory_bytes: 1100
import java.nio.charset.IllegalCharsetNameException;
import java.util.*;
import java.lang.*;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if (b - a == c - b) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}

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

int main(){
    string s; cin >> s;
    int count = 0;
    for (int i=0;i<s.size();i++){
        if (s[i] == '+') {
            count++;
        } else {
            count--;
        }
    }

    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
	int N = nextInt();
	int count = 0;
	int sum = 0;
	while(true){
		sum += N;
		count++;
		if(sum % 360 == 0){
			myout(count);
			return;
		}
	}
	}
	//Method addition frame start


  
	//Method addition frame end
}


Measured memory_bytes: 32988
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    char s;
    cin>>s;
    if (s=='Y'){
      cout<<"Four";
      return 0;
    }
  }
  cout<<"Three";  
}


Measured memory_bytes: 768
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<String> s = new ArrayList<>();
        IntStream.range(0, n).forEach(i -> s.add(sc.next()));
        int m = sc.nextInt();
        List<String> t = new ArrayList<>();
        IntStream.range(0, m).forEach(i -> t.add(sc.next()));

        Map<String, Integer> map = new HashMap<>();
        s.forEach(blue -> map.merge(blue, 1, (a, b) -> a + b));
        t.forEach(red -> map.merge(red, -1, (a, b) -> a + b));
        Entry<String, Integer> max = map.entrySet().stream().max(Map.Entry.comparingByValue()).get();

        if (max.getValue() < 0) {
            System.out.println(0);
            return;
        }
        System.out.println(max.getValue());
    }

}


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

using namespace std;
typedef long long ll;

struct UnionFind {
    vector<int> par; // 親ノード
    vector<int> rank; // ランク

    UnionFind(int n = 1) {
        init(n);
    }

    void init(int n = 1) {
        par.resize(n); rank.resize(n);
        for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;
    }

    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }

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

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        return true;
    }
};

int main() {
  int N;
  cin >> N;
  vector<pair<ll, ll> > xlist(N);
  vector<pair<ll, ll> > ylist(N);
  
  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    xlist[i] = make_pair(x, i);
    ylist[i] = make_pair(y, i);
  }
  sort (xlist.begin(), xlist.end());
  sort (ylist.begin(), ylist.end());

  vector<pair<int, pair<int, int> > > order;
  for (int i = 0; i < N - 1; i++) {
    ll xdiff = xlist[i + 1].first - xlist[i].first;
    order.push_back(make_pair(xdiff, make_pair(xlist[i].second, xlist[i + 1].second)));

    ll ydiff = ylist[i + 1].first - ylist[i].first;
    order.push_back(make_pair(ydiff, make_pair(ylist[i].second, ylist[i + 1].second)));    
  }

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

  ll ans = 0;
  UnionFind uf(N);

  for (auto o : order) {
    ll s = o.second.first;
    ll e = o.second.second;

    if (!uf.issame(s, e)) {
      uf.merge(s, e);
      ans += o.first;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 8052
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define mod 1000000007

using namespace std;
typedef pair<llint, llint> P;

llint n, N, M;
llint p[1<<17];
llint a[1<<18], ainv[1<<18], b[1<<18];
llint c[1<<18], d[1<<18];
vector<llint> vec;
llint ans = 0;

llint modpow(llint a, llint n)
{
	if(n == 0) return 1;
	if(n % 2){
		return ((a%mod) * (modpow(a, n-1)%mod)) % mod;
	}
	else{
		return modpow((a*a)%mod, n/2) % mod;
	}
}

void calc2(llint l, llint r, llint c[])
{
	for(int i = l; i <= r; i++){
		llint v = p[i-M]+M;
		while(v){
			c[v] += b[i], c[v] %= mod;
			vec.push_back(v);
			v /= 2;
		}
	}
}

void calc(llint x, llint l, llint r)
{
	llint m = (l+r)/2;
	
	vec.clear();
	calc2(l, m, c);
	calc2(m+1, r, d);
	
	sort(vec.begin(), vec.end());
	vec.erase(unique(vec.begin(), vec.end()), vec.end());
	reverse(vec.begin(), vec.end());
	
	llint ret = 0;
	for(int i = 0; i < vec.size(); i++){
		llint v = vec[i];
		if(v*2 < N){
			llint tmp = c[v*2] * d[v*2+1] % mod;
			tmp += d[v*2] * c[v*2+1] % mod, tmp %= mod;
			tmp *= ainv[v], tmp %= mod;
			ret += tmp, ret %= mod;
		}
	}
	for(int i = 0; i < vec.size(); i++){
		llint v = vec[i];
		c[v] = d[v] = 0;
	}
	
	ret *= ainv[x], ret %= mod;
	ans += ret, ans %= mod;
	
	if(x*2 < M) calc(2*x, l, m), calc(2*x+1, m+1, r);
}

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	N = 1<<n, M = 1<<(n-1);
	for(int i = 0; i < M; i++) cin >> p[i], p[i]--;
	
	a[1] = 1;
	for(int i = 2; i < N; i++) a[i] = a[i/2] * i % mod;
	for(int i = 1; i < N; i++) ainv[i] = modpow(a[i], mod-2) * modpow(a[i], mod-2) % mod * i % mod;
	for(int i = 0; i < M; i++) b[M+i] = a[M+i] * a[M+p[i]] % mod;
	
	calc(1, M, N-1);
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 46336
using System;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var inputs = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int a = inputs[0], b = inputs[1];

            var diff = Math.Abs(b - a);
            var possible = diff % 2 == 0;

            if (possible)
            {
                var answer = (a + b) / 2;
                Console.WriteLine(answer);
            }
            else
            {
                Console.WriteLine("IMPOSSIBLE");
            }
        }
    }
}


Measured memory_bytes: 13396
# Title: /\/\/\/
# Link: https://arc103.contest.atcoder.jp/tasks/arc103_a

import sys
import collections

sys.setrecursionlimit(10 ** 6)

read_single_int = lambda: int(sys.stdin.readline().strip())
read_list_int = lambda: list(map(int, sys.stdin.readline().strip().split(' ')))


def solution(n: int, vs: list):
    map_a = collections.defaultdict(lambda: 0)
    map_b = collections.defaultdict(lambda: 0)

    for i in range(0, n, 2):
        map_a[vs[i]] += 1
        map_b[vs[i+1]] += 1

    pair_a = [(k, map_a[k]) for k in map_a.keys()]        
    pair_b = [(k, map_b[k]) for k in map_b.keys()]

    pair_a = sorted(pair_a, key=lambda x: x[1], reverse= True)
    pair_b = sorted(pair_b, key=lambda x: x[1], reverse= True)

    first_a, second_a = pair_a[0], (0, 0) if len(pair_a) == 1 else pair_a[1]
    first_b, second_b = pair_b[0], (0, 0) if len(pair_b) == 1 else pair_b[1]

    if first_a[0] != first_b[0]:
        return n//2-first_a[1] + n//2-first_b[1]
    else:
        if first_a[1] + second_b[1] < second_a[1] + first_b[1]:
            return n//2-second_a[1] + n//2-first_b[1]

    return n//2-first_a[1] + n//2-second_b[1]


def main():
    n = read_single_int()
    vs = read_list_int()
    print(solution(n, vs))


if __name__ == '__main__':
    main()

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

int n, m;
typedef pair<int, int> P;
vector<P> g[1010];
long long int dist[1010];
long long int inf = 1e15;

bool BellmanFord(){
	for(int i=1; i<n; ++i)
		dist[i] = inf;
	for(int i=0; i<2*n; ++i){
		for(int j=0; j<n; ++j){
			for(int k=0; k<g[j].size(); ++k){
				if(dist[j] != inf && dist[g[j][k].second] > dist[j] + g[j][k].first){
					dist[g[j][k].second] = dist[j] + g[j][k].first;
					if(i >= n-1 && g[j][k].second == n-1)
						return true;
				}
			}
		}
	}
	return false;
}

int main(){
	cin >> n >> m;
	for(int i=0; i<m; ++i){
		int a, b, c;
		cin >> a >> b >> c;
		g[a-1].push_back(P(-c, b-1));
	}
	if(BellmanFord()) cout << "inf" << endl;
	else cout << -dist[n-1] << endl;
/*	for(int i=0; i<n; ++i)
		cout << dist[i] << endl;
*/
}

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

namespace ForATCODER
{
    public class Program
    {
        public static void Main(string[] args)
        {



            long[] sw = s2larray(Console.ReadLine().Split(' '));
            if (sw[1] >= sw[0]) { RESULT("unsafe"); } else { RESULT("safe"); }
        


        }
    
    



    
      
      
        static int s2i(String s)
        {
            return Convert.ToInt32(s);
        }
        static long s2l(String s)
        {
            return Convert.ToInt64(s);
        }
        static void RESULT(double res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(long res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(ulong res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(int res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(String res)
        {
            Console.WriteLine(res);
        }
        static String[] ReadLineAll(int count)
        {
            String[] res = new String[count];
            for (int i = 0; i < count; i++)
            {
                res[i] = Console.ReadLine();
            }
            return res;
        }

        static int[] s2iarray(String[] src)
        {
            int len = src.Length;
            int[] res = new int[len];
            for (int i = 0; i < len; i++)
            {
                res[i] = Convert.ToInt32(src[i]);
            }
            return res;
        }
        static long[] s2larray(String[] src)
        {
            int len = src.Length;
            long[] res = new long[len];
            for (int i = 0; i < len; i++)
            {
                res[i] = Convert.ToInt64(src[i]);
            }
            return res;
        }
    }
}


Measured memory_bytes: 27552
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
//ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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 (a>b) { a=b; return 1; } return 0; }
struct mint{
    using ull=unsigned long long int;
    ull v;
    mint(ll vv=0){s(vv%mod+mod);}
    mint& s(ull vv){
        v=vv<mod?vv:vv-mod;
        return *this;
    }
    //オーバーロード
    mint operator-()const{return mint()-*this;}//mint型にキャスト
    mint&operator+=(const mint&val){return s(v+val.v);}
    mint&operator-=(const mint&val){return s(v+mod-val.v);}
    mint&operator*=(const mint&val){
        v=ull(v)*val.v%mod;
        return *this;
    }
    mint&operator/=(const mint&val){return *this*=val.inv();}
    mint operator+(const mint&val){return mint(*this)+=val;}
    mint operator-(const mint&val){return mint(*this)-=val;}
    mint operator*(const mint&val){return mint(*this)*=val;}
    mint operator/(const mint&val){return mint(*this)/=val;}
    mint pow(int n)const{
        mint res(1),x(*this);
        while(n){
            if(n&1)res*=x;
            x*=x;
            n>>=1;
        }
        return res;
    }
    mint inv()const{return pow(mod-2);}
    //拡張ユークリッドの互除法
    /* mint inv()const{
        int x,y;
        int g=extgcd(v,mod,x,y);
        assert(g==1);
        if(x<0)x+=mod;
        return mint(x);
    }*/
    friend ostream& operator<<(ostream&os,const mint&val){
        return os<<val.v;
    }//出力
    bool operator<(const mint&val)const{return v<val.v;}
    bool operator==(const mint&val)const{return v==val.v;}
    bool operator>(const mint&val)const{return v>val.v;}
};
map<P,P> mp;
int main(){
   int n;
   cin>>n;
   ll zero=0;
   for(int i=0;i<n;i++){
       ll x,y;
       cin>>x>>y;
       if(x==0&&y==0){
           zero++;
           continue;
       }
       ll g=gcd(x,y);
       x/=g;y/=g;
       if(y<0){
           x=-x;
           y=-y;
       }
       if(x==0){
           mp[P(0,1)].fi++;
       }else if(y==0){
           mp[P(0,1)].se++;
       }else{
           if(x<0){
               mp[P(y,-x)].fi++;
           }else{
               mp[P(x,y)].se++;
           }
       }
   }
   mint ans=1;
   for(auto p:mp){
       mint res=1;
       res+=mint(2).pow(p.se.fi)-mint(1);
       res+=mint(2).pow(p.se.se)-mint(1);
       ans*=res;
   }
   ans-=mint(1);
   ans+=mint(zero);
   cout<<ans<<"\n";
}

Measured memory_bytes: 19264
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  ll n;
  cin >> n;
  vl a(n);
  rep(i,n){
    cin >> a[i];
  }
  ll k=n-1;
  while(k>=0){
    cout << a[k] << " ";
    k -=2;
  }
  if(k==-2){
    k=1;
    while(k<n){
      cout << a[k] << " ";
      k +=2;
    }
  }
  else if(k==-1){
    cout << a[0] << " ";
    k=2;
    while(k<n){
      cout << a[k] << " ";
      k +=2;
    }
  }
}

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

using namespace std;

#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(c) (c).begin(), (c).end()

struct State{
    int score, time, num;
    State(int score, int time, int num)
        :score(score), time(time), num(num){}
};

bool operator<(const State &a, const State &b){
    return tie(b.score, b.time, b.num) < tie(a.score, a.time, a.num);
}

bool operator==(const State &a, const State &b){
    return tie(a.score, a.time) == tie(b.score, b.time);
}

int main(){
    int M, T, P, R;
    while(cin >> M >> T >> P >> R, P|T|P|R){
        vector<State> team;
        rep(i, T)team.emplace_back(0, 0, i+1);
        vector<vector<int> > pen(T, vector<int>(P));
        while(R--){
            int m, t, p, j;
            cin >> m >> t >> p >> j;
            t--; p--;
            if(j)pen[t][p]++;
            else{
                team[t].score++;
                team[t].time -= m + 20 * pen[t][p];
            }
        }
        sort(all(team));
        rep(i, T){
            if(i)cout << (team[i-1] == team[i]? '=': ',');
            cout << team[i].num;
        }
        cout << '\n';
    }
    return 0;
}

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

/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
*/

using namespace std;

#if DEBUG && !ONLINE_JUDGE
    #include "debug.h"
#else
    #define debug(...)
#endif

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<vector<int> > vvi;
typedef vector<vector<ii> > vvii;

#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define ff first
#define ss second
#define trav(a, x) for(auto& a : x) 
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
const ll INF = 1e18;
const int mod = 1e9 + 7;
ll gcd(ll a,ll b){if (a==0) return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return a*(b/gcd(a,b));}
ll Abs(ll a){if(a>0)return a;return -a;}
ll Ceil(ll a,ll b){if(a%b==0)return a/b;else return a/b+1;}
double Abs(double a){if(a>0)return a;return -a;}

//*X.find_by_order(2) element at index=2
//X.order_of_key(1) how many elements strictly less than 1

//#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_NOde_update> 

inline int pow_(ll x, ll y,ll p){
  int r = 1; while(y){if(y & 1) r = r * x % p; y >>= 1; x = x * x % p;} return r;
}
inline int inv_(int x){return pow_(x, mod - 2, mod);}
inline int add(int a, int b){a += b; if(a >= mod) a -= mod; return a;}
inline int mul(int a, int b){return a * 1LL * b % mod;}
inline int sub(int a, int b){a -= b; if(a < 0) a += mod; return a;}

int main()
{
    #ifdef LOCAL_TEST
    freopen("in.txt","r",stdin);
    //freopen("out.txt", "w", stdout);
    #else
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    #endif
    ll a,b;
    cin>>a>>b;
    ll ans = max(a+b,max(a-b,a*b));
    cout << ans << "\n";
    return 0;   
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

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

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


int main()
{
	ll n, a, b;
	cin >> n >> a >> b;

	if (n == 1 && abs(a - b) > 1)
	{
		println(0);

		return 0;
	}

	if (a > b)
	{
		println(0);
		return 0;
	}


	ll m0 = a * (n - 1) + b;
	ll m1 = a + b * (n - 1);

	println(m1 - m0 + 1);
	
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] strs = new String[3];

		for (int i = 0; i < 3; i++) {
			strs[i] = sc.next();
		}
		System.out.println(strs[0].substring(0, 1) + strs[1].substring(1, 2) + strs[2].substring(2));
		sc.close();
	}

}


Measured memory_bytes: 22868
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/* clang-format off */
#define INF (INT_MAX / 4)
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
#define TIMER_S(start) chrono::system_clock::time_point start = chrono::system_clock::now();
#define TIMER_E(end) chrono::system_clock::time_point end = chrono::system_clock::now();
#define TIME(start, end) cout << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count()) << "ms" << "\n";
/* clang-format on */

int main() {
  ll a;
  double b;
  cin >> a >> b;
  int bi = (int)(b * 100.0+0.1);
  ll ans = a * bi;
  if (ans >= 100) {
    string anss = to_string(ans).substr(0, to_string(ans).size() - 2);
    cout << anss << "\n";
  } else {
    int ans2 = ans / 100;
    cout << ans2 << "\n";
  }

  return 0;
}


Measured memory_bytes: 3812
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	if(a+b>=a*b&&a+b>=a-b)
	{
		printf("%d",a+b);
		return 0;
	}
	if(a*b>=a+b&&a*b>=a-b)
	{
		printf("%d",a*b);
		return 0;
	}
	else
	{
		printf("%d",a-b);
		return 0;
	}
}

Measured memory_bytes: 256
// CppPractice.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

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

	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		if (i % 2 == 1) cnt += 1;
	}
	cout << (double)cnt / (double)n << endl;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

#define FOR(i,a,n) for (int i = a; i < (int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define whole(f,x,...) ([&](decltype((x)) whole) { \
    return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
template<typename T> bool chmin(T &a, const T &b) {if (a > b) { a = b; return true; }return false;}
template<typename T> bool chmax(T &a, const T &b) {if (a < b) { a = b; return true; }return false;}

using ll = int_fast64_t;

constexpr ll INF = (1e9);
constexpr ll MOD = (1e9+7);

int main() {
  int n; cin >> n;
  vector<int> a(n); REP(i,n) cin >> a[i];
  int cnt = 0;
  REP(i,n) {
    while (a[i] %2 == 0) {
      a[i]/=2; cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9+7;
bool path[10][10];
int main() {
	int n, m;
	cin >> n >> m;
	
	rep(i,m) {
			int a, b; cin >> a >> b;
			path[a-1][b-1] = true;
			path[b-1][a-1] = true;
	}
	vector<int> num(n-1);
	rep(i,n-1) num[i] = i+1;

	int ans = 0;
	do
	{
		int now = 0;
		bool ok = true;
		rep(i,n-1) {
			if (!path[now][num[i]]) ok = false;
			now = num[i]; 
		}
		if (ok) ans++;
	} while (next_permutation(num.begin(),num.end()));
	

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
	ll n, x, m;
	cin >> n >> x >> m;
	vector<int> a;
	set<int> p;
	int now = x;
	ll ans = 0, sum = 0;
	while (!p.count(now)) {
		a.push_back(now);
		p.insert(now);
		now = now % m * now % m;
	}
	int l = 0;
	for (int i = 0; i < a.size(); i++) {
		if (a[i] == now) {
			break;
		}
		l++;
	}
	ll c = (n - l) / (a.size() - l);
	ll r = (n - l) % (a.size() - l);
	for (int i = l; i < a.size(); i++) {
		sum += a[i];
	}
	if (n < l) {
		for (int i = 0; i < n; i++) {
			ans += a[i];
		}
		cout << ans << endl;
		return 0;
	}
	ll lSum = 0;
	for (int i = 0; i < l; i++) {
		lSum += a[i];
	}
	ans = lSum + sum * c;
	for (int i = l; i < l + r; i++) {
		ans += a[i];
	}
	cout << ans << endl;
	return 0;
}

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

#include <iostream>

using namespace std;
typedef unsigned long long ull;

const int MAX = 200001;
const int MOD = 998244353; //should be prime;

long long fac[MAX], finv[MAX], inv[MAX];
void COMBinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ull COMB(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(int argc, char* argv[]){
	int N, M, K;

	cin >> N >> M >> K;
	COMBinit();

	ull m[MAX] = {0};
	m[0] = 1;
	for(int i=1; i<=N; i++){ m[i] = ( (M - 1) * m[i-1] ) % MOD; }

	ull ans = 0;
	for(int k=0; k<=K; k++){
		ull c = COMB(N-1, k) % MOD;
		c = (M*c) % MOD;
		c = (c * m[N-k-1]) % MOD;
		ans += c;
	}
	cout << (ans%MOD) << endl;
	return 0;
}

Measured memory_bytes: 9936
N,K = [int(i) for i in input().split()]
#D = [int(i) for i in input().split()]は数値代入
#文字列を複数代入
D = input().split()
#集合に置き換える(型はset)
D = set(D)
use = set(['0','1','2','3','4','5','6','7','8','9'])
use -= D

for i in range(N,88889):
    if use >= set(str(i)):
        print(i)
        break


Measured memory_bytes: 2940
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var nextReader func() string

func newScanner() func() string {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, 1024), int(1e11))
	sc.Split(bufio.ScanWords)
	return func() string {
		sc.Scan()
		return sc.Text()
	}
}

func nextString() string { return nextReader() }

func nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }

func nextInts(size int) []int {
	ns := make([]int, size)
	for i := 0; i < size; i++ {
		ns[i] = nextInt()
	}
	return ns
}

func init() {
	nextReader = newScanner()
}

func pow(x, y int) int {
	return int(math.Pow(float64(x), float64(y)))
}

func nDigits(x int) int {
	if x == 0 {
		return 1
	}
	var cnt int
	for x != 0 {
		cnt++
		x /= 10
	}
	return cnt
}

func main() {
	N, M := nextInt(), nextInt()
	s := make([]int, M, M)
	c := make([]int, M, M)
	digits := make(map[int]int)
	for i := 1; i <= N; i++ {
		digits[i] = -1
	}
	for i := 0; i < M; i++ {
		s[i], c[i] = nextInt(), nextInt()
		if digits[s[i]] != c[i] && digits[s[i]] != -1 {
			fmt.Println(-1)
			return
		}
		digits[s[i]] = c[i]
	}
	var sum int
	for i := 1; i <= N; i++ {
		v := digits[i]
		if v == -1 {
			if i == 1 && len(digits) != 1 {
				v = 1
			} else {
				v = 0
			}
		}
		sum += v * pow(10, N-i)
	}
	if nDigits(sum) != N {
		fmt.Println(-1)
		return
	}
	if sum == -1 {
		fmt.Println(0)
	} else {
		fmt.Println(sum)
	}
}



Measured memory_bytes: 640