akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long                                    // long long省略
#define pb push_back                                    // push_back省略
#define mp make_pair                                    // make_pair省略
#define fi first                                        // first省略
#define se second                                       // second省略
#define itn int                                         // int誤字保険
#define count cout                                      // cout誤字保険
#define vecotr vector                                   // vector誤字保険
#define ednl endl                                       // endl誤字保険
#define opt() cin.tie(0); ios::sync_with_stdio(false)   // 入出力速度改善

#define rep(i,l,r) for(ll i=(l);i<(r);i++)               // 範囲[l, r)で刻み1のfor文(順方向)
#define repp(i,l,r,k) for(ll i=(l);i<(r);i+=(k))         // 範囲[l, r)で刻みkのfor文(順方向)
#define rrep(i,l,r) for(ll i=(r-1);i>=(l);i--)           // 範囲[l, r)で刻み1のfor文(逆方向)
#define rrepp(i,l,r,k) for(ll i=(r-1);i>=(l);i-=(k))     // 範囲[l, r)で刻みkのfor文(逆方向)
#define all(x) (x).begin(), (x).end()                   // vectorのポインタ位置指定用
#define max(p,q)((p)>(q)?(p):(q))                       // max拡張
#define min(p,q)((p)<(q)?(p):(q))                       // min拡張
#define bit(n,m)(((n)>>(m))&1)                          // 変数nのm番目のbitを取り出す

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

int dy[]={0, 1, 0, -1};                                 // 4方向近傍
int dx[]={1, 0, -1, 0};                                 // 4方向近傍

#define INF ((1LL<<62)-(1LL<<31))
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p) pom(a,p-2,p)

////////////////////////////////////////////////////////////////////////////////////////
int main(){
    ll n; cin >> n;
    ll a[n]; rep(i,0,n) cin >> a[i];
    
    ll sum = 0; rep(i,0,n) sum += a[i];
    ll csum[n]; csum[0] = a[0]; rep(i,1,n) csum[i] = csum[i-1] + a[i];

    ll res = INF;
    rep(i,0,n-1){
        res = min(res, abs(sum - csum[i]*2));
    }
    cout << res << endl;
}

Measured memory_bytes: 3328
#include<cstdio>
#include<vector>
using namespace std;
const int MAXN=100005;

int N,K;
int nxt[MAXN],dep[MAXN];
vector<int> radj[MAXN];
int ans=0;

void dfs(int u)
{
	for(auto v:radj[u])
	{
		dfs(v);
		dep[u]=max(dep[v]+1,dep[u]);
	}
	if(dep[u]==K-1&&nxt[u]!=1)
	{
		ans++;
		dep[u]=-1;
	}
}

int main()
{
	scanf("%d%d",&N,&K);
	for(int i=1;i<=N;i++)
	{
		scanf("%d",&nxt[i]);
		if(i==1&&nxt[i]!=1)
		{
			nxt[i]=1;
			ans++;
			continue;
		}
		if(i!=1)
			radj[nxt[i]].push_back(i);
	}
	dfs(1);
	printf("%d\n",ans);
	
	return 0;
}


Measured memory_bytes: 11264
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

const int N=55,MOD=1e9+7;
LL dp[N][N][N*N]; // dp(i,j,k): i之前保留j個空格分數為k

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,K;
    cin >> n >> K;
    dp[0][0][0]=1;
    REP(i,n) REP1(j,0,i) REP1(k,0,K) {
        // i-i
        dp[i+1][j][k+j*2]+=dp[i][j][k]; dp[i+1][j][k+j*2]%=MOD;
        // i-x i-x
        dp[i+1][j+1][k+(j+1)*2]+=dp[i][j][k]; dp[i+1][j+1][k+(j+1)*2]%=MOD;
        // i-j i-x
        dp[i+1][j][k+j*2]+=dp[i][j][k]*j*2; dp[i+1][j][k+j*2]%=MOD;
        // i-j i-j
        if ( j ) {
            dp[i+1][j-1][k+(j-1)*2]+=dp[i][j][k]*j*j; dp[i+1][j-1][k+(j-1)*2]%=MOD;
        }
    }

    cout << dp[n][0][K] << '\n';
    return 0;
}


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

int main() 
{
  int n;
  cin >> n;
  int ans = 3;
 
 for (int i = 0; i < n; i++) {
   string s;
   cin >> s;

   if (s == "Y") {
    ans = 4;
    break;
   }
}
  if (ans == 3) {
    cout << "Three" << endl;
  }
  else {
    cout << "Four" << endl;
  }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define OUT(s) cout << s << "\n";
using namespace std;

string N;
// https://atcoder.jp/contests/abc168
void Main()
{
    string tmp = N.substr((N.length() - 1), 1);
    if (tmp == "2" || tmp == "4" || tmp == "5" || tmp == "7" || tmp == "9" ) {
        OUT("hon");
    } else if (tmp == "0" || tmp == "1" || tmp == "6" || tmp == "8") {
        OUT("pon");
    } else {
        OUT("bon");
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    // cout << fixed << setprecision(15);
    cin >> N;
    Main();
    return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
void solve()
{
    double n, d;
    cin >> n >> d;
    int cnt = 0;
    for(int i = 0; i< n; i++)
    {
        double a, b;cin >> a >> b;
        a = pow(a,2);b = pow(b,2);
        if(sqrt(a + b) <= d)
            cnt++;
    }
    cout << cnt << endl;
}
int main()
{
    solve();
}

Measured memory_bytes: 3840
K = int(input())
cnt = 7
prev = 7
if K == 1 or K == 7:
    print(1)
    exit()
for i in range(K):
    prev = (prev*10) % K
    cnt += prev
    if cnt % K == 0:
        print(i+2)
        exit()
else:
    print(-1)


Measured memory_bytes: 63184
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(text){console.log(text);}//standard output
//[no]param
//0:noConvert	1:singleNum	2:spaceList	3:newLineList	4:spaceNumList	5:newLineNumList
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));}}

function Main(input) {
  input = myconv(input,0);
  var list = new Array(26).fill(0);
  var alpha = "abcdefghijklmnopqrstuvwxyz".split("");
  for(var i = 0; i < input.length; i++){
    list[alpha.indexOf(input.slice(i,i+1))]++;
  }
  var output = "";
  for(var i = 0; i < list.length; i++){
    if(list[i] == 0){
       output = alpha[i];
      break;
       }
  }
  if(output == ""){
     output = "None";
     }
  myout(output);
}

Main(myin());


Measured memory_bytes: 7944
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <map>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
queue <int> qua;
map <char, bool> flg;

int main() {
	int n;
	char s[105];
	cin >> n;
	scanf("%s", s);
	int maxt = 0;
	for(int i = 0; i < n; i++) {
		flg.clear();
		int cnt = 0;
		for(int j = 0; j <= i; j++) flg[s[j]] = 1;
		for(int k = i + 1; k < n; k++) {
			if(flg[s[k]]) {
				flg[s[k]] = 0;
				cnt++;
			}
		}
		maxt = max(maxt, cnt);
	}
	cout << maxt << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<map>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
void init(int n);
int find(int n);
void unite(int x,int y);
bool same(int x, int y);
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
bool cmp_P(const P &a,const P &b){
  return a.second < b.second;
}
int main()
{
  ll K,ind=1;
  string s;
  cin >> s;
  cin >> K;
  if(s.size() == 1){
    cout << s[0] << endl;
    return 0;
  }
  REP(i,(int)s.size()){
    if(s[i] != '1'){
      ind = i+1;
      break;
    }
  }
  if(K < ind){
    cout << 1 << endl;
  }else{
    cout << s[ind-1] << endl;
  }
  
  return 0;
}

int par[MAX_N];
int ranks[MAX_N];

//n要素で初期化
void init(int n){
  REP(i,n){
    par[i] = i;
    ranks[i] = 0;
  }

}

//木の根を求める
int find(int x){
  if(par[x] == x){
    return x;
  }else{
    return par[x] = find(par[x]);
  }
}

void unite(int x,int y){
  x = find(x);
  y = find(y);
  if(x == y) return ;
  if(ranks[x] < ranks[y]){
    par[x] = y;
  }else{
    par[y] = x;
    if(ranks[x] == ranks[y]) ranks[x]++;
  }
}

bool same(int x, int y){
  return find(x) == find(y);
}



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

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

    vector<int> s(M);
    vector<char> c(M);
    for(int i=0; i<M; i++){
        cin >> s.at(i);
        cin >> c.at(i);
    }

    for(int i=0; i<M-1; i++){
        for(int j=i+1; j<M; j++){
            if(s.at(i) == s.at(j) && c.at(i) != c.at(j)){
                cout << -1 << endl;
                return 0;
            }
        }
    }
    if(N>=2){
        for(int i=0; i<M; i++){
        if(s.at(i) ==1 && c.at(i) == '0'){
            cout << -1 << endl;
            return 0;
        }
        }
    }

    string S = "";
    for(int i=0; i<N; i++){
        S += '0';
    }
    for(int i=0; i<M; i++){
        S.at(s.at(i)-1) = c.at(i);
    }
    if(N>=2 && S.at(0)=='0'){
        S.at(0) = '1';
    }

    cout << stoi(S) << endl;

}

Measured memory_bytes: 256
import java.util.*;

// ARC 93-D
// https://beta.atcoder.jp/contests/arc093/tasks/arc093_b

public class Main {
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int numWhite = in.nextInt();
		int numBlack = in.nextInt();
		
		char WHITE = '.';
		char BLACK = '#';
		
		char[][] map = new char[100][100];
		
		for (int i = 0; i < 100; i++) {
			for (int j = 0; j < 100; j++) {
				// Left half is white and right half is black
				map[i][j] = j <= 49 ? WHITE : BLACK;
			}
		}
		
		int count = 1;
		// Fill black in white canvas
		for (int i = 0; i < 100; i += 2) {
			for (int j = 0; j <= 49 && count < numBlack; j += 2) {
				map[i][j] = BLACK;
				count++;
			}
		}
		
		count = 1;
		// Fill white in black canvas
		for (int i = 0; i < 100; i += 2) {
			for (int j = 51; j < 100 && count < numWhite; j += 2) {
				map[i][j] = WHITE;
				count++;
			}
		}
		
		System.out.println("100 100");
		for (int i = 0; i < 100; i++) {
			for (int j = 0; j < 100; j++) {
				System.out.printf("%c", map[i][j]);
			}
			System.out.println();
		}
	}
}

Measured memory_bytes: 32708
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

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

    string S;
    cin >> S;

    bool flag1 = true;
    bool flag2 = true;

    if (S[0] == '0'){
        flag1 = false;
    }
    if (S[n-1] == '0'){
        flag2 = false;
    }
    
    int along = 1;
    for (int i = 0; i < n - 1; i++){
        if (S[i] != S[i + 1]){
            along += 1;
        }
    }
    if (flag1 == false){
        along += 1;
    }
    if (flag2 == false){
        along += 1;
    }
    
    vector <int> a(along);
    int count = 1;
    int count2 = 0;
    
    if (flag1 == false){
        a[0] = 0;
        count2 += 1;
    }


    for (int i = 0; i < n; i++){
        if (S[i] == S[i + 1]){
            count ++;
        }else{
            a[count2] = count;
            count = 1;
            count2 ++;
        }
    }

    if (flag2 == false){
        a[along - 1] = 0;
    }
    
    int ans = 0, max = 0;

    if (along/2 - k + 1 <= 0){
        for (int i = 0; i < along; i++){
            max += a[i];
        }
    }else{
        for (int i = 0; i < along/2 - k + 1; i++){
            for (int j = 0; j < 2 * k + 1; j++){
                ans += a[2 * i + j];
           }
            if (ans >= max){
                max = ans;
            }
            ans = 0;
        }
    }
    
    cout << max << endl;

    return 0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define rep(i,s,n) for(int i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()
#define allg(v) v.begin(), v.end(), greater<int>()



signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;
  vector<int> a(n);  
  rep(i, 0, n) cin >> a[i];
  
  int now = 1;
  int cnt = 0;
  rep(i, 0, n) {
    if(now == 2) {
      cout << cnt << "\n";
      return 0;
    }      
    now = a[now-1];
    cnt++;
  }
  cout << -1 << "\n";
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ for(auto it : P) { s << "<" << it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ for(auto it : P) { s << "<" << it.first << "->" << it.second << "> "; } return s << endl; }


int main() {
    int H, W;
    cin >> H >> W;
    vector<string> fi(H);
    for (int i = 0; i < H; ++i) cin >> fi[i];
    vector<string> S = fi, T = fi;
    for (int w = 0; w < W; ++w) S[0][w] = '#', T[H-1][w] = '#';
    for (int w = 0; w < W; ++w) {
        for (int h = 1; h < H-1; ++h) {
            if (w % 2 == 1) S[h][w] = '#';
            else T[h][w] = '#';
        }
    }
    for (int h = 0; h < H; ++h) cout << S[h] << endl;
    cout << endl;
    for (int h = 0; h < H; ++h) cout << T[h] << endl;
    cout << endl;
}


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

int main()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    if (B <= C)
    {
        cout << 0 << endl;
    }
    else if (A <= C && C < B && B <= D)
    {
        cout << abs(C - B) << endl;
    }
    else if (C < A && B < D)
    {
        cout << abs(A - B) << endl;
    }
    else if (C <= A && A < D && D <= B)
    {
        cout << abs(A - D) << endl;
    }
    else if (D <= A)
    {
        cout << 0 << endl;
    }
    else if (A < C && D < B)
    {
        cout << abs(C - D) << endl;
    }

    return 0;
}

Measured memory_bytes: 256
X,K,D = map(int,input().split())
X = max([X,-X])
if X > K*D:
    print(X-K*D)
else:
    A = X//D
    k = K-A
    if k % 2 == 0:
        print(X%D)
    else:
        print(D-X%D)

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll

#define INF 1e16
#define mod 1000000007

int H,W;
string s[3001];
ll dp[3001][3001];

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

  cin>>H>>W;
  rep(i,H)cin>>s[i];
  dp[0][0]=1;
  rep(i,H)rep(j,W){
    if(i+1<H){
      int ni=i+1,nj=j;
      if(s[ni][nj]!='#')(dp[ni][nj]+=dp[i][j])%=mod;
    }
    if(j+1<W){
      int ni=i,nj=j+1;
      if(s[ni][nj]!='#')(dp[ni][nj]+=dp[i][j])%=mod;
    }
  }
  cout<<dp[H-1][W-1]<<endl;

  return 0;
}


Measured memory_bytes: 24832
#include <bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) 
#define ll long long 
#define int long long 
#define vll vector<long long>
#define pii pair<long long ,long long > 
#define vvi vector< vector<long long > > 
#define vpii vector<pair<int,int>> 
#define pll  pair<long long ,long long > 
#define pb  push_back
#define ff  first 
#define sec second  
#define SORT(a) sort(a.begin(),a.end())
#define SORTR(a) sort(a.rbegin(),a.rend()) 
#define m_p make_pair
#define all(x) (x.begin(),x.end()) 
#define sz(v) ((int)(v.size()))
#define endl '\n'
typedef vector< long long > vi ;
const int MOD=1e9 +7 ;
int size=10000000; 
 
int32_t main(){
  fast; 
 /* #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
  #endif 
	*/
  int T=1; //cin>>T; 
  while(T--){

  	int n; cin>>n; 
  	vector< double long  >  coins(n+1); 
  	for(int i=1; i<=n ; i++ ) cin>>coins[i]; 
  	
  	vector< vector< double long  > > dp(n+1,vector< double long >(n+1));
  	
  	dp[0][0]=1; 
  	
  	for(int i=1;i<=n;i++){
  		for(int j=0;j<=i;j++){
  			 
  			if(j==0 ) dp[i][j]=(double long )dp[i-1][j]*(1-coins[i]); 
  			else if(j==i) dp[i][j]=(double long )dp[i-1][j-1]*(coins[i]); 
  			else dp[i][j]=(double long )dp[i-1][j]*(1-coins[i])+(double long)dp[i-1][j-1]*coins[i]; 
  			//debug(i,j,dp[i][j]);
  		}
  	} 
  	

  	//debug(dp);
  	double long  ans=0; 

  	for(int j=n;j>n/2;j--) ans+=(double long)dp[n][j]; 

  	cout<<setprecision(11)<<ans<<endl; 

  }
    


  return 0; 
} 


Measured memory_bytes: 141056
M, K = map(int, input().split())
if 2**M <= K:
    print(-1)
    exit(0)
if M == 1:
    if K == 1:
        print(-1)
    else:
        print("0 0 1 1")
else:
    R = [i for i in range(2**M) if i != K]
    *S, = reversed(R)
    ans = [K] + R + [K] + S
    print(*ans)


Measured memory_bytes: 17296
import java.io.IOException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		try (Scanner s = new Scanner(System.in)) {
			String str = s.next();
			int array[] = new int[26];
			int len = str.length();
			for (int i = 0; i < len; i++) {
				int x = str.charAt(i) - 'a';
				array[x]++;
			}
			boolean isGood = true;
			len = array.length;
			for (int i = 0; i < len; i++) {
				if (array[i] % 2 != 0) {
					isGood = false;
					break;
				}
			}
			System.out.println(isGood ? "Yes" : "No");
		}
	}
}


Measured memory_bytes: 22868
#include<bits/stdc++.h>
using namespace std;
int main(){
	while(true){
		int n,y;
		double k=0,unk=0;
		cin>>n;
		if(n==0){
			break;
		}
		int ans=0;
		cin>>y;
		for(int q=0;q<n;q++){
			double a,b,c;
			cin>>a>>b>>c;
			if(c==1){//単利
				k=1*(1+y*(b/100));
			}else if(c==2){//福利
				double nijo=1+(b/100);
				double unnijo=nijo;
				for(int un=0;un<y-1;un++){
					nijo=unnijo*nijo;
				}
				k=nijo;
			}
			if(k>unk){
				ans=a;
				unk=k;
			}
		}
		printf("%d\n",ans);
	}
}


Measured memory_bytes: 3288
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <utility>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define MOD 1e9 + 7
#define INF 1e9
#define SENTINEsL 2e9
#define PIE 3.1415a926535

template <class T>
inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}
template <class T>
inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template <class T>
inline T GCD(T a, T b){if (b == 0) return a; else return GCD(b, a % b);}
template <class T>
inline T LCM(T a, T b) {return (a * b) / GCD(a, b);}

int main(){
    int n;
    cin >> n;
    int plsr = 0;
    while (n >= 500){
        n -= 500;
        plsr += 1000;
    }
    while (n >=5){
        n-=5;
        plsr += 5;
    }
    cout << plsr << endl;
}

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

int main(){
    int N,K;cin >> N >> K;
    vector<int> a(N);
    rep(i,N)cin >> a[i];
    vector<bool> dp(K+1,false);
    rep(i,K+1){
        rep(j,N)if(i-a[j]>=0&&!dp[i-a[j]])dp[i] = true;
    }
    if(dp[K])cout << "First" << endl;
    else cout << "Second" << endl;
    return 0;
}

Measured memory_bytes: 256
import heapq


def dijkstra(g, s):
    queue = [[0, s]]
    v = len(g)
    d = [float("inf")] * v
    d[s] = 0
    while queue:
        i, j = heapq.heappop(queue)
        if d[j] > i:
            continue
        for e in g[j]:
            if d[e[0]] > d[j] + e[1]:
                d[e[0]] = d[j] + e[1]
                heapq.heappush(queue, [d[e[0]], e[0]])

    return d


v, e, r = map(int, input().split())
g = [[] for i in range(v)]
for i in range(e):
    s, t, d = map(int, input().split())
    g[s].append((t, d))

d = dijkstra(g, r)
for i in d:
    if i < float("inf"):
        print(i)
    else:
        print("INF")



Measured memory_bytes: 90316
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [0] * n

for i in range(1, n):
    s = max(i-k, 0)
    dp[i] = min(dp[j] + abs(h[i]-h[j]) for j in range(s, i))

print(dp[-1])

Measured memory_bytes: 53600
#include <stdio.h>
 
int main(void){
	long long n, fact = 1;
	int i;
	
	scanf("%lld", &n);
	
	for (i = 1; i <= n; i++){
		fact = fact*i;
	}
	
	printf("%lld\n", fact);
	
    return 0;
}

Measured memory_bytes: 596
fun main() {
    var (n, k) = readLine()!!.split(" ").map { it.toInt() }
    val dislikeList = readLine()!!.split(" ")
    var canPurchase = false
    while (!canPurchase) {
        var count = 0
         for (i in 0 until k) {
            if (n.toString().contains(dislikeList[i])) {
                count++
                break
            }
        }
        if (count == 0) {
            canPurchase = true
        }
        n++
    }
    println(n - 1)
}

Measured memory_bytes: 46552
/*
ID: Aldew
LANG: C++14
PROG:
*/


#include <bits/stdc++.h>
#define check(x) cout<<(#x)<<": "<<x<<" ";
#define io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ss second
#define ff first
#define pb push_back
#define lb lower_bound
#define ub upper_bound

typedef long long ll;
typedef unsigned long long ull;

int pct(int x) { return __builtin_popcount(x); }

using namespace std;

//ifstream fin("lamps.in");
//ofstream fout("lamps.out");
int val[82];
int stock[82];
int money[82];

int n;
vector<int> a;

string b[82];
int mx = 0;
int solve(int index, bool buy, bool sell){
    //cout << "HERE" << endl;
    for (int i = index; i < n ; i++){
        if (i + 1 == n){
            money[i] = money[i-1] + stock[i-1] * a[i];
            b[i] = "end";

            if (money[i] > mx){
                for (int i = 0; i < n; i++){
                    cout << b[i] << endl;
                }
                mx = money[i];
            }


            if (b[0] == "buy" && b[1] == "sell" && b[3] == "hold" && b[4] == "buy"){
                cout << "----------" << endl;
                for (int i = 0; i < n; i++){
                cout << b[i] << endl;
                }
            cout << money[i] << endl;
            cout << "-------------" << endl;
            }
            return money[i];
        }
        else if (buy && money[i-1] > 0){
            //cout << "HERE1" << endl;
            money[i] = (a[i] % money[i-1]);
            stock[i] = (a[i] / money[i-1]) + stock[i-1];
            b[i] = "buy";
        }
        else if (sell){
            //cout << "HERE2" << endl;
            money[i] = (stock[i-1] * a[i]) + money[i-1];
            stock[i] = 0;
            b[i] = "sell";
        }
        else {
            money[i] = money[i-1];
            stock[i] = stock[i-1];
            b[i] = "hold";
        }

        solve(index + 1, true, false);
        solve(index+1, false, true);
        solve(index + 1, false, false);
        cout << "HERE " << endl;
        cout << b[0] << endl;
    }
}


int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> a(n);

    for (auto& it : a) cin >> it;

    for (int i = k; i< n; i++){
        if (a[i] > a[i -k]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    // on each day you either sell all or buy all or do nothings


    return 0;
}


Measured memory_bytes: 4048
NIL = -1

class Node():
    def __init__(self, key):
        self.key = key
        self.right = NIL
        self.left = NIL
        self.parent = NIL

def getAncestor(t, n):
    for i in range(n):
        if t[i].parent == -1:
            return i

def preOrderWolk(t, u, load=[]):
    load.append(u.key)
    if u.left != -1:
        load = preOrderWolk(t, u.left, load)
    if u.right != -1:
        load = preOrderWolk(t, u.right, load)
    return load

def preorder(u):
    if u == NIL:
        return
    print(' ' + str(u.key), end='')
    preorder(u.left)
    preorder(u.right)

def inorder(u):
    if u == NIL:
        return
    inorder(u.left)
    print(' ' + str(u.key), end='')
    inorder(u.right)

def inOrderTreeWalk(t, u, load=[]):
    if u.left != -1:
        load = inOrderTreeWalk(t, u.left, load)
    load.append(u.key)
    if u.right != -1:
        load = inOrderTreeWalk(t, u.right, load)
    return load

def find(x, k):
    """[finding Node which has key k]

    Args:
        x ([root Node]): [description]
        k ([int]): [description]
    """    
    while x != -1 and k != x.key:
        if k < x.key:
            x = x.left
        else:
            x = x.right
    return x


def insert(T, z):
    """[insert z to tree T]

    Args:
        T ([list]): [description]
        z ([Node class]): [Node ]
        r ([int]): [root intger]
    """
    y = NIL # x no parent
    x = T[0]
    while x != NIL and x.key != None:
        y = x
        if z.key < x.key:
            x = x.left
        elif z.key > x.key:
            x = x.right
    z.parent = y

    if y == NIL: ## T が空の場合
        T[0] = z
    elif z.key < y.key:
        T.append(z)
        y.left = z
    else:
        T.append(z)
        y.right = z


import sys
T = [Node(None)]
n = int(input())
r = 0
for _ in range(n):
    in_ = sys.stdin.readline().split()
    if in_[0][0] == 'i':
        z = Node(int(in_[1]))
        insert(T, z)
    elif in_[0][0] == 'f':
        key = int(in_[1])
        x = find(T[0], key)
        if x !=  -1:
            print('yes')
        else:
            print('no')
    else:
        inorder(T[0])
        print('')
        # pythonのprintは最後に改行記号をつけてくれるので、これで改行できる
        preorder(T[0])
        print('')




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

#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
#define FILL0(x) memset(x,0,sizeof(x))

using namespace std;

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

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

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

 
    string S;
    int K;
    cin >> K;
    cin >> S;

    if(S.size()>K)
    {
        rep(i,K)
        {
            cout << S[i];
        }
        cout << "..." << endl;
    }
    else
    {
        cout << S << endl;;
    }
    
 

 

    return 0;
}



Measured memory_bytes: 3656
#include <iostream>
#include<string.h>
#include<vector>
using namespace std;

int main() {
	// your code goes here
	int mod=2019;
string s;
cin>>s;
int n=s.length();
int suf=0;
vector<int> cntsf(mod);
cntsf[suf]++;
long long  ans=0;
int pow_ten=1;
for(int i=n-1;i>=0;i--)
{int d=s[i]-'0';
	suf=(suf+d*pow_ten)%mod;
	pow_ten=10*pow_ten%mod;

	
	ans+=cntsf[suf];
	cntsf[suf]++;
	
	
}
cout<<ans;
	return 0;
}

Measured memory_bytes: 3720
#include<stdio.h>
#include<limits.h>
#include<stdlib.h>
void maxHeapify(int *,int);
void buildMaxHeap(int *);
void heapExtractMax(int *);
void maxHeapInsert(int *,int);
void heapIncreaseKey(int *,int,int);
int H;
int main(){
  int *A;
  A=(int *)malloc(sizeof(int)*2000001);
  int i,j,x;
  char str[20];
  while(1){
    scanf("%s",str);
   
    if(str[2]=='s'){
      scanf("%d",&x);
      maxHeapInsert(A,x);
    }
    else if(str[2]=='t'){
      heapExtractMax(A);
    }
    else if(str[2]=='d')
      break;
  }

  return 0;
}
void maxHeapify(int A[],int i){
  int l,r,largest,hoge;
  l=i*2;
  r=i*2+1;
  if(l<=H && A[l]>A[i])
    largest=l;
  else
    largest=i;
  if(r<=H&&A[r]>A[largest])
    largest=r;
  if(largest!=i){
 
    hoge=A[i];
    A[i]=A[largest];
    A[largest]=hoge;
    maxHeapify(A,largest);
  }
    
  
  
}
void buildMaxHeap(int A[]){
  int i;
  for(i=H/2;i>0;i--)
    maxHeapify(A,i);

}
void heapExtractMax(int A[]){
  int max;
  if(H<1){printf("heap underflow\n"); return;}
  max = A[1];
  A[1]=A[H];
  H--;
  maxHeapify(A,1);
  printf("%d\n",max);
    

}
void maxHeapInsert(int A[],int key){
  H++;
  A[H]=INT_MIN;

  heapIncreaseKey(A,H,key);

}
void heapIncreaseKey(int A[],int i,int key){
  int p,hoge;

  if (key<A[i]){
    printf("new key is smaller than current key\n");
  return;
  }
  A[i]=key;
  p=i/2;
  while(i>1&&A[p]<A[i]){
    hoge=A[i];
    A[i]=A[p];
    A[p]=hoge;
    i=p;
    p/=2;
  }


}



Measured memory_bytes: 5688
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    S = input()

    for s in set(S):
        if S.count(s) % 2 != 0:
            print("No")
            return
    
    print("Yes")


main()


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

/**
 * vector<int>ar(3);
 * for(auto&e:ar){
 *     scanf("%d",&e);
 * }
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 ***/

int main(){
    double pai=3.141592653589;
    int a,b,c,ans=0;
    scanf("%d %d %d",&a,&b,&c);
    for(int i=a;i<=b;i++){
        if(c%i==0) ans++;
    }
    printf("%d\n",ans);
    return 0;
}

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

using namespace std;

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

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

int N, T;

void solve() {
    cin >> N >> T;
    multiset<int> st;
    int mn = (int) 1e9+1;
    int mx = 0;
    rep(i,N) {
        int a;
        cin >> a;
        mn = min(mn, a);
        st.insert(a - mn);
        mx = max(mx, a - mn);
    }
    cout << st.count(mx) << endl;
}

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


Measured memory_bytes: 4992
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T> using vec = std::vector<T>;
using namespace std;

int main() {
  ll N, A;
  cin >> N;
  unordered_set<ll> s;
  REP(i, N) {
    cin >> A;
    if (s.count(A) == 0) {
      s.emplace(A);
    } else {
      s.erase(A);
    }
  }
  cout << s.size() << endl;
  return 0;
}


Measured memory_bytes: 7284
#include <stdio.h>

int main() {
    char    s[4];

    scanf( "%s", s);

    if ( s[0] == s[1] || s[1] == s[2] || s[2] == s[3] || s[3] == s[4] ) {
        printf("Bad\n");
    }
    else {
        printf("Good\n"); 
    }

    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
long long mod = 1000000007LL;
long long val[100001];
long long expo(long long b, int e){
    if(e==0){
        return 1LL;
    }
    if(e==1){
        return b;
    }
    if((e&1)==0){
        return expo((b*b)%mod,e/2);
    }
    else{
        long long ret = b*expo(b,e-1);
        ret %= mod;
        return ret;
    }
}
long long get(int len){
    if(len<=100000){
        return val[len];
    }
    return (expo(10LL,len-1)*9LL)%mod;
}
int main(){
    val[0] = 0LL;
    long long ten = 1LL;
    for(int i = 1; i<=100000; i++){
        val[i] = (ten*9LL)%mod;
        ten *= 10LL;
        ten %= mod;
    }
    int nxt = 1;
    int po = 0;
    int s;
    cin >> s;
    long long ans = 0LL;
    for(int i = 1;;i++){
        if(i==nxt){
            po++;
            nxt *= 10;
        }
        if(po==7){
            break;
        }
        int rem = nxt-i;
        if(po*rem>=s){
            if(s%po==0){
                ans++;
            }
        }
        else{
            int ts = s-po*rem;
            int p = po+1;
            while(val[p]*p<ts){
                ts-=val[p]*p;
                p++;
            }
            if(ts%p==0){
                ans++;
            }
        }
    }
    for(int l = 1;;l++){
        int beg = s/l;
        if(beg<7){
            break;
        }
        if(beg==7 && s%l==0){
            if(val[7]>=l){
                ans += (get(beg)-(long long)l+1LL)%mod;
                ans += mod;
                ans %= mod;
            }
        }
        else if(beg==7){
            if(val[7]>=l || val[7]*7+8*(l-val[7])<=s){
                ans++;
            }
        }
        else if(s%l==0){
            ans += (get(beg)-(long long)l+1LL)%mod;
            ans += mod;
            ans %= mod;
        }
        else{
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <map>
#include <deque>
#include <iomanip>
#include <cstdio>
#include <stack>
#include <numeric>

using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back
#define inf 1000000007
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(int)(n);++i)


vector<vector<int> > g;
int dfs(int a,int pre){
    int sm =0;
    int cnt = 0;
    for(auto x:g[a]){
        if(x!=pre){
            int k = dfs(x,a);
            if(k!=0){
                sm += k;
            }else{
                cnt++;
            }
        }
    }
    if(cnt>=2){
        sm += cnt-1;
    }
    return sm;
}
int main(){
    int n;
    cin >> n;
    g.resize(n);
    rep(i,n-1){
        int a,b;
        cin >> a >> b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    int k=-1;
    int mx = 0;
    rep(i,n){
        if(mx<g[i].size()){
            mx = g[i].size();
            k = i;
        }
    }
   
    int ans = dfs(k,-1);
    if(ans==0)cout << 1 << endl;
    else cout << ans << endl;
    return 0;
}

Measured memory_bytes: 11904
n=int(input())
import math
n=math.factorial(n)
ans=1
i=2
while i*i<=n:
  count=1
  while n%i==0:
    count=count+1
    n=n//i
  i=i+1
  ans=ans*count
if n!=1:
  ans=ans*2
print(ans%(10**9+7))


Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>

using namespace std;
int main(){
	int n,k,dis[100010],a,before,tmp,ans;
	
	for(cin>>a;a>0;a--){
		ans=0;
		cin>>n>>k;
		cin>>before;
		for(int i=1;i<n;i++){
			cin>>tmp;
			dis[i-1]=tmp-before;
			before=tmp;
		}
		sort(dis,dis+n-1);
		
		
		for(int i=0;i<n-k;i++)ans+=dis[i];
		
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1564
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>

const long long INF = 1e17+7;
const long long MOD = 1e9+7;
const double PI=acos(-1);

using namespace std;

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



Measured memory_bytes: 3632
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int count = 0;
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt();
			if (a < x) {
				count++;
			} 
		}
		System.out.println(Math.min(count, m - count));
	}
}

Measured memory_bytes: 23892
N = int(input())
A = tuple(map(int, input().split(' ')))
B = tuple(map(int, input().split(' ')))
C = tuple(map(int, input().split(' ')))

s = sum(B)
s += sum([C[a1 - 1] for a1, a2 in zip(A, A[1:]) if a2 - a1 == 1])

print(s)


Measured memory_bytes: 3064
from decimal import Decimal

def main():
    N, D = map(int, input().split())
    ans = 0
    for _ in range(N):
        X, Y = map(int, input().split())
        tmp = X ** 2 + Y ** 2
        if tmp <= D ** 2:
            ans += 1

    print(ans)




if __name__ == "__main__":
    main()

Measured memory_bytes: 74688
import java.util.*;
import static java.lang.Math.*;
import static java.lang.System.out;

public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		new Main().AOJ0001();
	}
	
	void AOJ0001(){	// List of Top 3 Hills
		int[] m = new int[10];
		for(int i=0; i<10; i++)	m[i]=sc.nextInt();
		Arrays.sort(m);
		for(int i=9; i>=7; i--)	out.println(m[i]);
	}
	
	void AOJ10029(){	// Sort II
		int n=sc.nextInt();
		int[] ans = new int[n];
		for(int i=0; i<n; i++)	ans[i]=sc.nextInt();
		Arrays.sort(ans);
		out.print(ans[0]);
		for(int i=1; i<n; i++)	out.print(" "+ans[i]);
		out.println();
	}
	
	int[][] p26 = new int[10][10];
	int c26=100;
	void AOJ0026(){	// Dropping Ink
		int ans=0;
		while(sc.hasNext()){
			Scanner sc2 = new Scanner(sc.nextLine()).useDelimiter(",");
			int x=sc2.nextInt(), y=sc2.nextInt(), s=sc2.nextInt();
			// out.println("x"+x+" y"+y+" s"+s);
			ans=max(solve26(x,y),ans);
			ans=max(solve26(x-1,y),ans);	ans=max(solve26(x+1,y),ans);
			ans=max(solve26(x,y-1),ans);	ans=max(solve26(x,y+1),ans);
			if(s>=2){
				ans=max(solve26(x-1,y-1),ans);	ans=max(solve26(x-1,y+1),ans);
				ans=max(solve26(x+1,y-1),ans);	ans=max(solve26(x+1,y+1),ans);
			}
			if(s>=3){
				ans=max(solve26(x-2,y),ans);	ans=max(solve26(x+2,y),ans);
				ans=max(solve26(x,y-2),ans);	ans=max(solve26(x,y+2),ans);
			}
		}
		out.println(c26);
		out.println(ans);
	}
	int solve26(int x, int y){
		int r=-1;
		if(0<=x && x<=9 && 0<=y && y<=9){
			c26 -= p26[x][y]==0? 1: 0;
			p26[x][y]++;
			r=p26[x][y];
		}
		return r;	// RA
	}
	
	void AOJ0008(){	//Sum of 4 Integers
		while(sc.hasNext()){
			int ans=0, n=sc.nextInt();
			for(int a=0; a<10; a++){
				for(int b=0; b<10; b++){
					for(int c=0; c<10; c++){
						for(int d=0; d<10; d++){
							if((a+b+c+d)==n)	ans++;
						}
					}
				}
			}
			out.println(ans);
		}
	}
	
	void AOJ0055(){	// Sequence
		while(sc.hasNext()){
			double last=sc.nextDouble(), ans=last;
			for(int i=2; i<=10; i++){
				ans+= i%2==0? last*2: last/3;
				last = i%2==0? last*2: last/3;
				// out.println(last);
			}
			out.println(ans);
		}
	}
}

Measured memory_bytes: 12000
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 1<<30
#define MOD 1000000007
#define mod 10007
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//----------------------------------------------------------------------
int rc[200][200];
//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_time=clock();
    //------------------------------
    int r,c;cin>>r>>c;
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++){
            cin>>rc[i][j];
        }
    }
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++){
            rc[i][c]+=rc[i][j];
        }
    }
    for(int j=0;j<=c;j++){
        for(int i=0;i<r;i++){
            rc[r][j]+=rc[i][j];
        }
    }
    //rc[r][c]=rc[r-1][c]+rc[r][c-1];
    for(int i=0;i<=r;i++){
        for(int j=0;j<=c;j++){
            cout<<rc[i][j];
            if(j<c)cout<<" ";
        }
        cout<<Endl;
    }
    //-------------------------------  
    //ll end_time=clock();cout<<"time="<<end_time-begin_time<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------


































Measured memory_bytes: 3236
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    string S;
    cin >> S;
    if(S.find('a') != string::npos && S.find('b') != string::npos && S.find('c') != string::npos )
        cout << "Yes\n";
    else 
        cout << "No\n"; 
    return 0;
}

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

namespace ABC122_B
{
	internal class Program
	{
		public static void Main(string[] args)
		{
			string inp = Console.ReadLine();
			List<string> input = new List<string>();
			for (int i = 0; i < inp.Length; i++)
				input.Add(inp.Substring(i, 1));
			
			long count = 0;
			long max = 0;

			for (int i = 0; i < inp.Length; i++)
			{
				if (input[i] == "A" || input[i] == "C" || input[i] == "G" || input[i] == "T")
					count++;
				else
				{
					count = 0;
				}

				if (count > max) max = count;
			}
			
			Console.WriteLine(max);
		}
	}
}

Measured memory_bytes: 11092
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 1e2 + 10;
int b[N];
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n, m, c;
	cin >> n >> m >> c;
	int ans = 0;
	for (int i = 0; i < m; i++) cin >> b[i];
	while (n--)
	{
		int tot = c;
		for (int i = 0; i < m; i++)
		{
			int x;
			cin >> x;
			tot += x * b[i];
		}
		ans += tot > 0;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <string>

using namespace std;

int main()
{
        int n;
        int len[3];

        scanf("%d", &n);
        for (int i = 0; i < n; i++) {
                for (int i = 0; i < 3; i++) {
                        scanf("%d", &len[i]);
                }
                for (int i = 0; i < 2; i++) {
                        if (len[i] > len[i + 1]) {
                                int tmp = len[i];
                                len[i] = len[i + 1];
                                len[i + 1] = tmp;
                        }
                }
                string ans = ((len[0] * len[0] + len[1] * len[1]) == len[2] * len[2])
                                   ? "YES" : "NO";
                printf("%s\n", ans.c_str());
        }

        return 0;
}

Measured memory_bytes: 1036