akhauriyash/Code-Regression huggingface dataset:
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

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

	string S, T;
	cin >> S >> T;
	S += T.back();
	if (S == T)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <algorithm>
#include <set>
template<typename T> inline void read(T &x) { 
  x = 0; char c = getchar(); bool flag = false;
  while (!isdigit(c)) { if (c == '-') flag = true; c = getchar(); }
  while (isdigit(c)) { x = (x << 1 ) + (x << 3) + (c ^ 48); c = getchar(); }
  if (flag) x = -x; 
}
using namespace std;
multiset<string> st; 
int main() {
  int A, B, C; read(A), read(B), read(C);
  while (A) st.insert("a"), --A;
  while (B) st.insert("b"), --B;
  while (C) st.insert("c"), --C;
  while (st.size() != 1) {
    string smal = *(st.begin()), larg = *(--st.end());
    st.erase(st.find(smal)); st.erase(st.find(larg));
    st.insert(smal + larg);
  }
  cout << *st.begin() << endl;
  return 0;
}


Measured memory_bytes: 3160
a,b,m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = min(a)+min(b)
for i in range(m):
    x,y,c = list(map(int, input().split()))
    if a[x-1]+b[y-1]-c<ans: ans = a[x-1]+b[y-1]-c
print(ans)

Measured memory_bytes: 69956
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;


#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;


void Main(){
   int x;
   cin >> x;
   
  if(x < 1200){
     cout << "ABC" << endl;
  }
  else{
  cout << "ARC" << endl;
    }
 return;
 }
  
int main(){
 cin.tie(nullptr);
 ios_base::sync_with_stdio(false);
 cout << fixed << setprecision(15);
 Main();
 return 0;
 }


Measured memory_bytes: 256
#include <cstdint>
    #include<iostream>
    #include<cstdio>
    #include<algorithm>
    #include<cmath>
    #include<vector>
    #include<set>
    #include<map>
    #include<queue>
    #include<stack>
    #include<cctype>
    #include<climits>
    #include<string>
    #include<bitset>
    #include<cfloat>
    #include<iomanip>
    #include<numeric>
     
    //#define int long long
    #define repi(i,start,end) for(int (i)=(start),TemPNuM=(int)(end);(i)<TemPNuM;++(i))
    #define rep(i,end) repi((i),0,(end))
    #define rfor(x,v) for(auto& (x) : (v))
    #define all(x) (x).begin(),(x).end()
    #define rall(x) (x).rbegin(),(x).rend()
    #define fsort(v,lambda) sort(all((v)),(lambda))
    #define vin(v) rep(i,(v).size())cin >> (v)[i];
    #define vpin(v) rep(i,(v).size())cin>>v[i].first>>v[i].second
     
    using namespace std;
    using ll =  long long;
    using pint =  pair<int,int>;
    using vint = vector<int>;
    using vvint = vector<vint>;
    using vpint = vector<pint>;
     
    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; }
    template<class T>void put_double(T a){if(cout.precision()!=12)cout<<setprecision(12);cout<<a<<endl;}
    template<class T>void print(T a){cout << a << endl;}
    //lambda: [](int x, int y){return x<y;}
     
    signed main(void) {
        int n; cin >> n;
        ll ans = 1;
        ll MOD = 1e9 + 7;
        rep(i, n) {
            ans = ans * (i + 1) % MOD;
        }
        print(ans);
     
        return 0;
    }

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n, ans = 0;
LL a[2000100], b[2000100];
int main(){
   cin >> n;
   for(int i = 1; i <= n; i++){
       cin >> a[i];
       if(i > a[i]){
           b[i - a[i]]++;
       }
    }

    for(int i = 1; i <= n; i++){
        if(i > a[i]){
            b[i - a[i]]--;
        }
        if(i + a[i] <= n){
            ans += b[i + a[i]];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 6768
#include <stdio.h>

int main(){
    int a,b,c,n,counter=0;
    while (scanf("%d",&n) !=EOF) {
        for (a=0; a<=9; a++)
            for (b=0; b<=9; b++)
                for (c=0; c<=9; c++)
                    if (0<=n-a-b-c && n-a-b-c<=9)
                        counter++;
                    
        printf("%d\n",counter);
        counter=0;
    }
    
    return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

int main(){
	int a,b,c,i;
	vector<int> v;
	i=1;
	cin>>a>>b>>c;
	while(i<=a||i<=b){
	  if(a%i==0&&b%i==0){
	    v.push_back(i);
	  }
	  i++;
	}
	sort(v.begin(),v.end(),greater<int>());
	cout << v.at(c-1) <<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>

using namespace std;
using lint = int64_t;

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

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

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

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

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

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

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

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

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

lint n, k, l, r;
lint a[2 * 100010];

bool f(lint x) {
	lint cnt = 0;
	rep(i, n) {
		cnt += (a[i] + x - 1) / x - 1;
	}
	return cnt <= k;
}
int main() {
	cin >> n >> k;
	rep(i, n) {
		cin >> a[i];
		r = max(r, a[i]);
	}
	while (r - l > 1) {
		lint mid = (l + r) / 2;
		if (f(mid)) r = mid;
		else l = mid;
	}
	cout << r << endl;
}

Measured memory_bytes: 5152
import java.util.Scanner;

class Main {
	Scanner sc = new Scanner(System.in);

	boolean[][] cards=new boolean[4][14];
	
	public int StoI(String s){
		if("S".equals(s)){
			return 0;
		}else if("H".equals(s)){
			return 1;
		}else if("C".equals(s)){
			return 2;
		}else{
			return 3;
		}
	}
	public String ItoS(int i){
		switch(i){
		case 0:return "S";
		case 1:return "H";
		case 2:return "C";
		case 3:return "D";
		default:return null;
		}
	}
	
	public void run() {
		int N = sc.nextInt();
		for(int i=0;i<N;i++){
			String type=sc.next();
			int num=sc.nextInt();
			cards[StoI(type)][num]=true;
		}
		
		for(int c=0;c<4;c++)for(int i=1;i<=13;i++){
			if(!cards[c][i]){
				ln(ItoS(c)+" "+i);
			}
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}

	public static void pr(Object o) {
		System.out.print(o);
	}

	public static void ln(Object o) {
		System.out.println(o);
	}

	public static void ln() {
		System.out.println();
	}
}

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

int main() {
    int a,b,c;
    cin>>a>>b>>c;

    if(a<=c&&b>=c){
        cout<<"Yes"<<endl;
    }
    else {
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
using dou =long double;
string Yes="Yes";
string YES="YES";
string NO="NO";
string No="No";
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 rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(int i = m; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define res resize
#define as assign
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
 
typedef long long ll;
const int INF = 2000000000;
const ll INF64 = 922337203685477580ll;
const int mod = 1000000007ll;
const ll  MOD = 1000000007LL;
const double pi=3.1415926535897932384626;
int main(){
    int n;
    std::cin >> n;
    VEC(ll,a,n);
    int c=0;
    rep(i,n){
        if(a[i]<0){
            c++;
            a[i]*=-1ll;
        }
    }
    sort(all(a));
    
    if(c%2==0)std::cout << sum(a) << std::endl;
    else std::cout << sum(a)-a[0]*2 << std::endl;
}

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

#define p_ary(ary,a,b,i) do { cout << "["; for (int i = a;i <= b;++i) cout << ary[i] << (b == i ? "]\n" : ", "); } while(0)
#define p_map(map,it) do {cout << "{";for (auto it = map.begin();;++it) {if (it == map.end()) {cout << "}\n";break;}else cout << "" << it->first << "=>" << it->second << ", ";}}while(0)

int main() {
    int n,k,q,a[2010];
    cin >> n >> k >> q;
    for (int i = 0;i < n;++i) cin >> a[i];
    a[n] = -1;

    int ans = INT_MAX;
    for (int i = 0;i < n;++i) {
        int l = 0;
        vector<int> b,temp;
        for (int j = 0;j <= n;++j) {
            if (a[j] < a[i]) {
                if (l >= k) {
                    sort(temp.begin(),temp.end());
                    for (int x = 0;x < temp.size()-k+1;++x) b.push_back(temp[x]);
                }
                l = 0;
                temp.clear();
            } else {
                l++;
                temp.push_back(a[j]);
            }
        }
        sort(b.begin(),b.end());
        if (b.size() >= q) ans = min(ans,b[q-1]-a[i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
 
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//pair sort
bool compare_by_b(pair<LL, LL> a, pair<LL, LL> b) {
    if(a.second != b.second) return a.second < b.second;
    else return a.first < b.first;
}
std::uint32_t euclidean_gcd(std::uint32_t a, std::uint32_t b){return b != 0 ? euclidean_gcd(b, a % b) : a;}

const string YES = "Yes";
const string NO = "No";

void solve(std::vector<std::vector<long long> > c){
    for(int a0 = 0; a0 <=100; a0++){
        vector < LL > a(3);
        vector < LL > b(3);
        a[0]=a0;
        b[0] = c[0][0]-a[0];
        b[1] = c[0][1]-a[0];
        b[2] = c[0][2]-a[0];
        a[1] = c[1][1]-b[1];
        a[2] = c[2][1]-b[1];
        bool flag = true;
        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                if(c[i][j] != a[i]+b[j])flag=false;
            }
        }
        if(flag){
            cout<<YES<<endl;return;
        }
    }
    cout<<NO<<endl;
    return;
}

int main(){
    std::vector<std::vector<long long> > c(3, std::vector<long long>(3));
    for(int i = 0 ; i < 3 ; i++){
        for(int j = 0 ; j < 3 ; j++){
            scanf("%lld",&c[i][j]);
        }
    }
    solve(std::move(c));
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**9)

def dfs(G, v, p):
    seen[v] = True
    for nv in G[v]:
        if nv == p: continue
        if seen[nv]: continue
        dfs(G, nv, v)
    
    for c in G[v]:
        if c != p: continue
        sz[p] += (sz[v]+1)

n, m = map(int, input().split())
ab = []
for _ in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    if a > b:
        a, b = b, a
    ab.append((a, b))
ab = set(ab)

G = [[] for _ in range(n)]
for a, b in ab:
    G[a].append(b)
    G[b].append(a)

seen = [False]*n
sz = [0]*n
for i in range(n):
    if not seen[i]:
        dfs(G, i, -1)

print(max(sz)+1)

Measured memory_bytes: 746000
N=int(input())
s=[]
for i in range(N):
    s.append(str(input()))
M=int(input())
t=[]
for j in range(M):
    t.append(str(input()))

ans=0
for i in range(N):
    x=s.count(s[i])
    y=t.count(s[i])
    if ans<x-y:
        ans=x-y
print(ans)

Measured memory_bytes: 9064
var s:string;
var i:longint;
begin
 readln(s);s:=upcase(s);
 for i:=1 to length(s)-1 do 
  if((s[i]='A')and(s[i+1]='C')) then 
   begin
     writeln('Yes');halt;
   end;
 writeln('No');
end.

Measured memory_bytes: 128
#include <stdio.h>
#include <string.h>

int main(){
  char s[200],work;
  unsigned int m,h,i,j,k;

  while(1){

    scanf("%s",s);
    if(s[0]=='-') break;
    
    scanf("%d",&m);
    
    for(i=0; i<m; ++i){
      scanf("%d",&h);
      for(j=0; j<h; ++j){
	for(k=0; k < strlen(s) ; ++k){
	  if(k==0)
	    work=s[0];
	  else 
	    s[k-1]=s[k];
	}
	s[strlen(s)-1]=work;
      }
    }
    
    printf("%s\n",s);
    
  }
  

  return 0;
}



Measured memory_bytes: 2684
#include <bits/stdc++.h>
#define ll long long
#define db double
#define ldb long double
#define pii pair<int,int>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define xh1(a,b) for(int i=a;i<b;i++)
#define xh2(a,b) for(int j=a;j<b;j++)
#define stlbl(a) for(it=a.begin();it!=a.end();it++)
#define dzkt int T;cin>>T;while(T--)
#define mst(a,i) memset(a,i,sizeof(a))
#define iosks std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int N=2005,inf=1e9+10,mod=1e9+7;
ll pow2(ll a,ll b) {ll s=1; while(b) {if(b&1) s=(s*a); a=(a*a); b/=2; } return s;}
int gcd(int a,int b) {return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) {return a/gcd(a,b)*b; }
ll prime(ll x) {for(ll i=2;i<=sqrt(x+0.5);i++) if(x%i==0) return 0; return 1; }

char ch[N];
vector<ll> vec;

ll a[N],n,k,ans;

int main()
{
    iosks;
    cin>>n>>k;
    xh1(0,n) cin>>a[i];
    sort(a,a+n);
    xh1(0,k) ans+=a[i];
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>

using namespace std;

#define N 200008

int n;
int a[N];

int main()
{
	int four = 0, two = 0, one = 0;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
	{
		scanf("%d", &a[i]);
		if (a[i] % 4 == 0)
			four ++;
		else if (a[i] % 2 == 0)
			two ++;
		else
			one ++;
	}
	if (one <= four)
		printf("Yes\n");
	else if (one == four + 1)
	{
		if (two == 0)
			printf("Yes\n");
		else
			printf("No\n");
	}
	else
		printf("No\n");
	return 0;
}

Measured memory_bytes: 640
import math
import sys
from collections import Counter

N = int(input())
Ns = N
Nso = []
i = 0
if N == 1:
    print(0)
    sys.exit()

Nruto = math.sqrt(N)
Nruto = math.floor(Nruto)


# 素因数分解していきますpart2
for i in range(2, Nruto+1):
    while N % i == 0:
        N = N//i
        Nso.append(i)
    if N == 1:
        break
    Nruto = math.sqrt(N)
    Nruto = math.floor(Nruto)

Nso.append(N)
if 1 in Nso:
    Nso.remove(1)

# Nso^xの形にカウントしていきます
Nso.sort()
Nso = Counter(Nso)


# 設問の操作をしていきます
x = 0
count = 0
xcount = 0
while Ns > 1 and x <= len(Nso):
    for x in Nso.keys():
        for y in range(1, Nso[x]+1, +1):
            if Ns % (x**y) == 0:
                count = count+1
                Ns = Ns/(x**y)
                xcount = xcount+y
            else:
                break

print(count)


Measured memory_bytes: 9548
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#define INF 1000000007
using namespace std;
typedef long long ll;

int main() {
	int n;
	cin >> n;
	vector<int> arr(n);
	for(int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	reverse(arr.begin(),arr.end());
	vector<int> dp(n+1,INF);
	dp[0] = -1;
	for(int i = 0; i < n; i++) {
		int index = upper_bound(dp.begin(),dp.end(),arr[i]) - dp.begin() - 1;
		//cout << "index:" << index << endl;
		dp[index+1] = arr[i];
		/*
		for(int j = 1; j < n+1; j++) {
			cout << dp[j] << " ";
		}
		cout << endl;
		*/
	}
	int ans = 0;
	for(int i = 1; i <= n; i++) {
		ans += ((dp[i]!=INF)?1:0);
	}
	cout << ans << endl;
}


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

public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] p = new int[n];
        for (int i = 0; i < n; i++) {
            p[i] = sc.nextInt();
        }

        int ans = 0;
        for (int i = 1; i <= n-2; i++) {
            if ((p[i - 1] < p[i] && p[i] <= p[i + 1])
                    ||
                (p[i - 1] >= p[i] && p[i] > p[i + 1])) {
                ans++;
            }
        }
        System.out.print(ans);
    }

    // Main
    public static void main(String[] args) {
        new Main().solve();
    }
}



Measured memory_bytes: 22740
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
const int N=3100;
const ll mod=998244353;
ll dp[N][N];
inline void Add(ll &a, ll b) {
	a += b;
	a%=mod;
}
inline void Sub(ll &a, ll b) {
	a -= b;
	a+=mod;
	a%=mod;
}
inline ll Mul(ll a, ll b) {
	return (ll(a) * b) % mod;
}
int main()
{

	ios_base:: sync_with_stdio(false); cin.tie(0);
	ll a,b,c,d; cin>>a>>b>>c>>d;
	dp[a][b]=1;
	for(ll row=a; row<=c; row++) {
		for(ll column=b; column<=d; column++) {
			Add(dp[row][column],Mul(dp[row-1][column],column));
			Add(dp[row][column],Mul(dp[row][column-1],row));
			Sub(dp[row][column],Mul(row-1,Mul(column-1,dp[row-1][column-1])));
		}
	}

// dp[row][column]= dp[row-1][column]*row+column+dp[row][column-1]*column
	cout<<dp[c][d]<<endl;


	return 0;
}


Measured memory_bytes: 76236
#include<bits/stdc++.h>
using namespace std;
deque < string > s;
int ans=0;
int main()
{
	int n;
	cin>>n;
	string s2;
	for(int i=0;i<n;i++)
	{
		cin>>s2;
		s.push_back(s2);
	}
	sort(s.begin(),s.end());
	string u="";
	for(int i=0;i<n;i++)
	{
		if(u!=s[i])
		{
			u=s[i];
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 10064
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const int MAX_N = 1010;
const int MAX_M = 2010;
const ll INF = 1e16;

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

    vector<ll> a(MAX_M), b(MAX_M), c(MAX_M);
    rep(i, m) {
        cin >> a[i] >> b[i] >> c[i];
        a[i]--;  b[i]--;
        c[i] *= -1;
    }

    vector<ll> dist(MAX_N);
    rep(i, n) {
        dist[i] = INF;
    }

    dist[0] = 0;
    rep(loop, n-1) {
        rep(i, m) {

            if(dist[a[i]] == INF) {
                continue;
            }

            dist[b[i]] = min(dist[b[i]], dist[a[i]] + c[i]);

        }
    }

    ll ans = dist[n-1];

    vector<bool> negative(MAX_N);

    rep(loop, n) {
        rep(i, m) {

            if(dist[a[i]] == INF) {
                continue;
            }

            if(dist[b[i]] > dist[a[i]] + c[i]) {
                dist[b[i]] = dist[a[i]] + c[i];
                negative[b[i]] = true;
            }

            if(negative[a[i]]) {
                negative[b[i]] = true;
            }

        }
    }

    if(negative[n-1]) {
        cout << "inf";
    }
    else {
        cout << -ans;
    }

    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define inf 10000000000
#define pll pair<ll,ll>
#define magic ios_base::sync_with_stdio(false);cin.tie(nullptr)
using namespace std;
#define forn(i,n) for(ll i=1;i<=n;i++)
#define forRn(i,n) for(ll i=n;i>=1;i--)
#define forz(i,n) for(ll i=0;i<n;i++)
#define forRz(i,n) for(ll i=n-1;i>=0;i--)
#define forab(i,a,b) for(ll i=a;i<=b;i++)
#define mod 10007
#define has 3
ll gcd(ll x,ll y){ return y==0?x:gcd(y,x%y); }
ll lcm(ll x,ll y){ return x/gcd(x,y)*y; }

ll arr[200005];

int main(void)
{
    magic;
    ll N;
    cin>>N;
    vector<ll> ans;
    forn(i,N){
        cin>>arr[i];
    }
    forRn(i,N){
        ll gesu = 0;
        for(ll j = i+i; j<=N; j+=i){
            gesu += arr[j];
        }
        gesu = gesu%2;
        //cout<<i<<' '<<gesu<<' '<<arr[i]<<'\n';
        if(gesu!=arr[i]){
            arr[i] = 1;
            ans.push_back(i);
        } else arr[i] = 0;
    }

    ll asiz = ans.size();
    cout<<asiz<<'\n';
    forz(i,asiz){
        cout<<ans[i]<<' ';
    }

}


Measured memory_bytes: 3572
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 入力値を文字の配列で返却する
def gets_nsp_list()
  gets.chomp.split("")
end

w_list = gets_nsp_list

w_count_h = w_list.group_by(&:itself).map{|k,v| [k, v.count]}.to_h

dpp w_count_h

w_count_h.each do |k, v|
  if v.odd?
    puts "No"
    exit
  end
end

puts "Yes"

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

// syntax sugar: `for (int i = 0; i < N; ++i)`
#define rep(i, N) for (int i = 0; i < (int)(N); ++i)
#define rep2(i, startValue, N) for (int i = (int)(startValue); i < (int)(N); ++i)
// syntax sugar: `for (int i = 0; i < N; ++i)`
#define REP(type, name, beginValue, endCondValue) \
  for (type name = beginValue; name < endCondValue; ++name)
// syntax sugar: 多次元vector
#define VECTOR_DIM3(T, name, d1, d2, d3, initValue) \
    std::vector<std::vector<std::vector<T>>> name(d1, std::vector<std::vector<T>>(d2, std::vector<int>(d3, initValue)));
#define VECTOR_DIM2(T, name, d1, d2, initValue) \
    std::vector<std::vector<T>> name(d1, std::vector<T>(d2, initValue));
#define VECTOR_DIM1(T, name, d1, initValue) \
    std::vector<T> name(d1, initValue);
#define ll long long
#define ld long double
#define DUMP(v) "," #v ":" << v


// CODE FESTIVAL 2017 qualB
// B - Problem Set
int main(){
  ll n;
  cin >> n;
  vector<ll> diff(n, 0);
  rep(i,n) cin >> diff[i];
  ll m;
  cin >> m;
  vector<ll> tiff(m, 0);
  rep(i,m) cin >> tiff[i];

  unordered_map<ll, int> diffmap;
  for(const auto& d : diff) {
    diffmap[d]++;
  }
  unordered_map<ll, int> requiredmap;
  for(const auto& t : tiff) {
    requiredmap[t]++;
  }

  bool ans = true;
  for (const auto& p : requiredmap) {
    if (diffmap[p.first] < p.second) {
      ans = false;
      break;
    }
  }

  cout << (ans ? "YES" : "NO") << endl;
  return 0;
}


Measured memory_bytes: 22836
#include <iostream>
#define NUM 5

int main(){
  int a[NUM], k;
  for(int i=0; i<NUM; i++) std::cin >> a[i];
  std::cin >> k;

  bool exist = true;
  for(int i=0; i<NUM; i++){
    for(int j=i; j<NUM; j++){
      if(a[j]-a[i]>k){
        exist = false;
        break;
      }
    }
  }

  if(exist){
    std::cout << "Yay!" << std::endl;
  }else{
    std::cout << ":(" << std::endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
template <typename Monoid=ll> class SegmentTree {
    public:
    using Monoid_func = function<Monoid(Monoid, Monoid)>;
    ll size;
    std::vector<Monoid> segment;  // 1-indexed 葉ノードは size ~ 2*size-1
    Monoid Monoid_unit;
    Monoid_func Monoid_calc;

    SegmentTree(ll N, 
                Monoid Monoid_unit = 0,
                Monoid_func Monoid_calc = [](ll a, ll b){return a+b;}) 
            : size(1), Monoid_unit(Monoid_unit), Monoid_calc(Monoid_calc) {
        while(size < N) size <<= 1;
        segment.assign(size*2, Monoid_unit);
    }

    void set(ll k, Monoid a){
        segment[k+size] = a;
    }
    void build(){  // 全てのノードを再計算
        for(ll k=size-1; k>0; k--) segment[k] = Monoid_calc(segment[k*2], segment[k*2+1]);
    }
    void build(std::vector<Monoid> v){
        for(ll k=0; k<size; k++){segment[k+size]=v[k];} build();
    }
    void update_replace(ll k, Monoid a){
        k += size;
        segment[k] = a;
        while(k >>= 1) segment[k] = Monoid_calc(segment[k*2], segment[k*2+1]);
    }
    void update_add(ll k, Monoid a){
        k += size;
        segment[k] = Monoid_calc(segment[k], a);
        while(k >>= 1) segment[k] = Monoid_calc(segment[k*2], segment[k*2+1]);
    }
    void update_del(ll k, Monoid a){
        k += size;
        segment[k] = Monoid_calc_back(segment[k], a);
        while(k >>= 1) segment[k] = Monoid_calc_back(segment[k*2], segment[k*2+1]);
    }
    Monoid query(ll a, ll b){ // [a, b)の演算結果
        Monoid l=Monoid_unit, r=Monoid_unit;
        for(a+=size, b+=size; a<b; a>>=1, b>>=1){
            if(a % 2 == 1) l = Monoid_calc(l, segment[a++]);
            if(b % 2 == 1) r = Monoid_calc(segment[--b], r);
        }
        return Monoid_calc(l,r);
    }

    Monoid operator[](const ll &k) const{
        return segment[k+size];
    }
};

int main(){
    ll n,q;
    cin>>n;
    string s;
    cin>>s;
    vector<int> beg(26);
    vector<vector<int>> in; in.clear();
    for(auto i : s){
        vector<int> v(26);
        v[i-'a']=1;
        in.push_back(v);
    }
    int size=1;
    while(size < n) size <<= 1;
    while(in.size()<size)in.push_back(beg);
    SegmentTree<vector<int>> st(n, beg, [](vector<int> a, vector<int> b){
        vector<int> ans(26);
        REP(i,26)ans[i]=a[i]+b[i];
        return ans;
    });
    st.build(in);
    ll num,l,r;
    char c;
    cin>>q;
    REP(i,q){
        cin>>num;
        if(num==1){
            cin>>l>>c;
            vector<int> v(26);
            v[c-'a']++;
            vector<int> vv = st[l-1];
            int vvv;
            REP(j,26)if(vv[j]!=0)vvv=j;
            v[vvv]--;
            st.update_add(l-1,v);
        }
        else{
            cin>>l>>r;
            vector<int> ans = st.query(l-1,r);
            ll out=0;
            REP(i,26)out += (ans[i]!=0);
            cout<<out<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 279280
#include <algorithm>
#include <stdio.h>
#include <iostream>

int main(){
  int val[3];
  scanf("%d",&val[0]);
  scanf("%d",&val[1]);
  scanf("%d",&val[2]);
  std::sort(val, val+3);
  int calc = val[0] * val[1] / 2;
  printf("%d\n",calc);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;
typedef long long int lli;

lli power(int x, lli n) {
    if (n == 0) return 1;

    if (n == 1) return x;

    if (n & 1) {
        lli t = power(x, n >> 1);
        return t * t * x;
    } else {
        lli t = power(x, n >> 1);
        return t * t;
    }
}

int main() {
    lli N, P;
    cin >> N >> P;

    if (N == 1) {
        cout << P << endl;
        return 0;
    }

    if (N >= 40) {
        cout << 1 << endl;
        return 0;
    }

    int ans = 0;
    for (int i = 1; true; i++) {
        lli t = power(i, N);
        if (t > P) break;
        if (P % t == 0) ans = i;
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define pob pop_back
#define ff first
#define ss second
#define endl "\n"
#define all(a) a.begin(),a.end()
#define debug(x) cout << x << endl;
#define int long long
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

using namespace __gnu_pbds;
using namespace std;
using LD = long double;

const int N = 2e7+1;
const int mod = 1e9+7;
const int INF = 1e9;

void solve() {
	int n;
	cin >> n;
	int i = 1000;
	while(i < n) {
		i += 1000;
	}
	cout << i - n << endl;
}
 
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int t = 1,i = 1;
    //cin >> t;
    while(t--) {
        //cout << "Case #" << i << ": ";
        solve();
        //i++;
    }
    return 0;
}


Measured memory_bytes: 3664
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(m)]

from collections import defaultdict
g = defaultdict(list)
for a, b in ab:
    g[a - 1].append(b - 1)
    g[b - 1].append(a - 1)

ans = 0

for i in range(n):
    m = 0
    for target in g[i]:
        m = max(m, h[target])

    if h[i] > m:
        ans += 1

print(ans)


Measured memory_bytes: 116560
import java.util.Scanner;

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

        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int oddd = (a + 1) / 2;
        double ans = oddd * 1.0 / a;
        System.out.println(ans);

    }
}


Measured memory_bytes: 24020
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from scipy.sparse.csgraph import floyd_warshall
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush, heapify
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    x,n = inpm()
    l = inpl()
    for i in range(200):
        if x-i not in l:
            print(x-i)
            return
        if x+i not in l:
            print(x+i)
            return
    
if __name__ == "__main__":
    main()

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

#define rep(i,n) for(int i=0;i<(n); ++i)
#define INF 100000 // 2^31-1
#define MAX_V 100000


using namespace std;

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

string replaceAll(string &replacedStr, string from, string to) {
    unsigned int pos = replacedStr.find(from);
    int toLen = to.length();
 
    if (from.empty()) {
        return replacedStr;
    }
 
    while ((pos = replacedStr.find(from, pos)) != string::npos) {
        replacedStr.replace(pos, from.length(), to);
        pos += toLen;
    }
    return replacedStr;
}
 
int ctoi(const char c){
  switch(c){
    case '0': return 0;
    case '1': return 1;
    case '2': return 2;
    case '3': return 3;
    case '4': return 4;
    case '5': return 5;
    case '6': return 6;
    case '7': return 7;
    case '8': return 8;
    case '9': return 9;
    default : return -1;
  }
}

//22
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int gettt(long long int num){
    int digit=0;
if(num<10){
digit=0;
}else{
    while(num>1){
        num /= 10;
        digit++;
    }
}
    return digit;
}




int main() {

ios::sync_with_stdio(false);
cin.tie(0);
char n;
cin>>n;

if(isupper(n)){
cout<<"A"<<endl;
}else if(islower(n)){
cout<<"a"<<endl;
}

}
//double res=10.11;
//printf("%.10f",ans);
//cout << fixed << setprecision(5) <<(n*2)*M_PI << endl;


Measured memory_bytes: 3648
# coding=utf-8

###
### for atcorder program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]

# ソート
# N = N.sort()

# 10000個の素数リスト
# P = mymath.pnum_eratosthenes(105000)

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

def dist(A, B):
    d = 0
    for i in range(len(A)):
        d += (A[i]-B[i])**2            
    d = d**(1/2)
    return d


N = int(input())
A = [int(x) for x in input().split()]

#print(list(range(N-1, 0, -1)))

def printA(A):
    for i, n in enumerate(A):
        print(n, end='')
        if i != N-1:
            print(' ', end='')
    print()

printA(A)

count = 0
for i in range(1, N):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
        #printA(A)
    A[j+1] = v
    printA(A)
    #print(A)



Measured memory_bytes: 6408
#include <bits/stdc++.h>
using namespace std;
using pp=pair<int,int>;
using ll=long long;

int main() {
  ll N;
  string march="MARCH";
  cin >> N;
  map<char,ll> M;
  string S;
  for (ll i=0; i<N; i++) {
    cin >> S;
    for (char s:march) {
      if (s==S[0]) {
        goto OUT;
      }
    }
    continue;
  OUT:
    M[S[0]]++;
  }
  
  ll sum=0;
  for (int i=0; i<5; i++) {
    for (int j=i+1; j<5; j++) {
      for (int k=j+1; k<5; k++) {
        sum+=M[march[i]]*M[march[j]]*M[march[k]];
      }
    }
  }
  cout << sum << endl;
}
 

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define int long long
#define INF 1000000000000000
using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

    int N, K; cin >> N >> K;

    int ans;
    if(K % 2 == 1){
        int n = N / K;
        ans = n * n * n;
    }else{
        K /= 2;
        int n = N / K;
        int n_e = n / 2;
        int n_o = n - n_e;
        ans = n_e * n_e * n_e + n_o * n_o * n_o;
    }

    cout << ans;

    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

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

int a[100000][3];

int main()
{
	int f=1,i,j,n;
	cin>>n;
	for(i=0;i<=n;i++)
	{
		cin>>a[i][0]>>a[i][1]>>a[i][2];
		if(a[i][2]+a[i][1]>a[i][0]||a[i][0]%2!=(a[i][1]+a[i][2])%2) f=0;
	}
	
	if(f==1)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	
	return 0;
}

Measured memory_bytes: 1408
n = gets.chomp.split("")
for i in 0..n.length-1
  if i % 2 == 0
    if n[i] == "L"
      puts "No"
      exit
    end
  else
    if n[i] == "R"
      puts "No"
      exit
    end
  end
end
puts "Yes"


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

int main(){
  set<string> S;
  int N;
  cin >> N;
  string x;
  
  
  for(int i=0; i< N; i++){
    cin >> x;
    S.insert(x);
  }
  
  cout << S.size() << endl;
}

Measured memory_bytes: 19208
#include <bits/stdc++.h>
#define lli long long int
using namespace std;
#define S second
#define F first
#define pb push_back
#define M1 1000000007
#define M2 998244353
#define maxn 100000
#define plli pair<lli,lli>
#define setit set<lli>::iterator seti
#define mapit map<lli,lli> ::iterator mapi
#define MP make_pair
#define MT make_tuple
#define PI 3.14159265358979323846
// map      iterator->first  iterator.first
// map      mp[key]=value
// set      *s.begin()
// vector   v[j]=value
// pair     p.first p.second
// vector of pairs v[j].first v[j].second
// tuple    get<index>(tuple_name)
// vector of tuples get<index>(v[j])  sort(v.begin(),v.end())
//priority queue .top() .pop() .push()
// __gcd(x,y)
#define mini(x,y) (y + ((x - y) & ((x - y) >>(sizeof(int) * CHAR_BIT - 1))))
#define maxi(x,y) (x - ((x - y) & ((x - y) >> (sizeof(int) * CHAR_BIT - 1))))
#define fr(j,a,b) for(j=a;j<b;j++)

lli power(lli x, lli y, lli p)
{   lli res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {   if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
int main()
{
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    lli i, j, x, k, n, y,  p, q, l, t, z, m, w, r;
    cin >> t;
    if (t >= 30) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }
    // for(i=0;i<t;i++){
    //     cin>>n;
    //     lli a[n];
    //     for(j=0;j<n;j++){
    //         cin>>a[j];
    //     }

    // }
}

Measured memory_bytes: 3648
using System;

namespace AtCoder {

    class Program {

        static void Main(string[] args) {

            var D = int.Parse(Console.ReadLine());

            Console.Write("Christmas");

            for(int i = 0; i < Math.Abs(D - 25); i++) {

                Console.Write(" Eve");
            }
            Console.WriteLine("");
        }
    }
}


Measured memory_bytes: 11092
N,M,X,Y=gets.chomp.split(' ').map{|n| n.to_i}
x=gets.chomp.split(' ').map{|n| n.to_i}
y=gets.chomp.split(' ').map{|n| n.to_i}
if([x.max,X].max < [y.min,Y].min)
	puts "No War"
else
	puts "War"
end


Measured memory_bytes: 3836
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#define rep(i,a,b) for(int i = a; i < b; i++)
using namespace std;

int main(){
	long long n , a, b;
	cin >> n >> a >> b;
	cout << min(n*a, b) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define loop(n) for(ll i = 0; i<n; i++)
#define sort(a) sort(a.begin(), a.end())
using namespace std;

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    ll h, n, damage, cost; cin>>h>>n;
    vector<ll> dp(h+1, 1e12);
    dp[0] = 0;//dp[i] = min cost needed at health i of monster
    loop(n){
        cin>>damage>>cost;
        for(ll j = 0; j<=h; j++){
            dp[min(j + damage, h)] = min(dp[min(j + damage, h)], dp[j] + cost);
        }
    }
    cout<<dp[h]<<"\n";
    return 0;
}

Measured memory_bytes: 384
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let c: char = read();
    let mut ans = 'a';
    if c.is_uppercase() {
        ans = 'A';
    }
    println!("{}", ans);
}

Measured memory_bytes: 2008
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

int sx[4] = { 0, 1, 0, -1 };
int sy[4] = { 1, 0, -1, 0 };

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W;
	cin >> H >> W;
	string S[H];
	rep(i, H) cin >> S[i];
	//rep(i, H) cout << S[i] << endl;
	rep(i, H) {
		rep(j, W) {
			if (S[i][j] == '#') {
				int cnt = 0;
				rep(k, 4) {
					int x = i + sx[k];
					int y = j + sy[k];
					if (x < 0 || y < 0) continue;
					if (x >= H || y >= W) continue;
					if (S[x][y] == '#') cnt++;
				}
				// dump(cnt);
				if (cnt == 0) {
					cout << "No" << endl;
					return 0;
				}
			}
		}
	}
	cout << "Yes" << endl;

	return 0;
}


Measured memory_bytes: 256
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mx = 1e18;

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    ll a; string b;
    cin >> a >> b;
    ll c = 100 * (b[0] - '0') + 10 * (b[2] - '0') + b[3] - '0';
    cout << a * c / 100 << '\n';
}


Measured memory_bytes: 3620
import java.util.Scanner;

public class Main {

	static Scanner scanner;

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

	    int n=gi();
	    
	    
        //System.out.println(sb.toString());
        if (n==1) {
        	System.out.print("Hello World");
        }else {
        	System.out.print(gi()+gi());
        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Measured memory_bytes: 35628
#include <stdio.h>

int main()
{
	float a, b, c, d, e, f;
	float x, y;
	
	while(scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF){
		
		x = ((e*c)-(b*f)) / ((e*a)-(b*d));
		y = ((d*c)-(a*f)) / ((d*b)-(a*e));
		
		if(x == 0){
			 x = 0;
		}else if(y == 0){
			 y = 0;
		}
		
		printf("%.3f %.3f\n", x, y);
	}
	
	return 0;
}

Measured memory_bytes: 648