akhauriyash/Code-Regression huggingface dataset:
// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include <stack>
#include <random>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define all(a) a.begin(), a.end()
#define MM << " " <<

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

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

template<typename T>
void vdeb(std::vector<T> &da) {
    for (int i = 0;i < da.size();i++) {
        if (i == da.size() - 1) std::cout << da[i];
        else std::cout << da[i] << ' ';
    }
    std::cout << '\n';
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
    for (int i = 0;i < da.size();i++) {
        std::cout << i << ' ';
        vdeb(da[i]);
    }
    std::cout << '\n';
}

using namespace std;


int main() {
    string s; cin >> s;
    ll ret = 0;
    rip(i,s.size(),0) ret += s[i]-'0';
    cout << ((ret%9== 0)? "Yes":"No") << '\n';
}

Measured memory_bytes: 3724
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] l = new int[n];
        for(int i=0; i<n; i++){
            l[i] = sc.nextInt();
        }

        Arrays.sort(l);

        int other = 0;
        for(int i=0; i<n-1; i++){
            other += l[i];
        }

        if(other > l[n-1]){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

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

int main() {
    long long N;
    long long cnt1=0,cnt2=0,cnt3=0,cnt4=0;
    string input;
    cin >> N;
    for(long long i=0;i<N;i++){
        cin >> input;
        if(input == "AC"){
            cnt1++;
        }else if(input == "WA"){
            cnt2++;
        }else if(input == "TLE"){
            cnt3++;
        }else if(input == "RE"){
            cnt4++;
        }
    }
    cout <<"AC x " << cnt1 << endl;
    cout <<"WA x " << cnt2 << endl;
    cout <<"TLE x " << cnt3 << endl;
    cout <<"RE x " << cnt4 << endl;
}

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

int main(){
    string S;
    int64_t K;
    cin >> S >> K;
    int N = S.size();
    vector<int> lens;
    int len = 1;
    for(int i=1; i<N; i++){
        if(S[i-1] == S[i]){
            len++;
        }else{
            lens.push_back(len);
            len = 1;
        }
    }
    lens.push_back(len);
    if(lens[0] == N){
        int64_t L = N*K;
        int64_t ans = L/2;
        cout << ans << endl;
        return 0;
    }
    int sz = lens.size();
    int64_t ans = 0;
    if(S[0] == S[N-1]){
        for(int i=1; i<sz-1; i++) ans += (lens[i]/2) * K;
        ans += lens[0]/2;
        ans += lens[sz-1]/2;
        ans += ((lens[0]+lens[sz-1])/2) * (K-1);
    }else{
        for(int l : lens) ans += l/2;
        ans *= K;
    }
    cout << ans << endl;
    return 0;
}


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

#define INF (1ll << 60ll)

using namespace std;

long long n;
vector<long long> a;
vector<long long> b;
vector<long long> c;

int main()
{
    long long ans = 0;
    long long tmp;
    
    cin >> n;
    for (long long i = 0; i < n; i++) {
        cin >> tmp;
        a.push_back(tmp);
    }
    for (long long i = 0; i < n; i++) {
        cin >> tmp;
        b.push_back(tmp);
    }
    for (long long i = 0; i < n; i++) {
        cin >> tmp;
        c.push_back(tmp);
    }

    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());

    for (long long i = 0; i < n; i++) {
        auto ap = lower_bound(a.begin(), a.end(), b[i]);
        auto cp = upper_bound(c.begin(), c.end(), b[i]);

        ans += (ap - a.begin()) * (c.end() - cp);
    }

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


Measured memory_bytes: 3316
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		if (N<=K) {
			System.out.println(N*X);
		} else {
			System.out.println(K*X+(N-K)*Y);
		}
	}
}

Measured memory_bytes: 21460
n = int(input())
s = input()

lst = [[] for i in range(10)]

for i in range(n):
    c = int(s[i])
    lst[c].append(i)

done = []
cnt = 0
for x in range(0,1000):
    tmp = str(x).rjust(3,'0')
    c1,c2,c3 = int(tmp[0]),int(tmp[1]),int(tmp[2])
    
    mi = -1
    mx = -1
    if len(lst[c1]) != 0:
        mi = lst[c1][0]
    if len(lst[c3]) != 0:
        mx = lst[c3][-1]
    
    if mi >= 0 and mx >= 0:
        for y in lst[c2]:
            if mi < y < mx:
                done.append(tmp)
    else:
        continue
        

print(len(set(done)))


Measured memory_bytes: 27876
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cstring>

using namespace std;

int main(){

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

    int tempSum = 0;
    for(int i = 0; i < N + 1; i++){
        tempSum += abs(A[i + 1] - A[i]);
    }

    for(int i = 0; i < N; i++){
        int before = A[i];
        int now = A[i + 1];
        int next = A[i + 2];

        int dist1 = now - before;
        int dist2 = next - now;

        if(dist1 * dist2 >= 0){
            cout << tempSum << "\n";
        }
        else{
            cout << tempSum - 2 * min(abs(now - before), abs(next - now)) << "\n";
        }
    }

    return 0;
}

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



int main() {
	int n, k;
	cin >> n >> k;
	vector<int> v;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		v.push_back(x);
	}
	ll ans = 1e18;
	for (int i = 0; i + k - 1 < n; i++) {
		ll curr = min(abs(v[i]), abs(v[i + k - 1])) + abs(v[i]-v[i+k-1]);
		ans = min(curr, ans);
	}
	cout << ans;
}

Measured memory_bytes: 892
#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;

int main(){
	string s;
	cin >> s;
	int check = 0;
	for(int i = 0;i < s.size();i++){
		if(s[i] == 'L'){
			check = 1;
			break;
		}
		i++;
		if(s[i] == 'R'){
			check = 1;
			break;
		}
	}
	if(check == 1){
		cout << "No";
	}else{
		cout << "Yes";
	}
	return 0;
}


Measured memory_bytes: 256
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}
var mod = 1e9+7;

console.log(main());
function main(){
  var s = o.a(1);
  var l = s.length;
  var dp = xArray(0,l+1,13);
  dp[0][0] = 1;
  for(var i = 0; i < l; i++){
    var x = i+1;
    if(s[i] === "?"){
      for(var j = 0; j < 13; j++){
        for(var k = 0; k < 10; k++){
          var y = (j*10+k)%13;
          dp[i+1][y] += dp[i][j];
        }
      }
      for(var j = 0; j < 13; j++)dp[i+1][j] %= mod;
    }else{
      var t = +s[i];
      for(var j = 0; j < 13; j++){
        var y = (j*10+t)%13;
        dp[i+1][y] = dp[i][j];
      }
    }
  }
  return dp[l][5];
}

Measured memory_bytes: 75572
#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 <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define rep(i, init, n) for(int i = init; i <(int)(n); i++)

int main() {
    ll A, B, C, K;
    cin >> A >> B >> C >> K;
    ll sum = 0;
    if (K >= 0) {
        sum += min(A, K);
        K -= A;
    }
    if (K >= 0) {
        K -= B;
    }
    if (K >= 0) {
        sum -= K;
    }
    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 3148
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[7] = {0, 1, 1, 0, -1, -1, 0};
int dy[2][7] = {{1, 0, -1, -1, -1, 0, 0},
                {1, 1, 0, -1, 0, 1, 0}};
struct S{
  int x, y, s, t;
  S(int x, int y, int s, int t) : 
    x(x), y(y), s(s), t(t) {}
  bool operator < (const S& st) const {
    return s > st.s;
    if(t != st.t) return t > st.t;
    if(x != st.x) return x > st.x;
    return y > st.y;
  }
};

int main(){
  int sx, sy, gx, gy;
  while(cin>>sx>>sy>>gx>>gy){
    int n;
    bool furnit[201][201] = {};
    int fx[1000], fy[1000];
    cin>>n;
    REP(i, n){
      cin>>fx[i]>>fy[i];
    }
    int W, H;
    cin>>W>>H;
    REP(i, n){
      furnit[fy[i] + H][fx[i] + W] = true;
    }
    sx += W; sy += H; gx += W; gy += H;
    priority_queue<S> que;
    que.push(S(sx, sy, 0, 0));
    int ans = -1;
    bool used[201][201][6] = {};
    while(!que.empty()){
      S s = que.top(); que.pop();
      if(s.x == gx && s.y == gy) {
        ans = s.s;
        break;
      }
      if(used[s.y][s.x][s.t]) continue;
      used[s.y][s.x][s.t] = true;
      int dir = abs((s.x - W) * (s.y - H) * s.t) % 6;
      //printf("x = %d y = %d s = %d t = %d dir = %d\n", s.x - W, s.y - H, s.s, s.t, dir);
      for(int r = 0; r < 7; r++){
        S next(s.x + dx[r], s.y + dy[abs(s.x - W) % 2][r], (dir == r) ? s.s : (s.s + 1), (s.t + 1) % 6);
        //printf("next[%d]: x = %d y = %d s = %d t = %d ", r, next.x - W, next.y - H, next.s, next.t);
        if(valid(next.x, next.y, 2 * W + 1, 2 * H + 1) && !furnit[next.y][next.x] && !used[next.y][next.x][next.t]){
          //printf("OK");
          que.push(next);
        }
        //printf("\n");
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1948
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl;

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100000;

struct BIT {
	int n;
	vi bit;
	BIT(int num):bit(num+1,0){n=num;}
	void add(int i, int w){
		for(int x=i; x<=n; x+=x&-x) bit[x]+=w;
	}
	int sum(int i){
		int ret=0;
		for(int x=i; x>0; x-=x&-x) ret+=bit[x];
		return ret;
	}
	int sum(int l, int r){return sum(r)-sum(l);}
};

int a[N],s[N+1];

int main() {
	ll n;cin>>n;
	rep(i,n) {cin>>a[i];}
	int lower=1, upper=pow(10,9);
	int ans=0;
	while(upper>=lower){
		int mid=(lower+upper)/2;
		s[0]=0;
		rep(i,n){
			if(a[i]>=mid) s[i+1]=s[i]+1;
			else s[i+1]=s[i]-1;
		}
		BIT tree(2*n+10);
		rep(i,n+1) s[i]+=n+1;
		ll cnt=0;
		rep(i,n+1){
			cnt+=tree.sum(s[i]);
			tree.add(s[i],1);
		}
		if(cnt>=(n*n+n+3)/4){
			ans=max(ans,mid);
			lower=mid+1;
		}
		else upper=mid-1;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 1804
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <climits>
#include <bitset>
#include <list>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main(){
    string s;
    cin >> s;
    int cnt=0;
    for(int i=0; i<4; i++){
        if(s[i]=='2') cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <map>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)n;i++)
#define REP1(j,n) for(int j=0;j<(int)n;j++)
#define REPD(i,n) for(int i=n;i>=0;i--)
#define REPD1(j,n) for(int j=n;j=>0;j--)
#define REPS(i,n) for(int i=1;i<=(int)n;i++)
#define REPS1(j,n) for(int j=1;j<=(int)n;j++)
#define rep(i,a,n) for(int i=a;i<(int)n;i++)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())
#define AsceSort(a) sort(a.begin(),a.end())

using namespace std;
typedef long long ll;

int main(void) {
	int n,T,c[1005],t[1005];
	int ans = 1e5;
	bool b=false;
	cin >> n>>T;
	REP(i, n) { cin >> c[i] >> t[i]; }
	REP(i, n) {
		if (T >= t[i]) {
			ans = min(ans, c[i]);
			b = true;
		}
	}
	if (b)cout << ans << endl;
	else cout << "TLE" << endl;
	return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define mfill(x,y) memset(x,y,sizeof(x))
#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...) 42
#endif
#define y0 y12345
#define y1 y54321
typedef unsigned long ul;
typedef long long ll;
//typedef pair<int, int> mpair;
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;}
using namespace std;

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
   	int n,m;
	cin>>n;
	vector<pair<ul, ul>> p(n);
	ul a[n], b[n];
	rep(i, n) {
		cin>>a[i] >> b[i];
		p[i].first = b[i];
		p[i].second = a[i];
	}
	sort(p.begin(), p.end());
	rep(i, n){
		//cerr << p[i].first << p[i].second << endl;
	}
	ul now = 0;
	rep(i, n){
		now += p[i].second;
		if(now > p[i].first){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}


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

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }


int main() {
    ll a,b; cin >> a >> b;
    ll x = a * b;

    /* 自然数 a > b を確認・入替 */
    if(a<b){
        ll tmp = a;
        a = b;
        b = tmp;
    }

    /* ユークリッドの互除法 */
    ll r = a % b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }
    

    cout << x/b << endl;

    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <functional>
#include <numeric>
#include <limits>
#include <iomanip>
#include <queue>
#include <cmath>
#include <math.h>
using namespace std;
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; }
const long long INF = 1LL << 60;
using pll = pair<long long, long long>;
#define min(a, b) ((a) < (b) ? (a) : (b))

int main() {

    // 標準入力が早くなる。Cスタイルの入出力とC++スタイルの入出力を混合させてはならない。
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

	int N; cin >> N;

	for (int i = 1; i < 10; i++) {
		for (int j = 1; j < 10; j++) {
			if (i * j == N) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}

	cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

LL R, G, B, N;

int main() {
	cin >> R >> G >> B >> N;
	int ans = 0;
	for (LL r = 0; r <= N; ++r) {
		for (LL g = 0; g <= N; ++g) {
			LL now = r * R + g * G;
			if (N - now >= 0 && (N - now) % B == 0) {
				++ans;
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
X = int(input())

if(X>=400 and X<=599):
    print(8)
elif (X>=600 and X<=799):
    print(7)
elif (X>=800 and X<=999):
    print(6)
elif(X>=1000 and X<=1199):
    print(5)
elif(X>=1200 and X<=1399):
    print(4)
elif(X>=1400 and X<=1599):
    print(3)
elif(X>=1600 and X<=1799):
    print(2)
elif(X>=1800 and X<= 1999):
    print(1)

Measured memory_bytes: 61912
#include <bits/stdc++.h>
using namespace std;
#define ll                      long long
#define pb                      push_back
#define rep(i,a,b,c)            for(ll i=(a);i<=(b);i+=(c))
#define repb(i,a,b,c)           for(ll i=(a);i>=(b);i-=(c))
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
#define mp                      make_pair
#define vpll                    vector<pair<ll,ll> >
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define ln                      cout<<"\n";
#define endl                    "\n"
#define test                    ll T;cin>>T;while(T--)
#define isvowel(a)              (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define show(w,size)            for(ll i=0;i<size;i++) cout<<w[i]<<" ";
#define prll(a)                 cout<<a<<"\n";
#define mset(dp,no)             memset(dp,no,sizeof(dp))
#define input(a,n)              rep(i,0,n-1,1) cin>>a[i];
#define countbit                __builtin_popcount                                           //Number of setbits in decimal notation
#define lb(v,val)               lower_bound(all(v),val)-v.begin()
#define ub(v,val)               upper_bound(all(v),val)-v.begin()
/*#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}*/
ll pows(ll b,ll e){if(e==0)return 1;else if(e%2==0){ll a=pow(b,e/2);return a*a;}else {ll a=pow(b,e/2);return b*a*a;}}
ll powm(ll x,ll y,ll m){x=x%m;ll res=1;while(y){if(y&1)res=res*x;res%=m;y=y>>1;x=x*x;x%=m;}return res;}
ll modInverse(ll a, ll m=MOD){if(m == 1)return 0;ll m0=m,y=0,x=1;while(a>1){ll q=a/m,t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0) x+=m0;return x;}
int main()
{
fastIO
ll n,m,i,j,k,x,y,z,e,f,p,q,g,l,r,w,h,count1=0,prod=1,a,b,c,d,index,x1,x2,diff,ans=0,sum=0,sum1=0,sum2=0,flag=0,flag1=0,flag2=0;
string s,s1,s2;
cin>>n;
cin>>s;
for(i=0;i<n-2;i++)
{
	if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
	{
		count1++;
	}
}
cout<<count1;
}

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

void print(vector<unsigned> v) {
  for (unsigned i = 0; i < v.size() - 1; i++) {
    cout << v[i] << " ";
  }
  cout << v[v.size() - 1] << endl;
}

int main() {
  unsigned N;
  cin >> N;
  vector<unsigned> A(N);
  for (unsigned n = 0; n < N; n++) {
    cin >> A[n];
  }
  print(A);
  for (unsigned n = 1; n < N; n++) {
    unsigned v = A[n];
    unsigned m = n;
    while (m > 0 && A[m - 1] > v) {
      A[m] = A[m - 1];
      m--;
    }
    A[m] = v;
    print(A);
  }
  return 0;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	ll cur=1;
	FOR(i,N) {
		ll v;
		cin>>v;
		if(1.0*cur*v>1e18) cur=1LL<<60;
		else cur*=v;
	}
	if(cur>1000000000000000000LL) {
		cout<<-1<<endl;
	}
	else {
		cout<<cur<<endl;
	}
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 3660
#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;
int L[12],R[12];
const int MAX_N = 200005;
const ll MOD = 998244353;
ll dp[MAX_N],sum[MAX_N];

int main()
{
	int N,K;
	cin >> N >> K;
	rep(i,K)
	{
		cin >> L[i] >> R[i];
	}
	dp[1] = 1;
	sum[1] = 1;
	for (int i = 2; i <= N; ++i)
	{
		rep(j,K)
		{
			int l = max(1,i-R[j]), r = max(0,i-L[j]);
			ll temp = (sum[r] - sum[l-1]+ MOD) % MOD;
			dp[i] = (dp[i] + temp) % MOD;
		}
		sum[i] = (sum[i-1] + dp[i]) % MOD;
	}
	cout << dp[N] << endl;
	return 0;
}

Measured memory_bytes: 6720
#include<iostream>
#include<queue>
using namespace std;
int H,W,S;
string s[50],t[10][50];
int dp[2][50][50][1<<10];
int d[5]={0,1,0,-1,0};
main()
{
	cin>>W>>H;
	queue<pair<pair<int,int>,pair<int,int> > >Q;
	for(int i=0;i<H;i++)
	{
		cin>>s[i];
		for(int j=0;j<W;j++)
		{
			if(s[i][j]=='%')
			{
				Q.push(make_pair(make_pair(0,0),make_pair(i,j)));
			}
		}
	}
	cin>>S;
	for(int i=0;i<2;i++)for(int j=0;j<H;j++)for(int k=0;k<W;k++)for(int l=0;l<1<<S;l++)
	{
		dp[i][j][k][l]=2e9;
	}
	dp[0][Q.front().second.first][Q.front().second.second][0]=0;
	for(int i=0;i<S;i++)
	{
		for(int j=0;j<H;j++)cin>>t[i][j];
	}
	while(!Q.empty())
	{
		int f=Q.front().first.first,sw=Q.front().first.second,x=Q.front().second.first,y=Q.front().second.second;
		Q.pop();
		int nxt=dp[f][x][y][sw]+1;
		if(s[x][y]=='&')
		{
			cout<<dp[f][x][y][sw]<<endl;
			return 0;
		}
		for(int r=0;r<4;r++)
		{
			int tx=x+d[r],ty=y+d[r+1];
			if(tx<0||ty<0||tx>=H||ty>=W||s[tx][ty]=='#')continue;
			int nf=s[tx][ty]=='^'||s[tx][ty]>='A'&&s[tx][ty]<='J'?1:0;
			for(int k=0;k<S;k++)
			{
				if(sw>>k&1&&t[k][tx][ty]=='*')nf++;
			}
			nf%=2;
			if(s[tx][ty]!='|'&&nf!=f)continue;
			if(dp[f][tx][ty][sw]>nxt)
			{
				dp[f][tx][ty][sw]=nxt;
				Q.push(make_pair(make_pair(f,sw),make_pair(tx,ty)));
			}
		}
		if(s[x][y]=='|')
		{
			if(dp[1-f][x][y][sw]>nxt)
			{
				dp[1-f][x][y][sw]=nxt;
				Q.push(make_pair(make_pair(1-f,sw),make_pair(x,y)));
			}
		}
		else if(s[x][y]>='a'&&s[x][y]<='j')
		{
			int id=s[x][y]-'a';
			int nf=t[id][x][y]=='*'?1-f:f;
			int nsw=sw^1<<id;
			if(dp[nf][x][y][nsw]>nxt)
			{
				dp[nf][x][y][nsw]=nxt;
				Q.push(make_pair(make_pair(nf,nsw),make_pair(x,y)));
			}
		}
		else if(s[x][y]>='A'&&s[x][y]<='J')
		{
			int id=s[x][y]-'A';
			int nf=t[id][x][y]=='*'?1-f:f;
			int nsw=sw^1<<id;
			if(dp[nf][x][y][nsw]>nxt)
			{
				dp[nf][x][y][nsw]=nxt;
				Q.push(make_pair(make_pair(nf,nsw),make_pair(x,y)));
			}
		}
	}
	cout<<-1<<endl;
}



Measured memory_bytes: 23760
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1000000007)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin >> a >> b;
    cout << (a-1)*(b-1) << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int X = sc.nextInt();
        if(500*K >= X) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (long long i = 0; i < n; i++)
#define RREP(i, n) for (long long i = n - 1, 0 <= i; i--)
#define FOR(i, start, end) for (long long i = start; i < end; i++)
#define RFOR(i, start, end) for (long long i = start - 1; 0 <= i; i--)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1'000'000'007
using ll = long long;
using namespace std;
const int INF32       = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7        = 1'000'000'007;
const int MOD9        = 1'000'000'009;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}

// 素因数を数列で返す。ソートされている。
// first が素因数で second が個数
template <class T> map<T, long long> factring(T N) {
    map<T, long long> ans;
    int now = N;
    while (now != 1) {
        N           = now;
        long long i = 2;
        while (i * i <= N) {
            if (N % i == 0) {
                ans[i]++;
                N /= i;
            } else {
                i++;
            }
        }
        if (N != 1)
            ans[N]++;
        now--;
    }

    return ans;
};

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

    int N;
    cin >> N;
    auto fac      = factring(N);
    long long ans = 1;
    for (auto &&i : fac) {
        ans *= i.second + 1;
        MOD(ans);
    }
    print(ans);

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
using namespace std;
int main() {
	int a, b, c;
	//string s="error";
	cin >> a; cin >> b; //cin >> c;
	//if (b-a == c-b)cout << "YES" << endl;
	//else cout << "NO" << endl;
	cout << (a + b) % 24 << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    vector<int>p(n);
    REP(i,n)cin >> p[i];
    int min_num = 200100;
    int answer = 0;
    REP(i,n){
        if(p[i] < min_num){
            answer++;
            min_num = p[i];
        }
    }
    cout << answer << endl;
    return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

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

using namespace std;

const int dx[4]={0,-1,0,1};
const int dy[4]={1,0,-1,0};
const int p[4]={3,2,1,0};
const int q[4]={1,0,3,2};

string board[110];
int dist[100][100][4][11][11];

int main(void){
	int n,m,a;
	cin >> n >> m >> a;
	rep(i,n) cin >> board[i];

	int si=0,sj=0;
	rep(i,n)rep(j,m) if(board[i][j]=='S') si=i,sj=j;

	int gi=0,gj=0;
	rep(i,n)rep(j,m) if(board[i][j]=='G') gi=i,gj=j;
	
	rep(i,n)rep(j,m)rep(d,4)rep(pi,a+1)rep(qi,a+1) dist[i][j][d][pi][qi]=100;

	using state=tuple<int,int,int,int,int>;
	
	deque<state> que;
	dist[si][sj][0][a][a]=0;
	que.push_back(state(si,sj,0,a,a));

	while(!que.empty()){
		int ci,cj,d,pi,qi;
		tie(ci,cj,d,pi,qi)=que.front();
		que.pop_front();

		if(ci==si && cj == sj && d==2) continue;
		
		{
			const int ni=ci+dy[d],nj=cj+dx[d];
			if(0<=ni&&ni<n&&0<=nj&&nj<m&&board[ni][nj]!='#' && chmin(dist[ni][nj][d][pi][qi],dist[ci][cj][d][pi][qi])) 
				que.push_front(state(ni,nj,d,pi,qi)); 	
		}

		if(board[ci][cj]=='.'){
			if(pi>0){
				const int nd=p[d],npi=pi-1,nqi=qi,ni=ci+dy[nd],nj=cj+dx[nd];
				if(0<=ni&&ni<n&&0<=nj&&nj<m&&board[ni][nj]!='#' && chmin(dist[ni][nj][nd][npi][nqi],dist[ci][cj][d][pi][qi]+1)) 
					que.push_back(state(ni,nj,nd,npi,nqi));
			}
			if(qi>0){
				const int nd=q[d],npi=pi,nqi=qi-1,ni=ci+dy[nd],nj=cj+dx[nd];
				if(0<=ni&&ni<n&&0<=nj&&nj<m&&board[ni][nj]!='#' && chmin(dist[ni][nj][nd][npi][nqi],dist[ci][cj][d][pi][qi]+1))
					que.push_back(state(ni,nj,nd,npi,nqi));
			}
		}		
	}

	int ans=100;
	rep(d,4)rep(pi,a+1)rep(qi,a+1) chmin(ans,dist[gi][gj][d][pi][qi]);
	if(ans==100) ans=-1;
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 18708
#include <bits/stdc++.h>
using namespace std;
#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
using ll = long long;

int main() {
    string n;
    cin >> n;
    if(n[n.size()-1] == '2' || n[n.size()-1] == '4'|| n[n.size()-1] == '5'|| n[n.size()-1] == '7'
    || n[n.size()-1] == '9'){
        cout << "hon" << endl;
    }
    if(n[n.size()-1] == '0' || n[n.size()-1] == '1'|| n[n.size()-1] == '6'|| n[n.size()-1] == '8'){
        cout << "pon" << endl;
    }
    if(n[n.size()-1] == '3')cout << "bon" << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
#define END return 0
typedef int64_t ll;
const int mod7 = 1e9 + 7;
const int mod9 = 1e9 + 9;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a % b) : abs(a);}
template<typename T> T lcm(T a, T b) {return a / gcd(a, b) * b;}
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;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) {fill((T*)array, (T*)(array+N), val);}

int main() {
    string s;
    cin >> s;
    int n = s.size();
    map<int, int> m;
    reverse(s.begin(), s.end());
    ll sum = 0, k = 1;;
    m[sum]++;
    rep(i, n) {
        sum += k * (s[i] - '0'), sum %= 2019;
        k = k * 10 % 2019;
        m[sum]++;
    }
    ll ans = 0;
    for(auto c : m) {
        ll a = c.second;
        ans += a * (a - 1) / 2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
int main(){
    string a, b;
    cin >> a >> b;
    if(a[0]==b[2] && a[1]==b[1] && a[2]==b[0]){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
mod=1000000007
def powmod(a, n):
    global mod
    res = 1
    tmp=a
    while n>0:
        if n & 1 == 1:
            res = (res * tmp) % mod
        n=n//2
        tmp = tmp * tmp % mod
    return res
n,k=map(int, input().split())
appear_num = [0] * k
ans = 0
for gcm in range(k,0,-1):
    multi_num = k // gcm
    appear_num[gcm-1] = powmod(multi_num, n)
    for i in range(2, multi_num+1):
        appear_num[gcm-1] += mod - appear_num[i*gcm-1]
        appear_num[gcm-1] %= mod
    ans += gcm*appear_num[gcm-1]
    ans %= mod
print(ans)

Measured memory_bytes: 70092
T1, T2 = map(int, input().split())
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())

a, b, ans = 0, 0, 0
n1 = (A1-B1)*T1
n2 = n1 + (A2-B2)*T2
if n2 == 0:
  print('infinity')
elif n1*n2 < 0:
  ans += 2 * (abs(n1)//abs(n2))
  if abs(n1)%abs(n2) > 0:
    ans += 1
  print(ans)
else:
  print(0)

Measured memory_bytes: 61952
#include <cstdio>
#include <cstring>
#define rep(i, n) for(i=0;i<(n);++i)
int a[11][11], n, i, j, t;
int main()
{
    while (scanf("%d", &n), n) {
        memset(a, 0, sizeof(a));
        rep(i, n) rep(j, n) {
            scanf("%d", &t); a[i][j] = t; a[n][j] += t; a[i][n] += t;
        }
        rep(i, n) a[n][n] += a[i][n];
        rep(i, n+1) {
            rep(j, n+1) printf("%5d", a[i][j]);
            puts("");
        }
    }
    return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;

LL N;
std::vector<LL>a;
std::vector<std::vector<std::vector<std::pair<LL, LL>>>>memo;

std::pair<LL, LL> dp(LL i, LL j, LL k)
{
	std::pair<LL, LL>res(0, 0);
	if (j < i) return res;
	if (memo[i][j][k].first != -1) return memo[i][j][k];
	if (k == 0)
	{
		LL res1_X = dp(i + 1, j, (k + 1) % 2).first + a[i];
		LL res1_Y = dp(i + 1, j, (k + 1) % 2).second;
		LL res2_X = dp(i, j - 1, (k + 1) % 2).first + a[j];
		LL res2_Y = dp(i, j - 1, (k + 1) % 2).second;
		if (res1_X - res1_Y >= res2_X - res2_Y) res = std::make_pair(res1_X, res1_Y);
		else res = std::make_pair(res2_X, res2_Y);
	}
	else
	{
		LL res1_Y = dp(i + 1, j, (k + 1) % 2).second + a[i];
		LL res1_X = dp(i + 1, j, (k + 1) % 2).first;
		LL res2_Y = dp(i, j - 1, (k + 1) % 2).second + a[j];
		LL res2_X = dp(i, j - 1, (k + 1) % 2).first;
		if (res1_X - res1_Y <= res2_X - res2_Y) res = std::make_pair(res1_X, res1_Y);
		else res = std::make_pair(res2_X, res2_Y);
	}
	return memo[i][j][k] = res;
}

int main()
{
	in >> N;
	a.resize(N);
	rep(i, N) in >> a[i];

	memo.resize(N);
	rep(i, memo.size())
	{
		memo[i].resize(N);
		rep(j, memo[i].size()) memo[i][j].resize(2, std::make_pair(-1, -1));
	}
	out << dp(0, N - 1, 0).first - dp(0, N - 1, 0).second << std::endl;
}


Measured memory_bytes: 633472
#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include<stack>
#include<sstream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<list>
#include<numeric>
typedef long long ll;

#define pi 3.14159265358979323846
#define VI vector<int>
#define VLL vector<long long>
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
const ll MOD = 1e9 + 7;
using namespace std;
template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a * b / gcd(a, b);
}

template<typename T>
T finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}
	else { // 発見できなかったとき
		return 0;
	}
}
ll frac(ll n)
{
	if (n == 0) {
		return 1;
	}
	return (n * frac(n - 1)) % MOD;
}

/*char r[4];
int yaju[4];
char op[3];
int sum = 0;
scanf("%s", r);
for (int i = 0;i < 4;i++) {
	yaju[i] = r[i] - '0';
}
*/
int main() {
	VLL A(3), B(3), C(3);
	string S;cin >> S;
	ll ans = 0;
	for(ll i = S.size()-1;i > 0;i--) {
		if (S[i] != S[i - 1]) ans++;
	}
	cout << ans << endl;
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=s;i<n;i++)

typedef vector<double> vd;
typedef vector<vd> vvd;

int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    
    if(n % 2 == 1){
        cout << "No" << endl;
        return 0;
    }

    rep(i,n/2){
        if(s[i] != s[i + n/2]){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    return 0;
}

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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

int main() {
  ll r;
  cin >> r;

  r = r * 2;
  double ans = r * M_PI;
  cout << fixed << setprecision(10);
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3772
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<numeric>
#include<utility>
#include<unordered_map> //hash map

#define rep(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define rrep(i,a,n) for(int (i)=(a);(i)>=(n);(i)--)

#define INF 1000000000
#define MOD 1000000007

typedef  long long ll;

using namespace std;

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

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

double euclid_distance(double a,double b){
    return sqrt(a*a+b*b);
}

ll gcd(ll  a,ll b){
    ll r;
    if(a < b){
        ll tmp;
        tmp = a;
        a = b;
        b = tmp;
    }
    while(r = a % b){
        a = b;
        b = r;
    }
    return b;
}

void Integer_factorization(long long int b,long long int n){
    long long int a = 2;
    long long int count = 0;
    long long int ans = 1;
    long long int ndash = n;
    if(b == 1) cout << n << endl;
    else{
    while(ndash >= a*a){
        if(n % a  == 0){
            count++;
            n/=a;

        if(count % b == 0){
            ans *= a;
        }
        }else{a++;count = 0;}
    }

    cout<<  ans << endl;
    }
}

ll r_fuct[2000];
ll fuct[2000];

//MOD逆元
void conb(ll n,ll k){
    fuct[0] = 1;
    for(int i = 1;i < k+1;i++){
        fuct[i] *= fuct[i-1]%MOD;
        
        ll b = MOD, u = 1, v = 0;
        ll value = fuct[i];
        while (b) {
            ll t = value / b;
            value -= t * b;
            swap(value, b);
            u -= t * v;
            swap(u, v);
        }
        u %= MOD;
        if (u < 0) u += MOD;
        r_fuct[i] = u;
    }
}

ll factrial(ll n){
    if(n == 0) return 1;
    ll p = factrial(n-1)*n%MOD;
    return p;
}

//MOD逆元
ll farmat(ll n,ll p){    
    if(p == 0) return 1;
    else if(p == 1) return n%MOD;
    ll d = farmat(n,p/2);
    if(p%2 == 0){
        return (d*d)%MOD;
    }else{
        return ((n*d)%MOD*d)%MOD;
    }
}

ll conbination(ll n,ll k){
    ll a = factrial(n);
    ll b = factrial(k);
    ll c = factrial(n-k);
    return (a*farmat(b,MOD-2)%MOD*farmat(c,MOD-2))%MOD;
}


void solve() {
   int n;
   cin >> n;
   double a = 0;
   for(int i = 0;i < n;i++){
       double p;
       cin >> p;
       a += (double)1/p;
   }
   cout << (double)1/a << endl;

}

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
	return 0;
}


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

int main() {
  int a,b;
  cin >> a >> b;
  int sum = a+b;
  if(sum < 10) cout << sum << endl;
  else cout << "error" << endl;
  
}

Measured memory_bytes: 3624
#include<stdio.h>
int main(){
  int i,j,s,n[2],a=0,c=0;
  scanf("%d",&s);
   scanf("%d",&n[0]);
    scanf("%d",&n[1]);
    a=n[1]-n[0];
    if(n[0]>n[1]) n[0]=n[1];
  for(i=2;i<s;i++){
    scanf("%d",&n[1]);
      c=n[1]-n[0];
      if(a<c)a=c;
      if(n[0]>n[1]) n[0]=n[1];
    }
  printf("%d\n",a);
  return 0;
}



Measured memory_bytes: 2104
def solve(h, w):
    line = ''.join(['#' for i in range(w)])
    [print(line) for i in range(h)]
    print()

if __name__ == '__main__':
    while True:
        h, w = [int(i) for i in input().split()]
        if h == w == 0: break
        solve(h, w)

Measured memory_bytes: 6724
#include <algorithm>
#include <queue>
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <ios>     // std::left, std::right
#include <iomanip> 
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;

int Cx,Cy,H;
int get_height(int x, int y){
    int tmp = H - abs(x-Cx) - abs(y-Cy);
    return max(tmp,0);
}
int main(){
    int N;cin>>N;
    vector<vector<int>> pyramids(N,vector<int>(3,0));
    int hmax = 0;
    REP(i,N){
        cin>>pyramids[i][0] >> pyramids[i][1] >> pyramids[i][2];
        hmax = max(hmax,pyramids[i][2]);
    }
    for(H=hmax;H<=10000000000;H++){
        for(Cx=0;Cx<=100;Cx++){
            for(Cy=0;Cy<=100;Cy++){
                int count = 0;
                REP(i,N){
                    int px = pyramids[i][0];
                    int py = pyramids[i][1];
                    int pz = pyramids[i][2];
                    if(pz == get_height(px,py)){
                        count++;
                        //cout<<"OJ"<<count<<endl;
                    }
                }
                if(count==N){
                    cout<<Cx<<" "<<Cy<<" "<<H<<endl;
                    return 0;
                }
            }
        }
        //cout<<"X"<<Cx<<"Y"<<Cy<<"H"<<H<<endl;
    }

}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int a,b,c;
  int temp=0;
  scanf("%d%d%d",&a,&b,&c);
  if(a > b){
    temp=a;
    a=b;
    b=temp;
  }
  if(b > c){
    temp = b;
    b = c;
     c=temp;
  }
  if(a > b){
    temp = a;
    a = b;
    b = temp;
  }
  printf("%d %d %d\n",a,b,c);
  return 0;
}



Measured memory_bytes: 2032
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <bits/stdc++.h>
#include <iomanip>
#include <numeric>
#include <map>
#include <algorithm>
using namespace std;
typedef long long ll;

int main(void)
{
    ll h, n;
    cin >> h >> n;
    ll atk = 0;
    for (ll i = 0; i < n; ++i)
    {
        int tmp;
        cin >> tmp;
        atk += tmp;
    }
    string ans = "";
    if (atk >= h)
        ans = "Yes";
    else
        ans = "No";
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<vector>
#include<queue>
#include<bitset>
#include<string>
#include<stack>
#include<set>
#include<map>
#include<cstring>
#include<complex>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<algorithm>
#include<list>
#include<functional>
#include<cassert>
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define INF 1987654321
#define PI 3.14159265358979323846264
#define fup(i,a,b,c) for(int (i)=(a);(i)<=(b);(i)+=(c))
#define fdn(i,a,b,c) for(int (i)=(a);(i)>=(b);(i)-=(c))
#define MEM0(a) memset(a,0,sizeof(a));
#define MEM_1(a) memset(a,-1,sizeof(a));
#define ALL(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<double> Vd;
typedef vector<Pi> VPi;
typedef vector<Pll> VPll;
typedef vector<Pd> VPd;
typedef tuple<int, int, int> iii;
typedef tuple<ll, ll, ll> LLL;
typedef vector<iii> Viii;
typedef vector<LLL> VLLL;
typedef complex<double> base;
ll MOD = 1000000007;
ll POW(ll a, ll b, ll MMM = MOD) { ll ret = 1; for (; b; b >>= 1, a = (a*a) % MMM)if (b & 1)ret = (ret*a) % MMM; return ret; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { if (a == 0 || b == 0)return a + b; return a*(b / gcd(a, b)); }
int dx[] = { 0,-1,1,0 }, dy[] = { 1,0,0,-1 };
int ddx[] = { 0,0,1,1,1,-1,-1,-1 }, ddy[] = { 1,-1,1,0,-1,1,0,-1 };

int a[3];
int main() {
	fup(i, 0, 2, 1)scanf("%d", a + i);
	sort(a, a + 3);
	int ans = 0;
	ans += a[2] - a[1];
	a[0] += ans;
	int t = a[2] - a[0];
	if(t&1)
		ans += t / 2 + 2;
	else ans += t/2;
	printf("%d", ans);
}

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

void Main()
{
    int a, b;
    cin >> a >> b;
    if (a < 10 && b < 10) {
        cout << a * b << endl;
    } else {
        cout << -1 << endl;
    }
}

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: 3604
#include <stdio.h>
#include <string>
#include <algorithm>
#include <iostream>
#include <cmath>
using namespace std;

int a, b, c;

int main() {
    scanf("%d %d %d", &a, &b, &c);
    
    if ( (a <= c and c <= b) or (b <= c and c <= a) ) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    
    return 0;
}



Measured memory_bytes: 256