akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define piii pair<int,pair<int,int> >
int n,m,s,c[55],d[55],dp[55][2525];
vector<piii>v[55];
signed main()
{
	cin>>n>>m>>s;
	for(int i=0;i<m;i++)
	{
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		a--;
		b--;
		v[a].push_back(make_pair(b,make_pair(c,d)));
		v[b].push_back(make_pair(a,make_pair(c,d)));
	}
	for(int i=0;i<n;i++)
	{
		cin>>c[i]>>d[i];
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<2510;j++)
		{
			dp[i][j]=1e18;
		}
	}
	queue<piii>q;
	q.push(make_pair(0ll,make_pair(min(n*50-1,s),0ll)));
	while(!q.empty())
	{
		piii nw=q.front();
		q.pop();
		if(nw.second.first>=0 && nw.second.second>=0 && nw.second.second<dp[nw.first][min(n*50-1,nw.second.first)])
		{
			dp[nw.first][min(n*50-1,nw.second.first)]=nw.second.second;
			for(int i=0;i<v[nw.first].size();i++)
			{
				piii pp=v[nw.first][i];
				q.push(make_pair(pp.first,make_pair(nw.second.first-pp.second.first,nw.second.second+pp.second.second)));
			}
			q.push(make_pair(nw.first,make_pair(nw.second.first+c[nw.first],nw.second.second+d[nw.first])));
		}
	}
	for(int i=1;i<n;i++)
	{
		int ans=1e18;
		for(int j=0;j<n*50;j++)
		{
			ans=min(ans,dp[i][j]);
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 13744
#include<bits/stdc++.h>
using namespace std;
int ans,n,a[1005],pos;
int main()
{
    cin>>n;
    ans=10000005;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=1;i<=1005;i++)
    {
        int sum=0;
        for(int j=1;j<=n;j++)
        {
            sum+=(a[j]-i)*(a[j]-i);
        }
        //cout<<sum<<endl;
        if(ans>sum)
        {
            ans=sum;
            pos=i;
        }
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a; i< (int)(b); ++i)
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
typedef long double ld;
using ll=long long;
using namespace std;
const int mod=1e9+7;
const ll inf = 1LL << 60;
const ld pi = (acos(-1));
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }




int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  
  string s,t,ans="Yes"; cin >> s >> t;
  rep(i,0,s.size()){
    if(s[i]!=t[i]) ans="No";
  }
  cout << ans << endl;
}

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

int main() {
  int N, Y;
  cin >> N >> Y;
  
  int res10000 = -1, res5000 = -1, res1000 = -1;
  
  for (int a = 0; a <= N; a++){
    for (int b = 0; a + b <= N; b++){  
      int c = N - a - b;
      int total = 10000*a + 5000*b + 1000*c;
      if (total == Y){
        res10000 = a;
        res5000 = b;
        res1000 = c;
        break;
    }
   }
  }
  
  cout << res10000 << " " << res5000 << " " << res1000 << endl;

}

      
  
    

Measured memory_bytes: 256
/*#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>*/
#include <bits/stdc++.h>

using namespace std;
//using namespace __gnu_pbds;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

const int MOD = 1000000007;
double PI = 4*atan(1);

string a;
int nex[200005][26], mx[200005], dp[200005];
char to[200005]; // char, pos

int main() {
    cin >> a;
    F0R(i,26) nex[a.length()][i] = a.length(); // current # done, next index
    
    F0Rd(i,a.length()) {
        F0R(j,26) nex[i][j] = nex[i+1][j];
        nex[i][a[i]-'a'] = i;
        F0R(j,26) mx[i] = max(mx[i],nex[i][j]);
    }
    
    dp[a.length()+1] = 0;
    F0Rd(i,a.length()+1) { // currently have i characters
        dp[i] = MOD;
        F0R(j,26) dp[i] = min(dp[i],dp[nex[i][j]+1]+1);
        F0R(j,26) if (dp[nex[i][j]+1]+1 == dp[i]) {
            to[i] = char('a'+j);
            break;
        }
    }
    int cur = 0;
    string ans = "";
    while (cur != a.length()+1) {
        ans += to[cur];
        cur = nex[cur][to[cur]-'a']+1;
    }
    cout << ans;
}

// read!
// ll vs. int!

Measured memory_bytes: 22660
N = int(input())
Rest = dict()
Parg = [0]*(101)
for i in range(N):
    S, P = map(str,input().split())
    P = int(P)
    if S not in Rest:
        Rest[S] = [P]
    else:
        Rest[S] += [P]
    Parg[P] = i+1 
Restsort = sorted(Rest)
for cit in Restsort:
    box = Rest[cit]
    box.sort(reverse = True)
    for j in box:
        print(Parg[j])

Measured memory_bytes: 9144
#include <iostream>

const int coins[4] = {25, 10, 5, 1};

int main() {
    int N;
    std::cin >> N;
    int ans = 0;
    for (auto c : coins) {
        ans += N / c;
        N %= c;
    }
    std::cout << ans << std::endl;
    return 0;
}



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

typedef long long ll;
typedef pair<int,int> ii;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int n; cin>>n;
	vector<int> a(n);
	int sum=0;
	for (int i=0; i<n; i++)
		cin>>a[i], sum+=a[i];
	sort(a.rbegin(),a.rend());
	cout<<(sum-a.front()>a.front()?"Yes":"No")<<"\n";
	return 0;
}

Measured memory_bytes: 256
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};
fn main() {
    input! {//
        n:usize,
        s:Chars,
        k:Usize1,
    }
    let c = s[k];
    for &ch in s.iter() {
        if ch != c {
            print!("*");
        } else {
            print!("{}", ch);
        }
    }
}


Measured memory_bytes: 2120
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <complex>

#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define rep(i,n) for(int i=0;i<(n); i++)

using namespace std;
typedef long long ll;
const int NMAX = 200000;
const int k = 200000;
static const int INF = 1<<29;
string s,t,ans;
int dp[3001][3001];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0); //この2行はより速度を向上させる
    // 追加２, 以降 cin の入力元が 'input.txt' になる
    //提出時に消す！！


    int n;
    cin >> n;
    vector<int> A(n),B(n);
    rep(i,n) cin >> A[i];

    std::vector<int>::iterator iter = std::max_element(A.begin(), A.end());
    size_t index = std::distance(A.begin(), iter);

    sort(A.begin(),A.end());
    if(A[n-1]==A[n-2]){
        rep(i,n) cout << A[n-1] << endl;
        return 0;
    }
    else{
        rep(i,index) cout << A[n-1] << endl;
        cout << A[n-2] << endl;
        rep(i,n-index-1) cout << A[n-1] << endl;
    }

    return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
#define all(obj) (obj).begin(), (obj).end()
static const int dx[4] = {0, 1, 0, -1};
static const int dy[4] = {1, 0, -1, 0};
static const char dir[4] = {'u', 'r', 'd', 'l'};
static const ll INF = 1 << 21;
static const ll MOD = 1e9 + 7;
int N, A, B, C, D;
string S;

bool canReach(int start, int end) {
  for (int i = start; i <= end - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '#') {
      return false;
    }
  }
  return true;
}

signed main() {
  cin >> N >> A >> B >> C >> D >> S;
  S = "#" + S + "#";
  if (!canReach(A, C) || !canReach(B, D)) {
    puts("No");
    return 0;
  }
  if (C > D) {
    bool over = false;
    for (int i = B; i <= D; i++) {
      if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.') {
        over = true;
      }
    }
    if (!over) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  return 0;
}

Measured memory_bytes: 772
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef vector<int> vec;
int main(){
   double n,k; cin>>n>>k;
  long double ans=0;
  
  rep(i,n){
    if(i+1>=k)ans+=2;
    else ans+=1/(pow(2,-1+ceil(log2(ceil(k/(i+1))))));
  }
  
  ans/=2*n;
  cout<<fixed<<setprecision(10);
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>
const int maxn=100000+10;
const long long big=2000000000;
struct card
{
    int shu;
    char fu;
};
card L[maxn/2+2],R[maxn/2+2];
void zhenghe(card a[],int left,int mid,int right)
{
    int n1=mid-left;
    int n2=right-mid;
    for (int i=0;i<n1;i++) L[i]=a[left+i];
    for (int i=0;i<n2;i++) R[i]=a[mid+i];
    L[n1].shu=R[n2].shu=big;
    int i=0,j=0;
    for (int k=left;k<right;k++)
    {
        if(L[i].shu<=R[j].shu)
            a[k]=L[i++];
        else a[k]=R[j++];
    }
}
void guibing(card a[],int left,int right)
{
    if(left+1<right)
    {
        int mid=(left+right)/2;
        guibing(a,mid,right);
        guibing(a,left,mid);
        zhenghe(a,left,mid,right);
    }
}
int fenge(card a[],int left,int right)
{
    card x,t;
    x=a[right];
    int i=left-1;
    for (int j=left;j<right;j++)
    {
        if(a[j].shu<=x.shu)
        {
         i++;
         t=a[i];a[i]=a[j];a[j]=t;
        }
    }
    t=a[i+1];a[i+1]=a[right];a[right]=t;
    return i+1;
}
void quicksort(card a[],int left,int right)
{
    int q;
    if(left<right)
    {
        q=fenge(a,left,right);
        quicksort(a,left,q-1);
        quicksort(a,q+1,right);
    }
}
int main()
{
    int n,huan,biao=1;
    card a[maxn],b[maxn];
    char c[10];
    scanf("%d",&n);
    for (int i=0;i<n;i++)
    {
        scanf("%s %d",c,&huan);
        a[i].shu=b[i].shu=huan;
        a[i].fu=b[i].fu=c[0];
    }
    quicksort(b,0,n-1);
    guibing(a,0,n);
    for (int i=0;i<n;i++)
    {
        if(a[i].fu!=b[i].fu)
         biao=0;
    }
    if(biao==0) printf("Not stable\n");
    else printf("Stable\n");
    for (int i=0;i<n;i++)
    {
        printf("%c %d\n",b[i].fu,b[i].shu);
    }
    return 0;
}

Measured memory_bytes: 5004
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }
        static void Solve()
        {
            var NM = Sarray();
            var N = NM[0];
            var M = NM[1];
            var Xi = Sarray();
            var Yi = Sarray();
            Array.Sort(Xi);
            Array.Sort(Yi);
            var dstX = new long[N - 1];
            for (var i = 0; i < N - 1; ++i)
                dstX[i] = Xi[i + 1] - Xi[i];
            var dstY = new long[M - 1];
            for (var i = 0; i < M - 1; ++i)
                dstY[i] = Yi[i + 1] - Yi[i];

            var sumX = 0L;
            var W = N - 1;
            for (var i = 1; i <= W; ++i)
            {
                var t = i * (W - i + 1) % Mod * dstX[i - 1] % Mod;
                sumX = (sumX + t) % Mod;
            }
            var sumY = 0L;
            var H = M - 1;
            for (var i = 1; i <= H; ++i)
            {
                var t = i * (H - i + 1) % Mod * dstY[i - 1] % Mod;
                sumY = (sumY + t) % Mod;
            }
            WriteLine(sumX * sumY % Mod);
        }
    }
}

Measured memory_bytes: 46276
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>

using namespace std;



int main() {
	int i, j, k;
	int n;

	cin >> n >> k;

	vector<int>t(k, 0);

	int cnt = 0;

	for (i = 0; i < n; i++) {
		if (cnt == k) {
			cnt = 0;
		}
		t[cnt]++;
		cnt++;
	}

	sort(t.begin(), t.end());

	cout << t[k - 1] - t[0] << endl;






	getchar();
	getchar();
	return 0;
}

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

using namespace std;
using ll = long long;

int main() {


    ll n, k;
    scanf("%lld %lld", &n, &k);
    ll div_by_k = n / k, mod_half;
    ll res = div_by_k * div_by_k * div_by_k;
    if (k % 2 == 0) {
        mod_half = (n + k / 2) / k;
        res += mod_half * mod_half * mod_half;
    }
    printf("%lld\n", res);
}


Measured memory_bytes: 256
#pragma  warning (disable:4996)
#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#define MAX 1000000
using namespace std;
int amount[MAX];
int vis[MAX];
int prime[MAX];
int main(){
	memset(vis, 0, sizeof(vis));
	memset(prime, 0, sizeof(prime));
	prime[0] = prime[1] = 0;
	for (int i = 2; i<= MAX; i++){
		if (!vis[i]){
			prime[i] = 1;
			for (int j = i + i; j <= MAX; j += i){
				vis[j] = 1;
				prime[j] = 0;
			}
		}
	}
	int sum = 0;
	for (int i = 0; i <= MAX; i++){
		if (prime[i]){
			sum++;
		}
		amount[i] = sum;
	}
	int n;
	while (cin >> n){
		cout << amount[n] << endl;
	}
	return 0;
}

Measured memory_bytes: 12884
#include<iostream>

#include <iomanip>
const long double pi=3.141592653589;
int main(){
    long double r;
    std::cin>>r;
    long double b,c;
    b=pi*r*r;
    c=pi*2*r;
    std::cout<<std::fixed<<std::setprecision(6)<<b<<" "<<std::setprecision(6)<<c<<std::endl;
    return 0;
}


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

int main() {
	ios::sync_with_stdio(0);cin.tie(0);
	int n, m;
	cin >> n >> m;
	priority_queue<int, vector<int>> pq;
	for(int i=0; i<n; i++) {
		int t;
		cin >> t;
		pq.push(t);
	}
	while(m--) {
		int p = pq.top();
		pq.pop();
		pq.push(p/2);
	}
	long long ans = 0;
	while(pq.size()) {
		ans += pq.top();
		pq.pop();
	}
	cout << ans;
}

Measured memory_bytes: 892
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int64_t n,m;
  cin >> n >> m;
  int64_t ans= abs(n*m-(2*n+2*m-4));
  cout <<ans;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**5)
N,M,K = list(map(int,input().split(' ')))

friend_list = [0]*(N+1)
bad_list = [0]*(N+1)
group = {}

parent = [i for i in range(N+1)]
rank = [0]*(N+1)

def union(x,y):
    x = find(x)
    y = find(y)
    if x==y:
        return
    if rank[x]<rank[y]:
        parent[x]=y
    else:
        parent[y]=x
        if rank[x]==rank[y]:
            rank[x]+=1

def find(x):
    if parent[x] == x:
        return x
    else:
        parent[x]= find(parent[x])
        return parent[x]





for i in range(M):
    A,B = list(map(int,input().split(' ')))
    friend_list[A]+=1
    friend_list[B]+=1
    
    union(A,B)

for i in range(1,N+1):
    oya = find(i)
    if oya in group:
        group[oya] = group[oya]+1
    else:
        group[oya]=1

for i in range(K):
    A,B = list(map(int,input().split(' ')))
    if find(A)==find(B):
        bad_list[A]+=1
        bad_list[B]+=1


kouho = [0]*N

for i in range(1,N+1):
    oya = find(i)
    abc = group[oya]-friend_list[i]-bad_list[i]-1
    kouho[i-1] = abc

for k in kouho:
    print(k,end=" ")
print()


Measured memory_bytes: 21444
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
#define mod 1000000007

using namespace std;

ll d[300005], c[30];
string s;

int main() {
    cin >> s;
    for (int i = 0; i < s.length(); i++)
        d[i] = 1;
    c[s[0] - 97] = 1;
    for (int i = 1; i < s.length(); i++) {
        d[i] = d[i - 1];
        for (int j = 0; j < 26; j++)
            if (s[i] - 97 != j) d[i] += c[j];
        c[s[i] - 97]++;
    }
    cout << d[s.length() - 1] << endl;

	return 0;
}


Measured memory_bytes: 2180
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 6e5 + 7;

int n, a[N], k, tree[4 * N];

#define m (l + r) / 2
#define lson 2 * node
#define rson 2 * node + 1

void update(int pos, int v, int l, int r, int node) {
    if (l == r) {
        tree[node] = v;
        return;
    }
    if (pos <= m) update(pos, v, l, m, lson);
    else update(pos, v, m + 1, r, rson);
    tree[node] = max(tree[lson], tree[rson]);
}

int query(int ql, int qr, int l, int r, int node) {
    if (ql <= l && qr >= r) {
        return tree[node];
    }
    int ans = 0;
    if (ql <= m) ans = max(ans, query(ql, qr, l, m, lson));
    if (qr > m) ans = max(ans, query(ql, qr, m + 1, r, rson));
    return ans;
}
int main() {
    scanf("%d %d", &n, &k);
    for (int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        int res = query(max(a[i] - k, 0), a[i] + k, 0, N, 1) + 1;
        ans = max(ans, res);
        update(a[i], res, 0, N, 1);
    }
    cout << ans << endl;

}

Measured memory_bytes: 9116
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
using namespace std;
using ll=long long;
using ld=long double;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};

template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    rep(i,s.size()-1){
        FOR(j,i+1,s.size()){
            if(s[i]=='C'&&s[j]=='F'){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3656
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 998244353
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int main(){
  int n,k;cin>>n>>k;
  int i,j;
  double ans=0;
  repn(i,n){
    int x=i;
    double tmp=1.0/n;
    while(x<k){
      x*=2;
      tmp*=1.0/2;
    }
    //cout<<tmp<<endl;
    ans+=tmp;
  }
  cout<<setprecision(11)<<ans<<endl;
}


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

using namespace std;

int main()
{
    int n;
    int cnt;
    int l, r;

    cin >> n;
    cnt = n;
    for (int i = 0; i < n; ++i)
    {
        cin >> l >>  r;
        cnt += r - l;
    }   
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int S;
  int h, m, s;

  scanf("%d", &S);
  h = S / 3600;
  m = (S - h * 3600) / 60;
  s = S - h*3600 - m*60;
  printf("%d:%d:%d\n", h, m, s);
  return 0;
}



Measured memory_bytes: 2052
import Control.Monad
import Data.List
import Data.Set

main = do
    n <- readLn :: IO Int
    s <- getLine
    print $ maximum $ Data.List.map (chk s) [1..n-1]
    where chk s i = let (ls,rs) = splitAt i s
                  in size $ intersection (fromList ls) (fromList rs)
        
        

Measured memory_bytes: 1020
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<algorithm>
#include<iostream>
using namespace std;
int main() {
	int N, A, B;
	cin >> N >> A >> B;
	if (N == 1)puts("Hello World");
	else cout << A + B << endl;
	

	return(0);
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    char s[256];
    char p[256];
    int len, len2;
    int i;
    int j;
    int bOk = 0;
    
    scanf("%s", s);
    scanf("%s", p);
    
    len = strlen(s);
    len2 = strlen(p);
    for (i = 0; i < len; i++)
    {
        bOk = 0;
        if (s[i] == p[0])
        {
            bOk = 1;
            for (j = 0; j < len2; j++)
            {
                if (s[(i + j) % len] != p[j])
                {
                    bOk = 0;
                    break;
                }
            }
        }
        if (bOk)
            break;
    }
    
    if (bOk)
        printf("Yes\n");
    else    
        printf("No\n");

    return 0;
}


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

bool is753(long long int n)
{
    string s = to_string(n);
    bitset<3> use357;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '3')
        {
            use357[0] = true;
        }
        else if (s[i] == '5')
        {
            use357[1] = true;
        }
        else if (s[i] == '7')
        {
            use357[2] = true;
        }
    }

    if (use357[0] && use357[1] && use357[2])
    {
        return true;
    }
    else
    {
        return false;
    }
}

int dfs(long long int x, int N)
{
    int arr[3] = {3, 5, 7};
    if (x > N)
    {
        return 0;
    }

    int ret = 0;
    if (is753(x))
    {
        ret++;
    }

    for (int i = 0; i < 3; i++)
    {
        ret += dfs(x * 10 + arr[i], N);
    }

    return ret;
}

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

    cout << dfs(0, N) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7

int main(){
	ll N;
	cin >> N;
	cout << ((N) * (N - 1)) / 2 << endl;
}


Measured memory_bytes: 3620
#include <iostream>
#include <vector>

using namespace std;

bool solve(const vector<string> & W) { // constを使用することにより, 引数を変更しない(参照引数) ポイント参照になる
  const int n = W.size();
  // condition 1
  for (int i = 0; i < n-1; ++i) {
    if (W[i].back() != W[i+1].front()) {
      return false;
    }
  }
  // condition 2
  for (int i = 0; i < n; ++i) {
    for (int j = i+1; j < n; ++j) {
      if (W[i] == W[j]) {
        return false;
      }
    }
  }
  return true;
}

vector<string> input() { //input関数を定義 関数を定義する際は, 関数名の前に戻り値の型を指定する必要がある
  int n;
  cin >> n;
  vector<string> W(n); //初めから要素数が分かっている場合は要素数を指定した宣言をする
  for (int i = 0; i < n; ++i) {
    cin >> W[i];
  }
  return W;
}

int main() {
  const vector<string> W = input();
  if (solve(W)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
using namespace std;

const int N = 2e5+9;
const long long inf = 1e15;

int n,a[N];
long long dp[N][3],ans=-inf;

int main(){
    scanf("%d",&n);
    for(int i = 1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    for(int i = 0;i<N;i++){
        for(int j = 0;j<3;j++) dp[i][j]=-inf;
    }
    if(n%2==1){
        dp[0][0] = dp[0][1] = dp[0][2] = 0;
        for(int i = 1; i<=n/2;i++){
            dp[i][0] = dp[i-1][0] + a[(2*i)-1];
            dp[i][1] = max(dp[i-1][1],dp[i-1][0]) + a[2*i];
            dp[i][2] = max(max(dp[i-1][2],dp[i-1][1]),dp[i-1][0]) + a[(2*i)+1];
        }
        for(int i = 0;i<3;i++){
            ans=max(ans,dp[n/2][i]);
        }
    }
    else{
        dp[0][0] = dp[0][1] = 0;
        for(int i = 1; i<=n/2;i++){
            dp[i][0] = dp[i-1][0] + a[(2*i)-1];
            dp[i][1] = max(dp[i-1][1],dp[i-1][0]) + a[2*i];
        }
        for(int i = 0;i<2;i++){
            ans=max(ans,dp[n/2][i]);
        }
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 7196
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;

const int N=1e5+5;
const int mod=1e9+7;

int n,m,cnt,top,ans=1,H[N],a[N],b[N],dp[N];
struct Node {
	int x,y;
	bool operator == (Node&b) {return x==b.x&&y==b.y;}
} p[N];
bool cmp(Node a,Node b) {return (a.x!=b.x)?(a.x<b.x):(a.y>b.y);}

template <typename _Tp> inline void IN(_Tp&x) {
	char ch;bool flag=0;x=0;
	while(ch=getchar(),!isdigit(ch)) if(ch=='-') flag=1;
	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	if(flag) x=-x;
}

struct BIT {
	int c[N],res;
	inline int lowbit(int x) {return x&(-x);}
	inline void update(int x,int y) {for(;x<=top;x+=lowbit(x)) (c[x]+=y)%=mod;}
	inline int query(int x) {res=0;for(;x;x-=lowbit(x)) (res+=c[x])%=mod;return res;}
}bit;

int main() {
	IN(n),IN(m);
	for(int i=1;i<=n;++i) IN(a[i]);
	for(int i=1;i<=m;++i) IN(b[i]);
	sort(a+1,a+1+n),sort(b+1,b+1+m);
	for(int i=1;i<=n;++i) {
		if(a[i]<=b[1]||a[i]>=b[m]) continue;
		int pos=lower_bound(b+1,b+1+m,a[i])-b;
		if(b[pos]==a[i]) continue;
		p[++cnt]=(Node){a[i]-b[pos-1],b[pos]-a[i]},H[++top]=b[pos]-a[i];
	}
	sort(H+1,H+1+top),top=unique(H+1,H+1+top)-H-1;
	for(int i=1;i<=cnt;++i) p[i].y=lower_bound(H+1,H+1+top,p[i].y)-H;
	sort(p+1,p+1+cnt,cmp),cnt=unique(p+1,p+1+cnt)-p-1;
	for(int i=1;i<=cnt;++i) dp[i]=bit.query(p[i].y-1)+1,bit.update(p[i].y,dp[i]);
	for(int i=1;i<=cnt;++i) (ans+=dp[i])%=mod;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 2688
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    print(max(A + B, A - B, A * B))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
def insertionSort(a,n):
	for i in range(n):
		v=a[i]
		j=i - 1
		while j>=0 and a[j]>v:
			a[j+1]=a[j]
			j=j-1
		a[j+1]=v
		print(' '.join(map(str,a)))

n = int(input())
a = list(map(int,input().split()))
insertionSort(a,n)



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

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

#define vt          vector
#define sz(x)       (int)(x).size()
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define fi          first
#define se          second

signed main() {
    ios::sync_with_stdio(0), cin.tie(0);

    int n, s, t;
    cin >> n >> s >> t;
    s--, t--;
    if (n == 2) return cout << 0, 0;

    vt<vt<int>> adj(n);
    for (int i = 1; i < n; i++) {
        int u, v;
        cin >> u >> v;
        u--, v--;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    vt<int> ds(n, -1), dt(n, -1);
    auto bfs = [&](vt<int>& dist, int x) {
        dist[x] = 0;
        queue<int> q;
        q.push(x);
        while (!q.empty()) {
            int u = q.front();
            q.pop();

            for (int v : adj[u]) {
                if (~dist[v]) continue;

                dist[v] = dist[u] + 1;
                q.push(v);
            }
        }
    };
    bfs(ds, s);
    bfs(dt, t);

    int ans = 0;
    for (int i = 0; i < n; i++) {
        if (!~-sz(adj[i]) || ds[i] > dt[i]) continue;

        ans = max(ans, dt[i]);
    }
    cout << ans;
}


Measured memory_bytes: 9516
import java.util.Scanner;

class Main{
  public static void main(String args[]){
    int i,j,k,n,x,sum;
    Scanner sc = new Scanner(System.in);
    while(true){
      n = sc.nextInt();
      x = sc.nextInt();
      if(n == 0 && x == 0){
        break;
      }
      sum = 0;
      for(i = 1;i <= n - 2;i++){
        for(j = i + 1;j <= n - 1;j++){
          for(k = j + 1;k <= n;k++){
            if(i + j + k == x){
              sum += 1;
            }
          }
        }
      }
      System.out.println(sum);
    }
  }
}

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

using namespace std;

char s[101];
int  a,S,d,f,g,h,j,k,l,q,w,e,r,t,y,u,I,o,p,z,x,c,v,b,n,m;

void init()
{
	scanf("%s", s);
	int len = strlen(s);
	for (int i = 0; i < len; ++i)
	{
		if (s[i] == 'a')
		{
			a++;
		}
		else if (s[i] == 'S')
		{
			S++;
		}
		else if (s[i] == 'd')
		{
			d++;
		}
		else if (s[i] == 'f')
		{
			f++;
		}
		else if (s[i] == 'g')
		{
			g++;
		}		
		else if (s[i] == 'h')
		{
			h++;
		}		
		else if (s[i] == 'j')
		{
			j++;
		}		
		else if (s[i] == 'k')
		{
			k++;
		}		
		else if (s[i] == 'l')
		{
			l++;
		}		
		else if (s[i] == 'q')
		{
			q++;
		}		
		else if (s[i] == 'w')
		{
			w++;
		}		
		else if (s[i] == 'e')
		{
			e++;
		}		
		else if (s[i] == 'r')
		{
			r++;
		}		
		else if (s[i] == 't')
		{
			t++;
		}		
		else if (s[i] == 'y')
		{
			y++;
		}		
		else if (s[i] == 'u')
		{
			u++;
		}		
		else if (s[i] == 'I')
		{
			I++;
		}		
		else if (s[i] == 'o')
		{
			o++;
		}		
		else if (s[i] == 'p')
		{
			p++;
		}

		else if (s[i] == 'z')
		{
			z++;
		}		
		else if (s[i] == 'x')
		{
			x++;
		}		
		else if (s[i] == 'c')
		{
			c++;
		}		
		else if (s[i] == 'v')
		{
			v++;
		}		
		else if (s[i] == 'b')
		{
			b++;
		}		
		else if (s[i] == 'n')
		{
			n++;
		}		
		else if (s[i] == 'm')
		{
			m++;
		}		
	}
	if (a % 2 == 0 && S % 2 == 0 && d % 2 == 0 && f % 2 == 0 && g % 2 == 0 && h % 2 == 0 && j % 2 == 0 && k % 2 == 0 && l % 2 == 0 && q % 2 == 0 && w % 2 == 0 && e % 2 == 0 && r % 2 == 0 && t % 2 == 0 && y % 2 == 0 && u % 2 == 0 && I % 2 == 0 && o % 2 == 0 && p % 2 == 0 && z % 2 == 0 && x % 2 == 0 && v % 2 == 0 && c % 2 == 0 && b % 2 == 0 && n % 2 == 0 && m % 2 == 0)
	{
		printf("Yes\n");
	}
	else
	{
		printf("No\n");
	}
}

int main()
{

	//#ifndef ONLINE_JUDGE
		//freopen("input.txt","r",stdin);
		//freopen("output.txt","w",stdout);
	//#endif

	init();

	return 0;
}

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

struct Point {
    int x, y;

    Point() = default;
    Point(int x, int y) : x(x), y(y) {}

    Point operator+(const Point &rhs) const {
        return Point(x + rhs.x, y + rhs.y);
    }

    Point operator-(const Point &rhs) const {
        return Point(x - rhs.x, y - rhs.y);
    }

    long long operator*(const Point &rhs) const {
        return 1ll * x * rhs.x + 1ll * y * rhs.y;
    }

    long long operator%(const Point &rhs) const {
        return 1ll * x * rhs.y - 1ll * y * rhs.x;
    }
};

bool intersect(Point p1, Point p2, Point p3, Point p4) {
    if (max(p1.x, p2.x) < min(p3.x, p4.x) || max(p3.x, p4.x) < min(p1.x, p2.x)) return false;
    if (max(p1.y, p2.y) < min(p3.y, p4.y) || max(p3.y, p4.y) < min(p1.y, p2.y)) return false;
    return ((p3 - p1) % (p4 - p1)) * ((p3 - p2) % (p4 - p2)) <= 0 &&
           ((p1 - p3) % (p2 - p3)) * ((p1 - p4) % (p2 - p4)) <= 0;
}

double dist(Point p1, Point p2, Point p3, Point p4) {
    if (intersect(p1, p2, p3, p4)) return 0;
    double res = sqrt(min({(p1 - p3) * (p1 - p3), (p2 - p3) * (p2 - p3), (p1 - p4) * (p1 - p4), (p2 - p4) * (p2 - p4)}));
    if ((p1 - p3) * (p4 - p3) >= 0 && (p1 - p4) * (p3 - p4) >= 0) 
        res = min(res, abs((p1 - p3) % (p4 - p3)) / sqrt((p4 - p3) * (p4 - p3)));
    if ((p2 - p3) * (p4 - p3) >= 0 && (p2 - p4) * (p3 - p4) >= 0) 
        res = min(res, abs((p2 - p3) % (p4 - p3)) / sqrt((p4 - p3) * (p4 - p3)));
    if ((p3 - p1) * (p2 - p1) >= 0 && (p3 - p2) * (p1 - p2) >= 0) 
        res = min(res, abs((p3 - p1) % (p2 - p1)) / sqrt((p2 - p1) * (p2 - p1)));
    if ((p4 - p1) * (p2 - p1) >= 0 && (p4 - p2) * (p1 - p2) >= 0) 
        res = min(res, abs((p4 - p1) % (p2 - p1)) / sqrt((p2 - p1) * (p2 - p1)));
    return res;
}

int main() {
    int q; cin >> q;
    while (q--) {
        Point p1, p2, p3, p4;
        cin >> p1.x >> p1.y;
        cin >> p2.x >> p2.y;
        cin >> p3.x >> p3.y;
        cin >> p4.x >> p4.y;
        cout << fixed << setprecision(20) << dist(p1, p2, p3, p4) << endl;
    }
}



Measured memory_bytes: 3280
#include<iostream>

using namespace std;

int main()
{
	for(;;){
		int x, y;
		int map[100][100];
		int dp[100][100];
		
		cin >> x;
		cin >> y;
		if(x == 0 && y == 0){
			break;
		}
		
		for(int i = 0; i < y; i++){
			for(int j = 0; j < x; j++){
				cin >> map[i][j];
			}
		}
		
		//ツ鳴催渉可づ可暗ェツ氾板湘」ツづ個療アツづ個づつィツづィツ青板づーツ個按津ィ
		//0:ツ暗堋督ョツ嘉つ能
		//1:ツ湘。ツ害ツ閉ィ
		//2:ツジツδδδ督プツ妥、
		
		for(int i = 0; i < x; i++){
			dp[0][i] = map[0][i] == 0;
		}
		
		const int dx[] = {-1,0,1};
		
		for(int i = 1; i < y; i++){
			for(int j = 0; j < x; j++){
				if(map[i][j] == 0 || map[i][j] == 2){
					dp[i][j] = 0;
					for(int k = 0; k < 3; k++){
						int px = j+dx[k];
						if(px < 0 || x <= px || map[i-1][px] == 2 || (map[i][j] == 2 && dx[k] != 0)){
							continue;
						}
						dp[i][j] += dp[i-1][px];
					}
					if(i-2 >= 0 && map[i-2][j] == 2){
						dp[i][j] += dp[i-2][j];
					}
				}
				else{
					dp[i][j] = 0;
				}
			}
		}
		
		int ans = 0;
		/*
		for(int i = 0; i < y; i++){
			for(int j = 0; j < x; j++){
				cout<<dp[i][j] << " " << flush;
			}
			cout << endl;
		}
		*/
		for(int i = 0; i < x; i++){
			ans += dp[y-1][i];
			if(y-2 >= 0 && map[y-2][i] == 2){
				ans+= dp[y-2][i];
			}
		}
		
		cout << ans << endl;
	}
}

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

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

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

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



void _main() {
        int n, k; cin >> n >> k;
        double ans = 0;
        for (int res = 1; res <= n; res++) {
                int temp = res;
                double xar = 1;
                while (temp >= 1 && temp <= k - 1) {
                        temp *= 2;
                        xar /= 2;
                }


                ans += xar / n;
        }

        cout << fixed << setprecision(10) << ans;
}



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


Measured memory_bytes: 3740
#include <cstdio>

using namespace std;
bool ch[5001][5001];
int main(){
  
  while(1){
  
  int n,d[3002][2] = {0},ans = 0;
  
  
  scanf("%d",&n);
  
  if(n == 0)break;
  
  for(int i = 0;i < n;i++){
    scanf("%d%d",&d[i][0],&d[i][1]);
    ch[d[i][0]][d[i][1]] = true;
  }
  
  
  for(int i = 0;i < n;i++){
    for(int j = i + 1;j < n;j++){
      int x1 = d[i][0]; int y1 = d[i][1];
      int x2 = d[j][0]; int y2 = d[j][1];
      int po = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
      if(po <= ans) continue;
      int x3 = x2 + y2 - y1;
      int y3 = y2 + x1 - x2;
      if(x3 < 0 || x3 > 5000 || y3 < 0 || y3 > 5000 || ch[x3][y3] == false)continue;
      int x4 = x1 + y2 - y1;
      int y4 = y1 + x1 - x2;
      if(x4 >= 0 && x4 <= 5000 && y4 >= 0 && y4 <= 5000 & ch[x4][y4]){
	ans = po;
      }
    }
  }
  
  printf("%d\n",ans);
  }
      

  return 0;
}
    
    


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

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        long a = sc.nextLong();
        long b = sc.nextLong();
        if (Math.abs(b - a) % 2 == 1) {
            System.out.println("IMPOSSIBLE");
            return;
        }
        long ans = Math.min(a, b) + Math.abs(b - a) / 2;
        System.out.println(ans);
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

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


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

long long dp[100002][105];
long long a[100005];
long long w[100005];
long long v[100005];

int main()
{
    long long n , W;

    cin >> n >> W;

    long long cur = 0;

    for(long long i = 1 ; i<=n ; i++)
    {
        cin >> w[i] >> v[i];
        cur+=v[i];
    }

    long long ans = 0;

    for(int i = 1 ; i<=cur ; i++)
        for(int j = 0 ; j<=n ; j++)
            dp[i][j] = W+1;

    for(long long i = 1 ; i<=cur ; i++)
    {
        for(int j = 1 ; j<=n ; j++)
        {
            if(v[j]<=i)
            {
                dp[i][j] = min(dp[i][j-1] , dp[i-v[j]][j-1]+w[j]);
            }
            else
            {
                dp[i][j] = dp[i][j-1];
            }

            if(dp[i][j]<=W)
                ans = max(ans , i);
        }
    }

    cout <<  ans;

    return 0;
}


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

int main(){
    int a,b,c,d;
    cin >> a >> b >> c;
    if(a > b){
        d = a;
        a = b;
        b = d;
    }
    if(b > c){
        d = b;
        b = c;
        c = d;
    }
    if(a > b){
        d = a;
        a = b;
        b = d;
    }
    cout << a << " " << b << " " << c << endl;
    
    return 0;
}


Measured memory_bytes: 3112
n = int(input())
s = list(input())
l = 0
for i in range(1,n-1):
    p = list(set(s[:i]))
    q = list(set(s[i:]))
    pq = set(p) & set(q)
    k = len(pq)
    if k > l:
        l = k
print(l)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
  
using namespace std;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
#define setp(x) fixed << setprecision(x)
#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 3e5 + 555; // TL MB
const double PI = acos(-1.0);
void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}
 
void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r; 
}


void solve()
{
	int n, x, t;
	cin >> n >> x >> t;
	cout << (n + x - 1) / x * t; 
}




int main()
{
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
    // Red;
  	int T = 1;
  	// cin >> T;
  	for(int i = 1; i <= T; ++i){
  		solve();
  	}
  	return 0;

}

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

using namespace std;
using ll = long long;

#pragma GCC optimize("O3")
static const auto __ = [] {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  return nullptr;
}();

int solve() {
  int H, W;
  cin >> H >> W;
  int h, w;
  cin >> h >> w;
  return (H - h) * (W - w);
}

int main(int argc, char* argv[]) {
  cout << solve() << '\n';
  return 0;
}

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

int main() {
    int X;
    cin >> X;
    int res;
    if (X <= 599) {
        res = 8;
    } else if (X <= 799) {
        res = 7;
    } else if (X <= 999) {
        res = 6;
    } else if (X <= 1199) {
        res = 5;
    } else if (X <= 1399) {
        res = 4;
    } else if (X <= 1599) {
        res = 3;
    } else if (X <= 1799) {
        res = 2;
    } else {
        res = 1;
    }

    cout << res << endl;
}

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

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

int main() {
  int n,a,b;
  cin >> n >> a >> b;
  
  int total=0;
  for(int i=0;i<=n;i++) {
    int sum = findSumOfDigits(i);
    if(sum>=a && sum<=b) total+=i;
  }
  cout << total << endl;
  return 0;
}


Measured memory_bytes: 256
use std::cmp;
use std::collections::BinaryHeap; // 優先度付きキュー
use std::collections::HashMap; // 連想配列
use std::collections::HashSet; // 連想配列 キーのみ
use std::collections::VecDeque; // キュー or スタック
use std::io::Read;
use std::usize::MAX;

macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, [ $t:tt ]) => {{let len = read_value!($next, usize);(0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()}};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

fn solve() {
    input! {
        k: u64
    }

    let mut ans = 0;
    for i in 1..k + 1 {
        for j in 1..k + 1 {
            for k in 1..k + 1 {
                let mut tmp = gcd(i, j);
                tmp = gcd(tmp, k);
                ans += tmp;
            }
        }
    }

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

fn main() {
    let thd = std::thread::Builder::new().stack_size(104_857_600);
    thd.spawn(|| solve()).unwrap().join().unwrap();

    /*
    // 入力を一括で読み込む場合
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut input = buf.split_whitespace();

    // inputに対しnext()で読み込んでいく
    let q: usize = input.next().unwrap().parse().unwrap();
    */
}

const LARGE_PRIME: u64 = 1_000_000_007;

// @〜でsnippet
// 最大公約数
fn gcd(a: u64, b: u64) -> u64 {
    let mut aa: u64 = if a > b { a } else { b };
    let mut bb: u64 = if a > b { b } else { a };
    while bb != 0 {
        let tmp = bb;
        bb = aa % tmp;
        aa = tmp;
    }
    return aa;
}


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

#define name ""
#define ini freopen(name".inp","r",stdin); freopen(name".out","w",stdout)
#define foe(it,c) for (__typeof(c.begin()) it = c.begin(); it != c.end(); it++)
#define long long long 
#define db double 
#define pii pair <int, int>
#define pll pair <long, long>
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

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

const int N = 2e5+1;
int n, k, a[N + 1];

int main()
{
  fastio;
  cin >> k >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int mx = -INF; a[n + 1] = k + a[1];
  for (int i = 1; i <= n; i++) mx = max(mx, a[i + 1] - a[i]);
  cout << k - mx;
  return 0;
}

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

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define BIT(X,i) ((X>>i)&1)
#define REP(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define r_all(a) (a).rbegin(), (a).rend()
#define ina(x,n) rep(x_i,n) cin>>x[x_i]
#define outa(x,n) rep(x_i,n) cerr<<x[x_i]<<" \n"[x_i==n-1]

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<pll> vll;
typedef priority_queue<ll> pq;

const int MOD = 1e9+7;
const int INF = (1<<28);
const ll INFL = (1LL<<61);

ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
  return a * b / gcd(a, b);
}

int main() {
  int a, b; cin >> a >> b;
  cout << lcm(a, b) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll n,m;
  cin >> n >> m;
  vector<vector<ll>> graph(n);
  for(int i = 0;i < m;i++){
    ll a,b;
    cin >> a >> b;
    a--,b--;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  vector<pair<ll,ll>> res(n);
  for(int i = 0;i < n;i++)res[i] = make_pair(0,1000000000000);
  queue<pair<ll,ll>> que;
  int memo1 = graph[0].size();
  for(int i = 0;i < memo1;i++){
    que.push(make_pair(graph[0][i],(ll)1));
    res[graph[0][i]] = make_pair(0,1);
  }
  while(1){
    if(que.empty())break;
    pair<ll,ll> now = make_pair(que.front().first,que.front().second);
    que.pop();
    for(int i = 0;i < graph[now.first].size();i++){
    if(res[graph[now.first][i]].second > now.second + 1){
      res[graph[now.first][i]] = make_pair(now.first,now.second+1);
      que.push(make_pair(graph[now.first][i],now.second + 1));
    }
    }
  }
  cout << "Yes" << endl;
  for(int i = 1;i < n;i++)cout << res[i].first + 1 << endl;
}

Measured memory_bytes: 14432