akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using lint = long long;
using P = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
#define repn(i, a, b) for(int i = (a); i < (b); ++i)
#define rep_inv(i, n) for (int i = (n); i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define cend printf("\n")

//constexpr lint mod = 998'244'353LL;
constexpr lint Mod = 1000'000'007LL;
constexpr lint Inf = 4'500'000'000'000'000'007LL; //4.5e18+7
constexpr double Pi = 3.141592653589793;

template<class T> using prique     = priority_queue<T>;
template<class T> using prique_inv = priority_queue<T, vector<T>, greater<T>>;
template<class T> bool chmin(T& a, const T& b) {
	if (a > b) {
		a = b; return true;
	}
	return false;
}
template<class T> bool chmax(T& a, const T& b) {
	if (a < b) {
		a = b; return true;
	}
	return false;
}
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& rhs) { return is >> rhs.first >> rhs.second; }
template<class T, class U>inline ostream& operator<<(ostream& os, const pair<T, U>& rhs) { return os << "(" << rhs.first << ", " << rhs.second << ")"; }
template<class InputIterator> void arrin(InputIterator first, InputIterator last) { for (; first != last; ++first) cin >> (*first); }
template<class InputIterator> void arrout(InputIterator first, InputIterator last) {
	for (; first != last; ++first) {
		cout << (*first) << ((first + 1) != last ? " " : "\n");
	}
}

template<class T, class U> void print(const T& a, const U& b, bool f) {
	if (f) cout << a << "\n";
	else cout << b << "\n";
}

bool pri(lint x) { 
	for (lint i = 2; i * i <= x; ++i) {
		if (x % i == 0) return false;
	}
	return 1 < x; 
}

lint fact[3000000];
void fact_init(lint n, lint m = Mod) {
	if (3000000 <= n) return;
	fact[0] = fact[1] = 1;
	for (lint i = 2; i <= n; ++i) {
		fact[i] = i * fact[i - 1] % m;
	}
}

lint modpow(lint x, lint n, lint m = Mod) {
	lint res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % m;
		x = x * x % m;
		n >>= 1;
	}
	return res;
}

lint intpow(lint x, lint n) {
	lint res = 1;
	while (n > 0) {
		if (n & 1) res *= x;
		x *= x;
		n >>= 1;
	}
	return res;
}

lint comb(lint n, lint r, lint m = Mod) {
	if (r == 0 || r == n) return 1;
	lint res = fact[n] * modpow(fact[n - r], m - 2, m) % m * modpow(fact[r], m - 2, m) % m;
	return res < 0 ? res + m : res;
}

map<lint, lint> factring(lint n) {
	map<lint, lint> res;
	for (lint i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			n /= i;
			++res[i];
		}
	}
	if (n != 1) ++res[n];
	return res;
}

int main() {
	int d, t, s;
	cin >> d >> t >> s;
	print("Yes", "No", d <= t * s);
}

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

int main() {
  int M, a, b, c, d, e, f ;
  cin >> M ;
  a = M / 100;
  b = (M+90) / 100;
  c = b - a;
  d = (M+9) / 10;
  e = M / 10;
  f = d - e;
  cout << a + c + f << endl;
}

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

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}

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

  vector<int> L(N+1);
  L[0] = 0;
  vector<int> R(N+1);
  R[N] = 0;
  for (int i=0; i<N; i++) L[i+1] = gcd(L[i], A[i]);
  for (int i=N-1; i>=0; i--) R[i] = gcd(R[i+1], A[i]);

  int m = 0;
  for (int i=0; i<N; i++) {
    int l = L[i];
    int r = R[i+1];

    m = max(m, gcd(l, r));
  }

  cout << m << endl;

  return 0;
}


Measured memory_bytes: 1408
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            int u = sc.nextInt() - 1;
            int v = sc.nextInt() - 1;

            List<Integer>[] edges = new List[N];
            for (int i = 0; i < N; i++) {
                edges[i] = new ArrayList<>();
            }

            for (int i = 0; i < N - 1; i++) {
                int a = sc.nextInt() - 1;
                int b = sc.nextInt() - 1;
                edges[a].add(b);
                edges[b].add(a);
            }

            int[] d = new int[N];
            for (int i = 0; i < N; i++) {
                d[i] = Integer.MAX_VALUE;
            }
            d[u] = 0;
            dfs(u, d, edges);

            int[] e = new int[N];
            for (int i = 0; i < N; i++) {
                e[i] = Integer.MAX_VALUE;
            }
            e[v] = 0;
            dfs(v, e, edges);

            int q = -1;
            for (int i = 0; i < N; i++) {
                if (d[i] < e[i]) {
                    if (e[i] > q) {
                        q = e[i];
                    }
                }
            }

            if (q <= 0) {
                System.out.println(0);
            } else {
                System.out.println(q - 1);
            }
        }
    }

    static void dfs(int u, int[] d, List<Integer>[] edges) {
        for (Integer nu : edges[u]) {
            if (d[nu] == Integer.MAX_VALUE) {
                d[nu] = d[u] + 1;
                dfs(nu, d, edges);
            }
        }
    }

}


Measured memory_bytes: 109472
#include <iostream>
#include <unordered_map>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    long long N;
    cin >> N;
    unordered_map<string, long long > mp;
    long long cnt = 0;
    long long  ans = 0;
    long long  index = 0;
    vector<long long > vec(N, 0);
    while(cnt < N){
        string s;
        cin >> s;
        vector<char> ch(10);
        for (long long  i = 0; i < 10;i++)
            ch[i] = s[i];
        sort(ch.begin(), ch.end());
        for (long long  i = 0; i < 10;i++)
            s[i] = ch[i];
        auto itr = mp.find(s);
        if(itr != mp.end()){
            vec[mp.at(s)]++;
            ans += vec[mp.at(s)];
        }else{
            mp[s] = index;
            index++;
        }
        cnt++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 11428
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <math.h>
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const int INF=1e9;
const ll MX = 1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
 
int main() {
  vi x(5);
  rep(i,5) cin>>x[i];
  rep(i,5){
    if(x[i]==0){
      cout<<i+1<<endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3576
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;

struct xy{
    double x,y;
};

void f(int n,xy p1,xy p2){
    if(n==0)return ;
    xy s,t,u;
    s.x=(2*p1.x+p2.x)/3;
    s.y=(2*p1.y+p2.y)/3;
    t.x=(p1.x+2*p2.x)/3;
    t.y=(p1.y+2*p2.y)/3;
    u.x=(t.x-s.x)/2-(t.y-s.y)*(sqrt(3.0)/2)+s.x;
    u.y=(t.x-s.x)*(sqrt(3.0)/2)+(t.y-s.y)/2+s.y;
    
    f(n-1,p1,s);
    printf("%f %f\n",s.x,s.y);
    f(n-1,s,u);
    printf("%f %f\n",u.x,u.y);
    f(n-1,u,t);
    printf("%f %f\n",t.x,t.y);
    f(n-1,t,p2);
    
}

int main(){
    int n;
    cin>>n;
    xy p1,p2;
    p1.x=0,p1.y=0;
    p2.x=100,p2.y=0;
    printf("%f %f\n",p1.x,p1.y);
    f(n,p1,p2);
    printf("%f %f\n",p2.x,p2.y);
    return 0;
    
}


Measured memory_bytes: 3228
N,X = map(int,input().split())

s = [1]
p = [1]
for i in range(N):
    s.append(s[-1]*2 + 3)
    p.append(p[-1]*2 + 1)

ans = 0
for i in reversed(range(N)):
    if i > 0:
        if X == s[i]+2:
            ans += p[i]+1
            break
        elif X < s[i]+2:
            X -= 1
        else:
            X -= (s[i]+2)
            ans += p[i]+1
    else:
        ans += max(0,min(3, X-1))
print(ans)

Measured memory_bytes: 3064
<?php
        $num = fgets(STDIN);
        $in = fgets(STDIN);
        $in_array = explode(" ", trim($in));
        $array = array();
        for($i = 0; $i < $num; $i++){
            $array[] = $in_array[$i];
        }
        
        $count = 0;
        $odd = false;
        
        while(true){
            for($i = 0; $i < $num; $i++){
                if($array[$i] % 2 != 0){
                    $odd = true;
                }
            }
            
            if($odd){
                break;
            }
            
            for($i = 0; $i < $num; $i++){
                $array[$i] /= 2;
            }
            
            $count++;
        }
        echo $count;

?>


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

#define rep(i, N) for (ll i = 0; i < N; i++)
#define rep1(i, N) for (ll i = 1; i <= N; i++)
#define MOD (int)1e9+7;

using ll = long long;
using namespace std;

int main() {
    int N;
    string S;
    cin >> N;
    map<char, ll> mp;
    string ch = "MARCH";
    rep(i, N) {
        cin >> S;
        mp[S[0]]++; 
    }

    ll ans = 0;
    for(int i = 0; i < 5; i++) {
        for(int j = i+1; j < 5; j++) {
            for(int k = j+1; k < 5; k++) {
                ans += mp[ch[i]]*mp[ch[j]]*mp[ch[k]];
            }
        }
    }

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


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

int main(){
  int N, L;
  cin >> N >> L;

  vector<string> S(N);
  for(auto& x: S){
    cin >> x;
  }
  sort(S.begin(), S.end());

  for(auto& x: S){
    cout << x;
  }
  cout << endl;
}


Measured memory_bytes: 888
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m, L;
    cin >> n >> m >> L;

    const ll inf = 1LL << 60;
    auto Dist = make_v(n, n, 1LL << 60);
    REP(i, 0, n) {
        Dist[i][i] = 0;
    }
    REP(i, 0, m) {
        ll a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        chmin(Dist[a][b], c);
        chmin(Dist[b][a], c);
    }

    REP(k, 0, n) {
        REP(i, 0, n) {
            REP(j, 0, n) {
                chmin(Dist[i][j], Dist[i][k] + Dist[k][j]);
            }
        }
    }

    auto Cost = make_v(n, n, inf);
    REP(i, 0, n) {
        REP(j, 0, n) {
            Cost[i][j] = (Dist[i][j] <= L ? 1 : inf);
        }
        Cost[i][i] = 0;
    }
    REP(k, 0, n) {
        REP(i, 0, n) {
            REP(j, 0, n) {
                chmin(Cost[i][j], Cost[i][k] + Cost[k][j]);
            }
        }
    }
    int q;
    cin >> q;
    REP(i, 0, q) {
        int s, t;
        cin >> s >> t;
        s--;
        t--;
        cout << (Cost[s][t] == inf ? -1 : Cost[s][t] - 1) << endl;
    }
    return 0;
}


Measured memory_bytes: 1920
class Card
  def initialize
    @cards = []
    %w(S H C D).each do |mark|
      (1..13).each do |rank|
        @cards << "#{mark} #{rank}"
      end
    end
  end

  def delete(mark=nil, rank=nil)
    @cards.delete("#{mark} #{rank}")
  end

  def open
    puts @cards
  end
end

cards = Card.new
ARGF.each do |line|
  mark, rank = line.chomp.split
  cards.delete(mark, rank)
end

cards.open

Measured memory_bytes: 6100
#include<bits/stdc++.h>
#define fasterthanlight ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define test int T; cin>>T; while(T--)
#define endl "\n"
#define int long long
#define vi vector<int>
#define pb push_back
#define mod 1000000007
#define MAX 1e9
#define MIN -1e9
#define hi "visited\n" //sasta debugging
using namespace std;

//author::@whohet-->Het Patel

signed main()
{
  fasterthanlight;
  int x, n; cin >> x >> n;
  int arr[250 + 5] = {};
  for (int i = 0; i < n; i++)
  {
    int a;
    cin >> a;
    arr[a] = 1;
  }
  int ans = 0; int m = MAX;
  for (int i = -100; i <= 250; i++)
  {
    if (i > 0 && arr[i] != 1)
      if (m > abs(x - i))
      {
        m = min(m, abs(x - i));
        ans = i;
      }
    if (i <= 0)
    {
      if (m > abs(x - i))
      {
        m = min(m, abs(x - i));
        ans = i;
      }
    }
  }
  cout << ans;
  //cout << "\n\n"<<"Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " seconds.\n";
  return 0;
}


Measured memory_bytes: 3652
#include <stdio.h>

int main(void){
        int a, b, c, cnt=0, i;

        scanf("%d %d %d", &a, &b, &c);

        for( i=a ; i<=b ; i++ ){

                if( c%i )
                        continue;

                else
                        cnt++;

        }

        printf("%d\n", cnt);

        return 0;
}

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

const ll MOD = 1000000007;

int main(){
    string s;
    cin >> s;
    string s1;
    cin >> s1;
    int n = s1.size();
    s1.erase(n-1);
    if(s == s1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Arrays;


/**
 *
 * @author
 *
 *
 *
 */

public class Main {

//	public find() {
//	}

    public static void main(String[] args) throws IOException {
        MyScanner scanner = new MyScanner();
        PrintStream out = System.out;

        int data[] = scanner.nextIntArray();

        Arrays.sort(data);

        int a = data[0];
        int b = data[1];
        int c = 0;

        boolean isOdd = false;
        for (c = a; c <= b; c++) {
            if (a * b * c % 2 == 1) {
                isOdd = true;
                break;
            }
        }

        if (isOdd) {
            out.println("Yes");
        } else {
            out.println("No");
        }

        scanner.reader.close();
        out.close();
    }

    // -----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader reader;

        public MyScanner() {
            this.reader = new BufferedReader(new InputStreamReader(System.in));
        }

        public void close() throws IOException {
            this.reader.close();
        }

        int nextInt() {
            return Integer.parseInt(this.next());
        }

        long nextLong() {
            return Long.parseLong(this.next());
        }

        double nextDouble() {
            return Double.parseDouble(this.next());
        }

        String next() {
            String str = "";
            try {
                str = this.reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        String[] nextStringArray() {
            String[] str = null;
            try {
                str = this.reader.readLine().trim().split(" ");
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] nextIntArray() {
            String[] data  = nextStringArray();
            int[] a  = new int[data.length];

            for (int i = 0; i < a.length; i++) {
                a[i] = Integer.parseInt(data[i]);
            }

            return a;
        }

        Integer[] nextIntegerArray() {
            String[] data  = nextStringArray();
            Integer[] a  = new Integer[data.length];

            for (int i = 0; i < a.length; i++) {
                a[i] = Integer.parseInt(data[i]);
            }

            return a;
        }

        long[] nextLongArray() {
            String[] data  = nextStringArray();
            long[] a  = new long[data.length];

            for (int i = 0; i < a.length; i++) {
                a[i] = Long.parseLong(data[i]);
            }

            return a;
        }
    }
}



Measured memory_bytes: 20948
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for(ll i = m; i < (n); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>; 
using vl = vector<ll>;
using vll = vector<vl>;
using pll = pair<ll, ll>;

vl sieve(ll n){
    vl res(n+1);
    iota(all(res), 0);
    for(ll i = 2; i*i <= n; i++){
        if(res[i] < i) continue;
        for(ll j = i*i; j <= n; j += i){
            if(res[j] == j) res[j] = i;
        }
    }
    return res;
}

vector<pll> prime_factorize(ll n, const vl& min_factor){
    vector<pll> res;
    while(n > 1){
        ll prime = min_factor[n];
        ll num = 0;
        while(min_factor[n] == prime){
            num++;
            n /= prime;
        }
        res.push_back(make_pair(prime, num));
    }
    return res;
}

int main() {
    ll N;
    cin >> N;
    ll ans = 0;
    auto min_factor = sieve(N);
    rep(i, N){
        if(i == 0) continue;
        if(i == 1){
            ans++;
            continue;
        }
        auto pf = prime_factorize(i, min_factor);
        ll tmp = 1;
        for(auto x : pf){
            tmp *= x.second + 1;
        }
        ans += tmp;
    }
    cout << ans;
}

Measured memory_bytes: 11052
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
//deque/functional/iterator/list/map/memory/numeric/queue/set/stack/utility/vector
//#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
    int a;
    string s;
    cin>>a;
    cin>>s;
    if(a>=3200){
		cout<<s<<endl;
    }else{
		cout<<"red"<<endl;
    }


return 0;
}


Measured memory_bytes: 256
/*
CODED BY               
**************
DARSHAN JAIN
darshanjain31
**************
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define endl '\n'
int main()
{
	fast;
	ll a,b;
	cin>>a>>b;
	ll mn=a*2;
	ll mx=a*4;
	if(b%2==0)
	{
		if(mn<=b&&b<=mx)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
	else
			cout<<"No"<<endl;
}






Measured memory_bytes: 3648
N, K = map(int, input().split())
A_list = [-1] + list(map(int, input().split()))
out_loop = [1]
flag = [0, 1] + [0]* (N - 1)
a = A_list[1]
while flag[a] == 0:
    out_loop.append(a)
    flag[a] = 1
    a = A_list[a]
    

        
if K <= (len(out_loop) - 1):
    print(out_loop[K])
else:
    loop = out_loop[out_loop.index(a):]
    k = K - (len(out_loop) - 1)
    k %= len(loop)
    print(loop[k - 1])


    

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

constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;

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

    string s; cin >> s;
    int n = s.length();
    reverse(s.begin(), s.end());
    int i = 0;
    while (i < n) {
        if (s.substr(i, 5) == "maerd" || s.substr(i, 5) == "esare") i += 5;
        else if (s.substr(i, 6) == "resare") i += 6;
        else if (s.substr(i, 7) == "remaerd") i += 7;
        else {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pi pair<int,int>
#define ff first
#define ss second
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#include "string"
#define int long long

int32_t main(){
   boost;
   int a[5];
   for(int i=0;i<5;i++){
      cin>>a[i];
      if(a[i] == 0)
         cout<<i+1<<endl;
   }
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout)

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

int r;

int main(){
	//IO("input.txt", "output.txt");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> r;
	cout << r * r * 3 << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define ul unsigned long long int
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define pll pair<long long int, long long int>
#define pii pair<int, int>
#define vii vector<int>
#define vll vector<long long int>
#define sii set<int>
#define sll set<long long int>
#define usi unordered_set<int, custom_hash>
#define usl unordered_set<long long int, custom_hash>
#define mii map<int, int>
#define mll map<long long int, long long int>
#define umi unordered_map<int, int, custom_hash>
#define uml unordered_map<long long int, long long int, custom_hash>
#define ski stack<int>
#define skl stack<long long int>
#define all(v) v.begin(),v.end()
using namespace std;
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c`
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};


const int N=1e5+1;
const int mod=998244353;
ll a[N], b[N], c[N];

ll dp[101][N];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
#endif
    
    int n, w;
    cin>>n>>w;
    for(int i=1;i<=n;++i){
        ll x, y;   cin>>x>>y;
        for(int j=0;j<=w;++j){
            if(j>=x){
                dp[i][j]=y;
            }
            dp[i][j]=max(dp[i][j], dp[i-1][j]);
            if(j>=x){
                dp[i][j]=max(dp[i][j], y+dp[i-1][j-x]);
            }
            // cout<<dp[i][j]<<' ';
        }
        // cout<<endl;
    }

    cout<<dp[n][w]<<endl;

}

Measured memory_bytes: 79360
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  string A, B;
  cin >> A;
  cin >> B;
  
  int count = 0;
  
  for(int i = 0; i < 3; i++){
    if(A.at(i) == B.at(2 - i)){
      count++;
    }
  }
  
  if(count == 3){
    cout << "YES" << endl;
  }
  
  else{
    cout << "NO" << endl;
  }
}

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

const int NOTPARENT = -1;
const int NOTSEARHCH = 0;
const int SEARCHING = 1;
const int SEARCHED = 2;
const int INF = static_cast<int>(1e6);

struct Edge{
    int ToNode;
    int weight;
    Edge(int t, int w): ToNode(t), weight(w){}
};

bool operator>(const Edge &A, const Edge &B){
    return A.weight > B.weight;
}


// this function calculates shortest path spanning tree by fast dijkstra's algorithm that uses priority queue
std::vector<int> shortestPath(int s, std::vector<std::vector<Edge>> &graph){
    std::size_t n = graph.size();
    std::vector<int> shortestPathWeight(n, INF);
    std::vector<int> shortestPathParent(n);
    std::vector<int> nodeState(n, NOTSEARHCH);
    std::priority_queue<Edge, std::vector<Edge>, std::greater<Edge>> pq;
    shortestPathWeight[s] = 0;
    pq.push(Edge{s, 0});
    shortestPathParent[s] = NOTPARENT;

    int minWeight;
    int nextNode;
    while(!pq.empty()){
        nextNode = pq.top().ToNode;
        minWeight = pq.top().weight;
        pq.pop();

        nodeState[nextNode] = SEARCHED;
        if(shortestPathWeight[nextNode] < minWeight) continue;

        for(int i = 0; i < graph[nextNode].size(); i++){
            int adjacentNode = graph[nextNode][i].ToNode;
            int adjacentWeight = graph[nextNode][i].weight;
            if(nodeState[adjacentNode] != SEARCHED){
                if(shortestPathWeight[nextNode] + adjacentWeight < shortestPathWeight[adjacentNode]){
                    shortestPathWeight[adjacentNode] = shortestPathWeight[nextNode] + adjacentWeight;
                    nodeState[adjacentNode] = SEARCHING;
                    shortestPathParent[adjacentNode] = nextNode;
                    pq.push(Edge{adjacentNode, shortestPathWeight[adjacentNode]});
                }
            }
        }
    }

    return shortestPathWeight;
}

int main(){
    int n, X, Y;
    std::cin >> n >> X >> Y;
    X--;
    Y--; // to 0 origin
    // 重み付き隣接リスト
    std::vector<std::vector<Edge>> graph(n);
    for(int i = 0; i < n - 1; i++){
        graph[i].emplace_back(i + 1, 1);
        graph[i + 1].emplace_back(i, 1);
    }
    graph[X].emplace_back(Y, 1);
    graph[Y].emplace_back(X, 1);

    std::vector<int> out(n, 0);
    for(int s = 0; s < n; s++){
        std::vector<int> d = shortestPath(s, graph);
        for(int i = 0; i < n; i++){
            out[d[i]]++;
        }
    }

    for(int k = 1; k < n; k++){
        std::cout << out[k] / 2 << std::endl;
    }
    return 0;
}

Measured memory_bytes: 384
import java.util.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);  
    public static void main(String[] args) throws Exception {
        String s = sc.next();
        int l = s.length();
        int st = 0;
        int e = 0;
        for (int i = 0;i < l;i++) {
            char c = s.charAt(i);
            if (c=='A') {
                st = i;
                break;
            }
        }
        
        for (int i = st;i < l;i++) {
            char c = s.charAt(i);
            if (c=='Z') e = i;
        }
        
        System.out.println(e-st+1);
    }
}


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

using namespace std;
const int MAXN=2*1e5+1000;
int H[MAXN];
long long int V[MAXN];

set<int> altezze;
long long int sol[MAXN];
int N;
int mappa[MAXN];
int main(){
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>H[i];
		H[i]--;
	}
	for(int i=0;i<N;i++){
		cin>>V[H[i]];
		sol[H[i]]=V[H[i]];
	}
	set<int>::iterator it;
	for(int i=0;i<N;i++){
		it=altezze.upper_bound(H[i]);
		if(it!=altezze.begin()){
			it--;
			sol[H[i]]+=sol[*(it)];
		}
		altezze.insert(H[i]);
		it = altezze.find(H[i]);
		it++;
		while(it!=altezze.end() && sol[*(it)]<=sol[H[i]]){
			set<int>::iterator tmp = it;
			it++;
			altezze.erase(tmp);
		}
	}
	long long int risultato = 0;
	for(int i=0;i<=N;i++)
		risultato = max(risultato, sol[i]);
	cout<<risultato;
}

Measured memory_bytes: 13568
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)

ll K;
ll cnt = 0;

void search(ll pos, ll nd, ll num){
    if(pos == nd){
        if(cnt == K - 1){
            cout << num << endl;
            exit(0);
        }
        cnt++;
        return;
    }

    ll start, end;
    if(pos == 0){
        start = 1;
        end = 9;
    }else{
        start = max(0LL, num % 10 - 1);
        end = min(9LL, num % 10 + 1);
    }
    for(ll x = start; x <= end; ++x){
        search(pos + 1, nd, 10 * num + x);
    }
}

int main(){
    cin >> K;
    for(ll nd = 1; ; ++nd){
        search(0, nd, 0);
    }
    return 0;
}


Measured memory_bytes: 256
//
// Created on 2020/05/17.
//


#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <ios>
#include <iomanip>
#include <numeric>

#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const long long LINF =1e18;
const int INF = 1e9;


int main() {
    double a,b,h,m;
    cin>>a>>b>>h>>m;

    double h_deg = ((h * 60 + m) / (12 * 60))*360;
    double m_deg = (m / 60)*360;
    double deg = abs(h_deg - m_deg);

    double pi = 2.0 * asin(1.0);
    double unit = pi / 180.0;
    double deg_r = deg * unit;

    double ans = sqrt(pow(a,2)+pow(b,2)-2*a*b*cos(deg_r));

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

    return 0;
}


Measured memory_bytes: 4224
#include <bits/stdc++.h>
#define N 200006
using namespace std;
struct arr{int to,ne;}e[N];
int x,n,ans,cnt,d[N],s[N],g[N],head[N];
inline int read()
{
    int x=0,c=getchar();while(c<48)c=getchar();
    while(c>47)x=x*10+c-48,c=getchar();return x;
}
inline void add(int x,int y)
{
	e[++cnt].to=y;e[cnt].ne=head[x];head[x]=cnt;
}
void dfs(int x,int fa)
{
	int t=0;
	for(int i=head[x];i;i=e[i].ne){
		dfs(e[i].to,x);
	}
	for(int i=head[x];i;i=e[i].ne){
		g[++t]=d[e[i].to]+1;
	}
	sort(g+1,g+t+1);int h=0;
	for(int i=1;i<=t;i++){
		h=max(h+1,g[i]);
	}
	d[x]=h;
}
int main()
{
	n=read();
	for(int i=2;i<=n;i++)x=read(),add(x,i);
	dfs(1,0);printf("%d",d[1]);
}

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

bool hitofude(char a,char b){
	if(a=='A'){
		if(b=='B'||b=='D')return true;
		return false;
		}
	if(a=='B'){
		if(b=='A'||b=='E'||b=='C')return true;
		return false;
		}	
	if(a=='C')	{
		if(b=='B'||b=='F')return true;
		return false;
		}
	if(a=='D'){
		if(b=='A'||b=='E'||b=='G')return true;
		return false;
		}	
	if(a=='E'){
		if(b=='B'||b=='D'||b=='H'||b=='F')return true;
		return false;
		}	
	if(a=='F'){
		if(b=='C'||b=='E'||b=='I')return true;
		return false;
		}	
	if(a=='G'){
		if(b=='D'||b=='H')return true;
		return false;
		}	
	if(a=='H'){
		if(b=='E'||b=='G'||b=='I')return true;
		return false;
		}	
	if(a=='I')	{
		if(b=='F'||b=='H')return true;
		return false;
		}
		return true;
	}

int main(){
	for(int i=0;i<1000;i++){
		string s;
		cin>>s;
		int flg=1;
		for(int i=1;i<s.size();i++){
			if(!hitofude(s[i-1],s[i]))flg=0;
			}
		if(flg)cout<<s<<endl;	
		}
		return 0;
	}

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

int main() {
  int a, b;
  char c;
  cin >> a >> c >> b;
  if(c=='+')
    cout << a+b << endl;
  else if(c=='-')
    cout << a-b << endl;
  else
    cout << "error" << endl;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
#include <cassert>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#define ALL(v) begin(v),end(v)
#else
#define ALL(v) (v).begin(),(v).end()
#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}
template <class T> inline T &chmin(T &x, const T &y){ return x = min(x, y); }
template <class T> inline T &chmax(T &x, const T &y){ return x = max(x, y); }
template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}


#define REP(i,n) for(int i=0;i<int(n);++i)
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8

inline void add(LL &x, LL y){
	x += y;
	if(x >= MOD){ x -= MOD; }
}

LL dp[100010][256];

void mainmain(){
	int n, x;
	scanf("%d%d", &n, &x);
	vector<int> ss(n);
	for(int i = 0; i < n; ++i){
		scanf("%d", &ss[i]);
	}
	sort(ALL(ss));

	dp[x][0] = 1;
	for(int i = x; i >= 0; --i){
		bool ok = false;
		for(int j = 0; j <= n; ++j){
			ok |= dp[i][j] != 0;
		}
		if(!ok){ continue; }
		int k = upper_bound(ALL(ss), i) - ss.begin();
		int maxj = -1, minj = INT_MAX;
		for(int j = 0; j < n; ++j){
			add(dp[i][j + 1], dp[i][j] * (n - k - j) % MOD);
			if(dp[i][j] != 0){
				chmin(minj, j);
				maxj = j;
			}
		}
		for(int l = 0; l < k; ++l){
			int t = i % ss[l];
			for(int j = minj; j <= maxj; ++j){
				add(dp[t][j + 1], dp[i][j]);
			}
		}
	}
	
	LL ans = 0;
	for(int i = 0; i <= x; ++i){
		add(ans, dp[i][n] * i % MOD);
	}
	printf("%lld\n", ans);
}



}
int main() try{
//	ios::sync_with_stdio(false); cin.tie(0);
	cout << fixed << setprecision(10);
	cerr << fixed << setprecision(4);
	mainmain();
}
catch(...){
	throw;
}


Measured memory_bytes: 86272
#include <bits/stdc++.h>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
/*
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
namespace mp = boost::multiprecision;// 任意長整数型
using bint = mp::cpp_int;// 仮数部長が32の浮動小数点数型
using real32 = mp::number<mp::cpp_dec_float<32>>;// 仮数部長が1024の浮動小数点数型
using real1024 = mp::number<mp::cpp_dec_float<1024>>;// ついでに有理数型
using rat = boost::rational<bint>;
*/
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()
ll a,b,c,ans=0;
int main(){ //srand((unsigned)time(NULL));
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if(c%i == 0)ans++;
  }
  cout << ans << endl;
}



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

int Pow(int t){
	int ret = 1;
	for(int i = 0; i < t; i++) ret *= 10;
	return ret;
}

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		int r;
		cin >> r;
		int cnt = 0;
		while(true){
			if(r < 10) break;
			int x = 10;
			int rank;
			for(int i = 2;;i++){
				x *= 10;
				if(x > r){
					rank = i;
					break;
				}
			}
			int nr = 0;
			for(int i = 1; i <= rank-1; i++){
				int y = (r%Pow(i))*(r/Pow(i));
				if(y > nr) nr = y;
			}
			r = nr;
			cnt++;
		}
		cout << cnt << endl;
	}
}

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

/*
提出前に確認!
- setとmultisetを間違えない
*/

int	main(void)
{
	int n;
	cin >> n;
	string s;
	vector<int> ans(4, 0);
	for (int i = 0; i < n; i++)
	{
		cin >> s;
		if (s == "AC") ans[0]++;
		if (s == "WA") ans[1]++;
		if (s == "TLE") ans[2]++;
		if (s == "RE") ans[3]++;
	}
	cout << "AC x " << ans[0] << endl;
	cout << "WA x " << ans[1] << endl;
	cout << "TLE x " << ans[2] << endl;
	cout << "RE x " << ans[3] << endl;
	return (0);
}


Measured memory_bytes: 3608
n = int(input())
t = [0]*(n+1)
x = [0]*(n+1)
y = [0]*(n+1)

for i in range(1,n+1): t[i],x[i],y[i] = list(map(int,input().split()))

def distance(x1,y1, x2,y2):
    return abs(x1-x2) + abs(y1-y2)

def check_route(n,t,x,y):
    for i in range(n):
        dist = distance(x[i],y[i], x[i+1],y[i+1])
        if t[i+1] < dist: return "No"
        if (t[i+1] - t[i])%2 != dist%2: return "No"
    return "Yes"
        
print(check_route(n,t,x,y))

Measured memory_bytes: 11764
# B

import numpy as np
N, M = map(int, input().split())

A = np.array([list(input()) for i in range(N)])
B = np.array([list(input()) for i in range(M)])

flag=0
for i in range(N-M+1):
    for j in range(N-M+1):
        A_tmp = A[i:i+M,j:j+M]
        # print(A_tmp)
        # print(B)
        if (B==A_tmp).all():
            flag=1
        if flag==1:
            break
    if flag==1:
        break
if flag==1:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 14480
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <numeric>
#include <climits>
#define ll long long
#define LIM 1000
using namespace std;
int main() {
  char a, b;
  cin >> a >> b;
  if (a == b) {
    cout << "H" << endl;
  } else {
    cout << "D" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N; cin >> N;
    vector<int> data(N);
    for(int i = 0; i < N; i++){
        int tmp; cin >> tmp;
        data[i] = tmp;
    }

    long ans = 0;
    for(int i = 0; i < N-1; i++){
        if(data[i] > data[i+1]){
            int tmp = data[i] - data[i+1];
            ans += tmp;
            data[i+1] += tmp;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 4024
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var n = Number(lines[0]);
 var a = 0;
 var b = 0;
 var array = [];
 var p = lines[1].split(' ');
 p = p.map(function(str) { return Number(str)});
 var q = lines[2].split(' ');
 q = q.map(function(str) { return Number(str)});
 
 function junretsu(balls, nukitorisu){
  var arrs, i, j, zensu, results, parts;
  arrs = [];
  zensu = balls.length;
  if(zensu < nukitorisu){
    return;
  }else if(nukitorisu == 1){
    for(i = 0; i < zensu; i ++){
      arrs[i] = [balls[i]];
    }
  }else{
    for(i = 0; i < zensu; i ++){
      parts = balls.slice(0);
      parts.splice(i, 1)[0];
      results = junretsu(parts, nukitorisu - 1);
      for(j = 0; j < results.length; j ++){
        arrs.push([balls[i]].concat(results[j]));
      }
    }
  }
  return arrs;
}
for(i=1; i<=n; i++){
  array.push(i);
}
var arr = junretsu(array, n);
var i=0;
arr.forEach(item => {
  i++;
  if(JSON.stringify(item) == JSON.stringify(p)){
    a = i;
  }
  if(JSON.stringify(item) == JSON.stringify(q)){
    b = i;
  }
})
  
  console.log(Math.abs(a-b));
});

Measured memory_bytes: 45140
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;

struct Edge {
  int to;
  double cost;
  Edge() {}
  Edge(int to, double cost) : to(to), cost(cost) {}
};

const int MAX_N = 101;
int N;
double X[MAX_N], Y[MAX_N], Z[MAX_N], R[MAX_N];
vector<Edge> E[MAX_N];

double abs(double x, double y, double z) {
  return sqrt(x*x+y*y+z*z);
}

void makeE() {
  for(int i = 0; i < MAX_N; ++i) E[i].clear();
  for(int i = 0; i < N; ++i) {
    for(int j = 0; j < N; ++j) {
      double cost = max(0.0,
			abs(X[i]-X[j],Y[i]-Y[j],Z[i]-Z[j]) - (R[i]+R[j]));
      E[i].push_back(Edge(j,cost)); 
    }
  }
}
  
double prim() {
  priority_queue<pair<double,int> > que;
  bool vis[MAX_N];
  fill(vis,vis+MAX_N,false);
  que.push(make_pair(0.0,0));
  double sum = 0;
  while(!que.empty()) {
    double cost = que.top().first;
    int p = que.top().second;
    que.pop();
    if(vis[p]) continue;
    vis[p] = true;
    sum += -cost;
    for(int i = 0; i < E[p].size(); ++i) {
      Edge &e = E[p][i];
      if(vis[e.to]) continue;
      que.push(make_pair(-e.cost,e.to));
    }
  }
  return sum;
}

double solve() {
  makeE();
  return prim();
}

int main() {
  while(cin >> N && N) {
    for(int i = 0; i < N; ++i) {
      scanf("%lf%lf%lf%lf",&X[i],&Y[i],&Z[i],&R[i]);
    }
    printf("%.3f\n",solve());
  }
  return 0;
}

Measured memory_bytes: 0
n=int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  s=input()
  if s == "AC":
    ac += 1
  elif s == "WA":
    wa += 1
  elif s == "TLE":
    tle += 1
  elif s == "RE":
    re += 1
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

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

typedef long long ll;

ll n,x,a,o;
unordered_set<ll> num;
unordered_set<ll> t;
vector<ll> s;

void error(){
	cout << "No" << endl;
	// for(ll x : s){
	// 	cerr << x << " ";
	// }
	// cerr << endl;
	exit(0);
}

int main(){
	cin >> n >> x >> a >> o;
	for(ll i = 0;i < 1<<(n+1);i++){
		num.insert(i);
	}
	if(x == 0) error();
	if((a^o) == x) error();
	if(num.find(a^x) != num.end()) num.erase(num.find(a^x));
	if(num.find(o^x) != num.end()) num.erase(num.find(o^x));
	if(num.find(a) != num.end()) num.erase(num.find(a));
	if(num.find(o) != num.end()) num.erase(num.find(o));
	// if(((a^x)&(o^x)) == a || ((a^x)|(o^x)) == o) error();
	t.insert(a^x);
	t.insert(o^x);
	// cerr << (a^x) << " " << (o^x) << endl;
	// cerr << 1 << endl;
	while(true){
		while(t.size() > 0){
			ll hoge = *t.begin();
			t.erase(t.begin());
			s.push_back(hoge);
			vector<ll> tmp;
			for(ll y : num){
				// cerr << y << " | " << (y&hoge) << " " << (y|hoge) << endl;
				if((y&hoge) == a || (y|hoge) == o){
					// cerr << y << endl;
					tmp.push_back(y);
					tmp.push_back(y^x);
					// if(((y^x)&hoge) == a || ((y^x)|hoge) == o) error();
					t.insert(y^x);
				}
			}
			for(ll y : tmp){
				if(num.find(y) != num.end()) num.erase(num.find(y));
			}

		}
		if(num.size() > 0){
			// cerr << "------------" << endl;
			ll hoge = *num.begin();
			if(num.find(hoge) != num.end()) num.erase(num.find(hoge));
			if(num.find(hoge^x) != num.end()) num.erase(num.find(hoge^x));
			t.insert(hoge);
		}else{
			break;
		}
	}
	for(ll b1 : s){
		for(ll b2 : s){
			if((b1^b2) == x || (b1&b2) == a || (b1|b2) == o) error();
		}
	}
	cout << "Yes" << endl;
	for(ll i = 0;i < s.size()-1;i++){
		cout << s[i] << " ";
	}
	cout << s[s.size()-1] << endl;



}


Measured memory_bytes: 4072
#include <bits/stdc++.h>
using namespace std;
#define task "abc171"
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod = 1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// Head:
// Source:
const int maxn = 2e5 + 7;
int n;
int a[maxn], ans = 0;
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen(task".inp","r",stdin);
    freopen(task".out","w",stdout);
#endif
    cin>>n;
    rep(i, 1, n + 1){
        cin>>a[i];
        ans ^= a[i];
    }
    rep(i, 1, n + 1){
        int tt = ans ^ a[i];
        cout<<tt<<" ";
    }

}



Measured memory_bytes: 4312
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

signed main() {
    int n;
    cin >> n;
    int sum = n * (n - 1) / 2;
    cout << sum << "\n";
}

Measured memory_bytes: 256
/* Author rumoisen */
/* created 2018/10/20 */

#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <iostream>

using namespace std;
 
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

void no(){cout<<"No"<<endl;exit(0);}
void yes(){cout<<"Yes"<<endl;exit(0);}
void No(){cout<<"NO"<<endl;exit(0);}
void Yes(){cout<<"YES"<<endl;exit(0);}

using namespace std;

int main(void)
{
    string a,b,c;
    cin>>a>>b>>c;
    if(a[a.size()-1]==b[0]&&b[b.size()-1]==c[0]) Yes();
    else No();
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1e10;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define P pair<int, int>
#define V vector<int>
//#define S set<int>
#define itn int
bool dbg = false;

int H, N;
int A[1010], B[1010];
int dp[22101][1010];

void solve() {
    FOR(h, 1, H + 1 + 10101) {
        FOR(n, 0, N + 1)
        dp[h][n] = INF;
    }
    FOR(h, 1, H + 1 + 10101) {
        FOR(n, 1, N + 1) {
            dp[h][n] = dp[h][n - 1];
            if (h - A[n] >= 0) {
                dp[h][n] = min(dp[h][n], dp[h - A[n]][n] + B[n]);
            }
        }
    }
    itn ans = INF;
    FOR(h, H, H + 10101) {
        ans = min(ans, dp[h][N]);
    }
    cout << ans << endl;
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> H >> N;
    FOR(N)
    cin >> A[i + 1] >> B[i + 1];
    solve();
    return 0;
}


Measured memory_bytes: 160000
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<set>
using namespace std;


int main() {
    int a;
    cin >> a;
    if(a < 1200){
        cout << "ABC";
    }
    else{
        cout << "ARC";
    }
    cout << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
typedef long long ll;
using namespace std;
int main()
{
	ll a[88];
	int n;
	a[0]=2;
	a[1]=1;
	for(int i=2;i<88;i++)a[i]=a[i-1]+a[i-2];
	scanf("%d",&n);
	printf("%lld\n",a[n]);
	return 0;
}

Measured memory_bytes: 128