akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O2")
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <functional>
#include <numeric>
#include <algorithm>
using namespace std;
#define mod 1000000007

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n  , k ;
	cin >> n >> k ;
	vector<int> count(n) ;
	vector<int> d(k) ;
	for (int i = 0 ; i < k ; i++) {
		int b ;
		cin >> b ;
		vector<int> x(b) ;
		for (int j = 0 ; j < b ; j++) {
			int a ;
			cin >> a ;
			--a ;
			++count[a] ;
		}

	}
	int ans = 0 ;
	for (int i = 0 ; i < n ; i++) {
		if (count[i] == 0) ans++;
	}
	cout << ans << "\n";
	
	return 0 ;
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=n;i<N;i++)
#define MEM(a,n) memset(a,n,sizeof(a))
#define p(S) cout<<(S)<<endl
using namespace std;


int main(){
	int n,p;
	while(cin>>n>>p,n){
		int a[50],center=p;
		MEM(a,0);
		int ans;
		REP(i,0,n){
			if(center>0) {
				a[i]++;
				center--;
			}
			else{
				center+=a[i];
				a[i]=0;
			}
			if(center==0){
				bool flag=true;
				REP(j,0,n){
					if(i==j) continue;
					if(a[j]!=0){
						flag=false;
						break;
					}
				}
				if(flag) {
					ans=i;
					break;
				}
			}
			if(i==n-1) i=-1;
		}
		p(ans);
	}
	return 0;
}

Measured memory_bytes: 3052
//
//  main.cpp
//  CoderProj
//
//  Created by Minoru Hayashi on 2020/04/04.
//  Copyright © 2020 Minoru Hayashi. All rights reserved.
//
//  ABC129
//
//

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

#define REP(i,n) for (int i=0; i<(n); i++)
#define REP2(i,x,n) for (int i=x; i<(n); i++)
#define ALL(n) begin(n), end(n)

using ll = long long;

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

// const ll INF = 1LL<<60;
// const int INF = 1<<29;
// const ll MOD = 1000000007;
//#define __DBG__


void solve(void){
  
  int P, Q, R;
    
  cin >> P >> Q >> R;
  
  int ans=500;
  
  chmin(ans, P+Q);
  chmin(ans, Q+R);
  chmin(ans, R+P);
  cout << ans << endl;
 
  return;
}

#define TESTCASES 1

int main(int argc, const char * argv[]) {


    cin.tie(0);
    ios::sync_with_stdio(false);

    REP(i,TESTCASES){
      solve();
    }
 
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <iomanip>
using namespace std;

typedef long long ll;


struct e {ll from, to, w;};
vector<e> ans;

int main() {
	ll L; cin >> L;
	for (int i = 0; i < 19; i++) {
		ans.push_back({ i, i + 1, 0 });
	}
	ll b = 1, cnt = 0;
	while (b <= L) b *= 2, cnt++;
	b /= 2; cnt--;
	for (int i = 0; i < cnt; i++) {
		ans.push_back({ i, i + 1, 1 << i });
	}
	ll cur = b;
	while (true) {
		if (L <= cur) break;
		b = 1, cnt = 0;
		while (b <= L - cur) b *= 2, cnt++;
		b /= 2; cnt--;
		ans.push_back({ cnt, 19, cur });
		cur += b;
	}

	cout << 20 << " " << ans.size() << endl;
	for (auto ed : ans) {
		cout << ed.from + 1 << " " << ed.to + 1 << " " << ed.w << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::collections::HashMap;
use std::collections::VecDeque;
use std::cmp::max;
use std::cmp::min;


fn main() {
    input! {
        S: String,
    }

    // 文字列を両端から見ていってカウントしていく
    let mut ans = 0i64;

    // Sの長さが奇数でも偶数でも、左からS.len()文字を見ればOK
    for i in 0..S.len() / 2 {
        if &S[i..i + 1] != &S[S.len() - 1 - i..S.len() - 1 - i + 1] {
            ans += 1;
        }
    }

    println!("{}", ans);
}


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

#define REP(i, start, count) for(int i=(start); i<(int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

typedef long long ll;
typedef unsigned long long ull;

void Eratosthenes(const int N, vector<int>& ans)
{
    vector<bool> is_prime(N + 1, true);
    // float Nsqrt = sqrt(N);
    for (int idx = 2; idx <= N; ++idx) {
        if (!is_prime[idx]) continue;

        for (int k = idx * 2; k <= N; k += idx) {
            is_prime[k] = false;
        }
        ans.emplace_back(idx);
    }

    return;
}

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

    vector<int> primes;

    Eratosthenes(55555, primes);

    int count = 0;
    for (int i = 4; i <= primes.size(); ++i) {
        if (primes[i] % 5 == 1) {
            cout << primes[i];
            count++;
            if (count >= N) {
                cout << endl;
                break;
            }
            else {
                cout << ' ';
            }
        }
    }



    return 0;
}

Measured memory_bytes: 256
# include <iostream>
# include <algorithm>
const int MAX = 2e5 + 2;
using namespace std;

struct point {
    int x; int y;
};

bool order (point p1, point p2) {
    return p1.x < p2.x || (p1.x == p2.x && p1.y < p2.y);
}

int H, W, N;
point P[MAX];
int miny, maxy;

int main() {
    cin >> H >> W >> N;
    
    for (int k = 0; k < N; k++) {
        int X, Y;
        cin >> X >> Y;
        P[k] = {X, Y};
    }
    sort(P, P + N, order);
    
    int curx = 1;
    int maxy = 1;
    bool flag = false;
    for (int k = 0; k < N; k++) {
        if (P[k].y < maxy + P[k].x - curx) {
            curx = P[k].x;
            flag = true;
            break;
        } else {
            maxy += P[k].x - curx;
            curx = P[k].x;
        }
        if (P[k].y == maxy + P[k].x - curx) {
            maxy -= 1;
        }
    }
    
    if (!flag) {
        cout << H << endl;
    } else {
        cout << curx - 1 << endl;
    }
}


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

using namespace std;

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

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD
ll modpow(ll a,ll b){
  ll r = 1;
  while(b){
    if(b&1)r=r*a%MOD;
    a=a*a%MOD;
    b>>=1;
  }
  return r;
}

int main(){
  int n,k;
  scanf("%d%d",&n,&k);
  vi divisor;
  for(int x=1;x*x<=n;x++){
    if(n%x!=0)continue;
    divisor.push_back(x);
    if(x*x!=n)divisor.push_back(n/x);
  }
  sort(ALL(divisor));
  int m = divisor.size();
  vl vals(m,0);
  ll ans = 0;
  REP(i,m){
    int v = divisor[i];
    ll unit = modpow(k,(v+1)/2);
    REP(j,i)if(v%divisor[j]==0)unit=(unit-vals[j]+MOD)%MOD;
    vals[i] = unit;
    unit *= v;
    if(v%2==0)unit /= 2;
    ans = (ans+unit)%MOD;
  }
  printf("%lld\n",ans);
  return 0;
}


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

int main() {
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<int> V(N), C(N);
	for (int i = 0; i < N; i++) {
		cin >> V[i];
	}for (int i = 0; i < N; i++) {
		cin >> C[i];
	}
	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (V[i] > C[i]) {
			ans += V[i] - C[i];
		}
	}

	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast","no-stack-protector","unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
#define F(i,L,R) for(int i=L;i<R;++i)
#define FE(i,L,R) for(int i=L;i<=R;++i)
#define getI(a) scanf("%d", &a)
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define VgetI(n) int (n); scanf("%d",&(n))
#define VgetII(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define debug(x) cout<<(#x)<<"="<<x<<"\n";
#define qq cout<<"QQ\n";
#define pb emplace_back
#define pii pair<int,int>
#define mp make_pair
#define f first
#define s second
#define ll long long
#define INF 2000000000
ll preSum[200005];
map<int,int> m;
int main(){
        int n,k;
        while(~getII(n,k)){
                m.clear();
                preSum[0]=0;
                FE(i,1,n){
                        VgetI(x);
                        x--;
                        preSum[i]=(preSum[i-1]+x+k)%k;
                }
                ll ans=0;
                FE(i,0,n){//tail
                        if(i-k>=0) m[preSum[i-k]]--;
                        ans+=m[preSum[i]];
                        m[preSum[i]]++;
                }
                printf("%lld\n",ans);
        }
}


Measured memory_bytes: 11136
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <math.h>
#include <map>
#include <set>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define INF 1145141919
typedef long long int ll;
using namespace std;

int main(){
    int n,i;
    cin >> n >> i ;
    cout << n-i+1 << endl;

    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;

class Main {

    public static void main(String[] args) throws IOException {
        doit(args, System.in, System.out);
    }

    static void doit(String[] args, InputStream in, PrintStream out)
            throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        while (true) {
            String line = reader.readLine();
            if (line == null || line.isEmpty()) {
                break;
            }
            line += 'Z';
            int sum = 0;
            int n1 = numbers[line.charAt(0) - 'A'];
            for (int i = 0; i < line.length() - 1; i++) {
                int n2 = numbers[line.charAt(i + 1) - 'A'];
                if (n1 >= n2) {
                    sum += n1;
                } else {
                    sum -= n1;
                }
                n1 = n2;
            }
            out.println(sum);
        }
    }

    private static final int[] numbers = { 0, 0, 100, 500, 0, 0, 0, 0, 1, 0, 0,
            50, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 10, 0, 0 };
}

Measured memory_bytes: 9312
#include <iostream>
#include <fstream>
#include <iomanip>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>
#include <random>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>

using namespace std;

#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define sz(a) static_cast<int>((a).size())
#define endl '\n'

using ll = long long;

const ll INF = static_cast<ll>(1e9) + 7;
const int MAXN = static_cast<int>(2e5) + 17;

int n;
int h[MAXN];

bool read() {
    if (!(cin >> n))
        return false;

    forn (i, n)
        cin >> h[i];

    return true;
}

ll binpow(ll x, ll n) {
    ll res = 1ll;

    for (; n > 0; n >>= 1, x = x * x % INF)
        if (n & 1)
            res = res * x % INF;

    return res;
}

pair<ll, ll> dfs(int lx, int rx, int ly, int ry) {
    if (rx == lx)
        return make_pair(binpow(2ll, ry - ly + 1), 0);

    if (*max_element(h + lx, h + rx + 1) == ry) {
        return make_pair(binpow(2ll, ry - ly + 1), (INF + binpow(2ll, rx - lx + 1) - 2) % INF);
    }

    pair<ll, ll> res = {1, 1};

    for (int i = lx; i <= rx; ++i)
        if (h[i] > ry) {
            int l = i, r = i, hh = h[i];

            for (; r <= rx && h[r] > ry; ++r)
                hh = min(hh, h[r]);

            --r;
            auto p = dfs(l, r, ry + 1, hh);
            res.first *= p.first;
            res.first %= INF;
            res.second *= (2ll * p.first + p.second);
            res.second %= INF;
            i = r;
        } else {
            res.second += res.second;

            if (res.second >= INF)
                res.second -= INF;
        }

    res.second -= 2ll * res.first % INF;

    if (res.second < 0)
        res.second += INF;

    res.first *= binpow(2ll, ry - ly + 1);
    res.first %= INF;

    return res;
}

void solve() {
    auto p = dfs(0, n - 1, 1, *min_element(h, h + n));
    ll ans = (p.first + p.second) % INF;
    cout << ans << endl;
}

int main() {
    cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::mt19937 rand('S' + 'E' + 'R' + 'E' + 'Z' + 'H' + 'K' + 'A');

#ifdef SEREZHKA
    freopen("file.in", "r", stdin);
#endif

    while (read())
        solve();

    return 0;
}



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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    unordered_set<int> us;
    while (N--){
        int a;
        cin >> a;
        if (us.count(a) == 1){
            us.erase(a);
        }else{
            us.insert(a);
        }
    }
    cout << us.size() << endl;
    return 0;
}

Measured memory_bytes: 4388
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		
		int[] a = new int[m];
		int[] b = new int[m];
		
		int cost = 0;
		int max = 0;
		for(int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			if( a[i] < n) {
				int x = n - a[i];
				cost += x;
				max = Math.max(max, x);
			}
		}
		
		System.out.println(Math.max(0, cost - max));
	}
}


Measured memory_bytes: 32256
#include <stdio.h>

int main(void)
{
  int a,b,c;
  
  scanf("%d%d%d",&a,&b,&c);
  
  int max= a;
  
  if(b>max){
    max = b;
    }
  if(c>max){
    max = c;
    }
  int ans = max*10 + a+b+c-max;
  
  printf("%d",ans);
  
  return 0;
  }

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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)

int main()
{
    string S;cin >> S;
    vector<int> v(4);
    vector<char> c = {'N', 'W', 'S', 'E'};
    REP(i,SZ(S)){
        REP(j,4){
            if(S[i] == c[j])
                v[j] = 1;
        }
    }
    if(v[0]==v[2]&&v[1]==v[3]){
        cout << "Yes" << "\n";
    }else{
        cout << "No"
            << "\n";
    }

    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = sum(b) - sum(a)
d,e = 0,0
for i,j in zip(a,b):
    if i>j:
        d += i-j
    elif i<j:
        d += (j-i)%2
        e += (j-i+1)//2
if c < max(d,e):
    print('No')
else:
    if 2*d-e<=c:
        print('Yes')
    else:
        print('No')


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

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

int main() {
    int H, W;
    cin >> H >> W;
    vector<vector<char>> field(H, vector<char>(W));
    int white = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> field[i][j];
            if (field[i][j] == '.') white ++;
        }
    }

    if (field[0][0] == '#' || field[H-1][W-1] == '#') {
        cout << -1 << endl;
        return 0;
    }

    vector<vector<int>> dist(H, vector<int> (W, INF));
    queue<pair<int, int>> q;
    q.push(make_pair(0, 0));
    dist[0][0] = 0;

    while (q.size()) {
        int h = q.front().first; int w = q.front().second;
        q.pop();
        for (int i = 0; i < 4; i++) {
            int nh = h+dx[i]; int nw = w+dy[i];
            if (nh < 0 || nw < 0 || nh >= H || nw >= W || field[nh][nw] == '#' || dist[nh][nw] != INF) continue;
            dist[nh][nw] = dist[h][w]+1;
            q.push(make_pair(nh, nw));
        }
    }

    if (dist[H-1][W-1] == INF) cout << -1 << endl;
    else {
        cout << white-dist[H-1][W-1]-1 << endl;
    }
}

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

int main(){
  int N;
  int ans = 1;
  vector<int> list;
  

  cin >>N;

  for(int i = 0; i< N ;i++){
    int x;
    cin >>x;
    list.push_back(x);
  }

  for(int i = 1; i< N ;i++){
    int flg = 0;
    for(int j = 0;j<i;j++){
      if(list[j] > list[i] )flg=1;
    }
    if(flg == 0)ans++;
  }

  cout <<ans<<endl;




  return 0;
  }

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

int main() {
    int N; cin >> N;
    vector<long long> A(N), B(N);
    rep(i, 0, N) cin >> A[i];
    rep(i, 0, N) {
        if(i % 2 == 0) B[0] += A[i];
        else B[0] -= A[i];
    }
    rep(i, 0, N - 1) {
        B[(i + 1) % N] = 2 * A[i] - B[i];
    }
    rep(i, 0, N) cout << B[i] << " ";
    return 0;
}


Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long long ll;
typedef pair<int, int> P;
ll gcd(int x, int y){ return y?gcd(y, x%y):x;}
ll lcm(ll x, ll y){ return (x*y)/gcd(x,y);}


int main()
{
    int n;
    cin >> n;
    vector<P> xy(n);
    rep(i, n) {cin>>xy[i].first>>xy[i].second;}
    
    vector<int> a;
    rep(i, n){ a.push_back(i);}


    vector<vector<int>> a_all;
    do{
        a_all.push_back(a);
    }while(next_permutation(a.begin(), a.end()));

    double ans = 0;
    rep(i, a_all.size()){
        double len = 0;
        rep1(j, a_all[i].size()-1){
            int st = a_all[i][j-1];
            int end = a_all[i][j];

            double x = xy[end].first -xy[st].first;
            double y = xy[end].second -xy[st].second;
            len += sqrt((x*x) + (y*y));
        }
        ans+=len;
    }
    ans/=a_all.size();

    printf("%4.10f\n", ans);

}



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

using namespace std;

int main()
{
    cin.tie(0);
	ios::sync_with_stdio(false);
    int n;
    cin>>n;
    int a[n];
    vector<pair<int,int> > v;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        v.push_back(make_pair(a[i],i+1));
    }
    sort(v.begin(),v.end());
    for(int j=0;j<n;j++)
    {
        cout<<v[j].second<<" ";
    }

}

Measured memory_bytes: 2164
#! /usr/bin/env ruby
# coding: utf-8
while n = gets.to_i
  break if n == 0
  v = gets.split.map{|e| e.to_i }
  raise "assert" unless v.length == n
  count = {}
  count.default = 0
  v.each do |e|
    count[e] += 1
  end
  ans = "NO COLOR"
  count.each do |k, v|
    ans = k if v > n / 2
  end
  puts ans
end
    

Measured memory_bytes: 111476
#include<stdio.h>
int main(){
	while(1){
	int masu[2000];
	int n,m;
	scanf("%d%d",&n,&m);
	if(n==0 && m==0){
		break;
	}
	for(int i=1;i<=n;i++){
		scanf("%d",&masu[i]);
	}
	int iti=1;
	int sai[2000];
	for(int i=1;i<=m;i++){
		scanf("%d",&sai[i]);
	}
	for(int i=1;i<=m;i++){
		iti+=sai[i];
		iti+=masu[iti];
		if(iti>=n){
			printf("%d\n",i);
			break;
		}
	}
	}
}

Measured memory_bytes: 0
var input = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  input += chunk;
});

readable.on( 'end', function() {
  var data = input.split( "\n" );
  var nml = data[0].split( ' ' )
  var n = parseInt( nml[0] );
  var m = parseInt( nml[1] );
  var l = parseInt( nml[2] );
  var A = [];
  var j =0;
  for( var i=1; i<=n; i++ ) {
    A.push( data[i].split( ' ' ).map( Number ) );
  }
  var B = [];
  for( var i=n+1; i<data.length; i++ ) {
    B.push( data[i].split( ' ' ).map( Number ) );
  }
  var C = [];
  for( var i=0; i<n; i++ ) {
    C.push( Array( l ) );
  }
  for( var i=0; i<n; i++ ) {
    for( var j=0; j<l; j++ ) {
      C[i][j] = 0;
    }
  }
  for( var i=0; i<n; i++ ) {
    for( var j=0; j<l; j++ ) {
      for( var k=0; k<m; k++ ) {
        C[i][j] += A[i][k]*B[k][j]; 
      }
    }
    console.log( C[i].join( ' ' ) );
  }
});

Measured memory_bytes: 12132
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;
long long mod = 1e9+7;

int main(void) {
  string s; cin >> s;
  for(int i=0; i<3; i++) {
    if(s[i] == s[i+1]) {
      cout << "Bad" << endl;
      return 0;
    }
  }
  cout << "Good" << endl;
  return 0;


  return 0;
}

// EOF


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

using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define sz size
#define xx first
#define yy second

#define all(x) begin(x), end(x)

#define FOR(i,start,end) for(ll i=start; i < end; ++i)
#define FORD(i,start,end) for(ll i=start; i < end; --i)

void visit(auto a, auto s, auto &g, auto &c) {
  c[a] += c[s];
  for(auto b:g[a]) {
    if(b != s)
      visit(b, a, g, c);
  }
}

int main() {
  ll N, Q;
  cin >> N >> Q;

  vector<ll> c;
  c.resize(N);

  vector<vl> g;
  g.resize(N);

  FOR(i,0,N-1) {
    ll a, b;
    cin >> a >> b;

    a -= 1;
    b -= 1;

    g[a].pb(b);
    g[b].pb(a);
  }

  FOR(i,0,Q) {
    ll p, x;
    cin >> p >> x;

    c[p-1] += x;
  }

  for(auto a:g[0]) {
    visit(a, 0, g, c);
  }

  for(auto a:c) {
    cout << a << " ";
  }
  cout << endl;
}


Measured memory_bytes: 27392
#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 <queue>
typedef long long ll;
using namespace std;
const ll mod = 1000000007;
void onetwoone() {
	int a, b;
	cin >> a >> b;
	int c = a;
	if (b == 100)
	{
		c *= 1000;
	}
	else if (b >= 10) {
		c *= 100;
	}
	else {
		c *= 10;
	}
	c += b;
	int d = sqrt(c);
	cout << (c == d * d ? "Yes" : "No") << endl;
}

int main() {
	onetwoone();
	return 0;
}

Measured memory_bytes: 256
N=int(input())
number=0
numbers=[[0,0,0]]
for a in range(N):
    list=[]
    t,x,y=map(int,input().split())
    list.append(t)
    list.append(x)
    list.append(y)
    numbers.append(list)
for a in range(N):
    b=numbers[a][1]+numbers[a][2]
    c=numbers[a+1][1]+numbers[a+1][2]
    if (numbers[a+1][0]-numbers[a][0])%2==0:
        if abs(c-b)%2==0 and abs(c-b)<=numbers[a+1][0]-numbers[a][0]:
            number+=1
        else:
            pass
    else:
        if abs(c-b)%2==1 and abs(c-b)<=numbers[a+1][0]-numbers[a][0]:
            number+=1
        else:
            pass
if number==N:
    print('Yes')
else:
    print('No')
    

Measured memory_bytes: 21068
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>
#include <unordered_set>

using namespace std;
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
#define rep(i, n) for(int i = 0;i < n;i++)
const int INF = 1LL << 30;

int MOD = 1000000007;

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

    int n; cin >> n;

    std::vector<int> a(n);
    rep(i,n) cin >> a[i];

    double s=0.0;

    rep(i,n){

        s+=1.0/(a[i]+0.0);
    }

    cout << setprecision(10) << 1.0/s << endl;

    

    return 0;
}

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

int main(){
    int64_t A;
    double B;
    //int64_t ans;
    cin >> A >> B;
    B = B*100.0;
    //cout << "B" << B << endl;
    int64_t C = B+0.000001;
    //cout << "C" << C << endl;
    //cout <<   A*C << endl;

    cout << (A*C)/100 << endl;
}


Measured memory_bytes: 3692
//==================== default starts ====================//
#include <bits/stdc++.h>
 
using namespace std;
 
#define fread(x)        freopen(x,"r",stdin)
#define fwrite(x)       freopen (x,"w",stdout)
 
#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define MEMSET(a,x)     memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))
 
#define white           1
#define grey            2
#define black           3
 
#define ll              long long
#define pb              push_back
#define pf              push_front
#define INF             9e18
#define PI              acos(-1.0)
#define pii             pair<int,int>
#define pll             pair<ll, ll>
 
#define all(v)          v.begin(), v.end()
 
#define fastread        ios_base::sync_with_stdio(0);cin.tie(nullptr);
int on(int N,int pos){return N=N | (1<<pos);}
int off(int N,int pos){return N= N & ~(1<<pos);}
bool check(int N,int pos){return (bool)(N & (1<<pos));}
//==================== default ends ====================//
int main(){
	string s;
	cin>>s;
	for(char c : s){
		if(9 == c-'0')cout<<"1";
		else cout<<"9";
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<tuple>
#include<queue>
#include<set>

using namespace std;

struct S{
  int y,x,t;
  vector<int> v;
};

int main(){
  for(int N,M;cin>>N>>M,N;){
    char g[50][51];
    int y,x;
    for(int i=0;i<N;i++){
      cin>>g[i];
      for(int j=0;j<M;j++){
	if(g[i][j]=='S'){
	  y=i;
	  x=j;
	}
      }
    }
    int P;
    cin>>P;
    string p[10];
    for(int i=0;i<P;i++){
      cin>>p[i];
    }
    set<vector<int> > s[50][50];
    queue<S> que;
    que.push({y,x,0,vector<int>(P)});
    while(!que.empty()){
      auto cs=que.front();
      if(g[cs.y][cs.x]=='G')break;
      que.pop();
      if(!s[cs.y][cs.x].insert(cs.v).second)continue;
      for(int i=0;i<4;i++){
	static const int dy[]={-1,0,1,0};
	static const int dx[]={0,1,0,-1};
	int ny=cs.y+dy[i];
	int nx=cs.x+dx[i];
	if(0<=ny&&ny<N&&0<=nx&&nx<M&&g[ny][nx]!='#'){
	  S ns{ny,nx,cs.t+1,cs.v};
	  for(int j=0;j<P;j++){
	    string c=p[j].substr(0,cs.v[j])+"URDL"[i];
	    while(p[j].compare(0,c.size(),c)){
	      c.erase(c.begin());
	    }
	    if(c==p[j])goto fail;
	    ns.v[j]=c.size();
	  }
	  que.push(ns);
	fail:
	  ;
	}
      }
    }
    cout<<(que.empty()?-1:que.front().t)<<endl;
  }
}

Measured memory_bytes: 12168
#include <cstdio>

 
int main()
{
    int A, B, C, X, n = 0;

    scanf("%d", &A);
    scanf("%d", &B);
    scanf("%d", &C);
    scanf("%d", &X);

    int a = X / 500;
    while (a >= 0)
    {
        int xb = X - 500 * a;
        int b = xb / 100;
        while ( b >= 0)
        {
            int xc = xb - 100 * b;
            int c = xc / 50;
            if ( a <= A && b <= B && c <= C )
            {
                ++n;
            }
            --b;
        }
        --a;
    }

    // Output
    printf("%d\n", n);
    return 0;
}


Measured memory_bytes: 128
import java.util.*;
public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			double[] p = new double[9];
			for(int i=1; i<=8; i++) p[i] = sc.nextDouble();	
			double dot = (p[1]-p[3])*(p[5]-p[7])+(p[2]-p[4])*(p[6]-p[8]);
			if(dot == 0 || dot == -0)	System.out.println("YES");
			else System.out.println("NO");
		}
	}

}

Measured memory_bytes: 12000
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
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;
}
///////////////////////////////////////////////////////////////
 
int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); //入出力高速化
  int N; cin >> N;
  vector<vector<int>> G(N);
  rep(i,N-1) {
    int a,b; cin >> a >> b;
    a--; b--;
    G[a].emplace_back(b);
    G[b].emplace_back(a);
  }

  vector<int> df(N,-1),ds(N,-1);
  df[0] = 0;
  ds[N-1] = 0;
  queue<int> que;
  que.emplace(0);
  while (!que.empty()) {
    int v = que.front(); que.pop();
    for (auto nv : G[v]) {
      if (df[nv] != -1) continue;
      df[nv] = df[v] + 1;
      que.emplace(nv);
    }
  }

  que.emplace(N-1);
  while (!que.empty()) {
    int v = que.front(); que.pop();
    for (auto nv : G[v]) {
      if (ds[nv] != -1) continue;
      ds[nv] = ds[v] + 1;
      que.emplace(nv);
    }
  }

  int count = 0;
  rep(i,N) {
    if (df[i] <= ds[i]) count++;
  }

  if (2*count > N) cout << "Fennec" << endl;
  else cout << "Snuke" << endl;
}

Measured memory_bytes: 6528
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {

        in = new BufferedReader(new InputStreamReader(System.in));

        try {
            c = in.read();
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }

        int i = 1;
        while (getToken() == TK_NUM && num != 0) {
            System.out.printf("Case %d: %d\n", i++, num);
        }
    }

    private static final int TK_END = 1;
    private static final int TK_NUM = 2;

    private static BufferedReader in;
    private static int c;
    private static int num;

    public static int getToken() {
        try {
            if (c == -1) {
                return TK_END;
            } else if (Character.isDigit(c)) {
                num = Character.getNumericValue(c);
                while (Character.isDigit(c = in.read()))
                    num = num * 10 + Character.getNumericValue(c);
                return TK_NUM;
            }
            while ((c = in.read()) != -1 && !Character.isDigit(c))
                    ;
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
        return getToken();
    }
}

Measured memory_bytes: 57836
#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>;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
const ll INF=1e18;

int main() {
  int n,m,en=-100000,ans=0;
  cin >> n>>m;
  vector<P> p(m);
  rep(i,m){
    int a,b;
    cin >> a>>b;
    p[i]=P(b,a);
  }
  sort(p.begin(),p.end());
  rep(i,m){
    if(en<=p[i].second){
      en=p[i].first;
      ans++;
    }
  }
  cout <<ans<<endl;
}


Measured memory_bytes: 4004
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m-1); i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << " "; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int Log2(ll x) { int k; for (k = 0; x > 0; ++k) x >>= 1; return k; } // number of binary digits
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;


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

  ll ans = 0;

  rep2(i, 1, n+1) rep2(j, 1, n+1) rep2(k, 1, n+1) {
    ans += gcd(gcd(i, j), k);
  }
  cout << ans << endl;
  return 0;
}


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

int main()
{
  int cnt = 0;
  string s;
  cin >> s;
  if (s[0] == '1')
    ++cnt;
  if (s[1] == '1')
    ++cnt;
  if (s[2] == '1')
    ++cnt;
  cout << cnt << '\n';

  return 0;
}


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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

    double T, X;
    cin >> T >> X;
    printf("%.5lf", T/X);

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = 0;
		try {
			N = Integer.parseInt(br.readLine());
		} catch (NumberFormatException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		//キーがStringで中身がintのHashMapを作る
		HashMap<String, Integer> count = new HashMap<String, Integer>();
		
		for (int s=0; s<N; s++) {
			String S = "";
			try {
				S = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			if (count.containsKey(S)) { //HashMapに既にキーがあるとき
				int now = count.get(S); //キーSに紐づく中身のintを取得
				count.replace(S, now + 1);
			}
			else {
				count.put(S, 1); //まだHashMapにキーが登録されていないなら、登録する
			}
		}
		
		int Max = 0;
		for (int val: count.values()) { 
			if (Max <= val) {
				Max = val;
			}
		}
		
		List<String> print = new ArrayList<String>();
		
		for (String s: count.keySet()) { 
			int now = count.get(s);
			if (now == Max) {
				print.add(s);
			}
		}
		Collections.sort(print);
		
		StringWriter s = new StringWriter();
	    for (int i = 0 ; i < print.size() ; i++){
	        String ans = print.get(i);
	        s.append(ans + '\n');
	    }
	    System.out.println(s.toString());
	}
	
}


Measured memory_bytes: 74096
#include<iostream>
#include<algorithm>
#include<string> 
#include<map>
#include<set>
#include<vector>
#include<string.h> 
#include<math.h>
#include<stdio.h> 
#include<queue>
using namespace std;
int a[101];
int main()
{int n,m,x,b=0,c=0;cin>>n>>m>>x;
for(int i=0;i<m;i++)cin>>a[i];
for(int i=0;i<m;i++)for(int j=x;j<=n;j++)if(a[i]==j){b++;break;}
for(int i=0;i<m;i++)for(int j=x;j+1;j--)if(a[i]==j){c++;break;}
cout<<min(b,c);
system("pause");
return 0;
}

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

using namespace std;

int main()
{
    char s[100];
    int c=0;
    for(int i=0;i < 3;i++)
    {
        cin>>s[i];
        if(s[i] == '1')
        {
            c++;
        }
    }
    cout<<c;

    cout<<endl;
    return 0;
}

Measured memory_bytes: 384
n=int(input())
a=[]
b=[]
for i in range(n):
    x,y=map(int,input().split())
    a.append(x+y)
    b.append(x-y)
a=sorted(a)
b=sorted(b)
ans=max(a[-1]-a[0],b[-1]-b[0])
print(ans)

Measured memory_bytes: 107976
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int main()
{
    cin>>a>>b>>c;
    if (a>b) if (b>c) cout<<b+c<<endl;
    else if (a>c) cout<<b+c<<endl;
    else cout<<a+b<<endl;
    else if (a>c) cout<<a+c<<endl;
    else if (b>c) cout<<c+a<<endl;
    else cout<<b+a<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    string s;
    int N, Q;
    vector<int> b = vector<int>(N);
    // b には、i番目までに'AC'がいくつあるかを保存
    int li, ri;
    bool flag;
    int count;
    cin >> N >> Q;
    cin >> s;
    // AC を探しておく
    count = 0;
    for (int i = 0;i < N; i++){
        if (s[i] == 'A') {
            flag = true;
        } else if (s[i] == 'C'){
            if (flag){
                count++;
                flag = false;
            }
        } else {
            flag = false;
        }
        b[i] = count;
    }
    for (int i = 0; i < Q; i++){
        cin >> li >> ri;
        cout << b[ri-1] - b[li-1] << endl;
    }
}

Measured memory_bytes: 25728
#include <iostream>

int main() {
  unsigned long long x;
  std::cin >> x;
  for (unsigned long long i = 1; i <= x; ++i) {
    if (i * (i + 1) / 2 >= x) {
      std::cout << i;
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		sc.close();

		int p = x;
		while (!check(p)) {
			p++;
		}

		System.out.println(p);
	}

	private static boolean check(int n) {
		for (int i = 2; i <= Math.sqrt(n); i++) {
			if (n % i == 0) {
				return false;
			}
		}

		return true;
	}
}


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

int main() {
  string S;
  cin >> S;
  if(S == "abc" || S == "acb" || S == "bac" || S == "bca" || S == "cab" || S == "cba" ){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
using namespace std;
int main()
{
	int x,y,ans;
	scanf("%d%d",&x,&y);
	if(x==0)
	{
		if(y>0)
			ans=y;
		else
			ans=-y+1;
		printf("%d",ans);
		return 0;
	}
	ans=abs(abs(x)-abs(y));
	if(abs(x)>abs(y)&&x>0)
	{
		ans++;
		x=-x;
	}
	else if(abs(x)<abs(y)&&x<0)
	{
		ans++;
		x=-x;
	}
	if((x>0&&y<0)||(x<0&&y>0))
		ans++;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
//問題文および制約はちゃんと確認しよう！
//サイズは10^5じゃなくて2×10^5とかかもしれないし、重要な制約・条件を見落としているかも
//とりあえずサンプルを読んでから解法を考えよう？
int main()
{
	int l,d,r,out=0;
	cin>>l>>r>>d;
	REP(i,l,r+1){
		if(i%d==0) out++;
	}
	cout<<out<<endl;
}


Measured memory_bytes: 3620
#include<iostream>

int main(void){
	int a,b,c;
	std::cin>>a>>b>>c;
	int temp;

	temp=a;
	a=b;
	b=temp;

	temp=a;
	a=c;
	c=temp;

	std::cout<<a<<" "<<b<<" "<<c;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vp;
typedef pair<int,int> pii;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9+7;
const int MAX = 10000000;
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
//cout << 'H' << endl;
//next_permutation(ALL(p));
//typedef priority_que<int> pque;//これは大きい順
//typedef priority_que<int, vector<int>, greater<int>> pque;//これは小さい順


int main(){
	int a,b,c;
	cin >> a >> b >> c;
	if (a==b && b == c && c == a){
		cout << "No" << endl;}
	else if(a!= b && b!= c && c!=a){
		cout <<"No" << endl;
	}else{
		cout << "Yes" << endl;
	}

  return 0;
}


Measured memory_bytes: 256
n, k = gets.split.map(&:to_i)
ps = gets.split.map(&:to_i)

max = sum = ps[0...k].inject(:+)

(n - k).times do |i|
  sum = sum - ps[i] + ps[i + k]
  max = sum if max < sum
end

puts (max + k) / 2.0

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

const double PI = acos(-1);

int main() {
  int a, b, h, m;
  cin >> a >> b >> h >> m;
  double th = double(h*60 + m)/720*2*PI;
  double tm = double(m)/60*2*PI;
  double xh = a*cos(th), yh = a*sin(th);
  double xm = b*cos(tm), ym = b*sin(tm);
  double dx = xh - xm, dy = yh - ym;
  double ans = sqrt(dx*dx + dy*dy);

  printf("%.10f\n", ans);

  return 0;

}


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

long long int f(long long int n, long long int x)
{
    if (n >= 0)
    {

        return ((n / x) + 1);
    }
    else
    {
        return 0;
    }
}

int main()
{
    long long int a, b, x;
    cin >> a >> b >> x;

    long long int fb = f(b, x);
    long long int fa = f(a - 1, x);
    cout << fb - fa << endl;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <functional>
#include <algorithm>
#include <utility>
#include <iomanip>

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

using namespace std;

typedef pair<int, int> P;

const int INF = 2147483647;
const int MOD = 1e9+7;

template <typename T>
class segment_tree{
    private:
        static int calc_size(int n){
            int m = 1;
            while(m < n){
                m *= 2;
            }
            return m;
        }

        T query(int s, int t, int i, int l, int r) const {
            if(r <= s || t <= l){
                return init;
            }

            if(s <= l && r <= t){
                return node[i];
            }

            int m = l + (r - l) / 2;
            T vl = query(s, t, i * 2 + 1, l, m);
            T vr = query(s, t, i * 2 + 2, m, r);
            return f(vl, vr);
        }

    public:
        int n;
        vector<T> node;
        T init;
        function<T(T, T)> f;

        segment_tree(int n, T init, function<T(T, T)> f)
            : n(calc_size(n)), node(calc_size(n) * 2, init), init(init), f(f){}

        void update(int i, const T& x){
            i += (n - 1);
            node[i] += x;
            while(i > 0){
                i = (i - 1) / 2;
                node[i] = f(node[2*i+1], node[2*i+2]);
            }
        }

        T query(int s, int t) const {
            return query(s, t, 0, 0, n);
        }
};

signed main(){
    int n, q;
    cin >> n >> q;

    segment_tree<int> st(n+1, 0, [](int a, int b){return a+b;});

    rep(i, q){
        int com, x, y;
        cin >> com >> x >> y;

        if(com == 0){
            st.update(x, y);
        }

        if(com == 1){
            cout << st.query(x, y+1) << endl;
        }
    }

    return 0;
}



Measured memory_bytes: 4976
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define rep(i, a, b) for (int i = a; i < b; i++)
#define ff first
#define pii pair<int, int>
#define vii vector< pair<int,int> >
#define vi vector<int>
#define vvi vector< vector< int> >
#define ss second
#define MOD 998244353LL
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define ull unsigned long long
#define trace1(x)                cout<<#x<<": "<<x<<endl
#define trace2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace4(x, y, z, d)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<" | "<<#d<<": "<<d<<endl

#define trace3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1, 0};int dy[]={0,1,0, -1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
bool compare(const pair<int,int> &a,
             const pair<int,int> &b)
{
    if(a.ff == b.ff) {
        return (b.ss < a.ss);
    }
    return (a.ff<b.ff);
}

bool prime[1000001];
void SieveOfEratosthenes(int n) 
{
    // Create a boolean array "prime[0..n]" and initialize
    // all entries it as true. A value in prime[i] will
    // finally be false if i is Not a prime, else true.

    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
}
int32_t main()
{
    IOS;
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    // #endif
    /********************* From here ***********************/
    string s;
    cin >> s;
    int n = s.length();
    int ans = inf;
    rep(i, 0, n-3+1){
    	string t = s.substr(i, 3);
    	int a = stoi(t);

    	int temp = abs(a-753);
    	//cout << temp << endl;
    	ans = min(ans , temp);
    }

    cout << ans;
}

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

#define llint long long int
#define LNUM 1000000007
#define MULT(x,y) (((x%LNUM)*(y%LNUM))%LNUM)
#define SUM(x,y) (((x%LNUM)+(y%LNUM))%LNUM)

llint combi_val[2002][2002];

void init(){
  for(int i=0; i<2002; i++){
    for(int j=0; j<2002; j++){
      combi_val[i][j] = -1;
    }
  }
}

llint combi(int n, int k){
  if(combi_val[n][k] == -1){
    if(n == k || k == 0) combi_val[n][k] = 1;
    else                 combi_val[n][k] = SUM(combi(n-1,k-1), combi(n-1,k));
  }
  return combi_val[n][k];
}

int main(void){

  init();

  int n, k;
  std::cin >> n >> k;
  for(int i=1; i<=k; i++){
    if(n-k+1 < i) std::cout << 0 << std::endl;
    else          std::cout << MULT(combi(n-k+1, i), combi(k-1, i-1)) << std::endl;
  }


  return 0;
}

Measured memory_bytes: 31616
def gcd(x,y):
  if y==0:
    return x
  else:
    return gcd(y,x%y)
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in a:
  ans=gcd(i,ans)
count=0
while ans%2==0:
  count+=1
  ans=ans//2
print(count)

Measured memory_bytes: 3060