akhauriyash/Code-Regression huggingface dataset:
import javax.print.DocFlavor;
import java.awt.*;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.util.List;

public class Main {

    static String br = System.getProperty("line.separator");
    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int N = nextInt();

        int[] L = new int[N];
        Arrays.setAll(L,i->nextInt());

        Arrays.sort(L);

        int count = 0;
        for(int i=0; i<N; i++){
            for(int j=i+1; j<N; j++){
                for(int m=j+1; m<N && L[m]<L[i]+L[j]; m++){
                    count++;
                }
            }
        }
        println(count);
    }

    static long a(long n){
        return n < 2L ? 1L : n*a(n-2);
    }

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

    static Long nextLong() {
        return Long.parseLong(next());
    }

    static String next() {
        return sc.next();
    }

    static String nextLine(){
        return sc.nextLine();
    }

    static void println(Object o) {
        out.println(o);
        out.flush();
    }

    static void print(Object o) {
        PrintWriter out = new PrintWriter(System.out);
        out.print(o);
        out.flush();
    }
}


Measured memory_bytes: 27552
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

const int VMAX = 1e5+10;
const int EMAX = 1e5+10;
int V,E;
struct edge{
  int to;
  ll cost[2];
};

vector<vector<edge> > G(VMAX);
vector<vector<ll> > d(2,vector<ll>(VMAX,MAX_LL));

void dijkstra(int s, int x){
  priority_queue<PIL, vector<PIL>, greater<PIL> > pque;
  d[x][s] = 0;
  pque.push(PIL(s,0));
  while(!pque.empty()){
    PIL p = pque.top();pque.pop();
    int v = p.first;
    if(d[x][v] < p.second) continue;

    for(const edge &e : G[v]){
      if(d[x][e.to] > d[x][v] + e.cost[x]){
        d[x][e.to] = d[x][v] + e.cost[x];
        pque.push(PIL(e.to,d[x][e.to]));
      }
    }
  }
}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int s,t;cin >> V >> E >> s >> t;
  rep(i,E){
    int f;edge e;cin >> f >> e.to >> e.cost[0] >> e.cost[1];
    G[f].push_back(e);
    swap(f,e.to);
    G[f].push_back(e);
  }
  dijkstra(s,0);
  dijkstra(t,1);
  priority_queue<PLI, vector<PLI>, greater<PLI> > pque;
  repp(v,1,V+1) pque.push(PLI(d[0][v]+d[1][v],v));
  PLI p = pque.top();pque.pop();
  rep(v,V){
    while(v>=p.second){
      p = pque.top();pque.pop();
    }
    cout << 1e15 - p.first << endl;
  }
  return 0;
}


Measured memory_bytes: 21300
def count(a, b):
    c = 0
    for i in range(26):
        t = chr(ord('a') + i)
        if t in a and t in b:
            c += 1
    return c

n = int(input())
s = input()

print(max([count(s[:i], s[i:]) for i in range(n + 1)]))

Measured memory_bytes: 3060
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};
 

int main() {
  int R, G;
  cin >> R >> G;
  cout << G + (G - R) << endl;
  return 0;
}

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

using namespace std;

using ll = long long;

int main() {
  int n;
  cin >> n;
  vector<ll> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  ll m = n / 2;
  deque<int> dq;
  ll itr = 0, ritr = n - 1;
  for (int i = 0; i < m; ++i) {
    if (i % 2) {
      dq.push_back(v[itr]);
      itr++;
      dq.push_front(v[ritr]);
      ritr--;
    } else {
      dq.push_back(v[ritr]);
      ritr--;
      dq.push_front(v[itr]);
      itr++;
    }
  }
  ll ans = 0;
  ll pre = -1;
  ll f = dq.front(), b = dq.back();
  while (!dq.empty()) {
    ll now = dq.front();
    dq.pop_front();
    if (pre != -1) {
      ans += abs(now - pre);
    }
    pre = now;
  }
  if (n % 2) {
    ans += max(abs(v[m] - f), abs(b - v[m]));
  }
  cout << ans << endl;
}

Measured memory_bytes: 1408
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int n;
  scanf("%d", &n);
  vector<int> x(n), y(n), h(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d%d", &x[i], &y[i], &h[i]);
  }
  for (int X = 0; X <= 100; ++X) {
    for (int Y = 0; Y <= 100; ++Y) {
      bool conflict = false;
      int H = -1;
      for (int i = 0; i < n; ++i) {
        int cur = h[i] + abs(x[i] - X) + abs(y[i] - Y);
        if (h[i] == 0) continue;
        if (H < 0) {
          H = cur;
        } else if (H != cur) {
          conflict = true;
          break;
        }
      }
      for (int i = 0; i < n; ++i) {
        if (h[i]) continue;
        int cur = h[i] + abs(x[i] - X) + abs(y[i] - Y);
        if (H >= 0 && H > cur) {
          conflict = true;
          break;
        }
      }
      if (!conflict) {
        printf("%d %d %d\n", X, Y, H);
        return 0;
      }
    }
  }

  return 0;
}


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

vector<ll> prime;
void SieveOfEratosthenes(ll n) 
{ 
    for (ll p=2; p<=n; p++) 
    {   if (prime[p] == 1) 
        { 	//prime[p] = 2;
        	//ll r = 0;
            for (ll i=2*p; i<=n; i += p) {
            	ll count = 0;
            	ll r = i;
            	while (r % p == 0) { 
                    r = r / p; 
                    count++; 
                }
                //cout<<count<<" ";
                prime[i] *= count+1 ; 
            	//cout<<prime[i]<<" "<<i<<" ";
            }
        } 
    }
    for(ll p=2; p<=n; p++) {
    	if(prime[p]==1) prime[p] =2;
    } 
}

int main() { 
  
	ll n;
	cin>>n;
	prime.assign(n+1,1);
	//prime[1] = 1;
	SieveOfEratosthenes(n);
	//cout<<prime[n];
	ll ans = 0;
	for(ll i=1; i<=n; i++) {
		ans += i*prime[i];
	}
	cout<<ans;
  return 0;
} 
	/*
	ll n,m,k;
	cin>>n>>m>>k;
	ll a[n],b[m];
	for(ll i=0; i<n; i++) cin>>a[i];
	for(ll i=0; i<m; i++) cin>>b[i];
	//cout<<k<<" ";
	ll x=0,y=0,count=0;
	while((x<n || y<m) && k>0) {
		if(a[x]<=b[y]) {
			if(k-a[x]>=0) count++;
			
			k -= a[x];
			if(x<n-1) x++;
			//cout<<k<<" ";
		}
		else if(a[x]>b[y]) {
			if(k-b[y]>=0) count++;
			
			k -= b[y];
			if(y<m-1) y++;
			//cout<<k<<" ";
		}
	}
	cout<<count;
	*/
 

Measured memory_bytes: 81372
import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
		//System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		double a =scan.nextDouble();
		double b =scan.nextDouble();
		double C =scan.nextDouble();
		double Crad = Math.toRadians(C);


		double keisan =0.0;
		//??¢??? ??? ??????a * ???b sin(ab???????§????C)/2?????????C???????????¢????§???????????????????????????¨???
		keisan = a*b * Math.sin(Crad) /2 ;
		System.out.println(keisan);
		//??¨ ??? a + b +???a?????? + b?????? - 2*a*b*cos(C)
		keisan = (a+b)+Math.sqrt(a*a + b*b - 2*a*b*Math.cos(Crad));
		System.out.println(keisan);
		//?????? ??? b*sin(C)
		keisan = b*Math.sin(Crad);
		System.out.println(keisan);
	}
}

Measured memory_bytes: 27836
main = getLine >>= main' . map read . words
    where
        main' [_, a, b] = getLine >>= print . solve a b . map read . words

solve :: Int -> Int -> [Int] -> Int
solve a b = inner 0
    where
        inner acc (x : y : zs) = inner (min ((y - x) * a) b + acc) (y : zs)
        inner acc _ = acc


Measured memory_bytes: 36220
#include<stdio.h>
int main(void)
{
	int x,y,sum;
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	sum=a+b+c+d;
	x=0;
	while(sum>=60){
		sum=sum-60;
		x++;
	}
	y=sum;
	printf("%d\n%d\n",x,y);
	return 0;
}

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

ll solve(vector<ll> v)
{
 ll n=v.size();
  ll ans[n]={0};
  ans[0]=0;
  ans[1]=abs(v[1]-v[0]);
  for(ll i=2;i<n;i++)
  {
    ans[i]=min((abs(v[i]-v[i-1])+ans[i-1]),(abs(v[i]-v[i-2])+ans[i-2]));
  }
  return ans[n-1];
}

int main()
{
 ll n;
  cin>>n;
  vector<ll> v;
  for(ll i=0;i<n;i++)
  {
   ll x;
    cin>>x;
    v.push_back(x);
  }
  cout<<solve(v)<<endl;
}

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

int main() {
  string a;
  string b;
  string c;
  
  cin >> a >> b >> c;
  
  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}

Measured memory_bytes: 3564
N = int(input())
X = [int(_) for _ in input().split()]

xs = sorted(X)

m1 = xs[N // 2 - 1]
m2 = xs[N // 2]

for i in range(N):
    if X[i] <= m1:
        print(m2)
    else:
        print(m1)


Measured memory_bytes: 25556
// ATcordertuto.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//


#include <iostream>
#include<stdio.h>
#include<string>
#include<vector>
using namespace std;

/*
int main() {
	int N, M;
	cin >> N >> M;
	vector<int> A(M), B(M);
	for (int i = 0; i < M; i++) {
		cin >> A.at(i) >> B.at(i);
	}
	
	// N×Nのchar型の2次元配列のすべての要素を'-'で初期化
	vector<vector<char>> table(N, vector<char>(N, '-'));

	for (int i = 0; i < M; i++) {
		// 1〜N → 0〜N-1 に変換
		A.at(i)--; B.at(i)--;
		table.at(A.at(i)).at(B.at(i)) = 'o';  // AはBに勝った
		table.at(B.at(i)).at(A.at(i)) = 'x';  // BはAに負けた
	}
	/*
	vector<vector<char>> table(N, vector<char>(N, '-'));
	for (int i = 0; i < M; i++) {
		A.at(i)--; B.at(i)--;
		table.at(A.at(i).at(B.at(i)) = "〇";
		table.at(B.at(i).at(A.at(i)) = "×";
	}*/
//2.03ゲーム大会多次元配列


/*void saiten(vector<vector<int>> &A, int &correct_count, int &wrong_count) {

	for (int i = 0; i < 9; i++) {
		for (int j = 0; j < 9; j++) {
			//誤った値が書き込まれている場合
			if (A.at(i).at(j) != (i + 1)*(j + 1)) {
				A.at(i).at(j) = (i + 1)*(j + 1);
				wrong_count++;
			}
			else {
				//正しい値が書き込まれている場合
	// Aのうち、正しい値の書かれたマスの個数を correct_count に入れる
				correct_count++;
			}
		}
	}
}



// -------------------
// ここから先は変更しない
// -------------------
int main() {
	// A君の回答を受け取る
	vector<vector<int>> A(9, vector<int>(9));
	for (int i = 0; i < 9; i++) {
		for (int j = 0; j < 9; j++) {
			cin >> A.at(i).at(j);
		}
	}

	int correct_count = 0; // ここに正しい値のマスの個数を入れる
	int wrong_count = 0;   // ここに誤った値のマスの個数を入れる

	// A, correct_count, wrong_countを参照渡し
	saiten(A, correct_count, wrong_count);

	// 正しく修正した表を出力
	for (int i = 0; i < 9; i++) {
		for (int j = 0; j < 9; j++) {
			cout << A.at(i).at(j);
			if (j < 8) cout << " ";
			else cout << endl;
		}
	}
	// 正しいマスの個数を出力
	cout << correct_count << endl;
	// 誤っているマスの個数を出力
	cout << wrong_count << endl;
	system("pause");
}//2.04*/
//2.04参照

/*bool has_divisor(int N, int i) {
	if (i == N) {
		return false;
	}
	if (N % 1 == 0) {
		return true;
	}
	return has_divisor(N, i + 1);
}

bool is_prime(int N) {
	if (N == 1){
		return false;
	}
	else if (N == 2) {
		return true;
	}
	else {
		return !has_divisor(N, 2);
	}
}*/

int main() {
	int A;
	int P;
	cin >> A >> P;

	P += 3 * A;
	int AP = P / 2;

	cout << AP << endl;
}

Measured memory_bytes: 256
def gcd(a,b):
    r = max(a,b)
    s = min(a,b)
   
    if s == 0:
        return r
    else:
        return gcd(s,r%s)

      
n = int(input())
A = [int(i) for i in input().split()]
l = [0] * n
r = [0] * (n+1)
m = [0] * n
for i in range(1,n):
    l[i] = gcd(l[i-1],A[i-1])
for i in reversed(range(0,n)):
    r[i] = gcd(r[i+1],A[i])

for i in range(n):
    m[i] = gcd(l[i],r[i+1])
print(max(m))









    


Measured memory_bytes: 14400
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
 
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define speed() cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false)
// #define exit(a, b) return cout << a, b;
 
// debugger
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#define debug(stuff) cout << #stuff << ": " << stuff <<endl
#define debugc(stuff) cout << #stuff << ": "; for(auto x: stuff) cout << x << " "; cout << endl;
// 
 
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define all(v) v.begin(), v.end() 
 
#define print(stuff) cout << stuff << endl
#define printc(stuff) for(auto x: stuff) cout << x << " "; cout << endl;
#define printPrec(stuff) cout << fixed << setprecision(15) << stuff << endl;
#define len length
#define ret0 return 0
#define ret return 
 
 
#define ll long long
#define ld long double
#define fi first
#define endl '\n'
#define se second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define fill(ar, x) memset(ar, x, sizeof ar)
 
#define vl vector<ll> 
#define sl set<ll>
#define pll pair<ll, ll>
#define mll map<ll, ll> 
#define pq priority_queue<ll>
 
// typedef tree<ll,null_type,less<ll>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;
 
#define inf (long long int) 1e18
#define eps 0.000001
#define mod 1000000007
#define mod1 998244353
#define MAXN (ll)2e5+5
#define N (1ll<<10)

void solve(){
    ll n, m;
    cin>>n>>m;
    ll a[n+1];
    loop(i,1,n+1) cin>>a[i];

    vl adj[n+1];
    loop(i,0,m){
        ll a, b;
        cin>>a>>b;
        adj[a].pb(b), adj[b].pb(a);
    }
    ll ans = 0;
    for(ll i=1; i<=n; i++){
        ll cnt = 0;
        for(auto x: adj[i]){
            if(a[x] >= a[i]){
                cnt++;
            }
        }
        if(cnt == 0){

            ans++;
        }
    }
    print(ans);
}
 
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
        start_routine();
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
 
    ll t = 1;
    // cin>>t;
    while(t--){
        solve();
    }
        
    #ifndef ONLINE_JUDGE
        end_routine();
    #endif
}


Measured memory_bytes: 10248
import java.util.Scanner;
 
public class Main{
	
	
	
	public static void main(String args[])throws Exception{
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		long[] a = new long[N];
		for(int i=0;i<N;i++){
			a[i] = sc.nextLong();
		}
		
		long ans1 = 0;
		long ans2 = 0;
		long s = 0;
		for(int i=0;i<N;i++){
			
			if(i%2==0){
				if(s+a[i]<=0){
					
					ans1 += 1-(s+a[i]);
	
					s=1;
				}else{
					s=s+a[i];
				}
			}else{
				if(s+a[i]>=0){
					
					ans1 += 1+(s+a[i]);
					s=-1;
				}else{

					s=s+a[i];
	
				}
			}

			
		}
		
		s = 0;
		for(int i=0;i<N;i++){
			
			if(i%2==1){
				if(s+a[i]<=0){
					
					ans2 += 1-(s+a[i]);
					s=1;
				}else{
					s=s+a[i];
				}
			}else{
				if(s+a[i]>=0){
					
					ans2 += 1+(s+a[i]);
					s=-1;
				}else{
					s=s+a[i];
				}
			}
			
		}

		System.out.println(Math.min(ans1, ans2));
	}
}



Measured memory_bytes: 51220
n = int(input())
stations = []
for _ in range(n-1):
    stations.append(tuple(map(int, input().split())))

outputs = [0] * n
for i in range(n-1):
    t = 0
    for j in range(i, n-1):
        c, s, f = stations[j]
        if t <= s:
            t = s
        else:
            if t%f != 0:
                t = t+f - t%f
        t += c
    print(t)
print(0)


Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fl(i,a,b) for(int i=a;i<b;i++)
#define rfl(i,a,b) for(int i=a;i>b;i--)
#define cases() ll t;cin>>t;while(t--)
int main()
{
    ll a[2];
    cin>>a[0]>>a[1];
    sort(a,a+2);
    if(a[0]==2&&a[1]==3)
        cout<<1;
    else if(a[0]==1&&a[1]==2)
        cout<<3;
    else
        cout<<2;
    return 0;
}


Measured memory_bytes: 256
import Control.Applicative
import Control.Monad
import Data.List

main = do
    ns <- fmap (read :: String -> Int) . words <$> getLine
    let n = ns !! 0
        m = ns !! 1
        l = ns !! 2
    as <- getMatrix n
    bs <- transpose <$> getMatrix m
    mapM_ (\x -> putStrLn x) $ rowShow $ calcMatrix as bs

getMatrix :: Int -> IO [[Int]]
getMatrix n = do
    forM [1..n] $ \_ -> do
        fmap (read :: String -> Int) . words <$> getLine

calcMatrix :: [[Int]] -> [[Int]] -> [[Int]]
calcMatrix as bs = foldr (\x acc -> (sumVec $ mulVec x bs) : acc) [] as

-- [1,2] * [[1,1], [2,2]] = [[1,2], [2,4]]
mulVec :: [Int] -> [[Int]] -> [[Int]]
mulVec ns xs = foldr(\s acc -> (zipWith (*) ns s) : acc) [] xs

-- [[1,2], [2,4]] = [3, 6]
sumVec :: [[Int]] -> [Int]
sumVec = foldr (\x acc -> sum x : acc) []

rowShow matrix = foldr (\x acc -> (unwords x) : acc) [] $ map (\x -> map (\y -> show y) x) matrix

Measured memory_bytes: 12364
s=input()
n=len(s)
dp=list('false'*n)
dp[0]="true"
if s[0:5]=="dream" or s[0:5]=="erase":
    for i  in range(5):
        dp[i]="true"
if s[0:6]=="eraser":
    for i  in range(6):
        dp[i]="true"
if s[0:7]=="dreamer":
    for i in range(7):
        dp[i]="true"


for i in range(5,n):

    if dp[i-5]=="true" and (s[i-4:i+1]=="dream" or s[i-4:i+1]=="erase"):
        dp[i]="true"
    if dp[i-6]=="true" and s[i-5:i+1]=="eraser":
        dp[i]="true"
    if dp[i-7]=="true" and s[i-6:i+1]=="dreamer":
        dp[i]="true"

if dp[n-1]=="true":
    print("YES")
else:
    print("NO")

Measured memory_bytes: 78096
N = int(input())
D = {}

for k in range(2,10**6):
  while N%k<1:
    N//=k
    D[k]=D.get(k,0)+1

a = 0
for i in D.values():
  t = 0
  c = 0
  while t+c<i:
    c+=1
    t+=c
  a+=c
print(a+(N>1))

Measured memory_bytes: 9108
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
  int N;
  long long int Y;
  cin >> N >> Y;
  int ans0 = -1;
  int ans1 = -1;
  int ans2 = -1;
  for (int i = 0; i <= N; i++) {
    for (int j = 0; j <= N - i; j++) {
      int k = N - i - j;
      if (i * 10000 + j * 5000 + k * 1000 == Y) {
        ans0 = i;
        ans1 = j;
        ans2 = k;
      }
    }
  }
  cout << ans0 << " " << ans1 << " " << ans2 << endl;
  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

int n,a[2005][2005];
bitset<2005>win[2005];
bitset<2005>dp[2][2005];
int main(){
	scanf("%d",&n);
	for(int i=2;i<=n;i++){
	    char s[2005]; scanf("%s",&s);
		for(int j=1;j<i;j++){
			a[i][j] = s[j-1]-'0';
			a[j][i] = 1-a[i][j];
		}
	}
	repn(i,n) repn(j,n) win[i][j] = a[i][j];
	repn(i,n){
		dp[0][i][i] = 1;
		dp[1][i][i] = 1;
	}
	for(int L=2;L<=n;L++){
		for(int i=1;i+L-1<=n;i++){
			//dp[0][i][i+L-1]
			bool f = !!(win[i]&dp[1][i+1]&dp[0][i+L-1]).count();
			if(f) dp[0][i+L-1][i] = 1;
			//dp[1][i][i+L-1]
			f = !!(win[i+L-1]&dp[1][i]&dp[0][i+L-2]).count();
			if(f) dp[1][i][i+L-1] = 1;
		}
	}
	int ans = 0;
	for(int i=1;i<=n;i++){
		if(dp[1][1][i] && dp[0][n][i]) ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 17536
#include<stdio.h>
int main()
{
  int A,B;
  
  scanf("%d %d",&A,&B);
  
  B=B*2;
  
  if(A>B){
  printf("%d",A-B);
  
  }
  
  else{
    printf("0");
  }
  
  return 0;
}

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

int main()
{

    long int n, m, count = 0,temp;
    cin>>n>>m;

    for(int i = 0; i<m; i++)
    {
        cin>>temp;
        count = count + temp;
    }

    if(count>n)
        cout<<"-1";
    else
        cout<<n-count;

}




Measured memory_bytes: 3636
#include <cstdlib>
#include <fstream>
#include <iostream>

using namespace std;

struct Node {
    int key;
    Node *parent, *left, *right;
};
/*
 * 
 */
//NIL mean null
Node *root, *NIL;


void insert(int key) {
    Node *y = NIL;
    Node *x = root;
    Node *z;
    
    z = (Node *)malloc(sizeof(Node));
    z -> key = key;
    z -> left = NIL;
    z -> right = NIL;
    
    while(x != NIL) {
        y = x;
        if(x -> key < key) {
            //??????
            x = x -> right;
        }
        else {
            //??????
            x =  x -> left;
        }
    }
    
    z -> parent = y;
    if(y == NIL) {
        root = z;
    }
    else if(y -> key < key) {
        y -> right = z;
    }
    else {
        y -> left = z;
    }
}


void printInOrder(Node *node) {
    if(node == NIL) {
        return;
    }
    printInOrder(node -> left);
    cout << " " << node -> key;
    printInOrder(node -> right);
}

void printPreOrder(Node *node) {
    if(node == NIL) {
        return;
    }
    cout << " " << node -> key;
    printPreOrder(node -> left);
    printPreOrder(node -> right);
}

void releaseTree(Node *node) {
    if(node == NIL) {
        return;
    }
    releaseTree(node -> left);
    releaseTree(node -> right);
    free(node);
    
}
int main(void) {
    //ifstream ifs;
    //ifs.open("./input.txt", ifstream::in);
    
    int num, key;
    string command;
    cin >> num;
    
    for(int i = 0; i < num; i++) {
        cin >> command;
        if(command[0] == 'i') {
            cin >> key;
            insert(key);
        }
        else if(command[0] == 'p') {
            printInOrder(root);
            cout << endl;
            printPreOrder(root);
            cout << endl;
        }
    }
    
    releaseTree(root);
   
    return 0;
}

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

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int main() {

    int n, x, y; cin >> n >> x >> y;
    --x; --y;

    vector<int> ans(n);
    for (int i = 0; i < n; ++i) {
        for (int j = i+1; j < n; ++j) {
            int dist = abs(i - j);
            dist = min(dist, abs(i - x) + 1 + abs(j - y));
            dist = min(dist, abs(i - y) + 1 + abs(j - x));

            ans[dist]++;
        }
    }

    for (int i = 1; i < n; ++i) {
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 256
// C.

#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <cstring>

using namespace std;

int main(int argc, char *argv[])
{
	int dp[101][10] = {};
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int s;
		cin >> s;
		for (int j = 0; j < 10; ++j) {
			dp[i + 1][j] = dp[i][j];
		}
		for (int j = 0; j < 10; ++j) {
			int k = dp[i][j] + s;
			dp[i + 1][k % 10] = max(dp[i + 1][k % 10], k);
		}
	}
	int ans = *max_element(dp[n] + 1, dp[n] + 10);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62


YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    c= collections.Counter(S)
    if c.most_common()[0][1] == 2 and c.most_common()[1][1] == 2:
        print("Yes")
    else:
        print("No")

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3316
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int N, K;
	cin >> N >> K;
 
	string s;
	//cin >> s;
 
	//int A[5]
	//sort(A, A + 5);
	long long* A;
	A = new long long[N + 1];
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
	}
	A[N] = -1;
	for (int i = 0; i < N; i++)
	{
		if (A[i + K] < 0)
		{
			break;
		}
		if (A[i] < A[i + K])
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}
	delete[] A;
}


Measured memory_bytes: 4836
n = gets.chomp.to_i
data = n.times.map { gets.chomp.split.map(&:to_i) }

def is_reachable(current, next_data)
  # 次の地点までのマンハッタン距離
  tc, xc, yc = current
  tn, xn, yn = next_data
  dist = (xc - xn).abs + (yc - yn).abs

  # 最短距離でも間に合わない
  return false if dist > tn - tc

  # 行ったり来たりでちょうど到着できるか
  (dist - (tn - tc)).even?
end


current = [0, 0, 0]
data.each do |d|
  unless is_reachable(current, d)
    return puts 'No'
  end
  current = d
end

puts 'Yes'

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

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF   = 1e9;
const ll  INFLL = 1e18;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

const ll MOD = 1e9 + 7;
vector<ll> inv_mod;

void list_mod_inverse(ll n, ll m)
{
    inv_mod.resize(n + 1);
    inv_mod[1] = 1;
    for (int i=2; i<=n; i++) {
        inv_mod[i] = inv_mod[m % i] * (m - m / i) % m;
    }
}

ll next_conb(ll n, ll k, ll now)
{
    if (n < k) return 0;
    return ((now * inv_mod[k] % MOD) * (n - k + 1)) % MOD;
}

int main()
{
    ios::sync_with_stdio(false);

    ll N; cin >> N;
    ll NN = N + 1;
    vector<int> appear(N+1, -1);

    ll a, b;

    rep(i, NN) {
        int A; cin >> A;

        if (appear[A] >= 0) {
            a = appear[A];
            b = N - i;
        } else {
            appear[A] = i;
        }
    }

    list_mod_inverse(2*NN, MOD);

    ll all = NN, diff = 0, sum = 1;

    cout << N << endl;
    for (int k = 2; k <= NN; k++) {
        if (a + b >= k-1) {
            sum = next_conb(a+b, k-1, sum);
        } else {
            sum = 0;
        }

        all = next_conb(NN, k, all);

        cout << (all - sum + MOD) % MOD << endl;
    }
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

int H, W, h, w;

int main() {
	cin >> H >> W >> h >> w;
	cout << (H - h)*(W - w) << endl;
	return 0;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp;
use std::io::Write;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    let s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

macro_rules! input_inner {
  ($iter:expr) => {};
  ($iter:expr, ) => {};

  ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($iter, $t);
    input_inner!{$iter $($r)*}
  };
}

macro_rules! read_value {
  ($iter:expr, ( $($t:tt),* )) => {
    ( $(read_value!($iter, $t)),* )
  };

  ($iter:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  };

  ($iter:expr, chars) => {
    read_value!($iter, String).chars().collect::<Vec<char>>()
  };

  ($iter:expr, usize1) => {
    read_value!($iter, usize) - 1
  };

  ($iter:expr, $t:ty) => {
    $iter.next().unwrap().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  let out = std::io::stdout();
  let mut out = std::io::BufWriter::new(out.lock());
  macro_rules! puts {
    ($($format:tt)*) => (write!(out,$($format)*).unwrap());
  }
  input! {
    a: i32,
    b: i32,
    c: i32,
  }

  puts!("{}\n", cmp::max(c - (a - b), 0));
}


Measured memory_bytes: 4352
function Main(input) {
  input=input.split("\n");
  if(input[input.length-1]===''){
    input.pop();
  }
  const N=input[0]-0;
  const array=input[1].split(' ').map(e=>{
    return e-0;
  });
  if(array.every(e=>{
    return e%2!==0||e%3===0||e%5===0;
  })){
    console.log('APPROVED');
  }else{
    console.log('DENIED');
  }

}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  



  


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

int main(){
  int n, m , x;
  cin >> n >> m >> x;
  vector<int> c(n);
  vector<vector<int>> a(n, vector<int>(m));
  for(int i = 0; i < n; i++){
    cin >> c.at(i);
    for(int j = 0; j < m; j++){
      cin >> a.at(i).at(j);
    }
  }
  
  vector<int> ability(m);
  long long tem = 0;
  long long ans = 1000000000000;
  int exist = 0;
  
  for(int bit = 0; bit < (1<<n); bit++){
    for(int i = 0; i < n; i++){
      if(bit & (1<<i)){
        for(int j = 0; j < m; j++){
          ability.at(j) += a.at(i).at(j);
        }
        tem += c.at(i);
      }
    }
      sort(ability.begin(), ability.end());
      
      if(ability.at(0) < x){
        exist++;
        for(int j = 0; j < m; j++){
        	ability.at(j) = 0;
     	}
      	tem = 0;
        continue;
      }
      else if(ans > tem){
        ans = tem;
      }
      
      for(int j = 0; j < m; j++){
        ability.at(j) = 0;
      }
      tem = 0;
    }
  
    if(exist == (1<<n)){
      cout << -1 << endl;
    }
    else{
      cout << ans << endl;
    }
}

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

typedef long long int ll;
typedef long double ld;

#define pb push_back

#define all(n) n.begin(),n.end()

void solve()
{
				
	
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	
	cout<<max({a*c,a*d,b*c,b*d});	
			
		
	
}

int main()
{
	
solve();
		
	
	
}

Measured memory_bytes: 3632
#include <iostream>

using namespace std;

int main()
{
    int N;
    cin>>N;
    string cad;
    int a=0,b=0,c=0,d=0;
    for(int i=0;i<N;i++){
        cin>>cad;
        if(cad=="AC")
            a=a+1;
        if(cad=="WA")
            b=b+1;
        if(cad=="TLE")
            c=c+1;
        if(cad=="RE")
            d=d+1;
    }
    cout<<"AC x "<<a<<endl;
    cout<<"WA x "<<b<<endl;
    cout<<"TLE x "<<c<<endl;
    cout<<"RE x "<<d<<endl;
}


Measured memory_bytes: 3164
from collections import deque


#キューの実装を試みる
#①pythonで構造体が作れないかどうか調べる
#クラス定義でなんとかなりそう？
class Typedef:
    def __init__(self,name,time):
        self.name = name
        self.time = time
#キューを実装するための配列を定義
Q = deque([])

#プロセスの数とクオンタムを定義
process_num,quantum = map(int, input().split())

#キューに情報を入れていく(他人のやつを参考にする)
for loop in range(process_num):
    input_str = list(map(str, input().split()))
    tmp_infomation = Typedef(input_str[0],int(input_str[1]))
    Q.append((tmp_infomation))

#通算でかかった時間と終わったプロセス数を表す変数
total_time =0 
finish_process = 0

#ラウンドロビンスケジューリングを実装
while True:
    #情報の取り出し
    tmp_infomation = Q.popleft()
    #プロセス終了条件
    if (tmp_infomation.time <=quantum):
        total_time += tmp_infomation.time
        finish_process +=1
        print("%s %d"%(tmp_infomation.name, total_time))
    #quantumで終わらなかった場合
    else:
        total_time += quantum
        tmp_infomation.time -= quantum
        Q.append(tmp_infomation)#もう一度末尾に追加
    #プログラム終了条件
    if (finish_process == process_num):
        break
        
    


Measured memory_bytes: 17556
n = int(input())
h = input().split(' ')

for i in reversed(range(n)):
    if i < n - 1:

        h[i] = int(h[i])
        h[i + 1] = int(h[i + 1])

        if h[i] > h[i + 1]:
            h[i] -= 1
            if h[i] > h[i + 1]:
                print('No')
                exit()

print('Yes')

Measured memory_bytes: 11244
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
typedef long long ll;
using namespace std;
int main(void){
    int n;
    cin>>n;
    vector<int>x(n);
    vector<int>s(n);
    for(int i=0;i<n;i++){
        cin>>x[i];
        s[i]=x[i];
    }
    sort(s.begin(),s.end());
    int x_med=s[n/2-1];
    for(int i=0;i<n;i++){
        int num=x[i];
        if(num<=x_med){
            cout<<s[n/2]<<endl;
        }else{
            cout<<x_med<<endl;
        }
    }
}

Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long
const int N = 2e5 + 1;

void findAns()
{
    char c;
    cin >> c;

    if (islower(c)) cout << "a\n";
    else
        cout << "A";


}
int main()
{
// #ifndef ONLINE_JUDGE
//     freopen("in.txt", "r", stdin);
//     freopen("o1.txt", "w", stdout);
// #endif

    fastio;

    // ll int t;
    // cin >> t;

    // while (t--)
    findAns();
}

Measured memory_bytes: 3584
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>
#include <queue>
#include <bitset>
#include <iomanip>
#include <set>

using namespace std;

#define PI (3.14159265358979323846)
#define INF (2147483647)
#define INF_LL (9223372036854775807)
#define DIV_NUM (1000000007)



int main() {

	int N;
	cin >> N;
	set<int> inputs;
	for (int i = 0; i < N; i++) {
		int tmp;
		cin >> tmp;
		inputs.insert(tmp);
	}

	int count = 0;
	for (int d = 100; d > 0; d--) {
		if (inputs.count(d) != 0) count++;
	}

	cout << count << endl;

	return 0;
}


Measured memory_bytes: 256
n,m,l = map(int,raw_input().split())
a = [map(int,raw_input().split()) for _ in range(n)]
b = [map(int,raw_input().split()) for _ in range(m)]
c = [[0 for i in range(l)] for j in range(n)]

for i in range(n):
    for j in range(l):
        s = 0
        for k in range(m):
            s += a[i][k] * b[k][j]
        c[i][j] = s

for i in range(n):
    print ' '.join(map(str,c[i]))

Measured memory_bytes: 7128
#include "bits/stdc++.h"
using namespace std;


//wierd debugging stuff
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
//end of weird debugging stuff
using ll = long long;
using vi = vector<int>;
using ii = pair<int,int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define invec(v) for(auto& x : v)cin>>x;
#define Test int T;cin>>T;while(T--)
#define REP(i,j,k) for(int i=(j);(i)<(k);(i)++)
#define Time()	cerr <<'\n' << clock() * 1000 / CLOCKS_PER_SEC << "ms\n"
#define SZ(x) (int)x.size();
#define all(x) x.begin,x.end()
// no change 

//const int MxN = 1e9+5;
ll f(int a, int b){
	if(b<=0)return 0;
	ll ans = 2*a + f(a,b-a);
	return ans;
}
ll solve(int a,int b){
	ll ans = 0;
	if(a < b)return ans+=f(a,b);
	else{
		ans = a + solve(a-b,b);
	}
	return ans;
}
ll gcd(ll a,ll b){
	if(a==0)return b;
	else if(b == 0)return a;
	else return gcd(max(a,b)%min(a,b),min(a,b)) ;
}
int main() {
	ll a,b;
	cin >> a >> b;
	cout << 3*(a-gcd(a,b));
	
	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    int N; cin>>N;
    int sum=0;
    set<ll> A;
    for (int i = 0; i < N; ++i) {
        ll a; cin>>a;
        if(!A.count(a)) {
            A.insert(a);
            sum++;
        }else {
            A.erase(a);
            sum--;
        }
    }

    cout<<sum<<endl;
    return 0;
}

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

//template---{{{
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b); i > (a); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)

#define all(i) (i).begin(), (i).end();
//end.template ---}}}

int main() {

    string S;
    int res = 0;

    cin >> S;

    if (S[0] == 'a' || S[1] == 'a' || S[2] == 'a') res++;
    if (S[0] == 'b' || S[1] == 'b' || S[2] == 'b') res++;
    if (S[0] == 'c' || S[1] == 'c' || S[2] == 'c') res++;

    if (res == 3) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return (0);
}




Measured memory_bytes: 256
MOD = 998244353
n, s = map(int, input().split())
nums = list(map(int, input().split()))

dp = [[0] * (s + 1) for _ in range(n + 1)]
dp[0][0] = 1

for i in range(n):
  for j in range(s + 1):
    dp[i + 1][j] += dp[i][j] * 2 % MOD
    if j >= nums[i]:
      dp[i + 1][j] += dp[i][j - nums[i]]
    dp[i + 1][j] %= MOD
print(dp[n][s])

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

int main(){
	lld n;
	cin>>n;
	
	vector<lld > v(n+1);
	vector<lld > pre(n+5,0),post(n+5,0);
	for(lld i=1;i<=n;i++){
		cin>>v[i];
		pre[i]=pre[i-1]+v[i];
	}
	
	for(lld i=n;i>=1;i--){
		post[i]=post[i+1]+v[i];
	}
	post[n+1]=LLONG_MAX;
	lld ans=LLONG_MAX;
	for(lld i=1;i<=n;i++){
		ans=min(ans,abs(pre[i]-post[i+1]));
	}
	cout<<ans;
}

Measured memory_bytes: 4992
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define sim template < class c
#define int long long
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << '\n'; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef tree< pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long ll;
const ll MOD = 1e9 + 7 ;
const ll N = 2e5 + 10 ;
const ll INF = 1e18 + 10 ;
signed main(){
    fastio
    int n ; 
    cin >> n ; 
    map<string,int> mp ;
    for(int i = 0; i < n; i++){
        string x; 
        cin >> x ;
        mp[x]++ ;
    }
    cout << "AC x " << mp["AC"] << endl;
    cout << "WA x " << mp["WA"] << endl;
    cout << "TLE x " << mp["TLE"] << endl;
    cout << "RE x " << mp["RE"] << endl;
    return 0; 
}

Measured memory_bytes: 3652
var
util = require('util');

function main() {
  util.print(input.replace(/apple|peach/g, function(w) {
    return w === 'apple' ? 'peach' : 'apple';
  }));
}

var
input = '';

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});
process.stdin.on('end', function() {
  main();
});

Measured memory_bytes: 7652
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,a[400040],last[200020],len[400040];
int st[200020],tp,bg,l,s;
int vis[200020];
bool bj[200020];
long long k;
int main()
{
	scanf("%d %lld",&n,&k);
	for(int i=1;i<=n;++i)scanf("%d",&a[i]),a[i+n]=a[i];
	for(int i=2*n;i;--i)
	{
		if(last[a[i]])len[i]=len[last[a[i]]+1];
		else len[i]=2*n-i+1;
		last[a[i]]=i;
	}
	st[++tp]=len[n+1];
	vis[len[n+1]]=1;
	int x=len[n+1];
	for(int i=2;;++i)
	{
		x=len[n-x+1];
		if(vis[x])
		{
			bg=vis[x];
			l=i-vis[x];
			break;
		}
		vis[x]=i;
		st[++tp]=x;
	}
//	for(int i=1;i<=tp;++i)printf("%d ",st[i]);printf("\n");
	if(k<bg)s=st[k];
	else s=st[(k-bg)%l+bg];
	tp=0;
//	printf("%d\n",s);
	for(int i=n-s+1;i<=n;++i)
	{
//		printf("i:%d %d\n",i,a[i]);
		if(!bj[a[i]])bj[a[i]]=1,st[++tp]=a[i];
		else while(bj[a[i]])bj[st[tp--]]=0;
	}
	for(int i=1;i<=tp;++i)printf("%d ",st[i]);
	return 0;
}


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

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main() {
  int n,k;
  cin >> n>>k;
  long mod=1000000007;
  long ans=0;
  vector<long>d(k+1);
  for(int i=k;i>0;i--){
    d[i]=(d[i]+modpow(k/i,n,mod))%mod;
    for(int j=2;j*i<=k;j++){
      d[i]=(d[i]+mod-d[j*i])%mod;
    }
  }
  rep(i,k+1){
    ans=(ans+d[i]*i)%mod;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 4052
//  RAKSHIT KADAM

 #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 3
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree< int ,  null_type ,  less<int> ,  rb_tree_tag ,  tree_order_statistics_node_update>
#warning !!!check the size of arrayss!!!
 
// NUMERIC DEFINITIONS :
    #define INF 100000000000000005
    #define inf 1000000004
    #define MOD  1000000007
    #define mod 998244353
    #define MAX 300006
    #define pi 3.1415926535897932384626433832795
#define ld long double
 #define ll long long
 #define int long long
 
 #define P(gg) for(auto rax:gg){cout<<rax<<" ";}cout<<endl;
 #define Need_for_speed(activated) ios_base :: sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
 #define satisfy ll t; cin>> t; while(t--)
 #define inp(n) int n;cin >> n
 #define mp make_pair
 #define pb push_back
 #define endl "\n"
 #define x first
 #define y second
 #define fore(i,a,b) for(ll i=a;i<b;i++)
 #define forci(i,n) for(ll i=0;i<n;i++)
 #define vi vector<ll>
 #define Endl endl
 #define lb lower_bound
 #define ub upper_bound
#define pii pair<ll,ll>
 
 #define input freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout)
 #define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;
 
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
int power(int x, unsigned int y, unsigned int m){ if (y == 0) return 1;int p = power(x, y/2, m) % m;  p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m;}
ll modInverse(int a, int m){{ return power(a, m-2, m);}}
const int maxn = 500003;
// ll fact[1000005];
//ll modIN[1000005];
//void facto()
//{
//    ll lim =1000005;fact[0]=1;
//    for(ll i=1;i<lim;i++)
//    {
//        fact[i]=(fact[i-1]*i)%MOD;
//    }
//    modIN[n]=modInverse(fact[n],MOD);
//    for(ll i=n-1;i>=1;i--)
//    {
//        modIN[i] = (modIN[i+1]*(i+1))%MOD;
//    }
//}
//ll ncr(ll a,ll b)
//{
//    ll ret = 0;
//    ret = fact[a]*(modIN[b]);
//    ret%=MOD;
//    ret*=modIN[a-b];
//    ret%=MOD;
//    return ret;
//}
ll dp[3004][3004][4];
ll a[3004][3004];
ll r,c,k;
ll rec(ll i,ll j,ll k=0)
{
    if(i>=r || j>=c)return 0;
    if(dp[i][j][k]!=-1)return dp[i][j][k];
    dp[i][j][k]=0;
    if(!a[i][j])
    {
        dp[i][j][k]  = max(rec(i+1,j),rec(i,j+1,k));
    }
    else
    {
        if(k<3)
        {
            dp[i][j][k] = max(a[i][j]+rec(i,j+1,k+1),rec(i,j+1,k));
            dp[i][j][k] =max(dp[i][j][k],a[i][j]+rec(i+1,j));
        }
        else dp[i][j][k] =max(dp[i][j][k],rec(i+1,j));
        
    }
    return dp[i][j][k];
}
void solve()
{
    cin>>r>>c>>k;
    while(k--)
    {
        ll aa,b,c;cin>>aa>>b>>c;
        --b,--aa;
        a[aa][b]=c;
    }
    memset(dp,-1,sizeof dp);
    cout<<rec(0,0)<<endl;
}
signed main()
{
   Need_for_speed(activated);
    
//    satisfy
//    {
//
//    }
   
    solve();
    
    return 0;
}


Measured memory_bytes: 356576
import java.io.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
//		StringBuilder out = new StringBuilder();
		int n = sc.nextInt();
		String in = sc.next();
		int res = 0;
		for(int i = 0; i < n-2; i++) {
			if(in.substring(i, i+3).equals("ABC")) res++;
		}
		System.out.println(res);
	}
	static int calc(int[] arr, int n) {
		int res = 0;
		boolean[] seen = new boolean[n];
		for(int i = 0; i < n-1; i++) {
			int k = 0;
			for(int j = 0; j < n; j++) {
				if(!seen[j] && j < arr[i]) k++;
			}
			seen[arr[i]] = true;
			res += k;
			res *= (n-i-1);
		}
		return res;
	}

	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch(IOException e) {
				throw new RuntimeException(e);
			}
		}
	}

}


Measured memory_bytes: 22612