akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll mod=1e9+7;
int dy[]={1,-1,0,0};
int dx[]={0,0,1,-1};

int main(){
    int N,M,R;
    cin>>N>>M>>R;

    vector<int> r(R);
    for(int i=0;i<R;i++){
        cin>>r[i];
        r[i]--;
    }

    int a,b,c;
    vector<pair<int,int>> tonari[100001];
    for(int i=0;i<M;i++){
        cin>>a>>b>>c;
        tonari[a-1].push_back({c,b-1});
        tonari[b-1].push_back({c,a-1});
    }

    vector<vector<ll>> kyori(R,vector<ll>(R,-1));
    for(int i=0;i<R;i++) {
        vector<ll> dist(N, (ll)1e15);
        vector<bool> det(N, false);
        priority_queue<pair<ll,int>,vector<pair<ll,int>>,greater<>> pq;
        dist[r[i]] = 0;
        pq.push({0,r[i]});
        while (!pq.empty()) {
            pair<ll,int> pos = pq.top();
            pq.pop();
            if (det[pos.second]) continue;
            det[pos.second]=true;
            for (auto next:tonari[pos.second]) {
                if (det[next.second]) continue;
                dist[next.second] = min(dist[next.second],dist[pos.second] + (ll) next.first);
                pq.push({dist[next.second],next.second});
            }
        }
        for(int j=0;j<R;j++){
            kyori[i][j]=dist[r[j]];
        }
    }

    vector<int> via;
    for(int i=0;i<R;i++){
        via.push_back(i);
    }
    ll ans=1e15;
    do{
        ll path=0;
        for(int i=1;i<R;i++){
            path+=(ll)kyori[via[i]][via[i-1]];
        }
        ans=min(ans,path);
    }while(next_permutation(via.begin(),via.end())) ;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3528
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

int main(){
    int r, d, x;
    cin >> r >> d >> x;

    int ans = x;

    for(int i=1; i<=10; i++){
        ans = r * ans - d;
        cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    int a,b;
    cin >> a >> b;
    if(a%3==0||b%3==0||(a+b)%3==0) cout << "Possible" << endl;
    else cout << "Impossible" << endl;

}

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

int main(void){
    long long a,b,v,w,t;
    int i;
    
    scanf("%lu%lu%",&a,&v);
    scanf("%lu%lu",&b,&w);
    scanf("%lu%",&t);
    
    //if(t < 1000){
    //	t = t%1000;
    //}
    
    //printf("%lu%lu%lu%lu%lu",a,v,b,w,t);
    
    if(a > b){
    	if(a-(v*t) > b-(w*t)){
    		printf("NO");
    	}
    	else{
    		printf("YES");
    	}
    }
    else{
    	 if(a+(v*t) < b+(w*t)){
    		printf("NO");
    	}
    	else{
    		printf("YES");
    	}
    }
    
    printf("\n");
    
}

Measured memory_bytes: 1728
#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 <stdio.h>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define rep(i,a,n) for(ll i =(a);i<(n);++i)
#define urep(i,a,n) for(ll i = (a);i>=(n);--i)
#define all(x) (x).begin(),(x).end()
#define INF 1e18
typedef long long ll;
const ll MAX=510000;
const ll mod = 1e9 + 7;
using namespace std;
ll dx[4] = { 1,-1,0,0 };
ll dy[4] = { 0,0,1,-1 };
ll N,M,X,Y,A,B,C,D,Q,K,R,W,H,P,L,G;
ll ans;
string S,T;
ll h[101010];
ll y[101010];
ll a[201010];
ll c[101010];
ll k[101010];
ll b[201010];
ll d[101010];
ll t[101010];
ll p[101010];
ll n[101010];
ll l[101010];
ll r[101010];
ll v[101010];
ll s[101010];
ll x[101010];
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	else return gcd(b, a%b);
}
ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}
struct Edge{
	ll to,cost;
	 Edge(ll to, ll cost) : to(to), cost(cost) {}
};
typedef vector<vector<Edge> > AdjList;
AdjList graph;
vector<ll> dist;

struct UnionFind {
    vector<ll> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
	vector<ll> size;
    UnionFind(ll N) : par(N),size(N) { //最初は全てが根であるとして初期化
        for(ll i = 0; i < N; i++) par[i] = i;
		for(ll i = 0; i < N; i++) size[i] = 1;
    }

    ll root(ll x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }
	ll GetSize(ll x){
		return size[root(x)];
	}

    void unite(ll x, ll y) { // xとyの木を併合
        ll rx = root(x); //xの根をrx
        ll ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
		size[ry]+=size[rx];

    }

    bool same(ll x, ll y) { // 2つのデータx, yが属する木が同じならtrueを返す
        ll rx = root(x);
        ll ry = root(y);
        return rx == ry;
    }
};
ll count2[101010];
int main(){
    cin>>N>>M;
    priority_queue<ll> que;
    rep(i,0,N){
        cin>>a[i];
        que.push(a[i]);
    }
    while(M!=0){
        que.push(que.top()/2);
        que.pop();
        M--;
    }
    ans =0;
    while(!que.empty()){
        ans +=que.top();
        que.pop();
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3448
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define re cin>>
#define pr cout<<
#define in(x) scanf("%d",&x)
#define inn(x,y) scanf("%d%d",&x,&y)
#define innn(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)

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

ll ar[N];
ll cnt[N];
ll ways[N];

int main(){
    int n;
    re n;
    rep(i,n) {
        re ar[i];
        cnt[ar[i]]++;
    }
    ll sum=0;
    rep1(i,n){
        ways[i]=(cnt[i]*(cnt[i]-1))/2;
        sum+=ways[i];
    }
    rep(i,n){
        ll temp  =  (cnt[ar[i]]*(cnt[ar[i]]-1))/2;
        ll tmp  =  ((cnt[ar[i]]-1)*(cnt[ar[i]]-2))/2;
        pr sum-temp+tmp<<"\n";
    }
    return 0;
}

Measured memory_bytes: 6912
#include<bits/stdc++.h>
#define LL long long
#define dl double
template <class T>
void rd(T &x){
  x=0;T f=1;char ch=getchar();
  while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
  while(ch<='9' && ch>='0')x=x*10+ch-'0',ch=getchar();x*=f;
}
const int N=2e5+10;
using namespace std;
int n,a[N];
int main(){
 // freopen("in.txt","r",stdin);
 // freopen("o.txt","w",stdout);
 rd(n);
 for(int i=1;i<=n;i++)rd(a[i]);
 sort(a+1,a+n+1);
 int k=n-2;
 LL ans=a[n];
 for(int i=n-1;i>=1;i--){
  if(k)k--,ans+=a[i];
  if(k)k--,ans+=a[i];
 }
 printf("%lld\n",ans);
 return 0;
}
/**/

Measured memory_bytes: 4544
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

ll dp[2001][2001];

template <class T>
void chmax(T &a, T b) {
    if (b > a) a = b;
}

struct P {
    bool operator<(const P& p) const {
        return a > p.a;
    }
    int a, i;
};

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

    int n;
    cin >> n;

    vector<P> p(n);
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;

        p[i] = { a, i };
    }
    sort(p.begin(), p.end());

    dp[0][0] = 0;
    for (int j = 0; j < n; j++) {
        dp[0][j + 1] = dp[0][j] + (ll)p[j].a * (n - 1 - j - p[j].i);
    }
    for (int i = 0; i < n; i++) {
        dp[i + 1][0] = dp[i][0] + (ll)p[i].a * (p[i].i - i);
        for (int j = 0; j < n; j++) {
            int k = i + j + 1;
            if (k >= n) break;
            dp[i + 1][j + 1] = max(dp[i][j + 1] + (ll)p[k].a * (p[k].i - i), dp[i + 1][j] + (ll)p[k].a * (n - 1 - j - p[k].i));
        }
    }

    ll r = 0;
    for (int i = 0; i <= n; i++) {
        chmax(r, dp[i][n - i]);
    }

    cout << r << endl;

    return 0;
}

Measured memory_bytes: 26240
#include<bits/stdc++.h>
#define ll long long int
#define N 200005
using namespace std;

int main()
{
    string s;

    cin >> s;

    int n=s.size()-1,sz=(s.size()/2),ans=0;

    for(int i=0;i<sz;i++,n--)
    {
        if(s[n] != s[i]) ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int a, b;
        cin >> a >> b;
        if(a == 0)
            return 0;

        int ret = INT_MAX;
        for(int i=1; i*i<=a; ++i){
            if(a % i != 0)
                continue;
            for(int j=1; j*j<=b; ++j){
                if(b % j != 0)
                    continue;

                vector<int> x(4);
                x[0] = i;
                x[1] = a / i;
                x[2] = j;
                x[3] = b / j;
                sort(x.begin(), x.end());

                int tmp = 0;
                for(int k=0; k<3; ++k)
                    tmp += (x[k] - x[k+1]) * (x[k] - x[k+1]);
                ret = min(ret, tmp);
            }
        }
        cout << ret << endl;
    }
}

Measured memory_bytes: 1208
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

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

        int A = sc.nextInt();
        int B = sc.nextInt();
        int Q = sc.nextInt();
        long[] s = readArray(sc, A);
        long[] t = readArray(sc, B);
        long[] x = readArray(sc, Q);

        System.out.println(solve(s, t, x));

        sc.close();
    }

    static long[] readArray(Scanner sc, int size) {
        long[] result = new long[size];
        for (int i = 0; i < result.length; ++i) {
            result[i] = sc.nextLong();
        }

        return result;
    }

    static String solve(long[] s, long[] t, long[] x) {
        return IntStream.range(0, x.length)
                .mapToObj(i -> String.valueOf(Math.min(computeMinDistance(s, t, x[i]), computeMinDistance(t, s, x[i]))))
                .collect(Collectors.joining("\n"));
    }

    static long computeMinDistance(long[] values1, long[] values2, long start) {
        long result = Long.MAX_VALUE;
        for (Direction direction1 : Direction.values()) {
            long end1 = find(values1, start, direction1);
            if (end1 != -1) {
                for (Direction direction2 : Direction.values()) {
                    long end2 = find(values2, end1, direction2);
                    if (end2 != -1) {
                        result = Math.min(result, Math.abs(end1 - start) + Math.abs(end2 - end1));
                    }
                }
            }
        }

        return result;
    }

    static long find(long[] values, long current, Direction direction) {
        long result = -1;
        int lower = 0;
        int upper = values.length - 1;
        while (lower <= upper) {
            int middle = (lower + upper) / 2;

            if (direction == Direction.LEFT) {
                if (values[middle] < current) {
                    result = values[middle];
                    lower = middle + 1;
                } else {
                    upper = middle - 1;
                }
            } else {
                if (values[middle] > current) {
                    result = values[middle];
                    upper = middle - 1;
                } else {
                    lower = middle + 1;
                }
            }
        }

        return result;
    }
}

enum Direction {
    LEFT, RIGHT;
}

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


int main(){
  int n;
  string str;
  cin >> n >> str;
  if(n%2==0){
    int x = str.size();
    if(str.substr(0,x/2)==str.substr(x/2)){
      cout << "Yes" << endl;
    }
    else{
      cout << "No" << endl;
    }
  }
  else{
    cout << "No" << endl;
  }
}
      


Measured memory_bytes: 256
#include <bits/stdc++.h>
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 INF 0x3f3f3f3f
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
const ll mod=1000000007;
const double PI = acos(-1.0);
const double epsilon = PI / 180.0;//角度转弧度 
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;}
const int N = 1e3+10;
ll a[N];
int main() {
	int n, m;
	cin>>n>>m;
	rep(i, 0, n) scanf("%lld", &a[i]);
	sort(a, a + n);
	ll sum = 0;
	rep(i, 0, m) sum += a[i];
	cout<<sum;
	return 0;
}

Measured memory_bytes: 3700
#include <bits/stdc++.h>
#include <set> 
#include <iterator> 
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define ll long long
#define MOD 1000000007
#define nl cout<<endl
#define rt ll Q[100005]={0}
#define mp make_pair
#define test() ull t;cin>>t;while(t--)
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define oa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define ov(a) for(ll i=0;i<a.size();i++)cout<<a[i]<<" ";nl
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)


int main()
{
  
    fastio();
    int n,k;
    cin>>n>>k;
    int a[n];
    cn(a,n);
    int dp[k+1]={0};
    for(int i=0;i<a[0];i++)
    {
        dp[i]=2;
    }
    for(int i=a[0];i<=k;i++)
    {
        int f=2;
        for(int j=0;j<n;j++)
        {
            if(i-a[j]>=0)
            {
                if(dp[i-a[j]]==2)
                    f=1;
            }
        }
        dp[i]=f;
    }
    string s = "First";
    if(dp[k]==2)
        s="Second";
    cout<<s<<endl;
}


Measured memory_bytes: 640
import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
int x=sc.nextInt();
int y=sc.nextInt();
int ans=Integer.MAX_VALUE;
for (int i = 0; i <=100000; i++) {
    ans=min(ans,2*c*i+a*max(0,x-i)+b*max(y-i,0));
}
out.println(ans);
}}

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

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); //printfとかと混ぜるな！
    map<long long,int> d;
    map<long long,int> d2;
    long long n,q,tmp;
    cin>>n;
    d[0]=1;
    d2=d;
    for(long long i=0  ;i<n  ;i++){
        cin>>tmp;
        d=d2;
        for(auto itr=d.begin(); itr!=d.end() ;itr++){
            d2[itr->first+tmp]=1;
        }
    }
    cin>>q;
    for(long long i=0  ;i<q  ;i++){
        cin>>tmp;
        if (d2[tmp]){
            cout<<"yes"<<endl;
        }else{
            cout<<"no"<<endl;
        }
    }
}


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

using namespace std;

typedef long long ll;

ll dp[100010][2];

const ll MOD = 1e9 + 7;

int main(){
  string L; cin >> L;
  
  for(ll i = 0; i < 100010; i++){
    dp[i][0] = dp[i][1] = 0;}
  
  dp[0][0] = 1; int N = L.size();
    
  for(ll i = 0; i < N; i++){
    if( L[i] == '0'){
      dp[i+1][0] = dp[i][0];
      dp[i+1][1] = (3*dp[i][1]) % MOD;}
    else{
      dp[i+1][0] = (dp[i][0]* 2) % MOD;
      dp[i+1][1] = (dp[i][1] * 3 + dp[i][0] ) % MOD;}}
  
  cout << (dp[N][0] + dp[N][1] ) % MOD << endl; return 0;}
        
       
              

Measured memory_bytes: 2048
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <map>
#include <utility>
#include <numeric>
#define ll long long
#define REP(i, x) for(int (i) = 0; (i) < (x); (i) ++)
#define pi 3.1415926535
const int MOD = 1000000007;
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	ll ans = (n - m) * 100 + 1900 * m;
	REP(i, m) {
		ans *= 2;
	}
	cout << ans << endl;
	return 0;
}

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

int cnt = 0;

void merge(int *A, int left, int mid, int right) {
  int n1 = mid - left;
  int n2 = right - mid;
  int *L, *R;
  L = new int[n1+1];
  R = new int[n2+1];
  
  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] = INFTY;
  R[n2] = INFTY;
  
  int i = 0, j = 0;
  for (int k = left; k < right; k++) {
    if (L[i] <= R[j]) {
      A[k] = L[i++];
    } else {
      A[k] = R[j++];
    }
    cnt++;
  }
  
  delete[] L;
  delete[] R;
}

void msort(int *A, int left, int right) {
  if (right - left > 1) {
    int mid = (left + right) / 2;
    msort(A, left, mid);
    msort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main(void){
  int A[500000], n;
  
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  
  msort(A, 0, n);
  
  for (int i = 0; i < n; i++) {
    if (i != 0) cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << cnt << endl;
  
  return 0;
}

Measured memory_bytes: 5056
S = list(map(int,input().split()))

while 1:
 S[2] = S[2] - S[1]
 if(S[2] <= 0):
   print('Yes')
   break
 S[0] = S[0] - S[3]
 if(S[0] <= 0):
   print('No')
   break



Measured memory_bytes: 9152
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int N=2e5+10;
int a[N];
int b[N];
map <int,int>mp;
string s;
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i]>>b[i];
    sort(a+1,a+1+n);
    sort(b+1,b+1+n);
    if(n%2){
        cout<<b[(n+1)/2]-a[(n+1)/2]+1<<endl;
    }
    else{
        cout<<b[n/2]+b[n/2+1]-a[n/2]-a[n/2+1]+1<<endl;
    }
}



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

int main(){
  int n;
  cin >> n;
  int x[100];
  long long int ans=99999999;
    long long int tans = 0;
  for(int i = 0; i < n; i++){
    cin >> x[i];
  }
  for(int i = 0; i < 100; i++){
    for(int j = 0; j < n; j++){
      tans += (i-x[j])*(i-x[j]);
    }
    if(tans < ans)ans = tans;
   
    tans = 0;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
//
int sieve(int x){
  if	 (x <  2)	  { return 0; }	//素数ではない
  else if(x == 2)	  { return 1; }	//素数
  else if(x %  2 == 0){ return 0; }	//素数ではない
  
  int sqrtx = ceil( sqrt(x)+0.1 );
  for( int p=3; p<=sqrtx; p+=2 ){
    if(x % p == 0){ return 0; }		//素数ではない
  }
  return 1;							//素数
}
//
int main(){
  int x;
  scanf("%d",&x);
  for(int i=x; i<=100003; i++){
    if( sieve(i)==1 ){ printf("%d\n", i); return 0; }
  }
  return 0;
}

Measured memory_bytes: 2152
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repp(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)
#define p(s) cout << s << endl;
typedef long long LL;
template <class T>
bool contain(const std::string &s, const T &v)
{
    return s.find(v) != std::string::npos;
}

int main()
{
   char c; int cnt=0;
   rep(i,3){
       cin>>c;
       if(c=='o')cnt++;
   }
   cout << 700+100*cnt << endl;


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define mp make_pair
#define bit(n) (1LL<<(n))
#define F first
#define S second
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

int main() {
    int n;
    cin >> n;
    int d[n];
    rep(i,n)cin >> d[i];
    int sum=0;
    rep(i,n){
        rep(j,n){
            if(i==j)continue;
            else sum+=d[i]*d[j];
        }
    }
    cout << sum/2;
    


}

/*



 */



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

using namespace std;
int main(){
  int x;
  cin>>x;
  int a=0,w=0,t=0,r=0;
  for(int i=0;i<x;i++){
    string n;
    cin>>n;
    if(n=="AC")a++;
   	else if(n=="WA")w++;
    else if(n=="TLE")t++;
    else if(n=="RE") r++;
  }

  cout<<"AC x "<<a<<endl;
  cout<<"WA x "<<w<<endl;
  cout<<"TLE x "<<t<<endl;
  cout<<"RE x "<<r<<endl;
}



Measured memory_bytes: 3624
k, n = map(int, input().split())
As = list(map(int, input().split()))

maxdis = 0
for i in range(n):
  if i == 0:
    continue
  if As[i] - As[i-1] > maxdis:
    maxdis = As[i] - As[i-1]
if As[0] + k - As[n-1] > maxdis:
  maxdis = As[0] + k - As[n-1]
print(k - maxdis)
    
  

Measured memory_bytes: 26444
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	cin>>n;
	puta(n*(n-1)/2);
	return 0;
}

Measured memory_bytes: 256
n = int(raw_input())
for x in range(n) :
  edges = map(int, raw_input().split())
  a = min(edges); edges.remove(a)
  b = min(edges); edges.remove(b)
  c = edges[0]

  if a**2 + b**2 == c**2 :
    print "YES"
  else :
    print "NO"

Measured memory_bytes: 4236
#include <bits/stdc++.h>
       
using namespace std;
typedef long long ll;
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() {
  vector<string> s(3);
  for (int i = 0; i < (int)3; ++i) cin >> s[i];
  cout << "A" << s[1][0] << "C" << endl;

  return 0;
}


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

int main(){
  string s;
  string t;
  cin>>s;
  cin>>t;
  vector<vector<int>>v(26);
  for(int i=0;i<s.size();i++){
    int c=s.at(i)-'a';
    v[c].push_back(i);
  }
  for(int i=0;i<s.size();i++){
    int c=s.at(i)-'a';
    v[c].push_back(i+s.size());
  }  
  long long ans=0;
  long long cur=0;
  for(int i=0;i<t.size();i++){
    int c=t.at(i)-'a';
    
    //対象文字なし
    if(v[c].size()==0){
      cout<<-1<<endl;
      return 0;
    }  
    
    //cur以上の要素の内，一番左側の要素の位置をイテレータで返す
    //cout<<"#"<<cur<<endl;
    cur=*lower_bound(v[c].begin(),v[c].end(),cur)+1;
    //cout<<"$"<<cur<<endl;
    if(cur>=s.size()){
      cur-=s.size();
      ans+=s.size();
    }
  }
  cout<<ans+cur<<endl;
  return 0;
}


Measured memory_bytes: 4652
#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int p[n+1],c=0;
  for(int i=1;i<=n;i++)
  {
    cin>>p[i];
  }
  for(int j=2;j<n;j++)
  {
    if((p[j-1]<p[j]&&p[j]<p[j+1])||(p[j-1]>p[j]&&p[j]>p[j+1]))
    {
      c++;
    }
  }
  cout<<c;
  return 0;
}

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

using namespace std;

typedef long long ll;

const int MAX = 3e3+7;

double a[MAX], dp[MAX][MAX];

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	int n;cin>>n;
	for(int i = 1; i<=n; ++i)
		cin>>a[i];	
	dp[0][0] = 1.;
	for(int i = 1; i<=n; ++i)
		for(int j = 0; j<=i; ++j)
			if(j>0)dp[i][j] = dp[i-1][j]*(1.-a[i]) + dp[i-1][j-1]*a[i];
			else dp[i][j] = dp[i-1][j]*(1.-a[i]);
	double ans = 0.;
	for(int i = n/2 + 1; i<=n; ++i)ans += dp[n][i];
	cout << fixed << setprecision(11) << ans << '\n';
	
	
	return 0;
}

Measured memory_bytes: 69120
#include<bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10, mod = 1e9 + 7;

void plusle(int &a,int b){a+=b;if(a>=mod)a-=mod; return;}
void minun(int &a,int b){a-=b; if(a<0)a+=mod; return;}
int add(int a,int b) {a+=b;return a>=mod?a-mod:a;}
int sub(int a,int b) {a-=b;return a<0?a+mod:a;}
int mul(int a,int b) {return (int)((long long)a*b%mod);}
int power(int a,int b) {int res=1;while (b>0) {if (b&1) {res=mul(res,a);}a=mul(a,a);b>>=1;}return res;}

int n, k, a[nax];
const int Mx = 3e5 + 10;
int fac[Mx], invf[Mx];

void prefact(){
    fac[0] = 1;
    for(int i = 1;i < Mx;i ++)
        fac[i]=mul(fac[i-1],i);
    invf[Mx - 1] = power(fac[Mx - 1],mod - 2);
    for(int i = Mx - 2 ;i >= 0;i --){
        invf[i] = mul(invf[i + 1], i + 1);
    }
}
int ncr(int N,int R){
    if(N < 0) return 0;
    if(R > N || R < 0) return 0;
    if(N == 0 || N == R)
        return 1;
    return mul(fac[N], mul(invf[N - R],invf[R]));
}
int norm(int &a){
   a = ((a % mod) + mod) % mod;
   return a;
}


int main(){
    prefact();
    scanf("%d %d", &n, &k);
    for(int i = 1 ;i <= n ;i ++){
        scanf("%d",  a +  i);
    }
    sort(a + 1 ,  a + 1 + n);
    int ans = 0;
    for(int i = 1 ; i <= n ;i ++){
        int x = norm(a[i]);
        plusle(ans, mul(x, ncr(i - 1,  k - 1)));
        minun(ans, mul(x, ncr(n - i, k - 1)));
    }
    printf("%d\n", ans);
}
/*
    Good Luck
        -Lucina
*/


Measured memory_bytes: 2944
#include <algorithm>
#include <iostream>
#include <set>

using namespace std;

typedef pair<int, int> PII;

int main ( void )
{
	int t;
	while ( cin >> t ) {
	while ( t-- ) {
		int m, n;
		cin >> m >> n;
		
		set<PII> divisor;
		
		/*divisor.insert( PII(  1,  0 ) );
		divisor.insert( PII(  0,  1 ) );
		divisor.insert( PII( -1,  0 ) );
		divisor.insert( PII(  0, -1 ) );
		divisor.insert( PII(  m,  n ) );
		divisor.insert( PII( -n,  m ) );
		divisor.insert( PII( -m, -n ) );
		divisor.insert( PII(  n, -m ) );*/

		int l = max( abs( m ), abs( n ) );
		for ( int i = 0; i <= l; ++i ) {
			for ( int j = 0; j <= l; ++j ) {
				for ( int d1 = -1; d1 < 2; d1 += 2) {
					for ( int d2 = -1; d2 < 2; d2 += 2 ) {
						int p = m, q = n, _m = i * d1, _n = j * d2,
							xd = _m * p + _n * q,
							yd = _n * p - _m * q,
							nm = _n * _n + _m * _m;
						if ( ( nm > 0 ) && ( xd % nm == 0 ) && ( yd % -nm == 0 ) ) {
							int x = xd / nm, y = yd / -nm;
							divisor.insert( PII( _m, _n ) );
							//divisor.insert( PII( xd / nm, yd / -nm ) );
						}
					}
				}
			}
		}

		cout << ( divisor.size() == 8 ? "P" : "C" ) << endl;
	}
	}
	return 0;
}

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

int main() {
  int n,m,d[300],u[300];
  while(cin >> m && m) {
    cin >> n;
    memset(d,0,sizeof(d));
    memset(u,0,sizeof(u));
    for(int i=1; i<=n; i++) cin >> d[i];
    queue<int> que;
    que.push(0);
    u[0]=1;
    while(!que.empty()) {
      int x=que.front();que.pop();
      for(int i=1; i<=m; i++) {
        int y=i+x;
        if(y<0) y=0;
        else if(y>=n+2) y=n+1;
        y+=d[y];
        if(y<0) y=0;
        else if(y>=n+2) y=n+1;
        if(u[y]) continue;
        u[y]=1;
        que.push(y);
      }
    }
    bool f=1;
    for(int j=0; j<n+2; j++) {
      if(!u[j]) continue;
      memset(u,0,sizeof(u));
      u[j]=1;
      que.push(j);
      u[j]=1;
      while(!que.empty()) {
        int x=que.front();que.pop();
        for(int i=1; i<=m; i++) {
          int y=i+x;
          if(y<0) y=0;
          else if(y>=n+2) y=n+1;
          y+=d[y];
          if(y<0) y=0;
          else if(y>=n+2) y=n+1;
          if(u[y]) continue;
          u[y]=1;
          que.push(y);
        }
      }
      if(!u[n+1]) f=0;
    }
    if(f) cout << "OK" << endl;
    else cout << "NG" << endl;
  }
  return 0;
}


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

int main() {
  int A, B, M;
  cin >> A >> B >> M;
  int a[A], b[B], x[M], y[M], c[M];
  int min=1000000, rem;
  
  
  for(int i=0; i<A; i++)
    cin >> a[i];
  
  for(int i=0; i<B; i++)
    cin >> b[i];
  
  for(int i=0; i<M; i++)
    cin >> x[i] >> y[i] >> c[i];
  
  for(int i=0; i<M; i++){
    rem = a[x[i]-1]+b[y[i]-1]-c[i];
    if(rem <= min){
      min = rem;
    }
  }
  
  sort(a, a+A);
  sort(b, b+B);
  
  if(a[0]+b[0] <= min)
    min = a[0]+b[0];
  
  cout << min << endl;
  
  return 0;
}

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

const int N=3e5+10,Node=N<<2;

struct Node{
	int l,r;
	bool operator < ( const Node &A ) const { return r-l<A.r-A.l; } 
	int length() { return r-l+1; }
}p[N];

int n,m;

struct SegmentTree{
	#define ls z<<1
	#define rs z<<1|1
	int root,val[Node];
	
	void insert(int z,int l,int r,int ql,int qr,int v) {
		if (ql<=l && r<=qr) { val[z]+=v; return ; }
		int mid=(l+r)>>1;
		if (ql<=mid) insert(ls,l,mid,ql,qr,v);
		if (qr>mid)  insert(rs,mid+1,r,ql,qr,v);
	}
	
	int Query(int z,int l,int r,int pos) {
		if (l==r) return val[z];
		int mid=(l+r)>>1;
		if (pos<=mid) return Query(ls,l,mid,pos)+val[z];
		else return Query(rs,mid+1,r,pos)+val[z];
	}
	
}St;

void Init() {
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;++i) scanf("%d%d",&p[i].l,&p[i].r);
}

void Solve() {
	std::sort(p+1,p+n+1);St.root=1;
	int t=1;
	for (int i=1;i<=m;++i) {
		while (p[t].length()<=i && t<=n) 
			St.insert(St.root,1,m,p[t].l,p[t].r,1),++t;
		int cnt=n-t+1;
		for (int j=i;j<=m;j+=i) 
			cnt+=St.Query(St.root,1,m,j);
		printf("%d\n",cnt);
	}
}

int main() {
	Init();
	Solve();
	return 0;
}

Measured memory_bytes: 4864
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define debug(x) cout<<#x<<": "<<x<<endl
#define DEBUG(x) cout<<#x<<": "<<x<<endl
int powint(int a, int x){
	int res = 1;
	REP(i,x){
		res = res *a; 
	}
	return res;
}

using namespace std;

int main(){
	int N,H;
	cin>>N>>H;
	vector<int> a(N);
	vector<int> b(N);
	REP(i,N){
		cin>>a[i]>>b[i];
	}
	int amax=0;
	REP(i,N){
		amax = max(amax,a[i]);
	}
	int ans=0;
	int wa=0;
	sort(b.begin(),b.end(),greater<int>());
	REP(i,N){
		if(b[i]<amax) break;
		ans++;
		wa+=b[i];
		if(wa>=H) break;
	}
	if(wa<H){
		ans += (H-wa+amax-1)/amax;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
int main(){
	int n;
	int a,b;
	cin >> n;
	cin >> a;
	int flag = 2;
	int cnt = 1;
	rep(i,n-1){
		cin >> b;
		if ((flag==1&&a>b) || (flag==0&&a<b)){
			flag = 2;
			cnt++;
		}
		else if (a>b){
			flag = 0;
		}
		else if (a<b){
			flag = 1;
		}
		a = b;
	}

	cout << cnt << endl;
	return 0;
}


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

int main() {
	int n,k,j;
	cin>>n>>k;
	int h[n+2]={0},dp[n]={0},i;
	for(i=0;i<n;i++)
	cin>>h[i];
	dp[0]=0;
	dp[1]=abs(h[0]-h[1]);
	for(i=2;i<n;i++)
	{
		int min=INT_MAX,q;
		for(j=1;j<=k&&i>=j;j++)
		{		
				q=dp[i-j]+abs(h[i-j]-h[i]);
				if(q<min)
				min=q;
		}
		dp[i]=min;
	}
	cout<<dp[n-1];
	return 0;
}

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

int dp[3010][3010];

int main() {
    int n, t;
    cin >> n >> t;
    vector<pair<int, int>> p(n);
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        p[i] = make_pair(a, b);
    }
    sort(p.begin(), p.end(), greater<pair<int, int>>());
    for (int i = n - 1; i >= 0; i--) {
        for (int j = 0; j < t; j++) {
            if (j < p[i].first) {
                dp[i][j] = dp[i + 1][j];
            } else {
                dp[i][j] = max(dp[i + 1][j], dp[i + 1][j - p[i].first] + p[i].second);
            }
        }
        dp[i][t] = max(dp[i + 1][t], dp[i + 1][t - 1] + p[i].second);
    }
    cout << dp[0][t] << endl;
    return 0;
}


Measured memory_bytes: 35584
from collections import deque


top=0
S=deque()
array=input().split(" ")

for i in range(len(array)):
  s=array[i]
  if s=="+":
    a=S.pop()
    b=S.pop()
    S.append(a+b)
  elif s=="-":
    a=S.pop()
    b=S.pop()
    S.append(b-a)
  elif s=="*":
    a=S.pop()
    b=S.pop()
    S.append(a*b)
  else:
    S.append(int(s))
print(S.pop())



Measured memory_bytes: 6000
/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

vector<string> ans;
int n;

void dfs(string x, int q) {
    int i = (int)x.size();
    if(i == n) {
        ans.push_back(x);
        return;
    }
    for(int i = 0; i <= q + 1; ++i) {
        char z = 'a' + i;
        int nq = max(q, i);
        dfs(x + z, nq);
    }
}

void solve() {
	cin >> n;
    dfs("a", 0);
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    for(auto k: ans) {
        cout << k << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 7796
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=(ll)1e9+7;


int main() {
    string S,T;
    cin>>S>>T;
    int ans=0;
    for (int i = 0; i < 3; ++i) {
        if(S[i]==T[i]) ans++;
    }

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
# 解説を見てしまったので、せめて再帰ではない方法で
def main():
    n = int(input())
    m = 1 << n  # 総組合せ数
    aa = LLI(n)
    dp = [0] * m
    for s in range(3, m):
        # sのうさぎたちが1グループだった場合
        value = 0
        jj = []
        for i,aai in enumerate(aa):
            if not s & 1 << i: continue
            value += sum(aai[j] for j in jj if s & 1 << j)
            jj.append(i)
        # 部分集合tとその補集合に分かれる場合
        # 全体集合sから始めて、「1を引く」「sと論理積をとる」を繰り返すことで
        # すべての部分集合を列挙できる
        t = (s - 1) & s
        while t > 0:
            value_div = dp[t] + dp[s ^ t]
            if value_div > value: value = value_div
            t = (t - 1) & s
        dp[s] = value
    print(dp[m - 1])

main()


Measured memory_bytes: 45020
// header {{{
#include <bits/stdc++.h>
#include <string>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <boost/foreach.hpp>
#include <vector>
#include <algorithm>
using namespace std;

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;
using f80 = __float80;
// }}}

constexpr i64 INF = 1'010'000'000'000'000'017LL;

constexpr i64 MOD = 1'000'000'007LL;

constexpr f64 EPS = 1e-12;

constexpr f64 PI = 3.14159265358979323846;

// util {{{
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}

template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}
// }}}

// init {{{
struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
// }}}

//--------------------------------------------------------------------

signed main() {


	i64 ans = 0;
	string ANS;
	string S;

	cin >> S;


	for (int i = 0; i < (int)(S.length()); i++) {
		ANS += "x";
	}
	cout << ANS << "\n";
	return 0;
}

Measured memory_bytes: 256
import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val P = Array(N) { sc.next().toInt() }
        val P2 = P.sorted()
        var n = 0
        for (i in 0 until N) {
            if (P[i] != P2[i]) n++
        }
        pw.println(if (n == 0 || n == 2) "YES" else "NO")
    }
}


Measured memory_bytes: 35660
#include<stdio.h>
#include<stdlib.h>
#define MAX 2000001
#define VMAX 10000

int main(){
	unsigned short *A,*B;
	
	int C[VMAX+1];
	int n,i,j;
	scanf("%d",&n);
	
	A=malloc(sizeof(short)*n+1);
	B=malloc(sizeof(short)*n+1);
	
	for(i=0;i<=VMAX;i++)C[i]=0;
	
	for(i=0;i<n;i++){
		scanf("%hu",&A[i+1]);
		C[A[i+1]]++;
	}
	
	for(i=1;i<=VMAX;i++)C[i]=C[i]+C[i-1];
	
	for(j=1;j<=n;j++){
		B[C[A[j]]]=A[j];
		C[A[j]]--;
	}
	
	for(i=1;i<=n;i++){
		if(i>1)printf(" ");
		printf("%d",B[i]);
	}
	printf("\n");
	
	return 0;
}

Measured memory_bytes: 9544
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
        String s = new String();
        while(in.hasNext()) s=s+in.nextLine();
        s=s.toLowerCase();
		char[] a={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
        for(char c:a){
        	int r=0;
        	for(int i=0;i<s.length();i++){
            	if(s.charAt(i)==c)r+=1; 
        	}
        	System.out.println(c+" : "+r);
        }
	}
}

Measured memory_bytes: 18072
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

ld l;

ld solve() {
    return pow(l/3, 3.0);
}

void input() {
    cin >> l;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << solve() << endl;
}


Measured memory_bytes: 3288
let solve (l, r, d) =
    [| l .. r |]
    |> Array.filter (fun x -> x % d = 0)
    |> Array.length

[<EntryPoint>]
let main argv =
    stdin.ReadLine().Split()
    |> Array.map int
    |> fun x -> x.[0], x.[1], x.[2]
    |> solve
    |> printfn "%d"
    0


Measured memory_bytes: 30380
card = list(map(int, input().split()))

if card[3] > card[0] + card[1]:
    x = card[3] - card[0] - card[1]
    print(card[0] + x * -1)
else:
    if card[0] <= card[3]:
        print(card[0])
    else:
        print(card[3])


Measured memory_bytes: 9116
package main

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

func main() {
	N := ReadInt()
	as := ReadInts(N)

	s := make([]int, N+1)
	for i := 0; i < N; i++ {
		s[i+1] = s[i] + as[i]
	}

	ans := math.MaxInt64
	for i := 1; i < N; i++ {
		x := s[i]
		y := s[N] - s[i]
		ans = Min(ans, Abs(x-y))
	}
	fmt.Println(ans)
}

func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

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

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }

func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 6528
#include <iostream>

using namespace std;

int main()
{
    int p;
    cin>>p;
    int A[p];
    for(int i=0;i<p;i++){
        cin>>A[i];
    }
    int sum=0;
    for(int i=0;i<p-2;i++){
        if(A[i]>A[i+1]&&A[i+1]>A[i+2])
            sum++;
        else if(A[i]<A[i+1]&&A[i+1]<A[i+2])
            sum++;
    }
    cout<<sum;
}


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

using namespace std;
//using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007


class Comb{
  public:
  const int n;
  vector<ll> fac,refac;
  Comb(int N) : n(N),fac(N+1,1),refac(N+1,1) {
    rep(i,n)fac[i+1] = fac[i]*(i+1)%MOD;
    refac[n] = modpow(fac[n],MOD-2);
    for(int i = n;i > 0;i--)refac[i-1] = refac[i]*i%MOD;
  }
  ll comb(ll n,ll r){
    if(n < r)return 0;
    ll res = fac[n]*refac[r]%MOD;
    res = res*refac[n-r]%MOD;
    return res;
  }
  ll modpow(ll n,ll r){
    ll res = 1;
    while(r){
      if(r & 1)res = res*n%MOD;
      n = n*n%MOD;
      r >>= 1;
    }
    return res;
  }
};


int main(){
  
  int n;
  cin >> n;
  Comb comb(10000);
  int len = n/3;
  ll res = 0;
  for(int i = 1;i <= len;i++){
    int k = n-3*i;
    res = (res+comb.comb(k+i-1,k))%MOD;
  }
  cout << res << "\n";



  return 0;
}

Measured memory_bytes: 3780
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k,a,ak,h;
    cin>>n>>k>>a;
    h=a;
    for(int i=2;i<=n;i++){
        cin>>ak;
        a=__gcd(a,ak);
        h=max(ak,h);
    }
    if(k%a==0&&k<=h){
        cout<<"POSSIBLE"<<endl;
    }else{
        cout<<"IMPOSSIBLE"<<endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
using namespace std;
int main(){
  long long n;cin>>n;
  map<long long,long long> m;
  long long c=0;
  for(long long i=0;i<n;i++){
    long long ai;cin>>ai;
    c+=m[i-ai];
    m[i+ai]++;
  }
  cout<<c<<endl;
  return 0;
}



Measured memory_bytes: 26248
// D - Lunlun Number

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

int main() {
	int K;
	cin >> K;
	queue<int64_t> Q;
	for (int i = 1; i <= 9; i++) {
		Q.push(i);
	}
	int64_t out;
	while (true) {
		out = Q.front();
		Q.pop();
		K--;
		if (K == 0) {
			cout << out << endl;
			return 0;
		}
		if (out % 10 == 0) {
			Q.push(out * 10);
			Q.push(out * 10 + 1);
		} else if (out % 10 == 9) {
			Q.push(out * 10 + 8);
			Q.push(out * 10 + 9);
		} else {
			Q.push((out * 10) + (out % 10 - 1));
			Q.push((out * 10) + (out % 10));
			Q.push((out * 10) + (out % 10 + 1));
		}
	}
}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<vector>
#include<set>
#include<algorithm>
typedef long long ll;
struct event{
  ll a,b,c;
  event(ll x,ll y,ll z){
    a=x;
    b=y;
    c=z;
  }
  bool operator<(const event &r) const {
    if(this->a!=r.a)return this->a<r.a;
    else if(this->b!=r.b)return this->b<r.b;
    else return this->c<r.c;
  }
};
using namespace std;
int main(){
  ll n,q,st,en,now_d,ind;

  cin >> n >> q;
  ll ans[q];
  ll s[n],t[n],x[n],d[q];
  vector<event> e_set;
  for(int i=0;i<n;i++){
    scanf("%lld%lld%lld",&s[i],&t[i],&x[i]);
    e_set.push_back(event(s[i]-x[i],0,x[i]));
    e_set.push_back(event(t[i]-x[i],-1,x[i]));
  }
  for(int i=0;i<q;i++){
    scanf("%lld",&d[i]);
    e_set.push_back(event(d[i],1,i));
  }
  sort(e_set.begin(),e_set.end());
  ind=0;
  ll num=0;
  multiset<ll> tmp;
  for(auto j=e_set.begin();j!=e_set.end();j++){
//    cout << j->a <<" "<<j->b<<" "<<j->c<<"\n";
    if(j->b==0) tmp.insert(j->c);
    else if(j->b==-1) tmp.erase(j->c);
    else{
      if(tmp.empty()) ans[j->c]=-1;
      else ans[j->c]=*tmp.begin();
    }
  }
  for(int i=0;i<q;i++) printf("%lld\n",ans[i]);
}


Measured memory_bytes: 33768
import sys
input = sys.stdin.readline

INF = 10 ** 9
MOD = 10 **9 + 7

N = int(input())

C = [int(input()) for _ in range(N)]
lst = [INF] * (2 * 10 ** 5 + 10) #各番号がどこにあるかを管理するリスト
ans = [1] * N
 
lst[C[-1]] = N - 1

for i in range(N - 2, -1, -1):
    c = C[i]
    if lst[c] == INF or lst[c] == i + 1:
        ans[i] = ans[i + 1]
    else:
        ans[i] = ans[i + 1] + ans[lst[c]]
    ans[i] %= MOD
    lst[c] = i

# print (ans)
print (ans[0] % MOD)

Measured memory_bytes: 20500
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>


long long  INF=1000000000000000000;
using namespace std;


int main(){

int N;
cin >> N;
string s;
cin>>s;
if(N>=3200){
cout<< s<<endl;
}
else{
    cout<<"red"<<endl;
}
 return 0;
}

Measured memory_bytes: 256