akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
//#include <algorithm>
//#include <cstdio>
//#include <functional>
#include <iostream>
//#include <cfloat>
//#include <climits>
//#include <cstdlib>
//#include <cstring>
//#include <cmath>
//#include <map>
//#include <queue>
//#include <set>
//#include <sstream>
//#include <stack>
//#include <string>
//#include <time.h>
//#include <vector>
//#include <random>
//#include <unordered_set>
//#include <complex>
//#include <string.h>
#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define LL long long
#define pii pair<int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
using namespace std;
const LL MOD=1e9+7;
int ans,n,a[110];
/*
void dfs(int num,int s)
{
	if(num==n) return;
	int sum2=s,sum=s;
	sum+=a[num];
	if(sum%10!=0) ans=max(ans,sum);
	if(sum2%10!=0) ans=max(ans,sum2);
	dfs(num+1,sum);
	dfs(num+1,sum2);
	//cout<<"p"<<endl;
}
*/
int main()
{
	cin>>n;
	int sum=0;
	rep(i,n)
	{
		cin>>a[i];
		sum+=a[i];
	}
	sort(a,a+n);
	bool bl=0;
	if(sum%10!=0) cout<<sum;
	else
	{
		rep(i,n)
		{
			if(a[i]%10!=0) 
			{
				cout<<sum-a[i];
				bl=1;
				break;
			}
		}
		if(!bl) cout<<0;
	}
  rt0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999999;
	
	public class Node
	{
		public int Index{get;set;}
		public List<int> Edges {get;set;}
		public int Distance {get;set;}
		public bool Visited {get;set;}
	}
	
	public static void Main(string[] args)
	{
		var p = Input().ToInt();
		var n = p[0];
		var x = p[1] - 1;
		var y = p[2] - 1;
		
		var nodes = new Node[n];
		for(int i = 0; i < n; i++)
		{
			var e = new Node(){Index = i, Edges = new List<int>(), Distance = -1};
			if(i != n-1)
				e.Edges.Add((i+1)%n);
			if(i != 0)
				e.Edges.Add((i+(n-1))%n);
			nodes[i] = e;
		}
		nodes[x].Edges.Add(y);
		nodes[y].Edges.Add(x);
		
		var map = new long[n];
		for(int i = 0; i < n; i++)
		{
			BFS(nodes, i, 0);
			
			for(int j = i+1; j < n; j++)
			{
				var d = nodes[j].Distance;
				map[d]++;
			}
			for(int j = 0; j < n; j++)
				nodes[j].Distance = -1;
		}
		for(int i = 1; i < map.Length; i++)
			Console.WriteLine(map[i]);
	}
	
	static void BFS(Node[] nodes, int index, int far)
	{
		if(nodes[index].Distance != -1 && nodes[index].Distance <= far)
			return;
		nodes[index].Distance = far;
		foreach(var k in nodes[index].Edges)
		{
			BFS(nodes, k, far + 1);
		}
	}
	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str, int offset = 0)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt() + offset;
		return r;
	}
}

Measured memory_bytes: 13484
#include<stdio.h>

int n, arr[303], cnt[3];
double N, dp[303][303][303];

double solve(int a, int b, int c)
{
	if(a<0.0 || b<0.0 || c<0.0) return -1.0;
	if(dp[a][b][c]!=-1) return dp[a][b][c];
	double curr=0;
	double tot=a+b+c;
	double A = solve(a-1, b, c); 
	double B = solve(a+1, b-1, c);
	double C = solve(a, b+1, c-1);
	curr += (A + 1.0)*(a/N);
	curr += (B + 1.0)*(b/N);
	curr += (C + 1.0)*(c/N);
	curr += 1.0 - tot/N;
	curr*=n/tot;
	dp[a][b][c]=curr;
//	printf("%d %d %d - %0.9lf\n", a, b, c, dp[a][b][c]);
	return curr;
}
signed main()
{
	for(int i = 0; i < 303; i++) for(int j = 0; j < 303; j++) for(int k = 0; k < 303; k++) dp[i][j][k]=-1;
	scanf("%d", &n);
	N=n;
	for(int i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
		cnt[arr[i]-1]++;
	}
	dp[0][0][0]=0;
	double ans = solve(cnt[0], cnt[1], cnt[2]);
	printf("%0.8lf", ans);
}

Measured memory_bytes: 217600
#include <bits/stdc++.h>//復習必須
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
    int N;
    long long top[5]={};
    long long answer=0;
    std::string str;
 
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>str;
        if(str[0]=='M'){
            top[0]++;
        }
        else if(str[0]=='A'){
            top[1]++;
        }
        else if(str[0]=='R'){
            top[2]++;
        }
        else if(str[0]=='C'){
            top[3]++;
        }else if(str[0]=='H'){
            top[4]++;
        }
 
    }
 
    for(int i=0;i<=2;i++){
        for(int j=i+1;j<=3;j++){
            for(int k=j+1;k<=4;k++){
                answer+=top[i]*top[j]*top[k];
            }
        }
    }
    cout<<answer<<endl;
    return 0 ;
}

 


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

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define co(x) cout << (x) << "\n"
#define pb push_back
#define Never
#define To

using namespace std;

int main(){

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

	long long N, M;

	cin >> N >> M;

	long long A[M], B[M];

	for(int i = 0; i < M; i++){
		cin >> A[i] >> B[i];
	}

	sort(A, A+M);
	sort(B, B+M);

	cout << max(0LL, min(N, B[0]) - A[M-1] + 1) << endl;

	Never To return 0;
}


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

int main()
{
    int n;
    cin >> n;
    rep2 (x, 1, n+1) {
        int res = 0;
        rep2(i, 1, sqrt(n)+1) {
            if (i * i > x) break;
            rep2 (j, i, sqrt(n)+1) {
                if (i * i + j * j > x) break;
                rep2 (k, j, sqrt(n)+1) {
                    int p = i * i + j * j + k * k + i * k + j * k + i * j;
                    if (p > x) break;
                    if (p == x) {
                        if (i == j && j == k) res++;
                        else if (i != j && i != k && j != k) res += 6;
                        else res += 3;
                    }
                }
            }
        }
        cout << res << endl;
    }
    return 0;
}

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

int abs(int i)
{
  return ( i < 0 ? -i : i );
}
int km_to_yen(int km)
{
  switch(km)
  {
  case 5:
    return 250;
  case 6:
    return 300;
  case 7:
    return 350;
  case 10:
    return 400;
  case 12:
    return 450;
  case 13:
  case 15:
    return 500;
  case 17:
  case 18:
  case 20:
    return 600;
  case 23:
    return 700;
  case 25:
    return 850;
  case 30:
    return 1000;
  case 35:
  case 37:
    return 1150;
  case 40:
    return 1300;
  case 43:
  case 45:
    return 1350;
  case 52:
    return 1500;
  case 58:
    return 1650;
  }
}

int main()
{
  int ic_km[8] = { 0, 0, 6, 13, 18, 23, 43, 58, };
  while (true)
  {
    int from_num;
    int from_hour, from_min;
    cin >> from_num;
    if ( from_num == 0 ) break;
    cin >> from_hour >> from_min;
    int from_time = from_hour*100 + from_min;

    int to_num;
    int to_hour, to_min;
    cin >> to_num;
    cin >> to_hour >> to_min;
    int to_time = to_hour*100 + to_min;

    int km_diff = abs(ic_km[to_num] - ic_km[from_num]);
    int fare = km_to_yen(km_diff);
    if ( ( ( 1730 <= from_time && from_time <= 1930 ) ||
           ( 1730 <= to_time   && to_time   <= 1930 ) ) &&
         ( km_diff <= 40 ) )
    {
      fare /= 2;
      if ( fare % 50 != 0 )
      {
        fare = ( fare / 50 + 1 ) * 50;
      }
    }
    cout << fare << endl;
  }
}

Measured memory_bytes: 1160
#include <stdio.h>

int main(void)
{
	int b, f, r, v, n, count_1, count_2, count_3, data[4][3][10];

	for (count_1 = 0; count_1 < 4; count_1++)
	{
		for (count_2 = 0; count_2 < 3; count_2++)
		{
			for (count_3 = 0; count_3 < 10; count_3++)
			{
				data[count_1][count_2][count_3] = 0;
			}
		}
	}

	scanf("%d", &n);

	for (count_1 = 0; count_1 < n; count_1++)
	{
		scanf("%d %d %d %d", &b, &f, &r, &v);

		data[b - 1][f - 1][r - 1] = data[b - 1][f - 1][r - 1] + v;
	}

	for (count_1 = 0; count_1 < 4; count_1++)
	{
		for (count_2 = 0; count_2 < 3; count_2++)
		{
			for (count_3 = 0; count_3 < 10; count_3++)
			{
				printf(" %d", data[count_1][count_2][count_3]);
			}

			printf("\n");
		}
		if (count_1 < 3)
		{
			printf("####################\n");
		}
	}
	return 0;
}


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

#define rep(i, n) for(int i = 0; i < (n); i++)
using LL = long long;
using ULL = unsigned long long;


void solve() {
	int n; cin >> n;
	int l; cin >> l;
	int a[100000]; rep(i, n) cin >> a[i];

	int p = -1;
	rep(i, n - 1) {
		a[i] += a[i + 1];
		if (a[i] >= l) p = i;
	}
	if (p == -1) { cout << "Impossible" << endl; return; }

	cout << "Possible" << endl;
	for (int i = 0; i < p; i++) {
		cout << i + 1 << endl;
	}
	for (int i = n - 2; i >= p; i--) {
		cout << i + 1 << endl;
	}
}

int main() {

	solve();

	return 0;
}


Measured memory_bytes: 1152
from fractions import gcd
a,b,c,d = map(int,input().split())
ans = b - a + 1#ok
a -= 1#ok

g = gcd(c,d)
temp = c*d//g

cc = -int(a//c) + int(b//c)
dd = -int(a//d) + int(b//d)
cd = -int(a//temp) + int(b // temp)

print(ans - cc - dd + cd)

Measured memory_bytes: 5052
#include <iostream>
#include <vector>
#include <string>
using namespace std;

int gcd(int p, int q) {
    if (p % q == 0) return q;
    return gcd(q, p % q);
}

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

    long long sum = 0;
    for (int i = 1; i <= K; i++) {
        int numGcd = 0;
        for (int j = 1; j <= K; j++) {
            numGcd = gcd(i, j);
            for (int k = 1; k <= K; k++) {
                sum += gcd(numGcd, k);
            }
        }
    }

    cout << sum << endl;

    return 0;
}

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

int main() {
	string s;
	cin >> s;
	bool r = false;
	for (int i = 0; i < s.length(); i++) {
		r |= (s[i] == 'A' && s[i + 1] == 'C');
	}
	cout << (r ? "Yes" : "No") << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;
const int MAX_N = 21;

int main(){
  int N;
  int ans = 0;
  int V[MAX_N], C[MAX_N], D[MAX_N];
  cin >>N;
  for(int i=0; i<N; i++)
  {
    cin >> V[i];
  }
  for(int i=0; i<N; i++)
  {
    cin >> C[i];
    D[i] = V[i] -C[i];
    if(D[i] > 0){ans += D[i];}
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
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; }
const ll MOD = 1e9+7;

ll DPX[100100];
ll DPY[100100];
int main(){
    string L;
    cin >> L;

    int N = L.length();

    DPX[0] = 2;
    DPY[0] = 1;
    for(int i = 1; i < N; i++){
        char c = L[i]; 
        if(c == '1'){
            DPX[i] = 2*DPX[i-1];
            DPY[i] = 3*DPY[i-1] + DPX[i-1];
        }
        else{
            DPX[i] = DPX[i-1];
            DPY[i] = 3*DPY[i-1];
        }
        DPX[i] %= MOD;
        DPY[i] %= MOD;
    }

    ll ans = 0;
    ans = DPX[N-1] + DPY[N-1];

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


Measured memory_bytes: 2048
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n + 1];
        for (int i = 0; i < n - 1; i++) {
            int tmp = sc.nextInt();
            a[tmp]++;
        }
        for (int i = 1; i < a.length; i++) {
            System.out.println(a[i]);
        }
    }
}

Measured memory_bytes: 60644
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> pii;
#define rep(i, start, n) for (int i = (int)(start); i < (int)(n); ++i)
#define all(a) a.begin(), a.end()

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

int main(){
    string S;    
    int N;
    cin >> S;
    N = S.size();
    ll ans = 0;
    rep(i, 0, 1<<N){
        ll st = 0;
        rep(j, 0, N){
            if ((i>>j)&1){
                st = st*10 + (S[j] - '0');
            }
            else{
                ans += st;
                st = 0;
            }
        }
        ans += st;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3608
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);

        String str = s.next();

        int length = str.length();

        System.out.print(String.valueOf(str.charAt(0)) +
                (length-2) +
                String.valueOf(str.charAt(length-1)));
    }
}

Measured memory_bytes: 22868
//Relive your past life.
//Face your demons.
//The past is never dead,it is not even past.
//The memories are not only the key to the past but...also to the future.
//coded in Rusty Lake
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#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>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  1000000007
using namespace std;
int T;
ll a,b,c,d;
int main(){
    cin>>T;
    while(T--){
        cin>>a>>b>>c>>d;
        if(a<b||d<b){
            puts("No");
            continue;
        }
        if(c>=b-1){
            puts("Yes");
            continue;
        }
        ll e=__gcd(b,d);
        a=a-(a-c-1)/e*e;
        if(a<b)puts("No");
        else puts("Yes");
    }
	//system("pause");
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>
#include<set>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define PB(a,n) FOR(i,0,n){ll buf; scanf("%lld",&buf); a.pb(buf); }
#define LOWER(a,x) lower_bound(ALL(a), x) - a.begin() - 1;
#define COUNT(a,x)  upper_bound(ALL(a), x) - lower_bound(ALL(a), x);
#define MCOUNT(a,x,y) upper_bound(ALL(a), y) - lower_bound(ALL(a), x);
#define INF 111111111111111111
#define MOD 1000000007
#define pb push_back
#define F first
#define S second
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
ll n = 0, m = 0, ans = 0, sum = 0, cnt = 0, tmp = 0, ma = 0, mi = 0;
string s;
bool flag, ok;
ll dx[4] = { 1,-1,0,0 }, dy[4] = { 0,0,1,-1 };
ll ddx[8] = { 1,-1,0,0,1,1,-1,-1 }, ddy[8] = { 0,0,1,-1,1,-1,1,-1 };
#pragma endregion
#define MAX 111111


ll a[MAX];
int main(void) {
  ll x, y;
  priority_queue<ll> pq;
  cin >> n;
  FOR(i, 0, n) {
	cin >> tmp;
	a[tmp]++;
  }
  FOR(i, 0, MAX) if (a[i] > 1) pq.push(a[i]);
  ans = n;
  
  while (!pq.empty()) {
	x = pq.top();
	pq.pop();
	if (pq.empty()) {
	  ans -= (x / 2) * 2;
	  break;
	}
	y = pq.top();
	pq.pop();
	x--; y--;
	if (x != 1) pq.push(x);
	if (y != 1) pq.push(y);
	if (y < 0) break;
	ans -= 2;
  }
  cout << ans << endl;


  return 0;
}

Measured memory_bytes: 1280
#include<stdio.h>
int main() {
  int i, f = -1, s = -1, t = -1, n;
  for (i = 0; i < 10; i ++) {
    scanf("%d", &n);
    if (n >= f) {
      t = s; s = f; f = n;
    } else if (n >= s) {
      t = s; s = n;
    } else if (n >= t) {
      t = n;
    }
  }
  printf("%d\n%d\n%d\n", f, s, t);
  return 0;
}

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

#define ll long long
#define ldb long double
#define rep(i, x, n, j) for(int i=x;i<(int)n;i+=j)
#define F first
#define S second
#define per(i, x, n, j) for(int i=(int)n-1;i>=0;i-=j)
#define all(v) v.begin(),v.end()
#define sz(a) (int)a.size()

const int N = 2000100;
const ll MOD = 1e9+7;
const ll inf = 1e18+5;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;

int _;

ll fxn(ll n){
	return (((n-1)*n)/2)%MOD;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n, k; cin >> n >> k;
	ll a[n];
	rep(i,0,n,1) cin >> a[i];
	vector<ll> b(n);
	for(int i=0; i<n; ++i){
		ll counter=0;
		for(int j=i+1; j<n; ++j){
			if(a[j]<a[i]) ++counter;
		}
		b[i]=counter;
	}

	vector<ll> c(n);
	for(int i=0; i<n; ++i){
		ll counter=0;
		for(int j=0; j<n; ++j){
			if(a[j]<a[i]) ++counter;
		}
		c[i]=counter;
	}

	ll ans = 0;
	rep(i,0,n,1){
		ans += ((c[i]*fxn(k))%MOD)+((b[i]*k)%MOD);
		ans %= MOD;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;

ll mod(ll x){
    ll res=x%MOD;
    return res+(res<0?MOD:0);
}
ll inv(ll x){
    ll b=MOD,u=1,v=0;
    while(b){
        ll t=x/b;
        x-=t*b;swap(x,b);
        u-=t*v;swap(u,v);
    }
    return mod(u);
}
vector<ll> prods(int x){
    vector<ll> res(x+1);
    res[0]=1;
    for(int i=1; i<=x; i++)res[i]=mod(i*res[i-1]);
    return res;
}
vector<ll> pows(ll a,int x){
    vector<ll> res(x+1);
    res[0]=1;
    a=mod(a);
    for(ll i=1; i<=x; i++)res[i]=mod(a*res[i-1]);
    return res;
}
ll power(ll a, ll n){
    ll res=1;
    a=mod(a);
    for(;n>0;n>>=1){
        if(n&1)res=mod(res*a);
        a=mod(a*a);
    }
    return res;
}

vector<ll> p;//p=prods(MAX_n)
ll comb(ll a, ll b){
    ll ans = 1;
    for(ll i=0; i<b; i++){
        ans = mod(mod(ans*(a-i))*inv(b-i));
    }
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,a,b;cin>>n>>a>>b;

    //2^n-1からa,bほんのやつを引く
    ll ans = power(2,n)-1;
    cout<<mod(ans-comb(n,a)-comb(n,b));
    return 0;
}

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

int main(){
  string S;
  cin>>S;
  int N;
  N=S.length();
  string ss;
  int a;
  int num;
  num=1000000;
  for (int i=0;i<N-2;i++){
    ss=S.substr(i,3);
    a=atoi(ss.c_str());
    if (abs(a-753)<num){
      num=abs(a-753);
    }
  }
  cout<<num;
  return 0;
}

Measured memory_bytes: 256
N = int(input())
S = input()
ans = 0

for n in range(N-1):
  c = 0
  A = list(set(S[:n+1]))
  B = list(set(S[n+1:]))
  for a in A:
    if a in B:
      c+=1
  ans = max(ans,c)
  
print(ans)

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

using namespace std;

int main() {
  int n, l[200], ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n * 2; i++) {
    scanf("%d", &l[i]);
  }
  sort(l, l + n * 2);
  reverse(l, l + n * 2);
  for (int i = 0; i < n * 2; i++) {
    if (i % 2) {
      ans += l[i];
    }
  }
  printf("%d\n", ans);
  return 0;
}

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

typedef long long ll;
const int MOD = 1e9 + 7;

ll sum (ll l, ll r) {
  return (l + r) * (r - l + 1) / 2;
}

int main() {
  int n, k;
  cin >> n >> k;
  ll ans = 0;
  for (int i = k; i <= n + 1; i++) {
    ll l = sum(0, i - 1);
    ll r = sum(n - i + 1, n);
    ans += (r - l + 1);
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3580
N, T = map(int,input().split())
c = list()
t = list()
for _ in range(N):
    ci, ti = map(int, input().split())
    c.append(ci)
    t.append(ti)

ans = 100000
for i in range(N):
    if t[i] <= T:
        ans = min(ans, c[i])

if ans == 100000:
    print('TLE')
else:
    print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(x) (x).begin(),(x).end()
#define dup(x,y) (((x)+(y)-1)/(y))
#define sz(x) (int)(x).size()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main(){
    string s;
    cin >> s;
    if(s[0] != s[1] && s[0] != s[2] && s[1] != s[2]) puts("Yes");
    else puts("No");
    return 0;
}

Measured memory_bytes: 256
# import numpy as np
import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    A,B,H,M = map(int,input().split())

    temp1 = (H * 60 + M) / 2
    temp2 = M * 6

    if temp1 >= temp2:
        theta = temp1 - temp2
    else:
        theta = temp2 - temp1

    if theta == 0:
        res = max(A-B,B-A)
    else:
        res = A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(theta))
        # print(res)
        res = math.sqrt(res)

    # print(math.cos(math.radians(theta)))

    print(res)



main()


Measured memory_bytes: 9516
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;


int N,M;
int tmp[10],tmp2[10];
int count(int k){
    int sum=0;
    while(k>0){
        sum+=k&0x1;
        k=k/2;
    }
    return sum;
    
}

bool jud(int k){
    for(int i=0;i<M;i++){
        int a;
        a=k&tmp[i];
        if(count(a)%2!=tmp2[i])return 0;
    }
    return 1;
}

int main(void){
    cin >> N >> M;
    for(int i=0;i<M;i++){
        int k;
        cin >> k;
        tmp[i]=0;
        for(int j=0;j<k;j++){
            int s;
            cin >> s;
            tmp[i]=tmp[i]|(0x1<<(s-1));
        }
    }
    for(int i=0;i<M;i++){
        int p;
        cin >> p;
        tmp2[i]=p;
    }
    int sum=0;
    for(int i=0;i<pow(2.0,N);i++){
        if(jud(i))sum++;
    }
    cout << sum <<endl;
    return 0;
}

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

#define ll long long


int main(){

    int N, cnt = 0;
    cin >> N;
    vector<int> H, A;
    for(int i=0;i<N;i++){
        int a; cin >> a; H.push_back(a);
    }
    for(int i=0;i<N-1;i++){
        if(H[i] >= H[i+1]){
            cnt += 1;
        }else{
            cnt = 0;
        }
        if(cnt >= 1){
            A.push_back(cnt);
        }
    }
    if(A.empty()){
        cout << 0 << endl;
        return 0;
    }
    cout << *max_element(A.begin(), A.end()) << endl;
}    

Measured memory_bytes: 1400
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ in >> p.first >> p.second; return in; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
template <char d = ' ', class T>
ostream& operator << (ostream& out, vector<T>& v){ for(auto& e : v){ out << e << d; } return out; }

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> as(n), bs(n);
    cin >> as >> bs;
    int ans = 0;
    for(int i = 28; i >= 0; i--){
        for(auto& a : as){ a &= (2 << i) - 1; }
        for(auto& b : bs){ b &= (2 << i) - 1; }
        sort(as.rbegin(), as.rend());
        sort(bs.begin(), bs.end());
        auto xx = bs.begin(), yy = xx, zz = xx;
        int num = 0;
        for(auto& a : as){
            xx = lower_bound(xx, bs.end(), (1 << i) - a);
            yy = lower_bound(yy, bs.end(), (2 << i) - a);
            zz = lower_bound(zz, bs.end(), (3 << i) - a);
            int x = xx - bs.begin();
            int y = yy - bs.begin();
            int z = zz - bs.begin();
            // int x = lower_bound(bs.begin(), bs.end(), (1 << i) - a) - bs.begin();
            // int y = lower_bound(bs.begin(), bs.end(), (2 << i) - a) - bs.begin();
            // int z = lower_bound(bs.begin(), bs.end(), (3 << i) - a) - bs.begin();
            num += y - x + n - z;
        }
        ans |= num & 1 ? 1 << i : 0;
    }
    cout << ans << '\n';
}


Measured memory_bytes: 1792
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

S = input()

print(S[:3])

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

int main() {
        string str1, str2;
        int i, n, p1, p2;
        cin >> n;
        p1 = 0;
        p2 = 0;
        for(i = 0; i < n; i++) {
                cin >> str1 >> str2;
                if(str1 > str2) p1 += 3;
                else if(str1 < str2) p2 += 3;
                else {
                        p1++;
                        p2++;
                }
        }
        cout << p1 << " " << p2 << endl;
        return 0;
}

Measured memory_bytes: 3080
k, a, b = map(int, input().split())
if k < a or a >= b - 1:
    print(k + 1)
elif k % 2 == a % 2:
    print((b - a) * ((k - a + 1) // 2) + a + 1)
else:
    print((b - a) * ((k - a + 1) // 2) + a)


Measured memory_bytes: 2940
N = int(input())
p = list(map(int, input().split()))

max_n = p[0]
min_n = p[0]
ans = 1

for i in range(1, N):
    # print("max", max_n, "min", min_n,"p[i]", p[i])
    if min_n >= p[i]:
        ans += 1
        min_n = p[i]
    # else:
        # max_n = p[i]

print(ans)

Measured memory_bytes: 24744
N, K = map(int, input().split())
H = list(map(int, input().split()))
dp = [10**9+1] * N
dp[0] = 0

for n in range(N):
    for k in range(n+1, min(n+K+1, N)):
        dp[k] = min(dp[k], dp[n] + abs(H[k] - H[n]))

print(dp[N-1])


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

int main() {
  string N;
  cin >> N;
  if (N[0] == N[1] && N[1] == N[2]){
    cout << "Yes" << endl;

  }
  else if (N[1] == N[2] && N[2] == N[3]){
    cout << "Yes" << endl;

  }
  else{
   cout << "No" << endl;
  }
}


Measured memory_bytes: 256
line = gets.split(' ')
N = line[0].to_i
M = line[1].to_i

array = Array.new(40, 0)

for i in 1..N do
    line = gets.split(' ')
    k = line[0].to_i
    for j in 1..k do
        array[line[j].to_i] += 1
    end
end

ret = 0
for i in 1..M do
    if array[i] == N then
        ret += 1
    end
end

puts ret


Measured memory_bytes: 1788
#include<bits/stdc++.h>
#define rep(i, n, k) for(int i=k; i<n; ++i)
using namespace std;

vector<int> to[200005];
vector<int> ans;

void dfs(int, int);

int main(){
  int n, q;
  cin >> n >> q;
  ans.resize(n);
  
  rep(i,n-1,0){
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  
  rep(i,q,0){
    int s, t;
    cin >> s >> t;
    s--;
    ans[s] += t;
  }
  dfs(0,-1);
  rep(i,n,0) cout << ans[i] << endl;
}
    
void dfs(int x, int y){
  rep(i,to[x].size(),0){
    int u = to[x][i];
    if(u == y) continue;
    ans[u] += ans[x];
    dfs(u, x);
  }
}

Measured memory_bytes: 26624
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

#define MAX_N 2000005
ll inv[MAX_N], fac[MAX_N], finv[MAX_N];
void make() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for(int i=2; i<MAX_N; i++) {
    inv[i] = mod - inv[mod%i] * (mod/i) % mod;
    fac[i] = fac[i-1] * (ll)i % mod;
    finv[i] = finv[i-1] * inv[i] % mod;
  }
}
ll perm(ll n, ll r) {
  if(n < 0)       return 0;
  else if(n < r)  return 0;
  else            return (fac[n] * finv[n-r]) % mod;
}
ll comb(ll n, ll r) {
  ll ans = 1;
  ans = perm(n, r);
  ans = (ans * finv[r]) % mod;
  return ans;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  make();
  int n; cin >> n;
  vector<int> A(n+1); rep(i, n+1) cin >> A[i];
  map<int, vector<int>> pos;
  rep(i, n+1) pos[A[i]].push_back(i);
  int p1, p2;
  for(auto ele: pos) {
    if(ele.second.size() == 2) {
      p1 = ele.second[0];
      p2 = ele.second[1];
    }
  }
  if(n == 1) {
    cout << 1 << endk << 1 << endk;
    return 0;
  }
  for(int i=1; i<=n+1; i++) {
    ll ans = 0;
    if(i <= n-1) (ans += comb(n-1, i)) %= mod;
    if(i >= 2) (ans += comb(n-1, i-2)) %= mod;
    if(i <= n) (ans += comb(n-1, i-1) * 2 - comb(p1+n-p2, i-1) + mod) %= mod;
    cout << ans << endk;
  }
  return 0;
}


Measured memory_bytes: 61504
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

#define MAX_V 1000000

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  string rsl = "";
  rep(i, 0, n) {
      rsl = rsl + s[i] + t[i];
  }
  cout << rsl << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int minAm(int a, int b)
{
	int reval;
	if (a < b) reval = a;
	else reval = b;
	return reval;
}
int main()
{
	int N, A, B;
	scanf("%d%d%d", &N, &A, &B);
	int res = minAm(N*A, B);
	printf("%d\n", res);
	return 0;
}

Measured memory_bytes: 128
def main():
  N = int(input())
  t = input().split(" ")
  a = [0] + [int(i) for i in t] + [0]
  
  d = []
  dd = []
  sum = 0
  for i in range(N+1):
    d.append(abs(a[i] - a[i+1]))
    if i != 0:
      dd.append(abs(a[i-1] - a[i+1]))
    sum += d[i]
  for i in range(N):
    print(sum - d[i] - d[i+1] + dd[i])
main()

Measured memory_bytes: 23048
#include <bits/stdc++.h>
using namespace std;
const int nmax=1000;
bool ap[nmax+5];
int n;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        int a;
        cin>>a;
        ap[a]=1;
    }
    int s=0;
    for(int i=0;i<=nmax;i++)
        if(ap[i]==1)
            s++;
    cout<<s;
    return 0;
}
/**
**/


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define E(a) begin(a), end(a)
#define ER(a, r) begin(a), begin(a) + r
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int l, p;
	string a;
	cin >> l >> p >> a;
	a.replace(p - 1, 1, 1, (char)(a.c_str()[p - 1] + 32));
	cout << a << '\n';
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cstdio>
#include <cmath>
using namespace std;

int n;
int a[100000];

signed main() {
	int i;
	bool oddFlag = false;
	
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] % 2) oddFlag = true;
	}
	if (oddFlag) cout << "first" << endl;
	else cout << "second" << endl;
	return 0;
}

Measured memory_bytes: 640
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

long long int N, M, K, H, W, L, R;
//int N, M, K, H, W, L, R;



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

	cin >> N >> M;
	if (N <= 0 && M >= 0) {
		cout << "Zero\n";
		return 0;
	}
	if (N >= 1) {
		cout << "Positive\n";
		return 0;
	}
	if ((M - N) & 1) {
		cout <<"Positive\n";
		return 0;
	}
	cout << "Negative\n";
	return 0;
};

Measured memory_bytes: 256
#include <stdio.h>

int main(){

  int a, b, i;
  i = 3000;

  while(i != 0){
    scanf("%d %d", &a, &b);
    if ( a==0 && b==0 ){
      break;
    }

    if ( a > b ){
      printf("%d %d\n", b, a);
    }  else {
      printf("%d %d\n", a, b);
    }

    i--;
  }

  return 0;
}

Measured memory_bytes: 600
#include<stdio.h>
#define N 100
#define MAX 1000

int main(){
  int i,j,k,n,A[N],key;
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  for(i=0;i<n-1;i++){
    printf("%d ",A[i]);
  }
  printf("%d\n",A[n-1]);

  for(j=1;j<n;j++){
    key=A[j];
    i=j-1;
    while(i>=0 && A[i]>key){
      A[i+1]=A[i];
      i--;
    }
    A[i+1]=key;

    for(k=0;k<n-1;k++){
      printf("%d ",A[k]);
    }
    printf("%d\n",A[n-1]);

  }
  
  return 0;
}
    
    



Measured memory_bytes: 2124
#include<cstdio>
int H,W,A[2010][2010],h[2010],l[2010],stk[2010];
char S[2010][2010];
void cmax(int&a,int b){b>a?a=b:1;}
int main(){
	scanf("%d%d",&H,&W);
	for(int i=0;i<H;i++){
		scanf("%s",S[i]);
		for(int j=0;j<W;j++){
			S[i][j]=S[i][j]=='#';
			if(i&&j)A[i][j]=S[i][j]^S[i][j-1]^S[i-1][j]^S[i-1][j-1]^1;
		}
	}
	int ans=H>W?H:W;
	for(int i=1;i<H;i++){
		int*tp=stk;
		for(int j=1;j<=W;j++){
			h[j]=A[i][j]?h[j]+1:0;
			for(;tp>stk&&h[*tp]>=h[j];--tp)
				cmax(ans,(j-l[*tp])*(h[*tp]+1));
			l[j]=*tp;
			*++tp=j;
		}
	}
	printf("%d\n",ans);
}

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

int main() {
  vector<bool> primes(123456 * 2 + 1, true); // one based
  primes[1] = false;
  vector<int> primeSums(123456 * 2 + 1, 0);
  for(int n = 2; n < primes.size() / 2; ++n) if(primes[n]) for(int k = 2; k * n < primes.size(); ++k) primes[n * k] = false;
  for(int i = 1; i < primes.size(); ++i) primeSums[i] = primeSums[i - 1] + primes[i];
  int n;
  while(cin >> n, n) cout << primeSums[n * 2] - primeSums[n] << endl;
  return 0;
}

Measured memory_bytes: 2064
#include <bits/stdc++.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
using namespace std;
using ll = long long;


int main(void){
    // 文字列受け取ってソートして
    // ソート結果一緒ならアナグラム
    int n; cin >> n;
    vector<string> S(n);
    set<string> stst{}; // ダブりがあるかどうかの判定に使ってる
    map<string, ll> stnum; // 何種類の文字列があって、それぞれ何回観測されているか
    map<string, ll> stprs; // 何種類の文字列があって、それぞれで何pairs作れるか

    for(int i=0; i<n; i++){
        // 入力してソート
        cin >> S[i];
        sort(S[i].begin(), S[i].end());

        // 新しい種類の文字列が入ってきた
        if(stst.insert(S[i]).second){
            // mapに新しい要素を追加
            // 1種類目
            stprs[S[i]] = 0;
            stnum[S[i]] = 1;
        }

        // すでに存在する文字列が入ってきた
        else if(!stst.insert(S[i]).second){
            // その文字列の観測数を1増やす
            // 1増やすんじゃないわ,それまでにある同種の文字列数足せばcombinationいらないじゃん
            // nC2なのでこの考え方が可能
            stprs[S[i]] += stnum[S[i]];
            stnum[S[i]] += 1;
        }
    }

    ll ans=0;
    // ~~combinationの総和~~ いらなくなった
    // autoはc++11以降
    for(auto itr=stprs.begin(); itr!=stprs.end(); ++itr){
        // itr->secondで、mapの値を取ってこれる
        ans += itr->second;
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 38528
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define pb push_back
#define sz(x) (int)(x).size()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;


int main() {
  int a, b;
  cin >> a >> b;
  if(b%a==0){
    cout << a+b << endl;
    return 0;
  }
  cout << b-a << endl;
  return 0;
}

Measured memory_bytes: 256
import Control.Applicative
import Control.Monad
main = do
    ss <- string2int <$> getLine
    putStrLn $ show ( ans ss )

ans::Int -> Int
ans x
  | x == 0 = 1
  | x == 1 = 2
  | x == 2 = 1
  | otherwise = 0
string2int str = read str :: Int -- string2int ??? string to int ?????\

Measured memory_bytes: 3668
# import sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))

u = [i+1 for i in range(26)]
ans = []
for i in range(365):
    ans.append(u[i%26])
for i in range(365):
    print(ans[i])




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

using namespace std;

const int INF = 1001001001;

int main()
{
	int T;

	while (scanf("%d", &T) && T){
		int t[30];
		for (int i = 0; i < T; i++) scanf("%d", t + i);

		int N;
		int L[128];

		fill(L, L + 128, INF);
		scanf("%d", &N);
		for (int i = 0; i < N; i++){
			int x, y;
			scanf("%d %d", &x, &y);
			L[x] = min(L[x], y);
		}

		int dp[128][30];
		for (int i = 0; i < 128; i++) fill(dp[i], dp[i] + T, INF);

		dp[0][T - 1] = 0;
		for (int i = 1; i <= 100; i++){
			for (int j = 0; j < T; j++){
				if (t[(j + 1) % T] <= L[i]){
					dp[i][(j + 1) % T] = min(dp[i][(j + 1) % T], dp[i - 1][j]);
					dp[i][T - 1] = min(dp[i][T - 1], dp[i - 1][j] + 1);
				}
			}
		}

		printf("%d\n", *min_element(dp[100], dp[100] + T));
	}

	return (0);
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
int b[30],c=0,i,n;
int main(){
	char a[30];
	scanf("%s",a);
	n=strlen(a);
	for(i=0;i<n;i++){
		b[a[i]-97]++;
	}
	for(i=0;i<26;i++){
//		printf("%d = %d\n",i,b[i]);
		if(b[i]>1){
			c++;
		}
	}
	if(c>=1){
		printf("no");
	}
	else{
		printf("yes");
	}
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
    int a, b, c, t = 0;
    int s[3] = { 0 };

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

    s[0] = a;
    s[1] = b;
    s[2] = c;

    for (int i = 0; i < 3; i++) {
        for (int j = i + 1; j < 3; j++) {
            if (s[i] > s[j]) {
                t = s[j];
                s[j] = s[i];
                s[i] = t;
            }
        }
    }

    if (s[0] + s[1] == s[2]) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    return 0;
}



Measured memory_bytes: 128
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		char[][] field = new char[h][];
		int wCount = 0;
		for (int i = 0; i < h; i++) {
		    field[i] = sc.next().toCharArray();
		    for (int j = 0; j < w; j++) {
		        if (field[i][j] == '.') {
		            wCount++;
		        }
		    }
		}
		int[][] counts = new int[h][w];
		ArrayDeque<Order> deq = new ArrayDeque<>();
		deq.add(new Order(0, 0, 1));
		while (deq.size() > 0) {
		    Order order = deq.poll();
		    if (counts[order.h][order.w] != 0) {
		        continue;
		    }
		    counts[order.h][order.w] = order.count;
		    if (order.h != 0 && field[order.h - 1][order.w] == '.') {
		        deq.add(new Order(order.h - 1, order.w, order.count + 1));
		    }
		    if (order.h != h - 1 && field[order.h + 1][order.w] == '.') {
		        deq.add(new Order(order.h + 1, order.w, order.count + 1));
		    }
		    if (order.w != 0 && field[order.h][order.w - 1] == '.') {
		        deq.add(new Order(order.h, order.w - 1, order.count + 1));
		    }
		    if (order.w != w- 1 && field[order.h][order.w + 1] == '.') {
		        deq.add(new Order(order.h, order.w + 1, order.count + 1));
		    }
		}
		if (counts[h - 1][w - 1] == 0) {
		    System.out.println(-1);
		} else {
		    System.out.println(wCount - counts[h - 1][w - 1]);
		}
   }
   
   static class Order {
       int h;
       int w;
       int count;
       
       public Order(int h, int w, int count) {
           this.h = h;
           this.w = w;
           this.count = count;
       }
   }
}




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

#define rep(i,n) for(int i = 0; i < n; i++)
#define REP(i,n) for(int i = 1; i < n; i++)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



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

  int n;
  cin >> n;
  set<string> st;
  rep(i,n) {
    string s;
    cin >> s;
    st.insert(s);
  }
  cout << sz(st) << endl;
}

Measured memory_bytes: 19244
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
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 });
            var abx = Sarray();
            var a = abx[0];
            var b = abx[1];
            var x = abx[2];
            var l = b / x;
            if (a == 0)
            {
                WriteLine(l + 1);
                return;
            }
            var r = (a - 1) / x;
            WriteLine(l - r);
            //Out.Flush();
        }
    }
}

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

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

    vector<string> vec;
    for (int i = 0; i < n; i++) {
        string str;
        cin >> str;
        sort(str.begin(), str.end());

        vec.push_back(str);
    }

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

    vector<int> counter(n);
    counter[0] = 0;
    for (int i = 1; i < n; i++) {
        if (vec[i] == vec[i - 1]) {
            counter[i] = counter[i - 1] + 1;
            counter[i - 1] = 0;
        } else counter[i] = 0;
    }

    long long res = 0;
    for (int i = 0; i < n; i++) {
        res += (long long) (counter[i] + 1) * counter[i] / 2;
    }

    cout << res << endl;
}


Measured memory_bytes: 6132
#include <stdio.h>

int main(void)
{
	int N, M, i, j;
	int action[1024] = {0}, dise[1024] = {0};
	
	while (1){
		scanf("%d %d", &N, &M);
		
		if (!N && !M){
			break;
		}
		
		for (i = 0; i < N; i++){
			scanf("%d", &action[i]);
		}
		
		for (i = 0; i < M; i++){
			scanf("%d", &dise[i]);
		}
		
		i = 0;
		j = 0;
		while (1){
			j += dise[i];
			j += action[j];
			
			i++;
			
			if (j >= N - 1){
				break;
			}
		}
		
		printf("%d\n", i);
	}
	
	return (0);
}

Measured memory_bytes: 608
#ifdef __APPLE__
#include <iostream>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#else
#include <bits/stdc++.h>
#endif

using namespace std;
#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())
#define tc(t) for (int tc=1; tc<=t; tc++)
typedef vector<int> VI;
typedef vector<long long int> VLLI;
typedef vector<pair<int, int> > VPI;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll, ll> PLL;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll modInverse (ll a) {ll p = mod - 2; return powmod(a, p);}
// head

bool isValid(int i, int n, vector<vector<PII>>& data) {
    for (int j = 0; j < n; j++) {
        if ((i&(1<<j))) {
            // all testimonies must be correct
            for (int t = 0; t < data[j].size(); t++) {
                if (i&(1<<(data[j][t].first-1))) {
                    if (data[j][t].second == 0)
                        return false;
                } else {
                    if (data[j][t].second == 1)
                        return false;
                }
            }
        }
    }
    return true;
}

int main() {
    int n;
    cin >> n;
    int a;
    int x, y;
    vector<vector<PII>> data(n);
    for (int i = 0; i < n; i++) {
        cin >> a;
        for (int j = 0; j < a; j++) {
            cin >> x >> y;
            data[i].push_back({x, y});
        }
    }

    int msk = (1<<n);
    int ans = 0;
    for (int i = 0; i < msk; i++) {
        if (isValid(i, n, data))
            ans = max(ans, __builtin_popcount(i));
    }
    cout << ans << "\n";
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,c=0,i;
    cin>>n;

    long long int sum=0,x;
    for(i=0;i<n;i++)
    {
        cin>>x;
        sum=sum+x;
    }
    cout<<sum-n<<endl;

}


Measured memory_bytes: 256