akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include <stdio.h>
#include<algorithm>
#include<cstring>
#include <string>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<map>
#include<vector>
#include<bits/stdc++.h>
#include <set>
#define ll   long long
#define IO ios::sync_with_stdio(false);cin.tie();cout.tie(0)
#define inf 0x3f3f3f
#define pi 3.1415926535898
using namespace std;
const int N=1e5+10;
const int mod=1e9+7;
int f[N],r[N][2];
ll ans[N],b[N];
int finds(int x)
{
    if(f[x]==x)
    {
        return x;
    }
    else
    {
        return f[x]=finds(f[x]);
    }
}
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        cin>>r[i][0]>>r[i][1];
    }
    for(int i=1;i<=n;i++)
    {
        f[i]=i;
        b[i]=1;
    }
    ll sum=1ll*n*(n-1)/2;
    for(int i=m-1;i>=0;i--)
	{
		ans[i]=sum;
		int x=r[i][0];
		int y=r[i][1];
		finds(x);
		finds(y);
		if(f[x]==f[y])
		{
			continue;
		}
		sum-=((b[f[x]]+b[f[y]])*(b[f[x]]+b[f[y]]-1)/2-b[f[x]]*(b[f[x]]-1)/2-b[f[y]]*(b[f[y]]-1)/2);
		b[f[y]]+=b[f[x]];
		f[f[x]]=f[y];
	}
	for(int i=0;i<m;i++)
	{
		printf("%lld\n",ans[i]);
	}
    return 0;
}


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

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

	vector<int> a(n);
	for (int i = 0; i < n; ++i) {
		cin >> a.at(i);
	}

	sort(a.begin(), a.end());
	a.erase(unique(a.begin(), a.end()), a.end());

	if (n == a.size()) {
		cout << "YES";
	}
	else {
		cout << "NO";
	}


	return 0;
}

Measured memory_bytes: 1024
#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

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

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back



int main() {
    int n,q;
    cin>>n>>q;
    
    string data[100]={};
    data[0]="kogakubu10gokan";
    
    rep(i,n){
        int a;
        string s;
        cin>>a>>s;
        data[a]=s;
    }
    
    for(int i=q;i>=0;i--){
        if(data[i]!=""){
            cout<<data[i]<<endl;
            break;
        }
    }
    
    return 0;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin >> A.at(i);
  }
  sort(A.begin(),A.end());
	int sum=1;
  for(int i=0;i<N-1;i++){
    if(A.at(i)<A.at(i+1)){
      sum++;
    }
  }
	cout << sum << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

        int n = S.length() - 1;
        long ans = 0;

        for (int i = 0; i < Math.pow(2, n); i++) {

            StringBuilder sb = new StringBuilder(S);
            for(int j = n - 1; j >= 0; j--) {
                if( (1 & i >> j) == 1) {
                    sb.insert(j + 1, "+"); 
                }
            }

            String[] str = sb.toString().split("\\+", 0);
            for(int j = 0; j < str.length; j++) {
                ans += Long.parseLong(str[j]);
            }

        }
        System.out.println(ans);

    }
}

Measured memory_bytes: 22484
# -*- coding: utf-8 -*-
"""
A - Move and Win
https://atcoder.jp/contests/agc020/tasks/agc020_a

"""
import sys


def solve(N, A, B):
    if (A-B)%2:
        return 'Borys'
    return 'Alice'


def main(args):
    N, A, B = map(int, input().split())
    ans = solve(N, A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


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

typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PDD;

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define dbl(k, x) fixed << setprecision(k) << (x)

template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}

#define _upgrade                \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)

// ********************** CODE ********************** //

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

  set<string> S;

  while (n--) {
    string s;
    cin >> s;
    S.insert(s);
  }

  cout << sz(S) << endl;
  return 0;
}

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

int main() {
  int N;

  cin >> N;

  int Y = 0;

  for (int i = 0; i < N; i++) {
    char X;
    cin >> X;

    if (X == 'Y') Y++;
  }

  if (Y > 0) {
    cout << "Four" << endl;
  } else {
    cout << "Three" << endl;
  }
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	H, N := ReadInt(), ReadInt()
	A := make([]int, N)
	B := make([]int, N)
	for i := 0; i < N; i++ {
		A[i], B[i] = ReadInt(), ReadInt()
	}

	dp := make([][]int, N+1)
	for i := 0; i < N+1; i++ {
		dp[i] = make([]int, H)
	}
	for j := 0; j < H; j++ {
		dp[0][j] = 1 << 60
	}
	for i := 0; i < N; i++ {
		for j := H - 1; j >= 0; j-- {
			dp[i+1][j] = dp[i][j]
			if j+A[i] >= H {
				dp[i+1][j] = Min(dp[i+1][j], B[i])
			} else {
				dp[i+1][j] = Min(
					dp[i+1][j],
					dp[i][j+A[i]]+B[i],
					dp[i+1][j+A[i]]+B[i],
				)
			}
		}
	}
	fmt.Println(dp[N][0])
}

func Min(xs ...int) int {
	min := xs[0]
	for _, x := range xs[1:] {
		if min > x {
			min = x
		}
	}
	return min
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 84992
# coding: utf-8
from collections import deque
H, W = map(int, input().split())
INF = -1
maze = []
for i in range(H):
    tmp = list(input())
    maze.append(tmp[:])

def bfs(sx, sy):
    visited = [[INF for _ in range(W)] for _ in range(H)]
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]
    q = deque()
    q.append([sx, sy])
    visited[sx][sy] = 0
    while q:
        p = q.popleft()
        for i in range(4):
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]
            if 0 <= nx < H and 0 <= ny < W:
                if maze[nx][ny] != "#" and visited[nx][ny] == INF:
                    q.append([nx, ny])
                    visited[nx][ny] = visited[p[0]][p[1]] + 1
        dist = -1
        for i in range(H):
            dist = max(dist, max(visited[i]))
    return dist
ans = -1
for i in range(H):
    for j in range(W):
        x, y = i, j
        if maze[x][y] == "#":
            continue
        ans = max(ans, bfs(x, y))
print(ans)

Measured memory_bytes: 50140
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    string s;
    cin>>s;
    ll ans = 0;
    for(int i=0;i<s.size();i++) {
        ans+= (s[i]-'0');
    }
    if(ans % 9 == 0) {
        cout<<"Yes"<<endl;
    } else {
        cout<<"No"<<endl;
    }
}


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

int main() {
  int A, B, D, E;
  cin >> A >> B;
  int C=0;
  C+=max(A,B);
  D=min(A,B);
  E=max(A,B)-1;
  C+=max(D,E);
  cout << C << endl;
}


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

int main() {
  int ar[2];
  cin >> ar[0] >> ar[1];
  int ans = 0;
  for(int i = 0; i < 2; i++){
    if(ar[i] == 1) ans += 300000;
    else if(ar[i] == 2) ans += 200000;
    else if(ar[i] == 3) ans += 100000;
  }
  if(ar[0] == 1 && ar[1] == 1) ans += 400000;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn check(people: &Vec<bool>, testimonials: &Vec<Vec<(usize, bool)>>) -> bool {
	for (i, p) in people.iter().enumerate() {
		if !p { continue };
		//println!("taking seriously {:?} {:?}", i, people);
		for testimonial in &testimonials[i] {
			//println!("testimonial: {:?}", testimonial);
			if people[testimonial.0-1] != testimonial.1 {
				return false
			}
		}
	}
	true
}

fn main() {
	let n: usize = read();
	let mut people = vec![false; n];

	let mut testimonials: Vec<Vec<(usize, bool)>> = Vec::new();
	for (i, p) in people.iter().enumerate() {
		let mut testimonial = Vec::new();
		for _ in 0..read() {
			let target: usize = read();
			let honest: usize = read();
			testimonial.push((target, honest == 1));
		}
		testimonials.push(testimonial);
	}

	let mut honest = 0;
	'outer: loop {
		let possible = check(&people, &testimonials);
		//println!("is possible? {:?} with people like {:?}", possible, people);
		if possible {
			let n_honest = people.iter().filter(|p| **p).count();
			//println!("n_honest: {:?}", n_honest);
			if n_honest > honest {
				honest = n_honest;
			}
		}

		for i in 0..people.len() {
			if people[i] == false {
				people[i] = true;
				break;
			}
			people[i] = false;
			if i == people.len() - 1 {
				break 'outer;
			}
		}
	}
	println!("{}", honest);
}


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

using namespace std;

typedef long long ll;

int main()
{
#ifdef ONPC
    freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
#else
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
#endif
    int n;
    cin >> n;
    vector <int> cnt(26, 1e9);
    for (int i = 0; i < n; i++)
    {
        string s;
        cin >> s;
        vector <int> a(26);
        for (auto c : s)
        {
            a[c - 'a']++;
        }
        for (int i = 0; i < 26; i++)
        {
            cnt[i] = min(cnt[i], a[i]);
        }
    }
    for (int i = 0; i < 26; i++)
    {
        while (cnt[i]--)
        {
            cout << char('a' + i);
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int a, b;
int ans;
int s[5];
int main(){
	cin >> a >> b;
	s[0] = a - b;
	s[1] = a * b;
	s[2] = a + b;
	sort(s, s + 3);
	cout << s[2] << endl;
}

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

using ll = long long;
using pii = pair<int, int>;

template <typename T> constexpr T inf;
template <> constexpr int inf<int> = 1e9;
template <> constexpr ll inf<ll> = 1e18;
template <> constexpr double inf<double> = 1e18;

int main() {
    int N;
    cin >> N;
    vector<int> a(N), xs;
    for(int i = 0; i < N; ++i) {
        cin >> a[i];
        xs.push_back(a[i]);
    }
    sort(begin(xs), end(xs));
    xs.erase(unique(begin(xs), end(xs)), end(xs));
    for(int i = 0; i < N; ++i) {
        a[i] = lower_bound(begin(xs), end(xs), a[i]) - begin(xs);
    }

    const int m = xs.size();
    int incorrect = 0;
    vector<int> cnt1(m), cnt2(m);
    vector<int> ans;
    for(int i = 0; i < N; ++i) {
        if(cnt1[a[i]] + 1 == cnt2[a[i]]) {
            incorrect -= 1;
        } else if(cnt1[a[i]] == cnt2[a[i]]) {
            incorrect += 1;
        }
        cnt1[a[i]] += 1;
        if(cnt2[a[N - i - 1]] + 1 == cnt1[a[N - i - 1]]) {
            incorrect -= 1;
        } else if(cnt1[a[N - i - 1]] == cnt2[a[N - i - 1]]) {
            incorrect += 1;
        }
        cnt2[a[N - i - 1]] += 1;

        if(incorrect == 0) {
            ans.push_back(i + 1);
        }
    }

    for(int i = 0; i < (int)ans.size(); ++i) {
        cout << ans[i] << " \n"[i + 1 == (int)ans.size()];
    }
}


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

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

    int N;
    cin >> N;
    vector<int> a(N), b(N), c(N - 1);
    for (auto &&i : a) {
        cin >> i;
        i--;
    }
    for (auto &&i : b) {
        cin >> i;
    }
    for (auto &&i : c) {
        cin >> i;
    }

    int ans = b[a[0]];
    FOR(i, 1, N) {
        ans += b[a[i]];
        if (b[a[i - 1] + 1] == b[a[i]])
            ans += c[a[i - 1]];
    }
    print(ans);

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll
//#define _GLIBCXX_DEBUG

signed main() {
  int N; cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];
  
  bool t = false;
  
  int st = 0, mo = 1000;
  
  int k = A[0];
  rep(i, N) {
    if(i == 0) continue;
    if(!t) {
      if(k >= A[i]) {
        k = A[i];
      } else {
        st += mo/k;
        mo -= st*k;
        k = A[i];
        t = true;
      }
    } else {
      if(k <= A[i]) {
        k = A[i];
      } else {
        mo += st*k;
        st = 0;
        k = A[i];
        t = false;
      }
    }
  }
  
  if(t) {
    mo += st*k;
  }
  cout << mo << endl;

}

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

const int size = 101;
int P[size];
typedef pair <int, int> PII;
typedef pair <int, PII> EDGE;
typedef vector <EDGE> EDGES;

void init() {
    for ( int i = 0; i < size; i++ ) {
        P[i] = -1;
    }
}

int find( int a ) {
    if ( P[a] == -1 ) return a;
    return P[a] = find( P[a] );
}

void unite( int a, int b ) {
    int fa = find(a), fb = find(b);
    if ( fa != fb ) {
        P[fa] = fb;
    }
}

bool same_set( int a, int b ) {
    return find( a ) == find( b );
}

int main() {
    int n, m;
    while ( cin >> n >> m ) {
        if ( n == 0 && m == 0 ) break;

        bool G[n][n];
        for ( int i = 0; i < n; i++ ) for ( int j = 0; j < n; j++ ) G[i][j] = false;

        EDGES E;
        for ( int i = 0; i < m; i++ ) {
            int a, b, w;
            cin >> a >> b >> w;
            a--;
            b--;
            EDGE e( w, PII( a, b ) );
            E.push_back( e );
            G[a][b] = G[b][a] = true;
        }

        for ( int k = 0; k < n; k++ ) {
            for ( int i = 0; i < n; i++ ) {
	            for ( int j = 0; j < n; j++ ) {
	                if ( !G[i][k] || !G[k][j] ) continue;
	                G[i][j] = true;
	            }
            }
        }

        bool flag = false;
        for ( int i = 0; i < n; i++ ) {
            if ( !G[0][i] ) {
	            flag = true;
            }
        }

        if ( flag ) {
            cout << -1 << endl;
            continue;
        }

        sort( E.rbegin(), E.rend() );

        int slimness = 1<<24;
        for ( int i = 0; i < m; i++ ) {
            EDGE& e = E[i]; // has largest weight
            int a, b, w;
            w = e.first;
            a = e.second.first;
            b = e.second.second;

            init();
            unite( a, b );
            bool flag = true;
            int smallest = 1<<24;
            int cnt = 2;
            for ( int j = 0; j < m; j++ ) {
                if ( i == j || E[i].first < E[j].first ) continue;
                EDGE& e = E[j];
                int a, b, w;
                w = e.first;
                a = e.second.first;
                b = e.second.second;
                if ( !same_set( a, b ) ) {
                    unite( a, b );
                    if ( flag ) smallest = E[j].first;
                    smallest = min( smallest, E[j].first );
                    flag = false;
                    cnt++;
                }
            }
            if ( cnt == 2 && n == 2 ) {
                slimness = 0;
            }
            if ( !flag && cnt >= n ) slimness = min( slimness, E[i].first - smallest );
        }
        cout << slimness << endl;

    }
    return 0;
}

Measured memory_bytes: 1072
/*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<long long> vll;
typedef vector<int> vi;

#define io ios_base::sync_with_stdio(false)
#define pb push_back
#define eb emplace_back
#define mod   998244353
#define PI 2*acos(0.0)
#define dbg(a) cout<<#a<<" ->->->-> "<<a<<"\n"
int dirx[] = {1, -1,0, 0}, diry[] = {0, 0, 1, -1};

ll bigmod(ll x, ll p)
{
    ll res = 1;
    while(p)
    {
        if(p&1)
            res = (res*x)%mod;
        x = (x*x)%mod;
        p >>= 1;
    }
    return res;
}

//=============================================ASIFAZAD==============================================//

int32_t main()
{
    io;
    int n;
    cin>>n;
    vi inp(n);
    for(auto& x: inp) cin>>x;
    ll ans = 1000;
    for(int i = 0; i< n-1; i++)
        if(inp[i + 1] > inp[i])
            ans += (ans/inp[i])*(inp[i+1] - inp[i]);
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3576
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i;
    double x=0;
    cin>>n;
    if (n==1)
        cout<<"1.000000000"<<endl;
    else {
    for (i=1;i<=n;i++)
    {
        if (fmod(i,2)!=0)
            x++;
    }
    cout<<fixed<<setprecision(9)<<(x/n)<<endl;
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		int t = 0;
		int x = 0;
		int y = 0;
		boolean result = true;
		for(int n = 0 ; n < count ; n++) {
			int ti = sc.nextInt();
			int xi = sc.nextInt();
			int yi = sc.nextInt();
			int absX = Math.abs(xi -x);
			int absY = Math.abs(yi -y);
			int rest = (ti - t) - absX - absY;
			if(rest < 0 || rest%2 != 0) {
				result = false;
				break;
			} else {
				t = ti;
				x = xi;
				y = yi;
			}
		}
		if(result) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

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

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

return 0;
}

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


#define BUF_SIZE 10000

int comp(const void* a, const void* b) {
  return *(int*)a - *(int*)b;
}

int main(void) {
  char line[BUF_SIZE];
  FILE *fp = stdin;
  if(!fgets(line, BUF_SIZE, fp)) return 0;
  int num;
  sscanf(line, "%d", &num);
  int *arr = malloc(sizeof(int)*num);
  
  if(!fgets(line, BUF_SIZE, fp)) return 0;
  char *tmpbuf = line;
  int i, j, k;
  for(i = 0; i < num; i++) {
    char* tmp = strtok(tmpbuf, " ");
    arr[i] = strtol(tmp, NULL, 10);
    tmpbuf = NULL;
  }

  qsort(arr, num, sizeof(int), comp);
  int cnt = 0;
  for(i = 0; i < num; i++) {
    for(j = i+1; j < num; j++) {
      int ab = arr[i] + arr[j];
      for(k = j+1; k < num && arr[k] < ab; k++) {
        cnt++;
      }
    }
  }

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

Measured memory_bytes: 256
#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#include <random>
 
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 <<" "<< i << std::endl
 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (int i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}
 
ll pow_mod(ll a, ll b, ll mod=-1) {
  if ((a == 0)||(mod!=-1&&a%mod==0)) {
    return 0;
  }
 
  ll x = 1;
 
  while (b > 0) {
    if (b & 1) {
      x = (mod!=-1)?(x * a) % mod:x*a;
    }
    a = (mod!=-1)?(a * a) % mod:a*a;
    b >>= 1;
  }
  return x;
}
 
// const ll MOD = 998244353;
const ll MOD = 1e9 + 7;



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

  ll n;
  std::cin>>n;

  ll ans=0;

  rep(_,0,n){
    ll a,k;
    std::cin>>a>>k;

    while(a%k!=0&&a>=k){
      ll temp=a/k;
      ll cnt=(a-k*temp)/(temp+1)-(((a-k*temp)%(temp+1)==0)?1:0);
      a-=(cnt+1)*(temp+1);
    }

    ans^=(a/k);
  }

  if(ans==0)std::cout<<"Aoki\n";
  else std::cout<<"Takahashi\n";

  return 0;
}


Measured memory_bytes: 256
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input! {
        n: usize,
        s: Chars,
    }

    solve(n, &s);
}

fn solve(n: usize, s: &[char]) {
    match n % 2 {
        1 => println!("No"),
        _ => {
            for i in 0..n / 2 {
                if !(s[i] == s[i + n / 2]) {
                    println!("No");
                    return;
                }
            }
            println!("Yes");
        }
    }
}


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

int main() {
    int N,K;cin >> N >> K;
    ll H[N] = {};ll sum = 0;
    for (int i = 0;i < N;i++){
        cin >> H[i];
        sum += H[i];
    }
    sort(H,H + N);
    if (K > N) {
        cout << 0 << endl;
        return 0;
    }
    for(int i = 0;i < K;i++){
        sum -= H[N - 1 - i];
    }
    cout << sum << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
 
#define el '\n'
#define MOD 1000000007

int n,m;
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin >> n >> m;
    int lmax=-1;
    int rmin=1000000000;
    while(m--){
        int a,b;
        cin >> a >> b;
        lmax = max(lmax, a);
        rmin = min(rmin, b);
    }
    int res;
    if(rmin < lmax){
        res=0;
    } else {
        res=rmin-lmax+1;
    }
    cout << res << el;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e18;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int mod_pow(int x,int y) {
    int res = 1;
    while(y > 0) {
        if(y%2) {
            res = res*x%mod;
        }
        x = x*x%mod;
        y/=2;
    }
    return res;
}
signed main() {
    int n,a,b;
    cin >> n >> a >> b;
    int ans = mod_pow(2,n)-1;
    int cnt = 1;
    for(int i = n; i >= n-a+1; i--) {
        cnt *= i;
        cnt %= mod;
    }
    for(int i = 1; i <= a; i++) {
        cnt = cnt*mod_pow(i,mod-2)%mod;
    }
    ans = (ans+mod-cnt)%mod;
    cnt = 1;
       for(int i = n; i >= n-b+1; i--) {
           cnt *= i;
           cnt %= mod;
       }
       for(int i = 1; i <= b; i++) {
           cnt = cnt*mod_pow(i,mod-2)%mod;
       }
       ans = (ans+mod-cnt)%mod;
    cout << ans << endl;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;
#define PI acos(-1.0)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(register int i=(a);i<(b);i++)
#define per(i,a,b) for(register int i=(b);i>=(a);i--)
#define For(i,a,b) for(register int i=(a);i<=(b);i++)
#define Forenska(it,c) for(register __typeof(c.begin()) it=c.begin();it!=c.end();it++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
#define lowbit(x) ((x)&(-x))
using namespace std;
typedef long long LL;
typedef pair<int,int> Pair;
typedef vector<int> vec;
const long double PI=3.14159265358979323846264338327950288;
const LL INF=0x3f3f3f3f3f3f3f3f;
int main()
{
    int x;
    cin>>x;
    if(x==1)
    {
    	puts("Hello World");
	}
	else
	{
		int a,b;
		cin>>a>>b;
		cout<<a+b<<endl;
	}
	return 0;
}


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

int main() {
    int A[10000], i, a, b, t;
    string op;
    for (i = 0; i < 10000; i++) {
        cin >> a >> op >> b;
        if (op == "+") {
            t = a + b;
            A[i] = t;
        } else if (op == "-")  {
            t = a - b;
            A[i] = t;
        } else if (op == "*")  {
            t = a * b;
            A[i] = t;
        } else if (op == "/")  {
            t = a / b;
            A[i] = t;
        } else {
            break;
        }
    }
    for (int j = 0; j < i; j++) cout << A[j] << endl;
    return 0;
}

Measured memory_bytes: 1212
#include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define PER(i,n) for(int i=n-1;i>=0;--i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define MOD ((LL)1e9+7) 
#define INF ((LL)1e9+7)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(),(x).end()
#define BIT(x) (1LL << (x))
using namespace std;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

LL modpow(LL x, LL b){
	LL res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

LL modinv(LL x){
	return modpow(x, MOD-2);
}

int main(){
	map<char, int> m;
	int h, w;
	cin >> h >> w;
	int even = 0;
	int odd = 0;
	if(h&w&1)odd = 1;
	if(h&1){
		even += w / 2;
	}
	if(w&1){
		even += h / 2;
	}
	REP(i, h*w){
		char d;
		cin >> d;
		++m[d];
	}
	foreach(i, m){
		int d = i.second;
		if(d&1){
			if(odd--<=0){
				cout << "No" << endl;
				return 0;
			}

		}
		if(d&2){
			if(even--<=0){
				cout << "No" << endl;
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}


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

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

    int cnt = 0;
    int div = (int)pow(100, d);
    
    int num;
    for (num = 1; cnt < n; num++) {
        if (num % div == 0 && num % (div * 100) != 0) cnt++;
    }
    cout << num - 1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ll ans=0;

int main(){
	ll n,i;
	cin>>n;
	for(i=1;i<=n;++i){
		if(i%3!=0&&i%5!=0)
			ans+=i;
	}
	cout<<ans;
	
	
	return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

typedef unsigned long long UL;
typedef long long LL;
typedef long double LD;
#define LP(i, a, b) for (LL i = int(a); i < int(b); i++)
#define LPE(i, a, b) for (LL i = int(a); i <= int(b); i++)
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef vector<vector<PII> > WAL;
typedef vector<vector<int> > SAL;
#define Ep 1e-8
#define INF 1e9
#define LINF 1e18

LL const MaxSize = 100 + 5;
LL const MOD = 1e9 + 7;
LL const BASE = 256;

/*
 Idea 1: branch and bound

 Idea 2: find the highest number with a[x] = x, and remove
 */

vector<int> ans;
int n, used[MaxSize], b[MaxSize];

int main() {
	ios_base::sync_with_stdio(false);
	//freopen("/Users/georgeli/A_1.in", "r", stdin);
	memset(used, 0, sizeof(used));

	cin >> n;
	LPE(i, 1,n)
		cin >> b[i];

	LP(cnt, 0, n)
	{
		int ei = n - cnt;
		for (int j = n; j >= 1; j--) {

			if (used[j]) {

			} else {
				if (b[j] == ei) {
					ans.push_back(b[j]);
					used[j] = 1;
					//cout << cnt << " " << ei << " " << b[j] << endl;
					break;
				} else {
					ei--;
				}
			}
		}
	}

	if (ans.size() < n) {
		cout << -1;
	} else {
		for (int i = n - 1; i >= 0; i--) {
			cout << ans[i] << endl;
		}
	}

	return 0;
}


Measured memory_bytes: 256
use std::collections::VecDeque;

const INF: i64 = 1e9 as i64;

fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    let n: usize = sc.read();
    let m: usize = sc.read();
    let d: Vec<i64> = sc.vec(n);
    let mut graph = vec![vec![]; n];
    for i in 0..m {
        let a = sc.read::<usize>() - 1;
        let b = sc.read::<usize>() - 1;
        graph[a].push((b, i));
        graph[b].push((a, i));
    }

    let mut tree = vec![vec![]; n];
    let mut edges = vec![INF; m];
    for i in 0..n {
        let mut candidates = graph[i]
            .iter()
            .map(|&(next, edge_id)| (d[next], next, edge_id))
            .collect::<Vec<_>>();
        candidates.sort();
        let (_, next, edge_id) = candidates[0];
        if d[next] > d[i] {
            println!("-1");
            return;
        }

        tree[i].push(next);
        tree[next].push(i);
        edges[edge_id] = d[i];
    }

    let mut color = vec![0; n];
    for i in 0..n {
        if color[i] != 0 {
            continue;
        }
        let mut q = VecDeque::new();
        q.push_back(i);
        color[i] = 1;
        while let Some(v) = q.pop_front() {
            for &next in tree[v].iter() {
                if color[next] == 0 {
                    color[next] = if color[v] == 1 { 2 } else { 1 };
                    q.push_back(next);
                } else {
                    assert_ne!(color[next], color[v]);
                }
            }
        }
    }

    for i in 0..n {
        if color[i] == 1 {
            sc.write("W");
        } else {
            sc.write("B");
        }
    }
    sc.write("\n");
    for edge in edges.into_iter() {
        sc.write(edge);
        sc.write("\n");
    }
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> Self {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 30972
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<pair<int, int>> lr(n);
  rep(i, n){
    int a, b;
    cin >> a >> b;
    int l = a - b, r = a + b;
    lr.at(i) = {l, r};
  }

  sort(ALL(lr), [](const auto &l, const auto &r){
    return l.second < r.second;
  });

  int ans = 0;
  int r = -2e9;
  for(auto p : lr){
    if(r <= p.first){
      r = p.second;
    }else{
      ans++;
    }
  }
  ans = n - ans;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3968
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

int main()
{
	int n, m;
	cin >> n >> m;
	vector<pii> v;
	REP(i, n)
	{
		int a, b;
		cin >> a >> b;
		v.emplace_back(a, b);
	}
	vi p(m);
	REP(i, m) cin >> p[i];
	sort(ALL(p));
	vi os, es;
	es.push_back(0), es.push_back(p[0]);
	os.push_back(0);
	if(m > 1) os.push_back(p[1] - p[0]);
	else os.push_back(0);
	FOR(i, 2, m)
	{
		if (i % 2) os.push_back(os.back() + p[i] - p[i - 1]);
		else es.push_back(es.back() + p[i] - p[i - 1]);
	}
	ll ans = 0;
	REP(i, n) 
	{
		int a = v[i].first, b = v[i].second;
		ll tmp = 0;
		if (a < b)
		{
			int l = upper_bound(ALL(p), a) - p.begin();
			int r = lower_bound(ALL(p), b) - p.begin() - 1;			
			if (l > r)
			{
				tmp += b - a;
			}
			else if (l % 2)
			{
				if (r % 2)
				{
					tmp += os[r / 2 + 1] - os[l / 2 + 1];
					tmp += p[l] - a;
				}
				else
				{
					tmp += os[(r-1) / 2 + 1] - os[l / 2 + 1];
					tmp += p[l] - a;
					tmp += b - p[r];
				}
			}
			else
			{
				if (r % 2)
				{
					tmp = es[r / 2 + 1] - es[l / 2 + 1];
					tmp += p[l] - a;
					tmp += b - p[r];
				}
				else
				{
					tmp += es[r / 2 + 1] - es[l / 2 + 1];
					tmp += p[l] - a;
				}
			}
		}
		else
		{
			int l = upper_bound(ALL(p), b) - p.begin();
			int r = lower_bound(ALL(p), a) - p.begin() - 1;
			if (l > r)
			{
				tmp += a - b;
			}
			else if (r % 2)
			{
				if (l % 2)
				{
					tmp += es[r / 2 + 1] - es[l / 2 + 1];
					tmp += a - p[r];
				}
				else
				{
					tmp += es[(r - 1) / 2 + 1] - es[l / 2 + 1];
					tmp += p[l] - b;
					tmp += a - p[r];
				}
			}
			else
			{
				if (l % 2)
				{
					tmp = os[(r-1) / 2 + 1] - os[l / 2 + 1];
					tmp += p[l] - b;
					tmp += a - p[r];
				}
				else
				{
					tmp += os[r / 2] - os[l / 2];
					tmp += a - p[r];
				}
			}
		}
		//cout << tmp << endl;
		ans += tmp;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 5748
#include<iostream>
#include<fstream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#include<random>
#include<functional>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    string s;
    ll n;
    cin>>n;
    cin>>s;
    rep(i,s.size()){
        s[i]=(char)('A'+(s[i]-'A'+n)%26);
    }
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 256
result = 0
def BT(k, current, s):
    global result
    if k == len(a) :
        if current == 0 :
            result += s
    else :
        BT(k+1, int(a[k]), s+current)
        BT(k+1, current* 10 + int(a[k]), s)

a = input()+'0'
BT(1,int(a[0]),0)
print(result)

Measured memory_bytes: 3064
n=int(input())
t=[int(_) for _ in input().split()]
m=int(input())
p=[[int(_) for _ in input().split()] for i in range(m)]
for i in range (m):
    time=sum(int(_) for _ in t)-int(t[int(p[i][0])-1])+int(p[i][1])
    print(time)

Measured memory_bytes: 3060
import sys
N = int(input())
int_array = list(map(int,input().split()))

if N < 0 or N > 100:
    sys.exit()
if not len(int_array) == N:
    sys.exit()
if max(int_array) > 1000 or min(int_array) < 0:
    sys.exit()

print(max(int_array) - min(int_array))

Measured memory_bytes: 9168
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fill fill_n
#define pf push_front
#define pb push_back
#define FOR(i,l,r) for(int i=l;i<r;i++)
#define ROF(i,r,l) for(int i=r;i>=l;i--)
#define comp(v) (v).begin(),(v).end()
#define ff first
#define ss second
#define infile freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
typedef vector<int> vi;
typedef vector<ll> vli;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvli;
const int M = 1e9+7;
const int N = 2e5;
ll po(int,int);


void solve(){
    int n;cin>>n;
    map<string,int> m;
    FOR(i,0,n){
        string x;
        cin>>x;
        m[x]++;
    }
    cout<<"AC x "<<m["AC"]<<"\n";
    cout<<"WA x "<<m["WA"]<<"\n";
    cout<<"TLE x "<<m["TLE"]<<"\n";
    cout<<"RE x "<<m["RE"]<<"\n";
    
}





int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
    
	return 0;
	
	
}


ll po(int a,int b){
    if(b==0) return 1;
    ll ans=1;
    if(b%2==0){
        ans = po(a,b/2)%M;
        ans=(ans%M * ans%M)%M;
    }
    else{
        ans = po(a,(b-1)/2)%M;
        ans = (ans%M * ans%M * a)%M;
    }
    return ans%M;
}


Measured memory_bytes: 3684
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define maxn 200001
const ll inf=1e9+7;
#define pb push_back
#define PI 3.14159265
#define watch(x) cerr << (#x) << " is " << (x) << endl;
void solve();
void sieve();
int main()
{
	//sieve();
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout<<fixed;
	cout<<setprecision(10);
	
	int t=1;
	//cin>>t;
	while(t--)
	solve();
	return 0;
}
ll pr[1001];
vector<ll> prime;
void sieve()
{
	pr[0]=-1;
	pr[1]=-1;
	ll i,j;
	for(i=2;i<1001;i++)
	{
		if(pr[i]!=-1)
		{
			pr[i]=1;
			for(j=2;j<1001/i+1;j++)
			{
				if(i*j<1001)
				pr[i*j]=-1;
			}
		}
	}
	for(i=2;i<1001;i++)
	{
		if(pr[i]==1)
		prime.pb(i);
	}
}
		
bool pal(string s)
{
	string t=s;
	reverse(s.begin(),s.end());
	return (t==s);
}
ll countdig(ll x)
{
	ll c=0;
	if(x==0)
	return 1;
	
	while(x!=0)
	{
		c++;
		x/=10;
	}
	return c;
}
bool isprime(ll x)
{
	bool flag=true;
	for(ll i=2;i<=sqrt(x)+1;i++)
	{
		if(x%i==0)
		{
			flag=false;
			break;
		}
	}
	if(x==1)
	flag=false;
	
	return flag;
}
void swap(ll& a,ll& b)
{
	ll t=a;
	a=b;
	b=t;
}
void solve()
{
	ll n,i,b,c;
	cin>>n;
	ll arr[n];
	ll s=0;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		s+=arr[i];
	}
	map<ll,ll> m;
	for(i=0;i<n;i++)
	m[arr[i]]++;
	
	ll q;
	cin>>q;
	for(i=0;i<q;i++)
	{
		cin>>b>>c;
		s=s+c*m[b]-b*m[b];
		m[c]+=m[b];
		m[b]=0;
		cout<<s<<endl;
		
	}
} 
	
	
	
	
	
	
	
	
	
	
	
	
	


Measured memory_bytes: 10312
import java.util.*;

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

    int X = s.nextInt();
    int A = s.nextInt();
    if(X < A){
      System.out.println(0);
    }
    else{
      System.out.println(10);
    }
  }
}


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

#define INF 10000000

int W,N;
int v[1001],w[1001];

// dp[i][j] : i番目以降のものから重さｊ以下になるように選んだ時の最大値
int dp[1002][1002];

int rec(int i, int j){
  if(dp[i][j] >= 0){
    return dp[i][j];
  }
  int res;
  if(i == N){
    res = 0;
  }else if( j < w[i] ){
    res = rec(i + 1 , j);
  }else{
    res = max( rec(i + 1,j) , rec(i+1, j-w[i]) + v[i] );
  }
  return dp[i][j] = res;
}

int main(){
  int x = 1;
  while(1){
   
    cin >> W;
    if(W == 0) break;

    cin >> N;
    memset(dp,-1,sizeof(dp));
    for(int i = 0; i < 1001; i++){
      w[i] = INF;
      v[i] = -1;
    }
 
    for(int i = 0 ; i < N ; i++){
      char tmp;
      cin >> v[i] >> tmp >> w[i];
      //  cout << v[i] <<" "<< w[i] << endl; 
    }
    
    for(int i = 0; i < N ; i++){
      for(int j = 0; j <= W ; j++){
	rec(i,j);
      }
    }
    
    cout <<"Case " << x << ":" << endl;
    cout <<  dp[0][W] << endl;
    int t;
    for( t = 0; dp[0][W] != dp[0][t] ;t++){}
    cout << t << endl; 
    x++;
  }
  return 0;

}

Measured memory_bytes: 5140
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define endl '\n'

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

	int h, w;
	cin >> h >> w;
	char a[h+1][w+1];
	for(int i=1; i<=h; i++)
		for(int j=1; j<=w; j++)
			cin >> a[i][j];
	long long dp[h+1][w+1];
	for(int i=0; i<=h; i++)
		for(int j=0; j<=w; j++)
		{
			if( i == 1 && j == 1 )
				dp[i][j] = 1;
			else if( !i || !j || a[i][j] == '#' )
				dp[i][j] = 0;
			else
				dp[i][j] = ( dp[i-1][j] + dp[i][j-1] ) % MOD;
		}
	cout << dp[h][w] << endl;
	return 0;
}

Measured memory_bytes: 9088
#include <iostream>
#include <vector> 
#include <cmath>
#include <algorithm>
#include <set>
#include <string>
#include <map>
#include <cerrno>
#include <stdio.h>
#include <stdlib.h>
#include <cfenv>
#include <stack>
#include <math.h>
#include <iomanip>
#include <limits>
#include <queue>
#define ll long long int
#define pb push_back
#define mp make_pair

using namespace std;

int main(){

    int n;
    cin >> n;

    vector<int> h(n);

    for(int i=0;i<n;i++){
        cin >> h[i];
    }

    ll ans = h[0];

    for(int i=1;i<n;i++){
        if(h[i-1]<h[i]){
            ans += h[i] - h[i-1];
        }
    }

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

Measured memory_bytes: 256
import math
x1, y1, x2, y2 = input().split()
x1 = float(x1)
y1 = float(y1)
x2 = float(x2)
y2 = float(y2)
dist = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
print(dist)


Measured memory_bytes: 5652
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>
#include <cmath>
#include <utility>
#include <string>
#include <cstring>
#include <functional>

using namespace std;

int n, d;

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	cin >> n >> d;
	d = d * 2 + 1;
	cout << (n + d - 1) / d << endl;

	return 0;
}

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

int main() {
  map<pair<int, int>, int> mp;
  int N; cin >> N;
  REP(i, 1, N + 1) {
    auto s = std::to_string(i);
    mp[make_pair(s[0] - '0', s.back() - '0')]++;
  }
  ll ans = 0;
  REP(i, 1, 10) {
    REP(j, 1, 10) {
      ans += mp[make_pair(i, j)] * mp[make_pair(j, i)];
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include<cstdint>
#include<unordered_map>
#include<boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < ( int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define F first
#define S second

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

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

	if ((n - 1) % (k - 1) == 0) {
		printf("%d\n", (n - 1) / (k - 1));
	}
	else {
		printf("%d\n", (n - 1) / (k - 1)+1);
	}

}

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


void solve(){
  string s, t; cin >> s >> t;
  reverse(t.begin(), t.end());
  if(s == t) cout << "YES\n";
  else cout << "NO\n";
  return;
}

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


Measured memory_bytes: 256