akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main(){
  int b,f,r,v,i,j,n;
  int a[12][10];
  for (j=0;j<12;j++){
    for (i=0;i<10;i++)a[j][i]=0;
  }
  cin>>n;
  for (i=0;i<n;i++){
    cin>>b>>f>>r>>v;
    a[b*3+f-4][r-1]+=v;
  }
  for (j=0;j<12;j++){
    if (j&&!(j%3))cout<<"####################"<<endl;
    for (i=0;i<10;i++){
      cout<<' '<<a[j][i];
    }
    cout<<endl;
  }
}



Measured memory_bytes: 3084
use proconio::{input, fastout};

#[fastout]
fn main() {
    input! {
        a: u32,
        b: u32,
    }
    let ans = if (a * b) % 2 == 0 {
        "Even"
    } else {
        "Odd"
    };
    println!("{}", ans);
}


Measured memory_bytes: 2136
S = gets.chomp.split("").map &:to_i
N = S.size
Mod = 2019
a = 0
q = 1
A = S.reverse!.map{ |s|
  a = (a + s * q) % Mod
  q = q * 10 % Mod
  a
}
A.reverse!
A << 0
cnt = Array.new(2019, 0)
ans = 0
(0...A.size-1).reverse_each{ |i|
  a = A[i]
  b = A[i+1]
  ans += cnt[a]
  cnt[b] += 1
}
p ans

Measured memory_bytes: 29556
import java.util.Scanner;

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

        String O = sc.next();
        String E = sc.next();

        System.out.println(solve(O, E));

        sc.close();
    }

    static String solve(String O, String E) {
        char[] result = new char[O.length() + E.length()];
        for (int i = 0; i < result.length; ++i) {
            result[i] = (i % 2 == 0) ? O.charAt(i / 2) : E.charAt(i / 2);
        }

        return new String(result);
    }
}

Measured memory_bytes: 21844
//#define _GLIBCXX_DEB // Iterator safety; out-of-bounds access for Containers, etc.
//#pragma GCC optimize "trapv" // abort() on (signed) integer overflow.
#include <bits/stdc++.h>

using namespace std;

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

#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

#define ll long long int
#define mod 1000000007
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define prec(n) fixed << setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int>>
#define PI 3.1415926535897932384626
#define INF 1000000000
#define bits(n) __builtin_popcount(n)

ll dp[101][100001];

ll knapsack(ll wt[],ll val[],ll n,ll W)
{
    if(W==0||n==0)
    return 0;
    else if(dp[n][W]!=-1)
    return dp[n][W];
    else if(wt[n-1]<=W)
    {
        return dp[n][W]=max(val[n-1]+knapsack(wt,val,n-1,W-wt[n-1]),knapsack(wt,val,n-1,W));
    }
    else
    {
        return dp[n][W]=knapsack(wt,val,n-1,W);
    }
}

void solve()
{
    ll n,w;
    cin>>n>>w;
    memset(dp,-1,sizeof(dp));
    ll wt[n+1];
    ll val[n+1];
    for(int i=0;i<n;i++)
    {
        cin>>wt[i]>>val[i];
    }
    ll res=knapsack(wt,val,n,w);
    cout<<res;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input1.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output1.txt", "w", stdout);
#endif

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


Measured memory_bytes: 82484
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    if(n%10 == 3){
        cout<<"bon"<<endl;
    }
    else if(n%10 == 0 || n%10 == 1 ||n%10==6 ||n%10 ==8){
        cout<<"pon"<<endl;
    }
    else{cout<<"hon"<<endl;}
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n;
  cin >> n;
  vector<int>x(n);
  for(int i=0;i<n;i++){
    cin >> x.at(i);
  }
  sort(x.begin(),x.end());
  int ans=1e8;
  for(int i=x.at(0);i<=x.at(n-1);i++){
    int sum=0;
    for(int j=0;j<n;j++){
      sum+=pow(x.at(j)-i,2.0);
    }
    ans=min(ans,sum);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
#三井住友信託銀行プログラミングコンテスト2019 C

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

x = I()
y,z = divmod(x,100)
if y*5 >= z:
    print(1)
else:
    print(0)

Measured memory_bytes: 38256
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int A, B, C;
	cin >> A >> B >> C;

	if (A == B) {
		cout << C << endl;
	}
	else if (B == C) {
		cout << A << endl;
	}
	else {
		cout << B << endl;
	}
}


Measured memory_bytes: 256
n = gets.to_i

counter = {
  'AC' => 0,
  'WA' => 0,
  'TLE' => 0,
  'RE' => 0,
}
n.times do
  counter[gets.chomp] += 1
end

counter.each do |k, v|
  puts "#{k} x #{v}"
end


Measured memory_bytes: 14412
def main():
    N, P = map(int, input().split())
    S = [int(c) for c in input()]

    ret = 0
    if P in {2, 5}:
        for i, x in enumerate(S, 1):
            if x % P == 0:
                ret += i
        print(ret)
        return

    else:
        curr_num = 0
        counter = [0] * P
        counter[0] = 1
        for i, x in enumerate(reversed(S)):
            curr_num = (curr_num + x * pow(10, i, P)) % P
            ret += counter[curr_num]
            counter[curr_num] += 1
        print(ret)
        return


if __name__ == '__main__':
    main()


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

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

  char ans='1';
  for(int i=0; i<min(n, k); i++){
    if(s.at(i)!='1'){
      ans=s.at(i);
      break;
    }
  }
  cout << ans <<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[27];
int main()
{
    long long int i,j,k,z,t,x,y,n;
    cin>>n>>k>>x>>y;
    j=max(0LL,n-k);
    t=min(n,k);
    z=t*x+j*y;
    cout<<z<<endl;
}


Measured memory_bytes: 3564
#include <iostream>
//#include <iomanip>
//#include <string>
//#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
//using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

const int MAX = 10000000 ;
// UFTクラスを宣言するときはグローバル変数か、staticをつけて静的変数にすること
class UFT{
public :
	int par[MAX] ;
	int rank[MAX] ;
	int size[MAX] ;
	bool root[MAX] ;
	int graph ;
	int tree ;

	void init(int n){
		for(int i=0;i<n;i++){
			par[i] = i ;
			rank[i] = 0 ;
			size[i] = 1 ;
			root[i] = true ;
		}
		tree = n ;
		graph = n ;
	}

	int find(int x){
		if(par[x]==x) return x ;
		return par[x] = find(par[x]) ;
	}

	void unite(int x,int y){
		x = find(x) ;
		y = find(y) ;
		if(x==y){
			if(root[x]){
				root[x] = false ;
				tree-- ;
			}
			return ;
		}
		if(rank[x]<rank[y]){
			par[x] = y ;
			size[y] += size[x] ;
			graph-- ;
			if(root[x]){
				root[x] = false ;
				tree-- ;
			}
		}else{
			par[y] = x ;
			size[x] += size[y] ;
			if(rank[x]==rank[y]) rank[x]++ ;
			graph-- ;
			if(root[y]){
				root[y] = false ;
				tree-- ;
			}
		}
	}

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

int main(){
	ll n,m ;
	cin >> n >> m ;
	static UFT uft ;
	uft.init(n) ;
	for(int i=0;i<m;i++){
		ll a,b,c ;
		cin >> a >> b >> c ;
		a-- ; b-- ;
		uft.unite(a,b) ;
	}
	cout << uft.graph << endl ;
}


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


int main(){
    int N,D,X;
    vector<int> A(100);
    cin>>N;
    cin>>D>>X;
    for(int i=0;i<N;i++){
        cin>>A.at(i);
    }
    int eat=0;
    for(int i=0;i<N;i++){
        eat+=(1+(int)((D-1)/A.at(i)));
    }
    cout<<X+eat<<endl;
    return 0;
}


Measured memory_bytes: 3572
n,l = map(int,input().split())
aji = [ l + i - 1 for i in range(1,n+1) ]
Aji = [ abs(l + i - 1) for i in range(1,n+1) ]
Aji.sort()
try:
    i = aji.index(Aji[0])
except:
    i = aji.index(-Aji[0])
del aji[i]
print(sum(aji))

Measured memory_bytes: 3064
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
# define PI  3.14159265358979323846
ll maxi=LLONG_MIN;
ll maxii=LLONG_MIN;
ll mini=LLONG_MAX;
int main() 
{
	
	double r;cin>>r;
    double p;
    p=(2*M_PI*r);
    cout<<p;
 	
 	return 0;
 }

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    ll  bc=0,wc=0;
    ll  n=s.size();

    ll  c=0;
    ll pos=0;
    for(ll i=0;i<n;i++)
    {
        if(s[i]=='W')
        {
            c+=(i-pos);
            pos++;
        }

    }


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


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

template <class T>
void readVector(int n, vector<T> &v){
	for(int i=0; i<n; ++i){
		T t;
		cin >> t;
		v.push_back(t);
	}
}
int dx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
typedef pair<long long, long long> P;

void solve(int w, int h){
	vector<int> v[h];
	for(int i=0; i<h; ++i)
		readVector(w, v[i]);
	int ans = 0;
	for(int i=0; i<h; ++i)
		for(int j=0; j<w; ++j){
			if(v[i][j] == 1){
				++ans;
				v[i][j] = 0;
				queue<P> q;
				q.push(P(i, j));
				while(!q.empty()){
					P p = q.front();
					q.pop();
					int nx = p.first;
					int ny = p.second;
					for(int k=0; k<8; ++k)
						if(0<=nx+dx[k] && nx+dx[k]<h && 0<=ny+dy[k] && ny+dy[k]<w && v[nx+dx[k]][ny+dy[k]] == 1){
							v[nx+dx[k]][ny+dy[k]] = 0;
							q.push(P(nx+dx[k], ny+dy[k]));
						}
				}
			}
		}
	cout << ans << "\n";
}

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		int w, h;
		cin >> w >> h;
		if(w == 0 && h == 0) return 0;
		solve(w, h);
	}
}


Measured memory_bytes: 3080
#include<bits/stdc++.h>
using namespace std;
struct st{
    long long w,c;
    
};
int main()
{
 string s,t;
 cin>>s>>t;
 long long n=s.length(),m=t.length(),i,j;
 long long d[n+1][m+1];
 for(i=0;i<=n;i++)
 d[i][0]=0;
 for(i=0;i<=m;i++)
 d[0][i]=0;
 for(i=1;i<=n;i++)
 for(j=1;j<=m;j++)
 {
     if(s[i-1]==t[j-1])
     d[i][j]=d[i-1][j-1]+1;
     else
     d[i][j]=max(d[i-1][j],d[i][j-1]);
 }

 i=n;
 j=m;
 string x="";
 while(i>0&&j>0)
 {
     if(s[i-1]==t[j-1])
     {
         string z(1,s[i-1]);
         x+=z;
         i--;j--;
     }
     else
     {
         if(d[i-1][j]>d[i][j-1])
         i--;
         else
         j--;
     }
 }
 reverse(x.begin(),x.end());
 cout<<x;
  return 0;
}

Measured memory_bytes: 70656
#include<bits/stdc++.h>
using namespace std;
const int N=114514;
bitset<50005> v[50005];
int x[N],y[N],vis[N],fin[N];
char s[N];
signed main(){
	int n,m,T;
	cin>>n>>m>>T;
	if(T==1){
		for(int i=1;i<=n;++i)
			v[i][i]=1;
		for(int i=1;i<=m;++i){
			cin>>x[i]>>y[i];
			v[x[i]]|=v[y[i]];
			v[y[i]]=v[x[i]];
		}
		for(int i=1;i<=n;++i)
			if(v[i].count()==n){
				vis[i]=1;
				for(int j=m;j>=1;--j)
					if(vis[x[j]]) s[j]='^',vis[y[j]]=1;
					else if(vis[y[j]]) s[j]='v',vis[x[j]]=1;
					else s[j]='v';
				for(int j=1;j<=m;++j)
					cout<<s[j];
				return 0;
			}
		puts("-1"); 
	}
	else{
		if(n<=2) return puts("-1"),0;
		for(int i=1;i<=m;++i)
			cin>>x[i]>>y[i];
		for(int i=1;i<=n;++i)
			vis[i]=1,fin[i]=i;
		for(int i=m;i>=1;--i)
			if(vis[fin[x[i]]]>=vis[fin[y[i]]]) --vis[fin[x[i]]],++vis[fin[y[i]]],fin[x[i]]=fin[y[i]],s[i]='v';
			else --vis[fin[y[i]]],++vis[fin[x[i]]],fin[y[i]]=fin[x[i]],s[i]='^';
		for(int i=1;i<=m;++i)
			cout<<s[i];
	}
	return 0;
} 

Measured memory_bytes: 310204
#include<iostream>
#include<cstdlib>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<set>
#define rep(i,n) for(int i(0);i<n;i++)
using namespace std;
typedef long long ll;

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

	int cnt(0);
	rep(i,a+1){
		int int_a = x-i*500;
		if(int_a == 0)cnt++;
		else{
		rep(j,b+1){
			int int_b = int_a - j*100;
			if(int_b == 0)cnt++;
			else{
			rep(k,c+1){
				int int_c = int_b - k*50;
				if(int_c == 0)cnt++;
			}}
		}}
	}

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






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

int main(){
    long long n, ans = 1;
    cin >> n;
    for(long long i = 1; i <= n; i++){
        ans = ans * i % 1000000007;
        ans = ans % 1000000007;
    }
    cout << ans << endl;
}


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

int main() {
	
	ll n, k; cin >> n >> k;
	ll const mod = 1000000007;
	ll ans = 0;
	for (ll i = k; i <= n + 1; i++) {
		ll ans1 = i * (2 * n - i + 1) / 2;
		ll ans2 = (i - 1) * i / 2;
		ll ans3 = ans1 - ans2 + 1;
		ans = (ans + ans3) % mod;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<ll,ll> P;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define EFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i, n) FOR(i,0,n)
#define IINF 1e9

bool cmp(P a,P b){
    return a.second < b.second;
}
/* 
    memo:区間スケジューリング問題
*/
int main(void){
    ll m,n,ans = 0,end = 0;
    cin >> n >> m;
    vector<P> l(m);
    REP(i,m) cin >> l[i].first >> l[i].second;
    sort(l.begin(),l.end(),cmp);    // secondを基準に，昇順にソート
    REP(i,m){
        if(l[i].first >= end){
            end = l[i].second;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4832
import collections

from collections import Counter
N = int(input())
P = []
for i in range (N):
    P.append(str(input()))

counted = collections.Counter(P)
m = max(counted.values())
chars = {key for key, value in counted.items() if value == m}

chars2 = sorted(chars)

for i in range (len(chars2)):
    print("{}".format(chars2[i]))

Measured memory_bytes: 46060
s = input()
t = input()
n = len(s)
m = len(t)

ans = 0
for i in range(n - m + 1):
    cnt = 0
    for j in range(m):
        if t[j] == s[i+j]:
            cnt += 1
    ans = max(ans, cnt)

print(m - ans)

Measured memory_bytes: 9056
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

vector<vector<int>>adj;
int vis[200005];
int hgt[200005];
int sz=0,index1=1,index2=1;
int madar=0;

void dfs(int ver,int x)
{
  vis[ver]=1;
  hgt[ver]=x;
  for(auto i:adj[ver])
  {
    if(vis[i]==0)
    {
      dfs(i,x+1);
    }
    else
    {
      sz=hgt[ver]-hgt[i]+1;
      index1=i;
      index2=ver;
      madar=hgt[i]-hgt[1];
      return ;
    }
  }
}

signed main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);  
  cout.tie(0);   

  #ifndef ONLINE_JUDGE
      if(fopen("INPUT.txt","r"))
      {
      freopen ("INPUT.txt" , "r" , stdin);
      freopen ("OUTPUT.txt" , "w" , stdout);
      }
  #endif

  int n,k;
  cin>>n>>k;
  int x;
  adj.resize(n+1);
  int p[n+1];
  for(int i=1;i<=n;i++)
  {
    cin>>x;
    p[i]=x;
    adj[i].push_back(x);
  }
  dfs(1,0);
  if(madar==0)
  {
    k%=sz;
    int ini=1;
    for(int i=1;i<=k;i++)
    {
      ini=p[ini];
    }
    cout<<ini;
  }
  else if(k<=madar)
  {
    int ini=1;
    for(int i=1;i<=k;i++)
    {
      ini=p[ini];
    }
    cout<<ini;    
  }
  else
  {
    k-=madar;
    k%=sz;
    int ini=index1;
    for(int i=1;i<=k;i++)
    {
      ini=p[ini];
    }
    cout<<ini;    
  }
  
  

}


Measured memory_bytes: 31120
#ifdef __APPLE__
#include <iostream>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <iomanip>
#include <cmath>
#include <ctgmath>
#include <math.h>
#include <cassert>
#include <chrono>
#else
#include <bits/stdc++.h>
#endif

using namespace std;
#define io ios_base::sync_with_stdio(false), cin.tie(NULL)
#define GFOR(i,a,n) for (i=a;i<n;i++)
#define FOR(i,a,n) for (int i=a;i<n;i++)
#define RFOR(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define tc(t) for (int tc=1; tc<=t; tc++)
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<long long int> vll;
typedef vector<pair<int, int> > vpi;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll modInverse (ll a) {ll p = mod - 2; return powmod(a, p);}
// head

void solve() {
    int n;
    cin >> n;

    ll ans = 0;
    for (int i = 1; i < n; i++) {
        ans += ceil(n/(long double)i) - 1;
    }
    cout << ans << "\n";
}

int main() {
    #ifdef LOCAL
    auto t1 = std::chrono::high_resolution_clock::now();
    #endif

    io;
    solve();

    #ifdef LOCAL
    auto t2 = std::chrono::high_resolution_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::milliseconds>( t2 - t1 ).count();

    std::cout << "Time Taken: " << duration << "\n";
    #endif

}
// check for edge cases in limits
// printing double may print 1.223232e9 like values, beware of that
// carefully observe simulation of test cases
// multiset erase is does not do what it is supposed to


Measured memory_bytes: 3648
#include <stdio.h>
#include <string.h>

int main()
{

    char s[ 3 ] ;
    scanf(" %s", s);

    if(s[ 0 ] == s[ 1 ]  && s[ 0 ] != s[ 2 ] ){
        printf("Yes");
    }
    else if(s[ 0 ] != s[ 1 ] && s[ 1 ] == s[ 2 ] ){
        printf("Yes");
    }
    else if(s[ 0 ] == s[ 2 ]  && s[ 1 ] != s[ 0 ]){
        printf("Yes");
    }
    else{
        printf("No");
    }
    return 0;
}


Measured memory_bytes: 128
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

int main()
{
	double x1, y1, x2, y2;
	scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
	printf("%.8f", sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2)));
	
	return 0;
}

Measured memory_bytes: 656
x1, y1, x2, y2 = map(int, input().split())

x4 = x1 - (y2 - y1)
y4 = y1 + (x2 - x1)

x3 = x4 - (y1 - y4)
y3 = y4 + (x1 - x4)

print(x3, y3, x4, y4)

Measured memory_bytes: 2940
#include<iostream>
#include<math.h>
#include<string>
#include<algorithm>
#include<unordered_map>
#include<stack>
#include<vector>
using namespace std;
int main(){
    int N;
    cin >> N;
    
    int L[2220];
    for(int i = 1;i <= N;i++){
        cin >> L[i];
    }
    
    sort(L + 1, L + N + 1);
    
    int ans = 0;
    for(int i = 3;i <= N;i++){
        for(int j = 2;j < i;j++){
            for(int k = j - 1;k > 0;k--){
                if(L[i] < L[j] + L[k])ans++;
                else break;
            }
        }
    }
    cout << ans;
}


Measured memory_bytes: 256
#include<stdio.h>

#define n_MAX (int) 100
#define ai_MAX (int) 999
#define ai_MIN (int) 0

void Call(int n);

int main(void)
{
	int n, a[ n_MAX ];
	
	if( scanf( "%d", &n ) == 1 )
	{
		if( n <= n_MAX )
		{
			for( int i = 0; i < n; i++ )
			{
				if( scanf( "%d", &a[ i ] ) == 1 )
				{
					if( ( a[ i ] < ai_MIN ) && ( a[ i ] > ai_MAX ) )
					{
						return -1;
					}
				}
				else
				{
					return -1;
				}
			}
		}
		else
		{
			return -1;
		}
	}
	else
	{
		return -1;
	}
	
	for( int j = n-1; j > 0; j-- )
	{
		printf( "%d ", a[j] );
	}
	printf( "%d\n", a[0] );
	
	return 0;
}

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

int main(){
  int N, x = 0;
  cin >> N;
  for(int i = 0; i < N; i++){
    int l, r;
    cin >> l >> r;
    x += r - l + 1;
  }
  cout << x << endl;
}


Measured memory_bytes: 3632
const main = (inputs) => {
  var N = inputs[0].split(" ")[0]-0;
  var K = inputs[0].split(" ")[1]-0;
  var list = makeList(N);
  if(K > list.length-N+1){
    console.log(-1);
  }else{
    for(var i=0;i<K;i++){
      var tmp = list.shift();
      if(tmp.b == N){
        list.push(tmp);
        i--;
      }
    }
    console.log(list.length);
    for(var i=0;i<list.length;i++){
      console.log(list[i].a + " " + list[i].b);
    }
  }
}

function makeList(n){
  var list = [];
  for(var i=1;i<=n;i++){
    for(var j=i+1;j<=n;j++){
      list.push({a:i, b:j});
    }
  }
  return list;
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split("\n"));


Measured memory_bytes: 10740
h = Array.new(4){ Array.new(3){ Array.new(10,0) } }          #最後の１０，０は値をすべてまずゼロにする
n = gets.to_i
n.times do
  a,b,c,d = gets.split.map(&:to_i)
  h[a-1][b-1][c-1] += d                                      #arrayは０からはじまるから？？
end

for i in 0..3                                          #４棟のことあらわすため
  puts "#"*20 if i>0
  for j in 0...3
    puts " "+h[i][j].join(" ")     
  end
end



Measured memory_bytes: 6900
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
    int n,k; cin>>n>>k;
    vi a(n+1),h(n+1,1);
    for (int i=1;i<=n;i++) cin>>a[i];
    for (int i=k+1;i<=n;i++){
        if (a[i]>a[i-k]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

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


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

signed main()
{
    int n;
    cin >> n;
    map<int,int>ma;
    long long ans =0;
    while(n--){
        int x;
        scanf("%lld",&x);
        ma[x]++;
        ans += x;
    }
    int m;
    cin >> m;
    while(m--){
        int b,c;
        cin >> b >> c;
        ans -= ma[b]*b;
        ans += ma[b]*c;
        ma[c] +=ma[b];
        ma[b] = 0;
        cout << ans << endl;
    }
}

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

#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << '\n'
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef tuple<ll,ll> Pll;
typedef vector<ll> vll;
const ll INF = LLONG_MAX/10;
const ll MOD = 1e9+7;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N,A,B,C,D;cin>>N>>A>>B>>C>>D;
  A--;B--;C--;D--;
  string S;cin>>S;
  bool same=false;
  bool three=false;
  bool aok=false;
  bool bok=false;
  ll i=A;
  while(i<=C){
    if(i==B){
      same=true;
    }
    if(i==C){
      aok=true;
    }
    if(i+1<N&&S[i+1]=='.'){
      i++;
      continue;
    }
    if(i+2<N&&S[i+2]=='.'){
      i+=2;
      continue;
    }
    break;
  }
  i=B;
  while(i<=D){
    if(0<=i-1&&i+1<N&&S[i]=='.'&&S[i+1]=='.'&&S[i-1]=='.'){
      three|=true;
    }
    if(i==D){
      bok=true;
    }
    if(i+1<N&&S[i+1]=='.'){
      i++;
      continue;
    }
    if(i+2<N&&S[i+2]=='.'){
      i+=2;
      continue;
    }
    break;
  }
  bool isok=aok&&bok;
  if(D<C){
    isok&=same&&three;
  }
  cout<<(isok? "Yes":"No")<<endl;
  return 0;
}


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

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

typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;

template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;}
template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}




void _main() {
        int n; cin >> n;
        double sum = 0;
        while (n--) {
                double x; cin >> x;
                sum += 1 / x;
        }

        cout << fixed << setprecision(10) << 1 / sum;
}



signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}

Measured memory_bytes: 3724
#include<bits/stdc++.h>
using namespace std;
#define MAXN 100000

int main() {
    int N, M, H[MAXN + 3], degree[MAXN + 3], lower[MAXN + 3], answer;

    cin >> N >> M;
    for (int i = 1; i <= N; i++)
        cin >> H[i];

    memset(degree, 0, sizeof(degree));
    memset(lower, 0, sizeof(lower));
    for (int i = 1; i <= M; i++) {
        int A, B;
        cin >> A >> B;

        degree[A] += 1;
        degree[B] += 1;

        if (H[A] < H[B]) lower[B] += 1;
        if (H[A] > H[B]) lower[A] += 1;
    }

    answer = 0;
    for (int i = 1; i <= N; i++) {
        if (degree[i] == lower[i])
            answer += 1;
    }

    cout << answer << endl;
}


Measured memory_bytes: 4816
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  ll c,k;
  cin >> n >> c >> k;
  vector<ll> t(n);
  REP(i,n) cin >> t[i];
  sort(ALL(t));
  int ans = 1;
  int bus = 0;
  ll time = t[0]+k;
  REP(i,n){
    if(t[i]<=time && bus<c){
      bus++;
    }else{
      ans++;
      bus = 1;
      time = t[i]+k;
    }
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 1024
use proconio::input;
use proconio::marker::Usize1;
use std::collections::BTreeSet;

fn main() {
    input! {
        n: usize, m: usize, k: usize,
        ab: [(Usize1,Usize1); m],
        cd: [(Usize1,Usize1); k]
    }

    let friend = {
        let mut friend = vec![Vec::new(); n];
        for &(a,b) in &ab {
            friend[a].push(b);
            friend[b].push(a);
        }
        friend
    };

    let block = {
        let mut block = vec![Vec::new(); n];
        for &(c,d) in &cd {
            block[c].push(d);
            block[d].push(c);
        }
        block
    };

    let ans = {
        let mut ans = vec![0; n];
        let mut arr = vec![false; n];
        for i in 0..n {
            if arr[i] {
                continue;
            } else {
                let mut stack = Vec::new();
                stack.push(i);
                let mut set = BTreeSet::new();
                while let Some(j) = stack.pop() {
                    arr[j] = true;
                    set.insert(j);
                    for &k in friend[j].iter().filter(|&&k| !arr[k]) {
                        stack.push(k);
                    }
                }
                let cc = set.len()-1;
                for &j in set.iter() {
                    ans[j] = cc-friend[j].len()-block[j].iter().filter(|k| set.contains(k)).count();
                }
            }
        }
        ans
    };


    for i in 0..n-1 {
        print!("{} " ,ans[i])
    }
    println!("{}",ans[n-1])
}

Measured memory_bytes: 22700
#include <iostream>
#include <string>
#include <string.h>

using namespace std;

int main()
{
  string str;
  cin >> str;
  for(int i=0;str[i]!='\0';i++)
    {
      if('A'<=str[i]&&str[i]<='Z')
	str[i]=(char)(str[i]-'A'+'a');
    }

  string s;
  int sum=0;
  cin >> s;
  while(s!="END_OF_TEXT")
    {
      for(int i=0;s[i]!='\0';i++)
	{
	  if('A'<=s[i]&&s[i]<='Z')
	    s[i]=(char)(s[i]-'A'+'a');
	}
      if(str==s)
	sum++;
      cin >> s;
    }
  cout << sum << endl;

  return 0;
}

Measured memory_bytes: 1192
#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>
#include <numeric>

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) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
typedef pair<double, double> P;
bool compare(P p, P q){
  if((double)p.second * q.first != (double)q.second * p.first) return (double)p.second * q.first > (double)q.second * p.first; //rev
  else return p.first < q.first;
}
bool compare2(P p, P q){
  return !compare(p, q);
  if((double)p.second/p.first != (double)q.second/q.first) return (double)p.second/p.first < (double)q.second/q.first; //rev
  else return p.first < q.first;
}

int main(){
  int N;
  ll W;
  while(cin>>N>>W && N){
    vector<int> w(N), v(N);
    REP(i, N) cin>>w[i]>>v[i];
    vector<bool> used(N, 0);
    vector<P> get;
    vector<P> reduce;
    double ans = 0;
    REP(i, N){
      if(w[i] == 0){
        if(v[i] >= 0) ans += v[i];
        used[i] = true;
      }else if(w[i] < 0 && v[i] >= 0){
        ans += v[i];
        W -= w[i];
        used[i] = true;
      }else if(w[i] > 0 && v[i] <= 0){
        used[i] = true;
      }
    }
    REP(i, N)if(!used[i]){
      if(w[i] > 0){ assert(v[i] > 0); get.push_back(P(w[i], v[i])); }
      else { assert(v[i] < 0); reduce.push_back(P(w[i], v[i])); }
    }
    sort(get.begin(), get.end(), compare);
    sort(reduce.begin(), reduce.end(), compare2);
    int r_idx = 0;
    REP(i, get.size()){
      if(get[i].first <= W){
        W -= get[i].first;
        ans += get[i].second;
      }else{
        while(r_idx < reduce.size() && get[i].first > W && get[i].first/get[i].second < reduce[r_idx].first/reduce[r_idx].second){
          if(W - reduce[r_idx].first < get[i].first){
            W -= reduce[r_idx].first;
            ans += reduce[r_idx].second;
            r_idx++;
          }else{
            double rest = get[i].first - W;
            assert(rest > 0);
            double use_p = rest/abs(reduce[r_idx].first);
            assert(abs(W - reduce[r_idx].first * use_p - get[i].first) < 0.001);
            W = get[i].first;
            ans += reduce[r_idx].second * use_p;
            reduce[r_idx].first += rest;
            reduce[r_idx].second = (reduce[r_idx].second - reduce[r_idx].second * use_p);
          }
        }
        if(get[i].first <= W){
          W -= get[i].first;
          ans += get[i].second;
        }else if(W > 0){
          double p = (double)W/get[i].first;
          assert(0 < p && p < 1);
          W = 0;
          ans += get[i].second * p;
        }
      }
    }
    printf("%.6lf\n", ans);
  }
  return 0;
}

Measured memory_bytes: 1432
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int H=sc.nextInt();
    int W=sc.nextInt();
    int N=sc.nextInt();
    int Ans=0;
    int count=0;
    
    if(H>W){
      for(Ans=0;Ans<N;Ans+=H){
        count++;
      }
    }
    else{
      for(Ans=0;Ans<N;Ans+=W){
        count++;
      }
    }
    System.out.println(count);
  }
}

Measured memory_bytes: 22228
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define ALL(x) std::begin(x), std::end(x)
using namespace std;
template <class T, class U> inline void chmax(T & a, U const & b) { a = max<T>(a, b); }
template <class T, class U> inline void chmin(T & a, U const & b) { a = min<T>(a, b); }

double solve(int n, const vector<int> & xs, const vector<int> & ys) {
    auto sq = [&](double x) {
        return x * x;
    };
    auto get_radius = [&](double x, double y) {
        double r_sq = 0;
        REP (i, n) {
            chmax(r_sq, sq(xs[i] - x) + sq(ys[i] - y));
        }
        return r_sq;
    };
    double r_sq = INFINITY;
    REP (i, n) {
        REP (j, i) {
            chmin(r_sq, get_radius((xs[i] + xs[j]) / 2.0, (ys[i] + ys[j]) / 2.0));
            REP (k, j) {
                double a = xs[i];
                double b = ys[i];
                double c = xs[j];
                double d = ys[j];
                double e = xs[k];
                double f = ys[k];
                double y_num = (e - a) * (a*a + b*b - c*c - d*d) - (c - a) * (a*a + b*b - e*e- f*f);
                double y_den = 2 * (e - a) * (b - d) - 2 * (c - a) * (b - f);
                if (y_den == 0) continue;
                double y = y_num / y_den;
                double x = (c == a)
                    ? (2 * (b - f) * y - a*a - b*b + e*e + f*f) / (2 * (e - a))
                    : (2 * (b - d) * y - a*a - b*b + c*c + d*d) / (2 * (c - a));
                chmin(r_sq, get_radius(x, y));
            }
        }
    }
    return sqrt(r_sq);
}

int main() {
    int n; cin >> n;
    vector<int> x(n);
    vector<int> y(n);
    REP (i, n) {
        cin >> x[i] >> y[i];
    }
    cout << setprecision(18) << solve(n, x, y) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<vector>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
	long long A, B, C, X, Y;
	cin >> A >> B >> C >> X >> Y;
	vector<long long>ooi_vector(2);
	vector<long long>sukunai_vector(2);
	bool AB_use = ((A + B) >= (2 * C));//trueならABを使う
	long long ooi = max(A, B);
	long long sukunai = min(A, B);

	long long kazu_ooi = max(X, Y);
	long long kazu_sukunai = min(X, Y);
	vector<long long>kazu_ooi_vector(2);
	vector<long long>kazu_sukunai_vector(2);

	if (kazu_ooi == X)
	{

		kazu_ooi_vector[0] = A;
		kazu_ooi_vector[1] = X;

		kazu_sukunai_vector[0] = B;
		kazu_sukunai_vector[1] = Y;
	}
	else if (kazu_ooi == Y)
	{

		kazu_ooi_vector[0] = B;
		kazu_ooi_vector[1] = Y;

		kazu_sukunai_vector[0] = A;
		kazu_sukunai_vector[1] = X;
	}
	long long res = 0;
	if (AB_use)
	{
		if (A < C || B < C)
		{
			 res = C * (kazu_sukunai_vector[1] * 2)+kazu_ooi_vector[0]*(kazu_ooi_vector[1]-kazu_sukunai_vector[1]);
			cout << res << endl;
		}
		else
		{

			 long long horixyu = C * (kazu_ooi_vector[1]*2);//ここがやばい
			 long long horixyu_2 = C * (kazu_sukunai_vector[1] * 2) + kazu_ooi_vector[0] * (kazu_ooi_vector[1] - kazu_sukunai_vector[1]);
			 if (horixyu >= horixyu_2)
			 {
				 res = horixyu_2;
			 }
			 else
			 {
				 res = horixyu;
			 }
			cout << res << endl;
		}
	}
	else
	{
		res = A * X + B * Y;
		cout <<res << endl;
	}
	


}

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>;
    
int main(){
    int n, m;
    cin >> n >> m;
    cout << (n-1)*(m-1) << endl;
    return 0;
}

Measured memory_bytes: 256
object Main {
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val bs = Array.fill(n-1)(sc.nextInt)
    val bs2 = 100001 +: bs :+ 100001
    var result = 0
    for(i <- 1 to bs2.length-1) {
      result = result + Math.min(bs2(i-1), bs2(i))
    }
    println(result)
  }
}


Measured memory_bytes: 25664
import java.util.Scanner;
class Main{
public static void main(String[] args){
 Scanner scan = new Scanner(System.in);
 
 int N = scan.nextInt();
 int work[] = new int[N];
  for (int i = 0; i < N-1; i++){
    int a = scan.nextInt();
    work[a-1] += 1;
  }
  for (int j = 0; j < N  ; j++){
    System.out.println(work[j]);
    }
 }
}

Measured memory_bytes: 59892
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
static class Program{
	const int mod=(int)1e9+7;
	static List<Tuple<int,long>>[] li;
	static bool[] b;
	static int[] h;
	static void Main(){
		Sc sc=new Sc();
		int n=sc.I;
		li=new List<Tuple<int,long>>[n+1];
		b=new bool[n+1];
		h=new int[n];
		for(int i=1;i<=n;i++){li[i]=new List<Tuple<int,long>>();}
		for(int i=1;i<n;i++){
			int[] e=sc.Ia;
			li[e[0]].Add(Tuple.Create(e[1],(long)e[2]));
			li[e[1]].Add(Tuple.Create(e[0],(long)e[2]));
		}
		Fu(1,0,0);
		Console.WriteLine(String.Join("\n",h));
	}
	static void Fu(int a,int g,long k){
		b[a]=true;
		if(g==0){}
		else{h[a-1]=(k&1)==0?h[g-1]:(h[g-1]^1);}
		for(int i=0;i<li[a].Count;i++){
			if(!b[li[a][i].Item1]){Fu(li[a][i].Item1,a,li[a][i].Item2);}
		}
	}
}

public class Sc{
	private string[] a;
	private int n=-1,m=0;
	public int I{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return int.Parse(a[n]);}}
	public long L{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return long.Parse(a[n]);}}
	public double D{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return double.Parse(a[n]);}}
	public string S{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return a[n];}}
	public int[] Ia{get{if(n!=-1&&n!=a.Length-1){m=n;n=-1;return Array.ConvertAll(a.Skip(m+1).ToArray(),int.Parse);}return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public string[] Sa2{get{return ("# "+Console.ReadLine()).Split();}}
}

Measured memory_bytes: 40300
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

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> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int a,p;
    cin>>a>>p;
    p+=a*3;
    cout<<p/2<<endl;
}

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

int main(){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    if(s == "abc") cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int A, B, C;
	cin >> A >> B >> C;
	int D = A + B;
	int E = A + C;
	int F = B + C;

	if (D < E&&D < F) {
		cout << D << endl;
	}

	else if (E < D&&E < F) {
		cout << E << endl;
	}

	else {
		cout << F << endl;
	}
}


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

int main() {
  int K,N,M;
  cin >> K >> N >> M;
  
  for (int i = N; i < M+1; i++) {
    if (i%K == 0){
      cout << "OK" << endl;
      return 0;
    }
  }
  cout << "NG" << endl;
}

  

Measured memory_bytes: 3612
n, m, l = map(int, input().split())

listA = []
for i in range(n):
    listA.append(list(map(int, input().split())))

listB = []
for i in range(m):
    listB.append(list(map(int, input().split())))

for i in range(n):
    listC = []
    for j in range(l):
        ans = 0
        for k in range(m):
            ans += listA[i][k] * listB[k][j]
        listC.append(ans)
    print(' '.join(map(str, listC)))


Measured memory_bytes: 6304
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;

using namespace std;
int main() {
	int n;
	cin >> n;
	cout << 180 * (n - 2) << endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define FILE_IO freopen("input.txt","r",stdin)
#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

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

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for(auto &it : t)cout<<it<<" ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 

void solve(){
   int n;
   cin >> n;
   vector<int> v;
   for(int i = 0 ; i < n; i++){
	  int x;
	  cin >> x;
	  v.push_back(x);   
	}
	int val = v[0];
	for(int i = 1; i < n; i++) val ^= v[i];
   if (val == 0) cout << "Yes" << endl;
   else cout << "No" << endl;
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}


Measured memory_bytes: 1400
#include <vector>
#include <iostream>
#include <string>
typedef long long ll;

using namespace std;


void handle_r_array(int begin_r, int pos_l, vector<int> *ans) {
  for(int i = begin_r; i < pos_l; i++) {
    int diff = pos_l - i;    
    if(diff % 2 == 0) {
      (*ans)[pos_l] += 1;
    } else {
      (*ans)[pos_l-1] += 1;
    }
  }
}
void handle_l_array(int begin_l, int end_l, vector<int> * ans) {
  for(int i=begin_l;i<=end_l;i++) {
    int diff = i - begin_l;
    if(diff % 2 == 0) {
      (*ans)[begin_l] += 1;
    } else {
      (*ans)[begin_l-1] += 1;
    }
  }
}

/**
 * https://atcoder.jp/contests/abc136/tasks/abc136_d
 */
vector<int> gathering_children(vector<char> s) {
  vector<int> ans(s.size());

  int start = 0;
  char formar_char = 'R';
  for(int i=1;i<s.size();i++) {
    if(formar_char == 'R') {
      if(s.at(i) == 'L') {
	handle_r_array(start, i, &ans);
	formar_char = 'L';
	start = i;
	if(i == s.size() - 1) {
	  ans[s.size() - 1] +=  1;
	}
      }
    } else {
      if(s.at(i) == 'R') {
	handle_l_array(start, i-1, &ans);
	start = i;
	formar_char = 'R';
      } else if (i == s.size() -1) {
	handle_l_array(start, i, &ans);
      }
    }
  }
  return ans;
}

int main() {
  string s_in;
  cin >> s_in;
  ll length = s_in.size();
  vector<char> s(length);
  for(ll i= 0;i < length;i++) {
    s[i] = (char) s_in[i];
  }
  vector<int> ans = gathering_children(s);
  length = (ll) ans.size();
  for(ll i =0;i<length;i++) {
    cout << ans[i];
    if(i != length - 1) {
      cout << " ";
    }
  }
}

Measured memory_bytes: 4020
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<iostream>
#define ll long long
#define re register
using namespace std;
inline int gi(){
    int f=1,sum=0;char ch=getchar();
    while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){sum=(sum*10)+ch-'0';ch=getchar();}
    return f*sum;
}
struct node{
	int l,r;
	bool operator<(const node b)const{
		return l<b.l || (l==b.l && r<b.r);
	}
}c[100010];
int n,m;
int main(){
	n=gi();m=gi();int l=0,r=n+1;
	for(int i=1;i<=m;i++)c[i].l=gi(),c[i].r=gi(),l=max(l,c[i].l),r=min(r,c[i].r);
	printf("%d\n",max(0,r-l+1));
	return 0;
}

Measured memory_bytes: 1024
/*------U Have To DO It------*/
/* BY-> RicoProg */
/*        ___ 
           __|__|
          |  |___       */
#include <bits/stdc++.h>
using namespace std;
 
 
//---------------------------------------------------MACROS----------------------------------------------------------
#define ll long long
#define ld long double
#define beg(i ,n) for(ll i=0;i<n;i++)
#define beg1(i ,n) for(ll i=1;i<n;i++)
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back 
#define mp make_pair
#define nl "\n" 
#define vec(v , n) vector<ll> v(n)
#define all(x) x.begin() , x.end()
#define pii pair<int , int>
#define pll pair<ll , ll>
#define mii map<int , int>
#define mll map<ll , ll>
#define msi map<string , int>
#define mci map<char , int>
#define f1 first
#define f2 second
#define inf 1e18 + 10
 
//---------------------------------------------------GLOBAL----------------------------------------------------------
const ll MOD = 1e9 + 7 ;
const ll MAX = 1e5 + 7 ;


//---------------------------------------------------TEMPLATES-------------------------------------------------------

void add_self(ll &a , ll b){
	a += b ;
	if(a>=MOD){
		a -= MOD ; 
	}
}

void sub_self(ll &a , ll b){
	a -= b ;
	if(a<0){
		a += MOD ; 
	}
}

void merge_self(vector<ll> &a , vector<ll> b){
	ll s = a.size() ;
	beg(i , s) a[i] += b[i] ;
}

void set_self(vector<ll> &a , ll n , ll s){
	beg(i , s) a[i] = n ;
}

ll factors(){

}

//---------------------------------------------------FUNCTIONS-------------------------------------------------------

ll dp[401][401] , sum[401] , ar[401] ;

void rec(ll s , ll e){
	if(s==e){
		dp[s][e] = 0 ;
		return ;
	}
	if(dp[s][e]!=-1){
		return ;
	}
	dp[s][e] = inf ;
	for(int i=s ; i<e ; i++){
		rec(s , i) ;
		rec(i+1 , e) ;
		dp[s][e] = min(dp[s][e] , dp[s][i] + dp[i+1][e] + sum[e] - sum[s-1]) ;
		//cout << s << "  " << e << "  " << sum[e] - sum[s-1] << nl ;
	}
	return ;
}

void solve(){
	memset(dp , -1 , sizeof(dp)) ;
	ll n ;
	cin >> n ;
	beg1(i , n+1) cin >> ar[i] ;
	sum[0] = 0 ;
	beg1(i , n+1) sum[i] = sum[i-1] + ar[i] ;
	rec(1 , n) ;
	cout << dp[1][n] ;
}

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

Measured memory_bytes: 1536
#include <stdio.h>

int main(void)
{
	int i;
	int n;
	int tmp;
	double sum;
	
	scanf("%d\n", &n);
	
	for (i = sum = 0; i < n; i++){
		scanf("%d", &tmp);
		sum += tmp;
	}
	
	printf("%.0lf\n", sum / n);
	
	return (0);
}



Measured memory_bytes: 1992