akhauriyash/Code-Regression huggingface dataset:
////////////////////////// Author
////////////////////////// Nasim Hossain Rabbi
////////////////////////// JU-CSE28
////////////////////////// CF - imnasim3.1415
////////////////////////// UVA - imnasim3.1415
////////////////////////// Mail - imnasim3.1415@gmail.com
#include<bits/stdc++.h>
using namespace std;
#define sz size()
#define mk make_pair
#define clr clear()
#define B begin()
#define E end()
#define EM empty()
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(i,n) for(i=0;i<n;i++)
#define Rep(i,n) for(i=1;i<=n;i++)
#define all(cont) cont.begin(),cont.end()
#define pb push_back
string en="\n";
string t="hello";
#define sqr(a) ((a) * (a))
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
#define pi 3.1415926535897932384626433832795
#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define vp(vi,x) cin>>x; vi.pb(x);
#define LB(a,x) (lower_bound(all(a),x)-a.B)
#define UB(a,x) (upper_bound(all(a),x)-a.B)
typedef long long LL;
typedef unsigned long long ULL;
bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}
int toInt(string s){int sm;stringstream ss(s);ss>>sm;return sm;}
template<typename T>inline T gcd(T a,T b){if(a<0)return gcd(-a,b);if(b<0)return gcd(a,-b);return (b==0)?a:gcd(b,a%b);}
template<typename T>inline T lcm(T a,T b) {if(a<0)return lcm(-a,b);if(b<0)return lcm(a,-b);return a*(b/gcd(a,b));}
int main()
{
//    fast;
    LL i,j,k,n,m,l,s=0,x,y,tc=1,c=0;
    while(cin>>n>>m)
    {
        map<int,int> mp;
        rep(i,m)
        {
            cin>>x>>y;
            mp[x]++;
            mp[y]++;
        }
        Rep(i,n)
        {
            cout<<mp[i]<<en;
        }
    }
}



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

template<class T> inline T chmax(T& a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }
constexpr int INFINT = (1 << 30) - 1;                    // 1.07x10^ 9
using namespace std;

int main() {
  int n; cin >> n;
  int h[n];
  int dp[n]; rep(i,n) dp[i] = INFINT;
  
  rep(i, n) cin >> h[i];
  dp[0] = 0;
  dp[1] = abs(h[1] - h[0]);
  for (int i = 2; i < n; ++i) {
  	chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]));
    chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
  }
  
  cout << dp[n-1] << endl;
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("3 2");
            WillReturn.Add("#.#");
            WillReturn.Add(".#.");
            WillReturn.Add("#.#");
            WillReturn.Add("#.");
            WillReturn.Add(".#");
            //Yes
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("4 1");
            WillReturn.Add("....");
            WillReturn.Add("....");
            WillReturn.Add("....");
            WillReturn.Add("....");
            WillReturn.Add("#");
            //No
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] wkArr = InputList[0].Split(' ').Select(X => int.Parse(X)).ToArray();

        int N = wkArr[0];
        int M = wkArr[1];

        var AList = new List<string>();
        for (int I = 1; I <= N; I++) {
            AList.Add(InputList[I]);
        }
        int UB_A_X = AList[0].Length - 1;
        int UB_A_Y = AList.Count - 1;

        var BList = new List<string>();
        for (int I = 1; I <= M; I++) {
            BList.Add(InputList[N + I]);
        }
        int UB_B_X = BList[0].Length - 1;
        int UB_B_Y = BList.Count - 1;

        for (int X1 = 0; X1 <= UB_A_X - UB_B_X; X1++) {
            for (int Y1 = 0; Y1 <= UB_A_Y - UB_B_Y; Y1++) {

                bool IsOK = true;
                for (int X2 = 0; X2 <= UB_B_X; X2++) {
                    for (int Y2 = 0; Y2 <= UB_B_Y; Y2++) {
                        if (AList[Y1 + Y2][X1 + X2] != BList[Y2][X2]) {
                            IsOK = false;
                            break;
                        }
                    }
                    if (IsOK == false) break;
                }

                if (IsOK) {
                    Console.WriteLine("Yes");
                    return;
                }

            }
        }
        Console.WriteLine("No");
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)
#define all(cont) cont.begin(), cont.end()
#define unique(a)  sort(all(a)) , (a).erase(unique((a).begin(), (a).end()),(a).end())
#define rall(cont) cont.rbegin(), cont.rend()
#define sz(x) (int)(x).size()
#define fastio          ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PB push_back
#define endl "\n"
#define f first
#define s second
#define mset(m,v) memset(m,v,sizeof(m))
#define mod 1000000007
const int N = 2e5 + 5;
#define PI acos(-1.0)
long double EPS = 1e-9;
typedef long long ll;
#define int long long
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vpii;
#define pqll_max priority_queue<ll> // max heap. push(),pop(),top(),size(),empty()
#define pqll_min priority_queue<ll,vector<ll>,greater<ll> >
#define lb(v,val)   lower_bound(v.begin(),v.end(),val) //first equal to or lower than [------------
#define ub(v,val)   upper_bound(v.begin(),v.end(),val) //first greater than ------------)
#define bs(v,x) binary_search(v.begin(),v.end(),x)
inline ll add(ll x, ll y) { x += y; if (x >= mod) x -= mod; return x; }
inline ll sub(int x, int y) { x -= y; if (x < 0) x += mod; return x; }
inline ll mul(ll x, ll y) { return (x%mod * 1ll * y%mod) % mod; }
inline ll pwr(ll a, ll b) { ll x = 1 % mod; while (b) { if (b & 1) x = mul(x, a); a = mul(a, a); b >>= 1; }return x % mod; }
inline ll inv(ll a) { return pwr(a, mod - 2) % mod; }
ll gcd(ll a, ll b) { if (!a)return b % mod; return gcd(b%a, a) % mod; }
#define debug(x) cout << #x << " = " << x << endl;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#define in(container) for (auto &it : container) cin>>it;
#define out(container) for (auto it : container) cout << it << " "; cout << endl;
void solve() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int turn = 0;
	while (1) {

		if (!turn) {
		
					c -= b;
					if (c <= 0) {
						cout << "Yes" << endl;
						break;
					}
				
			}
		else {
			a -= d;
			if (a <= 0) {
				cout << "No" << endl;
				break;
			}
		}
		turn++;
		turn = turn % 2;

	}
	
}
signed main()
{
	fastio;
	//cout<<fixed<<setprecision(15);
	//clock_t begin = clock();
	int tc;
	tc = 1;
	//cin >> tc;
	while (tc--) {
		solve();
	}
	//clock_t end = clock();double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;cerr << elapsed_secs;
}


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

string to_string(string s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

void test_case() {
  int n;
  cin >> n;
  vector<int> A(n + 1);
  multiset<int> mst;
  for (int i = 1; i <= n; ++i) {
    cin >> A[i];
    mst.insert(A[i]);
  }
  for (int i = 1; i <= n; ++i) {
    mst.erase(mst.find(A[i]));
    cout << *(--mst.end()) << "\n";
    mst.insert(A[i]);
  }
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  test_case();
  return 0;
}


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

using namespace std;

using ll = long long;
using dd = double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<dd, dd>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<dd>;
using vb = vector<bool>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;

template <class T, class V>
istream& operator>>(istream& in, pair<T, V>& pair) {
    return in >> pair.first >> pair.second;
}

template <class T>
istream& operator>>(istream& in, vector<T>& elements) {
    for (size_t i = 0; i < elements.size(); ++i) {
        in >> elements[i];
    }
    return in;
}

template <class Container, class Element>
bool Contains(const Container& container, const Element& element) {
    return container.find(element) != container.end();
}

template <class T>
ostream& operator<<(ostream& out, const vector<T>& elements) {
    for (const T& element : elements) {
        out << element << ' ';
    }
    return out;
}

template <class T, class V>
ostream& operator<<(ostream& out, const pair<T, V>& pair) {
    return out << pair.first << ' ' << pair.second;
}

#define FOR(i,n) for(size_t i=0, i##_len=(n); i<i##_len; ++i)
#define SORT(c) sort((c).begin(), (c).end())
#define SUM(c) accumulate((c).begin(), (c).end(), 0ll)

int main() {
    ios_base::sync_with_stdio(false);
    
    int M, D;
    cin >> M >> D;
    
    int res = 0;
    for (int i = 1; i <= M; ++i) {
        for (int j = 22; j <= D; ++j) {
            int d1 = j / 10;
            int d10 = j % 10;
            if (d1 >= 2 && d10 >= 2 && d1 * d10 == i) {
                ++res;
            }
        }
    }
    cout << res << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define int long long
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}


int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int h;
int ans, k = 1;

signed main() {
	cin >> h;
	while (h > 0) {
		ans += k;
		h /= 2;
		k *= 2;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>

char jukuClass(int, int, int);

int main()
{
    while (true) {
        int number;
        std::cin >> number;
        if (number == 0) {
            break;
        }
        for (int i = 0; i < number; ++i) {
            int pm, pe, pj;
            std::cin >> pm >> pe >> pj;
            std::cout << jukuClass(pm, pe, pj) << std::endl;
        }
    }
    return 0;
}

char jukuClass(int pm, int pe, int pj)
{
    if (pm == 100 || pe == 100 || pj == 100) {
        return 'A';
    } else if ((pm + pe) / 2.0 >= 90) {
        return 'A';
    } else if ((pm + pe + pj) / 3.0 >= 80) {
        return 'A';
    } else if ((pm + pe + pj) / 3.0 >= 70) {
        return 'B';
    } else if (((pm + pe + pj) / 3.0 >= 50) && (pm >= 80 || pe >= 80)) {
        return 'B';
    } else {
        return 'C';
    }
}

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

using namespace std;
using ll=long long;
using vi=vector<int>;

int main() {
    ios::sync_with_stdio (false), cin.tie (0);
    int A, B;
    cin >> A >> B;
    if(2 * B >= A){
        cout << 0 << '\n';
    }
    else cout << A - 2 * B << '\n';



    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);
		double a = sc.nextDouble(), b = sc.nextDouble(), C = sc.nextDouble();
		C *= Math.PI;
		C /= 180;
		double S = a * b * Math.sin(C) / 2;
		double l = a + b + Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(C));
		double h = S * 2 / a;
		System.out.printf("%f\n%f\n%f\n", S, l, h);
		sc.close();
	}
}


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

using namespace std;

int calc(int y,int m,int d){
  int res=0;
  for(int i=1;i<y;i++){
    if(i%3!=0)res+=195;
    else res+=200;
  }
  for(int i=1;i<m;i++){
    if(y%3!=0&&i%2==0)res+=19;
    else res+=20;
  }
  return res+d-1;
}

int main(){

  int n;
  cin>>n;
  while(n--){
    int y,m,d;
    cin>>y>>m>>d;
    cout<<196470-calc(y,m,d)<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 0
#include<stdio.h>

int main(){
  long long n,b=1000000007,ans=0;
  scanf("%lld",&n);
  long long a[n+1],c[n+1];
  c[0]=0;
  for(long long i=1;i<=n;i++){
    scanf("%lld",&a[i]);
    a[i]=a[i]%b;
    c[i]=(c[i-1]+a[i])%b;
  }
  
  for(long long i=2;i<=n;i++){
    ans=(ans+a[i]*c[i-1])%b;
  }
  
  printf("%lld",ans);
  return 0;
}


Measured memory_bytes: 5224
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int MOD=1000000007;



int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  ll b=0;
  for(int i=0;i<n;i++){
    cin >> a.at(i);
    b^=a.at(i);
  }
  for(int i=0;i<n;i++){
    cout << (b^a.at(i)) << " ";
  }
  cout << endl;
}

Measured memory_bytes: 4744
# coding : utf-8
a, b, c = map(int, input().split())
if a < b:
    if b < c:
        print (a, b, c)
    else:
        if a < c:
            print (a, c, b)
        else:
            print (c, a, b)
else: # b < a
    if a < c:
        print (b, a, c)
    else: # c < a
        if b < c:
            print (b, c, a)
        else:
            print (c, b, a)


Measured memory_bytes: 5596
#include <iostream>

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

    int rem1 = a%3;
    int rem2 = b%3;
    int rem3 = (a + b)%3;

    std::string ans;
    if(0 == rem1 * rem2 * rem3){
        ans = "Possible";
    }else{
        ans = "Impossible";
    }

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

Measured memory_bytes: 256
def split_returner(chardata):
        chardata = str(chardata).split(" ")
        for i in range(0,len(chardata)):
            chardata[i] = int(chardata[i])
        return chardata

num = int(input())
value = split_returner(input())
cost = split_returner(input())

res = 0
gain = 0

for i in range(0,len(value)):
    gain = value[i] - cost[i]
    if gain >= 0:
        res += gain
    else:
        pass

print(res)

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

//定数
const long long MOD1=1000000007;
const long long MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const long long dx[]={0,1,0,-1,1,-1,1,-1};
const long long dy[]={1,0,-1,0,1,1,-1,-1};

//省略
#define ll long long
#define ull unsigned long long
#define ld long double
#define uld unsigned long double
#define pll pair<long long,long long>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define vvvl vector<vector<vector<long long>>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vs vector<string>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vp vector<pair<long long,long long>>
#define umap unordered_map
#define uset unordered_set
#define Lqueue priority_queue<long long>
#define Squeue priority_queue<long long,vector<long long>,greater<long long>>
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back

//マクロ
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rbf(a,x) for(auto& a:x)
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s);i<(long long)(n);i++)
#define bitrep(i,s,n) for(long long i=(s);i<(1LL<<(n));i++)
#define bitcheck(bit,i) (bit)&(1LL<<(i))
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Size(x) ((long long)(x).size())
#define Lin(s) getline(cin,(s))

//Yes,No
void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

//MAX,MIN
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}

//最大公約数,最小公倍数
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a,long long b){return a/gcd(a,b)*b;}

//切り上げ除算
long long cutup(long long a,long long b){return (a+b-1)/b;}

//累乗
template<typename t>
constexpr t my_pow(t a,long long b){
    if(b==0)return 1;
    if(a==0)return 0;
    t x=1;
    while(b>0){
        if(b&1LL)x*=a;
        a*=a;
        b>>=1LL;
    }
    return x;
}
#define pow my_pow

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

//組み合わせ O(r)
template<typename t>
constexpr t nCr(t n,long long r){
    if(r==0)return 1;
    if(n==0)return 0;
    if(n<r)return 0;
    t x=1;
    for(long long i=1;i<=r;i++){
        x*=n-i+1;
        x/=i;
    }
    return x;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int r,d,x;
    cin>>r>>d>>x;
    rep(i,10){
        cout<<r*x-d<<endl;
        x=r*x-d;
    }
}

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

int main() {
    int n, m, a, b, ans = 0;
    cin >> n >> m;
    vector<vector<bool>> v(n, vector<bool>(n, false));
    for (int i = 0; i < m; i++) {
        cin >> a >> b;
        v.at(a - 1).at(b - 1) = true;
        v.at(b - 1).at(a - 1) = true;
    }
    vector<int> casee(n - 1);
    for (int i = 0; i < n - 1; i++) {
        casee.at(i) = i;
    }

    bool each;
    do {
        each = true;
        if (!v.at(0).at(casee.at(0) + 1)) each = false;
        else {
            for (int i = 0; i < n - 2; i++) {
                if (v.at(casee.at(i) + 1).at(casee.at(i + 1) + 1)) continue;
                else  {
                    each = false;
                    break;
                }
            }
        }
        if (each) {
            ans++;
        }
    } while (next_permutation(begin(casee), end(casee)));
    cout << ans << endl;
}

Measured memory_bytes: 3620
/*input
1000000000
*/

//sometimes it's the people who no one imagines anything of 
//who do the things that no one can imagine.

//code author: iamxlr8

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

#define ll long long
#define endl "\n"
#define all(c) c.begin(),c.end()
#define mod 1000000007
#define inf 1000000000000000001
#define F first
#define S second
#define dbg(x) cout << #x << " = " << x << '\n'
#define off ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

void solve()
{
    ll n;
    cin>>n;
    ll ans=0;
    ans+=n/500*1000;
    n%=500;
    ans+=n/5*5;
    n%=5;
    cout<<ans;
}

int main() 
{
    off;
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ll tests=1;
    // cin>>tests;
    while(tests--)
    {
        solve();
    }
    return 0;
}

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


int main() {
  int e;
  int o;
  cin >> e >> o;
//e+e o+o
  int ans=0;
  if(e>=2) ans += e * (e - 1) / 2;
  if(o>=2) ans += o * (o - 1) / 2;
  cout << ans << endl;
}


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

int main(){

    char S[10];
    char T[11];


    for(int i=0; i<10; i++){
        S[i]=0;
        T[i]=0;
    }
    T[10]=0;

    scanf("%s",S);
    scanf("%s",T);


    //bool check = true;
    int check=0;
 	for(int i=0; i<strlen(S); i++){
 	    if(S[i]!=T[i]){
 	    	//check = false;
 	    	check++;
 	    	//printf("Called ! : %d",check);
 	    	break;
 	    }

 	}

 	if(T[strlen(T)] != S[strlen(T)]){
 	    check = 0;
 	}

 	if(strlen(S) == strlen(T)){
 		check = 1;
 	}

 	//printf("%s %s\n",S,T);
 	if(check == 0){
 	    printf("Yes\n");
 	}else{
 		printf("No\n");
 	}

    

    return 0;

}



Measured memory_bytes: 1616
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n-1); i >= 0; i--)
#define all(v) (v).begin(),(v).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a/gcd(a,b)*b; }
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
	int n;
	cin >> n;
    int ans = 800 * n - 200 * (n/15);
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	string ans = "No";
	for (int i = 0; i < 9; i++)
	{
		for (int j = 0; j < 9; j++)
		{
			if((i+1)*(j+1)==N)ans = "Yes";
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<cmath>
#include<queue>
#include<string.h>
#include<map>
#include<stack>
#include<algorithm>
#define ll long long
#define pi pair < ll,ll >
#define mp(a,b) make_pair(a,b)
#define rep(i,a,b) for(int i = a;i < b;i++)
#define N 300004
#define INF 1e9+7

using namespace std;

struct point{
    ll x;
    ll y;
    ll id;
};

ll n,r,c;
pi a,b;
point neo;
stack < ll > st;
vector < point > v;

double ccw(point a,point b)
{
    return a.x*b.y-a.y*b.x;
}

bool cmp(const point &a,const point &b)
{
    ll cc = ccw(a,b);

    if(cc == 0)
    {
        if(a.x == b.x)
            return a.y > b.y;
        return a.x<b.x;
    }

    return cc > 0;
}

int main()
{
    ios_base::sync_with_stdio(false);

    cin >> r >> c >> n;

    rep(i,0,n)
    {
        cin >> a.first >> a.second >> b.first >> b.second;

        if(((a.first == 0 || a.first == r) || (a.second == 0 || a.second == c)) && ((b.first == 0 || b.first == r) || (b.second == 0 || b.second == c)))
        {
            neo.x = a.first;
            neo.y = a.second;
            neo.id = i+1;
            v.push_back(neo);
            neo.x = b.first;
            neo.y = b.second;
            neo.id = i+1;
            v.push_back(neo);
        }
    }

    sort(v.begin(),v.end(),cmp);

    rep(i,0,v.size())
    {
     //   cout << v[i].x << " " << v[i].y << "  " << v[i].id << endl;
        if(!st.empty() && st.top() == v[i].id)
            st.pop();
        else
            st.push(v[i].id);
    }

    if(st.empty())
        cout << "YES\n";
    else
        cout << "NO\n";

    return 0;
}



Measured memory_bytes: 8560
n = int(input())
V = input().split()

v1 = {}; v2 = {}

for i in range(0, n, 2):
    v = V[i]
    if v in v1.keys():
        v1[v] += 1
    else:
        v1[v] = 1

for i in range(1, n, 2):
    v = V[i]
    if v in v2.keys():
        v2[v] += 1
    else:
        v2[v] = 1

max_v1 = max(v1.items(), key=lambda x: x[1])
max_v2 = max(v2.items(), key=lambda x: x[1])

ans = 0
if max_v1[0] != max_v2[0]:
    ans = n - max_v1[1] - max_v2[1]
elif len(v1) == len(v2) == 1:
    ans = int(n/2)
elif len(v1) == 1:
    max_v2_ = max(v2.items(), key=lambda x: x[1])
    ans = n - max_v1[1] - max_v2_[1]
elif len(v2) == 1:
    max_v1_ = max(v1.items(), key=lambda x: x[1])
    ans = n - max_v1_[1] - max_v2[1]
else:
    v1.pop(max_v1[0])
    v2.pop(max_v2[0])
    max_v1_ = max(v1.items(), key=lambda x: x[1])
    max_v2_ = max(v2.items(), key=lambda x: x[1])
    
    if max_v1_[1] >= max_v2_[1]:
        ans = n - max_v1_[1] - max_v2[1]
    else:
        ans = n - max_v1[1] - max_v2_[1]

print(ans)

Measured memory_bytes: 18608
N, M = map(int, input().split())

H = list(map(int, input().split()))

highest = list(range(1,N+1))

lists = []

for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        highest[B-1] = A
    elif H[A-1] < H[B-1]:
        highest[A-1] = B
    else:
        highest[B-1] = A
        highest[A-1] = B

count = 0

for i in range(N):
    if highest[i] == i+1:
        count += 1

print(count)




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

int main() {
  string s;
  cin >> s;
  
  bool answer = true;
  for (int i = 0; i < s.size();i++){
    for (int j = 0; j < s.size();j++){
      if (i == j) continue;
      if (s.at(i) == s.at(j)) {
        answer = false;
        break;
      }
    }
  }
  if (answer) cout << "yes" << endl;
  else cout << "no" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>
typedef long long LL;
#define rep(i,N) for(int i=0;i<(LL)N;i++)
int compare(const int*a,const int*b){if(*a<*b)return -1;else if(*a==*b)return 0;else return 1;}
inline LL IN(void)
{
  LL x=0;short f=0,c=getchar();
  while(c<48||c>57)f^=c==45,c=getchar();
  while(c>47&&c<58)x=x*10+c-48,c=getchar();
  return f?-x:x;
}
signed main(void)
{
  int N,NG,OK,BASE,minus;
  LL K,L=-pow(16,16)/16,M,R=LLONG_MAX/3,count;
  N=IN(),K=IN();
  int A[N];
  rep(i,N)A[i]=IN();
  qsort(A,N,sizeof(int),(int(*)(const void*,const void*))compare);
  while(R-L>1)
  {
    M=(L+R)/2,count=0;
    rep(i,N)
    {
      NG=i,OK=N,minus=(A[i]<0);
      while(OK-NG>1)
      {
        BASE=(NG+OK)/2;
        if((LL)A[i]*A[BASE]<=M){if(minus)OK=BASE;else NG=BASE;}
        else{if(minus)NG=BASE;else OK=BASE;}
      }
      count+=(minus)?N-OK:NG-i;
    }
    if(count<K)L=M;else R=M;
  }
  return printf("%lld\n",R),0;
}

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vec;
#define PI 3.14159265359


int main() {
    int sum = 0;
    string s ,t;
    cin >> s >> t;
    for(int i = 0 ; i < s.size() ; ++i){
        if(s.at(i) == t.at(i)){
            sum++;
        }
    }
    if(sum == s.size())cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
using namespace std;

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;

int main() {
    int n, k; cin >> n >> k;
    vector<int> x(n);
    rep(i,n) cin >> x[i];
    int ans = 0;
    rep(i,n){
        ans += 2 * min(abs(x[i]),abs(k - x[i]));
    }
    cout << ans << endl;
}




Measured memory_bytes: 3592
from collections import Counter
class UnionFind:
    #Union Find木のクラス

    def __init__(self, n):
        #親要素のノード番号を格納。par[x] == xのときそのノードはroot
        self.par = [i for i in range(n)]
        #木の高さ（初期状態では0）
        self.rank = [0] * n

    def find(self, x):
        #木の根を求める
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def same(x, y):
        # xとyが同じ集合に属するかを判定
        return self.find(x) == self.find(y)

    def union(self, x, y):
        #併合する
        #まず根を探す
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1


N, K, L = map(int, input().split())
road = UnionFind(N)
rail = UnionFind(N)

for i in range(K):
    pi, qi = map(lambda x: int(x) - 1, input().split())
    road.union(pi, qi)

for i in range(L):
    ri, si = map(lambda x: int(x) - 1, input().split())
    rail.union(ri, si)


road_and_rail = [(road.find(i), rail.find(i)) for i in range(N)]
count = Counter(road_and_rail)

ans = []
for i in range(N):
    ans.append(str(count.get(road_and_rail[i])))
print(' '.join(ans))

Measured memory_bytes: 66264
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#define INF 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main(){
    ll n,k;
    cin>>n>>k;
    vector<P> p(n);
    rep(i,n){
        cin>>p[i].first>>p[i].second;
    }
    sort(p.begin(),p.end());
    rep(i,n){
        k-=p[i].second;
        if(k<=0){
            cout<<p[i].first<<endl;
            break;
        }
    }
    return 0;
}



Measured memory_bytes: 1024
S=input()
N=[[0,0] for i in range(len(S)+1)]

for i in range(len(S)):
    if(S[i]=="<"):
        N[i+1][0]=N[i][0]+1
    
    if(S[-1-i]==">"):
        N[-2-i][1]=N[-1-i][1]+1
s=0
for i in range(len(N)):
    s+=max(N[i][0],N[i][1])
print(s)
        

Measured memory_bytes: 98992
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("no-stack-protector")
// #pragma GCC optimize("fast-math")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,popcnt,avx,avx2,tune=native")

#include <bits/stdc++.h>

using namespace std;

typedef int64_t ll;
typedef uint64_t ull;

const ll LINF = 9187201950435737471;
const ll nLINF = -9187201950435737472;
const ll INF = 2139062143;
const int nINF = -2139062144;
const ull ULINF = numeric_limits<ull>::max();
const ll MAXN = 1e5 + 15;
const ll MAXE = 1000 + 15;
const double PI = acos(-1);
const ll MOD = 998244353;
const double EPS = 1e-10;
auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rnd(seed);

bool isEqual(double a, double b) {
    return abs(a - b) <= EPS;
}

#define all(_v) _v.begin(), _v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) (int)(v.size())
#define sqr(_v) ((_v) * (_v))
#define vpi vector<pair<int, int>>
#define eb emplace_back
#define pb push_back
#define mod(x, m) ((x) % m + ((x) < 0  && ((x % m) != 0) ? m : 0))
#define vi vector<int>
#define pi pair<int, int>
#define minq(x, y) (x) = min(x, y)
#define maxq(x, y) (x) = max(x, y)


inline void IO() {
#if(DEBUG_LEVEL > 0)
    freopen("../input.txt", "r", stdin);
    freopen("../out.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
}

template <typename T>
istream& operator >> (istream& in, vector<T>& a) {
    for (auto& i : a)
        in >> i;
    return in;
}

template <typename T>
ostream& operator << (ostream& out, const vector<T>& a) {
    for (auto& i : a) {
        out << i << " ";
    }
    return out;
}

template <typename T, typename D>
istream& operator >> (istream& in, pair<T, D>& a) {
    in >> a.first >> a.second;
    return in;
}

template <typename T, typename D>
ostream& operator << (ostream& out, const pair<T, D>& a) {
    out << a.first << " " << a.second;
    return out;
}

#define int ll

vi adj[MAXN];
int dp[MAXN];

void DFS(int v, int p = -1) {
    vi all;
    for (auto u : adj[v]) {
        if (u != p) {
            DFS(u, v);
            all.eb(dp[u]);
        }
    }
    sort(rall(all));
    int add = 1;
    for (auto u : all) {
        maxq(dp[v], u + add);
        add++;
    }
}

inline void solve() {
    int n;
    cin >> n;
    for (int i = 2; i <= n; ++i) {
        int x;
        cin >> x;
        adj[x].eb(i);
    }
    DFS(1);
    cout << dp[1];
}

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





Measured memory_bytes: 20728
#include <iostream>
#include <string>
#define llint long long

using namespace std;

llint n, k, Q;
llint a[100005];

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> k >> Q;
	llint x;
	for(int i = 1; i<= Q; i++){
		cin >> x;
		a[x]++;
	}
	
	for(int i = 1; i <= n; i++){
		if(a[i] > Q-k) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1408
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>

#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll, ll> pll;
//int dx[4] = { 1,0,0,-1 };
//int dy[4] = { 0,1,-1,0 };
#define MOD 1000000007
#define ARRAY_MAX 55

const int INF = 1e9 + 7;


int a[ARRAY_MAX][ARRAY_MAX];
int dp[ARRAY_MAX][ARRAY_MAX];

int calc(int x, int tm) {

	int res = 1;
	for (int i = 0; i < tm; i++) {
		res *= x;
	}
	return res;
}

int make_digit(int n) {

	int res = 0;
	while (n > 0)
	{
		res += n % 10;
		n /= 10;
	}
	return res;
}

int main() {


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

	int a, n, m;
	cin >> a >> n >> m;
	int ans = 0;

	for (int i = 1; calc(i, n) <= m; i++) {

		int num = calc(i, n);//i^n
		int digit = make_digit(num);
		int digit_plus_a = digit + a;

		//cout << i << " " << num << " " << digit << " " << digit_plus_a << endl;
		if (num == calc(digit_plus_a, n))
		{
			//cout << "i= " << i << endl;
			ans++;
		}
	}
	cout << ans << endl;

	return 0;
}



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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;


const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()


int main(){
    ll N,K;
    ll sum=0,ANS;
    cin>>N>>K;
    vector<ll>mp(100010,0);
    rep(i,N){
        int a,b;
        cin>>a>>b;
        mp[a]+=b;
    }
    REP(i,1,100001){
        if(K<=mp[i]){
            cout<<i<<endl;
            return 0;
        }
        K-=mp[i];
    }

    return 0;
}

//a=97,z=122

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll GCD(ll a, ll b){ return a ? GCD(b % a, a) : b; }
int main(){
    string n;
    cin>>n;
    if(n[n.size()-1]=='3') cout<<"bon"<<endl;
    else if(n[n.size()-1]=='2'||n[n.size()-1]=='4'||n[n.size()-1]=='5'||n[n.size()-1]=='7'||n[n.size()-1]=='9') cout<<"hon"<<endl;
    else cout<<"pon"<<endl;
}

Measured memory_bytes: 3600
// ALDS1_1_B Greatest Common Divisor
import java.io.*;

class Main {
   public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      try {
         String[] input = br.readLine().split(" ");
         int x = Integer.parseInt(input[0]);
         int y = Integer.parseInt(input[1]);
         System.out.println(gcd(x, y));
      }
      catch (Exception e) {
         e.printStackTrace();
      }
   }
   static int gcd(int x, int y) {
      int r;
      if (x <= y) swap(x, y);
      while (y > 0) {
         r = x % y;
         x = y;
         y = r;
      }
      return x;
   }
   static void swap(int x, int y) {
      int work;
      work = x;
      x = y;
      y = work;
   }
}

Measured memory_bytes: 17088
#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
using P = pair <int, int>;
 
ll MOD = 1000000007;
ll INF =1<<29;

ll cnt (ll y){
    if(y==1) return 0;
    return (y-2)*(y+1)/2+1;
}
int main() {
     int n;
     cin >> n;
     vector<string> s(n);
     rep(i,n) {cin >> s[i];
     sort(s[i].begin(),s[i].end());}
     map<string,int>mp;
     for(string x:s){
         mp[x]++;}
     ll ans = 0;
     for(auto x:mp){
             ll t = x.second;
             ans +=cnt(t);
     }
     cout << ans <<endl;

}

Measured memory_bytes: 18176
#include <stdio.h>
 
int main(void) {
    int W, H, x, y, r;
    scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
    if(x >= r && y >= r && (H - r) >= y && (W - r) >= x) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 584
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using Enu = System.Linq.Enumerable;

public class Program
{
    public void Solve()
    {
        int N = Reader.Int();
        var A = Reader.IntArray(N);
        long ans = 0;
        for (int i = 0; i < N; i++)
        {
            ans += A[i] / 2;
            if (i + 1 < N && A[i] % 2 == 1 && A[i + 1] > 0) { ans++; A[i + 1]--; }
        }
        Console.WriteLine(ans);
    }
}


class Entry { static void Main() { new Program().Solve(); } }
class Reader
{
    static TextReader reader = Console.In;
    static readonly char[] separator = { ' ' };
    static readonly StringSplitOptions op = StringSplitOptions.RemoveEmptyEntries;
    static string[] A = new string[0];
    static int i;
    static void Init() { A = new string[0]; }
    public static void Set(TextReader r) { reader = r; Init(); }
    public static void Set(string file) { reader = new StreamReader(file); Init(); }
    public static bool HasNext() { return CheckNext(); }
    public static string String() { return Next(); }
    public static int Int() { return int.Parse(Next()); }
    public static long Long() { return long.Parse(Next()); }
    public static double Double() { return double.Parse(Next()); }
    public static int[] IntLine() { return Array.ConvertAll(Split(Line()), int.Parse); }
    public static int[] IntArray(int N) { return Range(N, Int); }
    public static int[][] IntTable(int H) { return Range(H, IntLine); }
    public static string[] StringArray(int N) { return Range(N, Next); }
    public static string[][] StringTable(int N) { return Range(N, () => Split(Line())); }
    public static string Line() { return reader.ReadLine().Trim(); }
    public static T[] Range<T>(int N, Func<T> f) { var r = new T[N]; for (int i = 0; i < N; r[i++] = f()) ; return r; }
    static string[] Split(string s) { return s.Split(separator, op); }
    static string Next() { CheckNext(); return A[i++]; }
    static bool CheckNext()
    {
        if (i < A.Length) return true;
        string line = reader.ReadLine();
        if (line == null) return false;
        if (line == "") return CheckNext();
        A = Split(line);
        i = 0;
        return true;
    }
}

Measured memory_bytes: 7128
//In The Name of Allah
#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define Mp make_pair

typedef pair < int , int > pii;

const int N = 2e5 + 10;

int mark[N], cmp[2][N];
vector < int > adj[2][N];
map < pii , int > mp;

void dfs(int v, int t, int c){
    mark[v] = 1;
    cmp[t][v] = c;
    for (int u : adj[t][v])
        if (!mark[u])
            dfs(u, t, c);
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n, m1, m2;
    cin >> n >> m1 >> m2;
    for (int i = 0; i < m1; i ++){
        int u, v;
        cin >> u >> v;
        adj[0][u].pb(v);
        adj[0][v].pb(u);
    }
    for (int i = 0; i < m2; i ++){
        int u, v;
        cin >> u >> v;
        adj[1][u].pb(v);
        adj[1][v].pb(u);
    }
    int c = 0;
    for (int i = 1; i <= n; i ++)
        if (!mark[i])
            dfs(i, 0, c ++);
    fill(mark, mark + N, 0);
    c = 0;
    for (int i = 1; i <= n; i ++)
        if (!mark[i])
            dfs(i, 1, c ++);
    for (int i = 1; i <= n; i ++)
        mp[Mp(cmp[0][i], cmp[1][i])] ++;
    for (int i = 1; i <= n; i ++)
        cout << mp[Mp(cmp[0][i], cmp[1][i])] << ' ';
    return 0;
}


Measured memory_bytes: 31520
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

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

    int cost;
    for (int i = 1; i < N+1; i++) {
        if ((A[i+1]-A[i])*(A[i]-A[i-1]) > 0) cost = sum;
        else {
            cost = sum - abs(A[i]-A[i-1]) - abs(A[i+1]-A[i]) + abs(A[i+1]-A[i-1]);
        }
        cout << cost << endl;
    }
}

Measured memory_bytes: 1664
#include<iostream>
#include<algorithm>
using namespace std;
int dp[100][65536], c[30][16], d[30][16];
int n, m, p[16], q[16];
int _count() { int cnt2 = 0; for (int i = 0; i < 16; i++) { cnt2 += q[i] * (1 << i); }return cnt2; }
int main() {
	while (true) {
		for (int i = 0; i < 100; i++) {
			for (int j = 0; j < 65536; j++) {
				dp[i][j] = -1; c[i % 30][j % 16] = 0; d[i % 30][j % 16] = 0;
			}
		}
		cin >> n >> m; int cnt = 0; if (n == 0 && m == 0) { break; }
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < 16; j++) { cin >> c[i][j]; }
		}
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < 16; j++) { cin >> d[i][j]; }
		}
		for (int i = 0; i < n; i++) { cnt += c[0][i] * (1 << i); }
		dp[0][0] = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < 65536; j++) {
				if (dp[i][j] == -1) { continue; }
				for (int k = 0; k < 16; k++) { p[k] = (j / (1 << k)) % 2; }
				for (int k = 0; k < 16; k++) { if (c[i][k] == 1) { p[k] = 1; } }
				for (int k = 0; k < m; k++) {
					for (int l = 0; l < 16; l++) { q[l] = p[l]; }cnt = 0;
					for (int l = 0; l < 16; l++) {
						if (d[k][l] == 1) {
							if (q[l] == 1) { cnt++; } 
							q[l] = 0;
						}
					}
					dp[i + 1][_count()] = max(dp[i + 1][_count()], dp[i][j] + cnt);
				}
			}
		}
		int minx = 0; for (int i = 0; i < 65536; i++) { minx = max(minx, dp[n][i]); }
		cout << minx << endl;
	}
}

Measured memory_bytes: 26764
#include <cstdio>
#include <climits>
#include <algorithm>
using namespace std;

const int O = 1 << 18;

struct Node {
  int val = INT_MAX, idx, add;

  void nAdd(int v){ val += v; add += v; }

  void prop(Node &a, Node &b){
    a.nAdd(add); b.nAdd(add); add = 0;
  }

  void nMin(Node &a, Node &b){
    if(a.val < b.val){ val = a.val; idx = a.idx; }
    else{ val = b.val; idx = b.idx; }
  }

  void nMin(Node &a){
    if(a.val < val){ val = a.val; idx = a.idx; }
  }
};

int p[200002], q[200002];
Node tr[O << 1];

void init(int L){
  for(int i = 1; i <= L; i++) tr[i + O - 1] = { q[i], i, 0 };

  int a = O - 1, l = a << 1, r = l | 1;

  while(a > 0){
    tr[a].nMin(tr[l], tr[r]);
    a--; l -= 2; r -= 2;
  }
}

void qAdd(int now, int s, int e, int qs, int qe){
  if(e < qs || s > qe) return ;
  if(s >= qs && e <= qe){ tr[now].nAdd(1); return ; }

  int l = now << 1, r = l | 1;
  tr[now].prop(tr[l], tr[r]);

  int m = (s + e) >> 1;
  qAdd(l, s, m, qs, qe); qAdd(r, m + 1, e, qs, qe);

  tr[now].nMin(tr[l], tr[r]);
}

void qMin(int now, int s, int e, Node &res, int qs, int qe){
  if(e < qs || s > qe) return ;
  if(s >= qs && e <= qe){ res.nMin(tr[now]); return ; }

  int l = now << 1, r = l | 1;
  tr[now].prop(tr[l], tr[r]);

  int m = (s + e) >> 1;
  qMin(l, s, m, res, qs, qe); qMin(r, m + 1, e, res, qs, qe);
}

int main(){
  int N; scanf("%d", &N);

  for(int i = 1; i <= N; i++){
    int x; scanf("%d", &x); p[i] = x; q[i] = x;
  }

  sort(q + 1, q + N + 1);

  int L = unique(q + 1, q + N + 1) - q - 1;

  init(L);

  long long ans = 0;

  for(int i = 1; i <= N; i++){
    int t = lower_bound(q + 1, q + L + 1, p[i]) - q;

    Node r; qMin(1, 1, O, r, t, L);
    ans += r.val - p[i];

    qAdd(1, 1, O, 1, r.idx - 1);
  }

  printf("%lld\n", ans);
  return 0;
}

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

int main() {
  int N;
  int64_t li = 3;
  int64_t li_1 = 1;
  int64_t li_2 = 2;

  cin >> N;
  
  for(int i=3; i<=N; i++){
    li_2 = li_1;
    li_1 = li;
    li = li_1 + li_2;
  }

  if (N==1) cout << 1 << endl;
  else if (N==2) cout << 3 << endl;
  else cout << li << endl;
}

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

using namespace std;

char str[5];

int main(){
	scanf(" %s", str);
	
	if(str[0] == str[1] || str[1] == str[2] || str[2] == str[3]){
		printf("Bad");
	}else{
		printf("Good");
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <assert.h>
#include <limits.h>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using ll = long long;
using P = std::pair<ll, ll>;

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr <<"debug "<< i << std::endl;

//const ll MOD = 998244353;
const ll MOD = 1e9+7;
 
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  //問題文中の添え字が0-indexか1-indexか確認!

  ll n;
  std::cin>>n;

  std::vector<P> a(n);
  std::vector<ll> count(n,0);

  rep(i,0,n){
    ll temp;
    std::cin>>temp;
    a[i]={temp,i};
  }

  a.push_back({0,-1});

  std::sort(all(a),std::greater<P>());

  ll min=MOD;

  rep(i,0,n){
    min=std::min(min,a[i].second);
    count[min]+=(i+1)*(a[i].first-a[i+1].first);
  }

  rep(i,0,n)std::cout<<count[i]<<"\n";

  return 0;
}


Measured memory_bytes: 5632
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl "\n"
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mp make_pair
#define mm(a) memset(a,0,sizeof(a))
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define repn(i,a,b) for(ll i = a; i >= b; i--)
#define pb push_back
#define ff first
#define ss second
#define fto(k,m) for(auto k:m)
#define in_edges(m) repp(i, 1, m){ ll a, b; cin >> a >> b; adj[a].pb(b), adj[b].pb(a);}
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define MOD 1000000007
#define sz(a) ll((a).size())
#define pii 3.1415926535897
#define ld long double
#define print(a,n) rep(i,0,n)cout <<a[i] <<" ";
#define BRAHAMASTRA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
// stoll(s);
int main()
{
   BRAHAMASTRA
   ll t; t=1;
   // cin >>t;
   while(t--)
   {
       ll l,r,d; cin >>l>>r>>d;
       ll cnt = 0;
       rep(i,l,r+1)
       {
          if(i%d==0)cnt++;
       }
       cout<<cnt<<endl;
   }
}


Measured memory_bytes: 3576