akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
template<class S, class T> inline S divup_L(S a, T b){
  return (a+b-1)/b;
}
int solve(int A, int K){
  int d, n, r;
  for(;;){
    r = A % K;
    if(r==0){
      break;
    }
    d =divup_L(A,K);
    n =divup_L(r,d);
    A -= n*d;
  }
  return A/K;
}
int main(){
  int A, K, Lj4PdHRW, N, res=0;
  rd(N);
  for(Lj4PdHRW=0;Lj4PdHRW<N;Lj4PdHRW++){
    rd(A);
    rd(K);
    res ^= solve(A,K);
  }
  if(res){
    wt_L("Takahashi");
    putchar_unlocked('\n');
  }
  else{
    wt_L("Aoki");
    putchar_unlocked('\n');
  }
  return 0;
}
// cLay varsion 20180208-1

// --- original code ---
// int solve(int A, int K){
//   int r, d, n;
//   for(;;){
//     r = A % K;
//     if(r==0) break;
//     d = A /+ K;
//     n = r /+ d;
//     A -= n*d;
//   }
//   return A/K;
// }
// 
// {
//   int N, A, K;
//   int res = 0;
//   
//   rd(N);
//   rep(N){
//     rd(A,K);
//     res ^= solve(A,K);
//   }
//   if(res) wt("Takahashi"); else wt("Aoki");
// }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
	int a, b, ab;
	cin >> a >> b;
 
	string res = "No";
 
	if(b < 10)
	{
		ab = a * 10 + b;
	} else if(b >= 100)
	{
		ab = a * 1000 + b;
	} else 
	{
		ab = a * 100 + b;
	}
 
    for(int i = 1; i <= 1000; ++i)
    {
    	if(i * i == ab)
    	{
    		res = "Yes";
    	}
    }
    
    cout << res << "\n";
    return 0;
}

Measured memory_bytes: 3560
import sys
import numpy as np
from numba import njit
 
read = sys.stdin.buffer.read
 
@njit
def solve(A):
  count = np.zeros(10**6+10, np.int32)
  for x in A:
    if count[x] > 1:
      continue
    else:
      count[::x] += 1
  ret = 0
  for x in A:
    if count[x] == 1:
      ret += 1
  return ret
 
 
A = np.array(read().split(),np.int32)[1:]
print(solve(A))

Measured memory_bytes: 122428
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647

void rf(vector<vector<int> > &tree, vector<int> &a, vector<int> &lis, vector<int> &dp, vector<bool> &visited, int n, int x) {
    if (visited.at(x)) {
        return;
    } else {
        visited.at(x) = true;
        auto itr = lower_bound(dp.begin(), dp.end(), a.at(x));
        int old = *itr;
        *itr = a.at(x);
        lis.at(x) = distance(dp.begin(), lower_bound(dp.begin(), dp.end(), INF));
        for (int y: tree.at(x)) {
            if (!visited.at(y)) {
                rf(tree, a, lis, dp, visited, n, y);
            }
        }
        *itr = old;
        return;
    }
}

int main() {
    int n; cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
    }
    vector<vector<int> > tree(n);
    for (int i = 0; i < n-1; i++) {
        int u, v; cin >> u >> v;
        tree.at(u-1).push_back(v-1);
        tree.at(v-1).push_back(u-1);
    }
    vector<int> lis(n);
    vector<int> dp(n, INF);
    vector<bool> visited(n, false);
    rf(tree, a, lis, dp, visited, n, 0);
    for (int i = 0; i < n; i++) {
        cout << lis.at(i) << endl;
    }
}

Measured memory_bytes: 36800
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        List<Integer> W = new ArrayList<>();
        for(int i=0; i<N; i++){
            W.add(scanner.nextInt());
        }

        int wLeft = 0;
        int wRight = 0;
        for(int i=0; i<N; i++){
            wRight += W.get(i);
        }
        int minAbsDiff = wRight;
        for(int i=0; i<N; i++){
            int absDiff = Math.abs(wLeft - wRight);
            if(absDiff < minAbsDiff){
                minAbsDiff = absDiff;
            }
            wLeft += W.get(i);
            wRight -= W.get(i);
        }

        System.out.println(minAbsDiff);
    }
}

Measured memory_bytes: 21588
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

int main(){
  using namespace std;
  double r;
  cin>>r;
  double ans = 2 * PI * r;
  cout<<fixed<<setprecision(5)<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3844
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
# define ll int64_t
# define str string
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define PI 3.141592653589793
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;



#define INF 2000000000
#define MAX_V 10



bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll modpow(ll a,ll n,ll mod1) {
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod1;
        a = a*a%mod1;
        n >>= 1;
    }
    return res;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) (x*=i)%=mod;
    return x;
}

ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b,a%b));
}

ll lcm(ll a,ll b){
   return a/gcd(a,b)*b;
}
const ll MAX = 5100000;
const ll MOD = 1000000007;
 
ll fac[MAX], finv[MAX], inv[MAX];
 
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

using graph = vector<vector<ll>>;
pair<pair<ll,ll>,ll> p[100010];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n;
    cin>>n;
    if(n%10==3) cout<<"bon"<<endl;
    else if(n%10==0 || n%10==1 || n%10==6 || n%10==8) cout<<"pon"<<endl;
    else cout<<"hon"<<endl;
    return 0;
}

Measured memory_bytes: 3640
# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read


n,*a = [int(i) for i in read().split()]

from collections import Counter
c = Counter(a)
res = sum(v*(v-1)//2 for k,v in c.items())

for i in a:
    v = c[i]
    ans = res - v*(v-1)//2 + (v-1)*(v-2)//2
    print(ans)


    

Measured memory_bytes: 25116
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

int n;

inline void Try(int n)
{
    int m = sqrt(n);
    for (; m; m--)
    {
        if (!(n%m))
        {
            int p=n/m;
            if ((p+m-1)%2 == 0)
            {
                printf("%d %d\n", (p-m+1)>>1, m);
                return;
            }
        }
    }
    return;
}

int main()
{
    while (scanf("%d", &n))
    {
        if (!n) return 0;
        else Try(n<<1);
        
    }
}



Measured memory_bytes: 2728
def div(n):
    # divisors whose values are not more than sqrt(n) 
    ret = list()
    a = 1
    while a ** 2 <= n:
        if n % a == 0:
            ret.append(a)
        a += 1
    return ret


def f(A, B):
    return max([len(str(A)), len(str(B))])


def main():
    N = int(input())
    ans = len(str(N))
    for d in div(N):
        ans = min([ans, f(d, N // d)])
    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
$a = <>;
%hash = ();
$i = 1;
for(;<>;){
	chomp($_);
	@ar=($_=~/\D/g);
	@ar=sort@ar;
    $val = join"",@ar;
    $hash{$val}++;
}
$sum = 0;
foreach (keys(%hash)){
	$sum += $hash{$_} * ($hash{$_}-1) / 2;
}
print $sum;


Measured memory_bytes: 19072
#include <stdio.h>

#define N 100

int main()
{
  int num, i, j, tmp, flag, count=0;
  int array[N];

  scanf("%d", &num);

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

  for( i=0; i<num; i++){
    flag = 1;

    while( flag ){
      flag = 0;

      for( j=num-1; j>0; j--){
	if( array[j] < array[j-1] ){
	  tmp = array[j];
	  array[j] = array[j-1];
	  array[j-1] = tmp;
	  flag = 1;
	  count++;
	  break;
	}
      }
    }
  }

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

  printf("%d\n%d\n", array[num-1], count);

  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
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;
}
void hr() { cerr << "--------------" << endl; }
const int INF = 2e9;
const int MOD = 1e9 + 7;

int main() {
   int n;
   cin >> n;
   vector<int> a(n);
   rep(i, 0, n) cin >> a[i];
   int ans = 0;
   rep(i, 0, n) {
      while (i < n - 1 && a[i] == a[i + 1]) {
         i++;
      }
      if (i < n - 1 && a[i] < a[i + 1]) {
         while (i < n - 1 && a[i] <= a[i + 1]) i++;
      } else if (i < n - 1 && a[i] > a[i + 1]) {
         while (i < n - 1 && a[i] >= a[i + 1]) i++;
      }
      ans++;
   }
   cout << ans << endl;
   return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1e9 + 7;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
const int inf = 1000000000; // 10^9 Ten to the power of nine.
/**** Type Define ****/
 
   int main(){
       string S;
       string T;
       cin>>S>>T;
        int count =0;
        int ans = S.length();
        for (int i = 0; i < ans; i++)
        {
            if(S[i]==T[i]){count++;}
        ;}
        cout<<ans-count<<endl; 
   }

Measured memory_bytes: 3912
//#include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main(){
    int M1,M2,D1,D2;
    cin >> M1 >> D1;
    cin >> M2 >> D2;
    if(D1 > D2){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
}

Measured memory_bytes: 888
import java.util.*;
 
class Main {
  public static void main(String[] args){
	Scanner scanner = new Scanner(System.in);
    
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    
    if((a * b) % 2 == 0) {
      System.out.println("Even");
      
    } else {
      System.out.println("Odd");
    }
  }
}


Measured memory_bytes: 23252
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
using namespace std;

struct node
{
    long long a,b;
    friend bool operator < (const node& a,const node& b)
    {
        if (a.a == b.a) return a.b < b.b;
        return a.a < b.a;
    }
    void set(int pos)
    {
        if (pos < 64)
            a |= 1LL<<pos;
        else
            b |= 1LL<<(pos-64);
    }
    int get(int pos)
    {
        if (pos < 64)
            return ((a>>pos)&1);
        else
            return ((b>>(pos-64))&1);
    }
};

int n,m,res;
int g[100][100];
set<node> flag;

void Gao(int tot,node used,int last)
{
    if (tot > 1)
    {
        int sum = 0,tsum;
        for (int i = 0; i <= last; i++)
            if (used.get(i) == 1)
            {
                tsum = 19921005;
                for (int j = 0; j <= last; j++)
                    if (i != j && used.get(j) == 1)
                        tsum = min(tsum,g[i][j]);
                sum += tsum;
            }
        res = max(res,sum);
    }
    node tmp;
    bool check;
    for (int i = last+1; i < n; i++)
    {
        check = true;
        for (int j = 0; j <= last; j++)
            if (used.get(j) == 1 && g[j][i] == 0)
            {
                check = false;
                break;
            }
        if (check == true)
        {
            tmp = used;
            tmp.set(i);
            Gao(tot+1,tmp,i);
        }
    }
}

int main()
{
    while (scanf("%d%d",&n,&m) != EOF)
    {
        memset(g,0,sizeof(g));
        for (int i = 0; i < m; i++)
        {
            int u,v,f;
            scanf("%d%d%d",&u,&v,&f);
            u--;
            v--;
            g[u][v] = max(g[u][v],f);
            g[v][u] = max(g[v][u],f);
        }
        res = 0;
        flag.clear();
        node tmp;
        tmp.a = tmp.b = 0;
        Gao(0,tmp,-1);
        printf("%d\n",res);
    }
    return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

template <class T>
class ConvexHullTrick {
    struct Line {
        T a, b;
        Line(T a, T b) : a(a), b(b){};
        T operator()(T x) const { return a * x + b; }
    };

public:
    vector<Line> lines;
    bool isMonotonicX;

    explicit ConvexHullTrick(bool xflag = false) : isMonotonicX(xflag){};

    // l2が必要か否か
    bool isneeded(Line l1, Line l2, Line l3) const {
        if (l1.a < l3.a) swap(l1, l3);  // 追加クエリが単調増加の場合に対応
        return (l3.b - l2.b) * (l2.a - l1.a) < (l3.a - l2.a) * (l2.b - l1.b);
    }

    // 直線y = ax + bを追加  aは単調であることを要求
    void add(T a, T b) {
        Line line(a, b);
        // 後ろから不要な直線を抜き続ける
        while (lines.size() >= 2 &&
               !isneeded(*(lines.end() - 2), lines.back(), line)) lines.pop_back();
        lines.push_back(line);
    }

    // xにおける最小値を返す
    T operator()(T x) const {
        if (isMonotonicX) {
            static int itr = 0;
            while (itr < lines.size() - 1 && lines[itr](x) > lines[itr + 1](x)) ++itr;
            return lines[itr](x);
        } else {
            // l[ok - 1](x) > l[ok](x)
            int ok = 0, ng = lines.size();
            while (ng - ok > 1) {
                int mid = (ok + ng) / 2;
                if (lines[mid - 1](x) > lines[mid](x)) {
                    ok = mid;
                } else {
                    ng = mid;
                }
            }
            return lines[ok](x);
        }
    }
};

int main() {
    int N;
    ll C;
    cin >> N >> C;
    vector<ll> H(N);
    for (auto& h : H) cin >> h;

    vector<ll> dp(N, 0);
    ConvexHullTrick<ll> cht(true);
    cht.add(-2 * H[0], H[0] * H[0] + dp[0]);

    for (int i = 1; i < N; ++i) {
        dp[i] = cht(H[i]) + H[i] * H[i] + C;
        cht.add(-2 * H[i], H[i] * H[i] + dp[i]);
    }

    cout << dp[N - 1] << endl;
    return 0;
}


Measured memory_bytes: 9456
#include <bits/stdc++.h>
 
 
#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr)
using namespace std;
 
signed main() {
    FAST_IO;
 
    int n;
    cin >> n;
    int a[n], b[n], c[n];
    for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i];

    int dp[n][3]; // dp[i][j] : i represents the day and j represents the activity
    				         // j is 0 for activity A, 1 for activity B and 2 for activity C

  	// Set the base values
    dp[0][0] = a[0]; // If you swim in the sea in sea on the first day, you cannot get more than a[0] points.
    dp[0][1] = b[0]; // If you catch bugs in the mountains on the first day, you cannot get more than b[0] points.
    dp[0][2] = c[0]; // If you do homework at home on the first day, you cannot get more than c[0] points.

    // i represents what day it is (0 based indexing)
    for (int i = 1; i < n; i++) { 
        dp[i][0] = a[i] + max(dp[i - 1][1], dp[i - 1][2]); // If we do activity A today, we have to have done activities B or C on the previous day.
        dp[i][1] = b[i] + max(dp[i - 1][0], dp[i - 1][2]); // If we do activity B today, we have to have done activities A or C on the previous day.
        dp[i][2] = c[i] + max(dp[i - 1][1], dp[i - 1][0]); // If we do activity C today, we have to have done activities A or B on the previous day.
    }

  	// Our answer is the maximum of all the points gained by doing activity A, B, or C on the last day.
    cout << max({dp[n - 1][0], dp[n - 1][1], dp[n - 1][2]}); 
    return 0;
}

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

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

  string S;
  cin >> S;
  size_t size = S.size();

  while(size--){
    cout << 'x';
  }
  cout << endl;

  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		// 1行、2つ(複数)数字
		String[] ss0 = br.readLine().trim().split(" ", 0);
		long a = Long.parseLong(ss0[0]);
		long b = Long.parseLong(ss0[1]);
		long c = Long.parseLong(ss0[2]);


		if((a<=c)&&(c<=b)) { System.out.println("Yes"); return; }

        System.out.println("No");
        return;
    }


}

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

int main(){
    int N;
    cin >> N;
    int NN = N;
    if(N == 3){
        cout << "2 5 63" << endl;
        return 0;
    }
    
    N -= 4;
    vector<int> ans = {2, 4, 3, 9};
    for(int v=8; v<30000; v+=6){
        if(N >= 2){
            N -= 2;
            ans.push_back(v);
            ans.push_back(v+2);
        }
    }
    for(int v=15; v<30000; v+=12){
        if(N >= 2){
            N -= 2;
            ans.push_back(v);
            ans.push_back(v+6);
        }
    }
    for(int v=6; v<=30000; v+=6){
        if(N >= 1){
            N--;
            ans.push_back(v);
        }
    }
    for(int i=0; i<NN; i++) cout << ans[i] << " \n"[i==NN-1];
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio (false) ;cin.tie(NULL);
#define tc  int t;cin>>t;for(int i=0;i<t;i++)
#define ll long long int
#define forn(i,n) for(int i=0;i<n;i++)
#define forn1(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define um(a,b) unordered_map<a,b>
#define vv(a) vector<a>
#define pp(a,b) pair<a,b>
ll power(ll a,ll b,ll mod){  ll ans=1;  while(b>0){
  if(b&1){ ans=(ans*a)%mod;} a=(a*a)%mod;  b=b/2; } return ans;}

int main(){
FIO  
 ll d,t,s;
 cin>>d>>t>>s;
 if(d<=t*s){
    cout<<"Yes"<<endl;
 }else{
  cout<<"No"<<endl;
 }
}

Measured memory_bytes: 3648
#include <stdio.h>
#include <string.h>
int
main ()
{
  char word[100], temp;
  scanf("%s",&word);
  for(int i=0;i<strlen(word);i++){
      temp=word[i];int count=0;
      for(int j=0;j<=strlen(word);j++){
          if(temp==word[j])
          count++;
          
      }
      if(count%2!=0){
      printf("No\n");
          return 0;
      }
      
  }printf("Yes\n");


  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <queue>
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <cctype>  // std::islower(), std::isupper(), std::tolower, std::toupper
#include <iomanip> // std::std::setprecision(X)
#include <limits>  //std::numeric_limits<int>::max(), min()

typedef long long ll;

int main (void) {
  std::string U; std::cin >> U;
  std::string D; std::cin >> D;
  std::reverse(D.begin(), D.end());
  if ( U == D ) std::cout << "YES" << std::endl;
  else std::cout << "NO" << std::endl;
  return 0;
}


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

#define ll long long
#define MOD 1000000007


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

    vector<int> c(n);
    vector<vector<int>> a(n,vector<int>(m));

    vector<ll> t(m,0);

    for(int i=0;i<n;i++){
        cin>>c.at(i);
        for(int j=0;j<m;j++){
            cin>>a.at(i).at(j);
        }
    }

    ll v=99999999;
    ll co=0;

    for(int bits=1;bits<(2<<n-1);bits++){
        for(int i=0;i<m;i++){
            t.at(i)=0;
        }
        co=0;
        for(int i=0;i<n;i++){
            if((1<<i)&(bits)){
                co+=c.at(i);
                for(int j=0;j<m;j++){
                    t.at(j)+=a.at(i).at(j);
                }
            }
        }
        for(int i=0;i<m;i++){
            if(t.at(i)<x)break;
            if(i==m-1)v = min(v,co);
        }
    }

    if(v==99999999){
        cout<<-1<<endl;
    }else{
        cout<<v<<endl;
    }


}



Measured memory_bytes: 3636
n = gets.to_i
list = gets.split(" ").map {|it| it.to_i}
sum = 0
list.each_cons(3) do |a, b, c|
  next if 1 >= b || b >= n
  sum += 1 if a > b && b > c
  sum += 1 if a < b && b < c
end
puts sum

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int R;cin>>R;
    if(R<1200)cout<<"ABC"<<endl;
    else if(R<2800)cout<<"ARC"<<endl;
    else cout<<"AGC"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
#include<set>
using namespace std;


const long long int mod=1000000007;
const long long int INF=99999999999999999;




long long int H,N,A[1005],B[1005],res=0,now=1,dp[30004]={};
int main() {
	cout << fixed << setprecision(18);
	
	cin>>H>>N;
	for(int i=0;i<N;i++){
		cin>>A[i]>>B[i];
	}
	for(int i=H-1;i>=0;i--){
		
		dp[i]=INF;
	}
	dp[H]=0;
	for(int i=H;i>=0;i--){
		for(int j=0;j<N;j++){
			if(i-A[j]>=0)dp[i-A[j]]=min(dp[i-A[j]],dp[i]+B[j]);
			else{dp[0]=min(dp[0],dp[i]+B[j]);}
		}
	}
	cout<<dp[0];
} 

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
int main(){
	int n;
	while(cin>>n,n){
		vector<pair<int,int> > fld;
		fld.push_back(make_pair(0,0));
		int a,b;
		for(int i=1;i<n;i++){
			cin>>a>>b;
			fld.push_back(make_pair(fld[a].first+dx[b],fld[a].second+dy[b]));
		}
		int xr=0,xl=0,yu=0,yd=0;
		for(int i=1;i<n;i++){
			int x=fld[i].first,y=fld[i].second;
			xr=max(xr,x);
			xl=min(xl,x);
			yu=min(yu,y);
			yd=max(yd,y);
		}
		cout<<xr-xl+1<<" "<<yd-yu+1<<endl;
	}
}

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

int main(){
  ll n,k,a,b,d,cnt,now,ans=(ll)-1e10,kcnt;
  bool flg;
  cin>>n>>k;
  ll p[n],c[n];
  for(int i=1;i<=n;i++)cin>>p[i];
  for(int i=1;i<=n;i++)cin>>c[i];
  for(int i=1;i<=n;i++){
    a=i;b=i;cnt=1;d=0;now=0;kcnt=0;flg=false;
    while(p[b]!=a){
      b=p[b];
      d+=c[b];
      ans=max(ans,d);
      cnt++;
      kcnt++;
      if(kcnt==k){flg=true;break;}
    }
    if(flg)continue;
    d+=c[a];
    ans=max(ans,d);
    now=((k/cnt)-1)*d;
    b=i;
    for(int j=0;j<cnt;j++){
      now+=c[p[b]];
      b=p[b];
      ans=max(now,ans);
    }
    for(int j=0;j<(k%cnt);j++){
      now+=c[p[b]];
      b=p[b];
      ans=max(now,ans);
    }
  }
  cout<<ans<<endl;
}


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

int main() {
  int n;
  string s;
  cin>>n>>s;
  vector<int> Rn(n),Gn(n),Bn(n);
  int tmp=0;
  rep(i,n){
    if(s[i]=='R')tmp++;
    Rn[i]=tmp;
  }
  tmp=0;
  rep(i,n){
    if(s[i]=='G')tmp++;
    Gn[i]=tmp;
  }
  tmp=0;
  rep(i,n){
    if(s[i]=='B')tmp++;
    Bn[i]=tmp;
  }
  ll ans=0;
  for(int i=0; i<n; i++){
    for(int j=i+1; j<n; j++){
      if((s[i]=='R' && s[j]=='G') || (s[i]=='G' && s[j]=='R')){
        ans+=Bn[n-1]-Bn[j];
        if(2*j-i<n && s[2*j-i]=='B'){
          ans--;
        }
      }
      if((s[i]=='G' && s[j]=='B') || (s[i]=='B' && s[j]=='G')){
        ans+=Rn[n-1]-Rn[j];
        if(2*j-i<n && s[2*j-i]=='R'){
          ans--;
        }
      }
      if((s[i]=='B' && s[j]=='R') || (s[i]=='R' && s[j]=='B')){
        ans+=Gn[n-1]-Gn[j];
        if(2*j-i<n && s[2*j-i]=='G'){
          ans--;
        }
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3668
a, b = map(int,input().split())
#素因数分解
def prime(n):
    i = 2
    table = set()
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.add(i)
        i += 1
    if n > 1:
        table.add(n)
    return table

print(len(prime(a).intersection(prime(b))) + 1)

Measured memory_bytes: 8960
#include<stdio.h>
int IN(void)
{
  int x=0;short f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
void OUT(int x){if(x<0)putchar('-'),x=-x;if(x>=10)OUT(x/10);putchar(x%10+48);}
signed main(void)
{
  int N=IN(),a=0,i=0,j,max=0,DP[1000001]={0};
  while(i<N){a=IN();DP[a]++;max=a>max?a:max;i++;}a=0,i=1;
  while(i<=max){if(DP[i]==1){a++;}j=2;if(DP[i]){while(i*j<=max)DP[i*j]=0,j++;}i++;}
  return OUT(a),0;
}

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

#define check(val) std::cout << "\033[31m" << #val << ": " << val << "\033[m" << std::endl
#define check_v(vec) \
  std::cout << "\033[31m" << #vec << ": [ ";\
  for(auto it=vec.begin(); it!=vec.end(); it++){cout << *it << " ";}\
  cout << "]"<< "\033[m" << endl;

int main() {
  ll n;
  cin >> n;
  map<ll, ll> mp;
  ll tmp;
  vector<ll> v(n);
  rep(i,n) {
    cin >> tmp;
    v[i] = tmp;
    mp[tmp] +=1;
  }
  map<ll, ll> total;
  map<ll, ll> gone;
  for(auto x :mp){
    ll num = x.second; 
    total[x.first] = (num * (num -1)) / 2;
    if (num <= 1){
      gone[x.first] = 0;
    } else {
      gone[x.first] = ((num-1) * (num -2)) / 2;;
    }
  }
  
  ll sum = 0;
  for(auto x : total){
    sum += x.second;
  }

  // for(auto x : gone){
  //   check(x.first);
  //   check(x.second);
  // }
    
  rep(i,n){
    cout << sum - total[v[i]] +  gone[v[i]] << endl;
  }
  // ll test = 2 * 1000000;
  // cout << test * test << endl;
  return 0;
}


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

int n;
int ans=0;

void dfs(int num){
    if(num>n) return;
    string s=to_string(num);
    int r1=s.find("3");
    int r2=s.find("5");
    int r3=s.find("7");
    if(r1!=string::npos && r2!=string::npos && r3!=string::npos) ans++;
    dfs(stoll(s+"3"));
    dfs(stoll(s+"5"));
    dfs(stoll(s+"7"));

}

signed main(){
    cin >> n;
    dfs(0);
    cout << ans << endl;

}

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

#define ll long long
#define t() int t;cin>>t;while(t--)
#define ff first
#define ss second
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rloop(i,a,b) for(int i=a;i>b;i--)
#define pb push_back
#define mp make_pair

 

void solvea(){
 
 	int x;
 	cin>>x;
 	x=!x;
 	cout<<x;
 }

	
	
 
void solveb(){
	t(){
		
	}
}

int main()
{
	#ifndef ONLINE_JUDGE
		//for getting input from input1.txt
		freopen("input1.txt","r",stdin);
		//for getting output from output.txt
		freopen("output.txt","w",stdout);
		#endif

		solvea();
return 0;
}

Measured memory_bytes: 3496
n=int(input())
a=list(map(int,input().split()))
f=1
ans=0
while f==1:
  f=0
  for i in range(n-1,0,-1):
    if a[i]<a[i-1]:
      v=a[i]
      l=a[i-1]
      a[i]=l
      a[i-1]=v
      f=1
      ans+=1
print(" ".join(map(str,a)))
print(ans)



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

int main() {
    int N;
    cin >> N;
    vector<string> S(N);
    rep(i,N) cin >> S.at(i);
    map<string, int> mp;
    int max_num = 0;

    rep(i,N) ++mp[S.at(i)];
    for (auto x : mp) max_num = max(max_num, x.second);
    for (auto x : mp) {
        if (x.second == max_num) {
            cout << x.first << endl;
        }
    }
}


Measured memory_bytes: 25148
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        Node[] nodes = new Node[N];
        for (int i = 0; i < N; i++) {
            int parent = sc.nextInt() - 1;
            String v = sc.next();
            nodes[i] = new Node(v);
            if (i > 0) nodes[parent].children.add(nodes[i]);
        }
        nodes[0].print(0);
    }

    static class Node {
        ArrayList<Node> children = new ArrayList<>();
        String v;

        public Node(String v) {
            this.v = v;
        }

        void print(int depth) {
            for (int i = 0; i < depth; i++) {
                System.out.print(".");
            }
            System.out.println(v);
            for (Node c : children) {
                c.print(depth + 1);
            }
        }
    }
}

Measured memory_bytes: 61376
import java.util.Scanner;

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

    public static void solve(Scanner sc) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        if (a + b == c + d) {
            System.out.println("Balanced");
        } else {
            System.out.println(a + b > c + d ? "Left" : "Right");
        }
    }
}

Measured memory_bytes: 23124
class UnionFind():
    n=1
    par=[0]
    rnk=[0]
    def __init__(self,size):
        self.n=size
        self.par=[0 for i in range(self.n)]
        self.rnk=[0 for i in range(self.n)]
        for i in range(self.n):
            self.par[i]=i
            self.rnk[i]=0
    def find(self,vertex1):
        if self.par[vertex1]==vertex1:
            return vertex1
        else:
            self.par[vertex1]=self.find(self.par[vertex1])
            return self.par[vertex1]
    def unite(self,vertex1,vertex2):
        vertex1=self.find(vertex1)
        vertex2=self.find(vertex2)
        if vertex1==vertex2:
            return
        if (self.rnk[vertex1]<self.rnk[vertex2]):
            self.par[vertex1]=vertex2
        else:
            self.par[vertex2]=vertex1
            if(self.rnk[vertex1]==self.rnk[vertex2]):
                self.rnk[vertex1]+=1
    def same(self,vetrex1,vertex2):
        return self.find(vetrex1)==self.find(vertex2)
N,K,L=map(int,input().split())
road=UnionFind(N)
train=UnionFind(N)
for i in range(K):
    p,q=map(int,input().split())
    road.unite(p-1,q-1)
for i in range(L):
    r,s=map(int,input().split())
    train.unite(r-1,s-1)
X=[(road.find(i),train.find(i)) for i in range(N)]
D=dict()
for i in range(N):
    if not(X[i] in D):
        D[X[i]]=0
    D[X[i]]+=1
ans=[D[X[i]] for i in range(N)]
print(" ".join([str(i) for i in ans]))


Measured memory_bytes: 118784
#include<bits/stdc++.h>
using namespace std;
int main () {
  const int INF = 1e15;
  int N;
  cin >> N;
  vector<long long>que(N);
  for (int i = 0; i < N; i ++) cin >> que[i];
  long long dp[3030][3030];
  for (int n = 0; n <= N; n ++) {
    for (int l = 0; l <= N - n; l ++) {
      int r = l + n;
      int tore = (N - n + 1) % 2;
      if (!n) {
        dp[l][r] = 0;
        continue;
      }
      if (tore) {
        dp[l][r] = max(dp[l + 1][r] + que[l],
                       dp[l][r - 1] + que[r - 1]);
      }
      else {
        dp[l][r] = min(dp[l + 1][r] - que[l],
                       dp[l][r - 1] - que[r - 1]);
      }
    }
  }
  cout << dp[0][N] << endl;
}


Measured memory_bytes: 71936
N = int(input())
connect_list = [[] for i in range(N)]
for i in range(N-1):
    u,v,w = map(int,input().split())
    u -= 1
    v -= 1 
    connect_list[u].append([v,w])
    connect_list[v].append([u,w])

d = [0]+[-1 for i in range(N-1)]
stack = []
stack.append(0)
while len(stack) != 0:
    s = stack.pop()
    for x,w in connect_list[s]:
        if d[x] == -1:
            d[x] = d[s] + w
            stack.append(x)

for i in range(N):
    print(d[i]%2)   

Measured memory_bytes: 48968
import java.io.*;
public class Main{
    public static void main(String[] args) throws Exception{
        BufferedReader buf=new BufferedReader(new InputStreamReader(System.in));
        int x=Integer.parseInt(buf.readLine());
        String num[]=buf.readLine().split(" ");
        int max=-99999999,min=99999999;
        long sum=0;
        for(int i=0;i<num.length;i++){
            int tmp=Integer.parseInt(num[i]);
            if(tmp>max){
                max=tmp;
            }if(tmp<min){
                min=tmp;
            }
            sum +=tmp;
                
        }
        System.out.println(min+" "+max+" "+sum);
    }
}

Measured memory_bytes: 28480
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def div2(h, w):
    if w % 2 and h % 2:
        if w < h: w, h = h, w
        return h * (w // 2), h * (w // 2 + 1)
    else:
        return h * w // 2, h * w // 2

def main():
    h, w = MI()
    a = []
    for w1 in range(1, w // 2 + 1):
        p1 = w1 * h
        p2, p3 = div2(h, w - w1)
        a.append(max(p1, p2, p3) - min(p1, p2, p3))
    h, w = w, h
    for w1 in range(1, w // 2 + 1):
        p1 = w1 * h
        p2, p3 = div2(h, w - w1)
        a.append(max(p1, p2, p3) - min(p1, p2, p3))
    print(min(a))

main()


Measured memory_bytes: 7064
N=int(input())
a=[0]*10**4
for j in range(1,101):
    for k in range(1,101):
        for h in range(1,101):
            tmp=h**2+j**2+k**2+h*j+j*k+k*h
            if tmp<=10000:
                a[tmp-1]+=1
for i in range(N):
    print(a[i])

Measured memory_bytes: 9288
import math
a,b,x = map(int, input().split())
h = 2*(a*b-x/a)/a
h2 = 2*(x/a)/b
if x/a > a*b/2:
    atan = math.degrees(math.atan(h/a))
else:
    atan = math.degrees(math.atan(b/h2))
print(atan)

Measured memory_bytes: 38384
#include <bits/stdc++.h> 
using namespace std;
#define REP(i,N) for(i=0;i<N;i++)
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;
typedef struct{
  int first;
  int second;
  int third;
}T;

//昇順
bool comp_Se(T& l, T& r){
  return l.second < r.second;
}
int N;
vector<map<string,int>> memo;

bool notAGC(string last4){
  if( last4.substr(1,3) == "AGC")return false; 
  if( last4.substr(1,3) == "GAC")return false; 
  if( last4.substr(1,3) == "ACG")return false;
  if( last4.substr(0,1)+last4.substr(2,2) == "AGC")return false;
  if( last4.substr(0,2)+last4.substr(3,1) == "AGC")return false;
  return true;
} 

int dfs(int cur, string last3){
  if(cur == N) return 1;
  if(memo[cur].count(last3)) return memo[cur][last3];
  int ret = 0;
  int i;
  string ACGT="ACGT";
  REP(i,4){
    if(notAGC(last3+ACGT.substr(i,1))){
      ret = ( ret + dfs(cur+1,last3.substr(1,2) + ACGT.substr(i,1)) )%MOD;
    }
  }
  return memo[cur][last3] = ret;
}

int main(void){
  cin >> N;
  memo.resize(N);
  cout << dfs(0,"TTT") << endl;
  return 0;
}


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

int main() {
  string N;
  cin >> N;
  int len = N.size();
  bool can = false;
  for (int i =0; i < len; i++) {
    if (N.at(i) == '7') {
      can = true;
      break;
    }
  }
  if (can)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3624
# -*- coding: utf-8 -*-
import math
n, d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    for j in range(i+1, n):
        s = 0
        for xi, xj in zip(x[i], x[j]):
            s += (xi - xj)**2
        if math.sqrt(s) % 1 == 0:
                ans += 1
print(ans)


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


using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define reps(i,n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i,n) for (int i = (int)(n - 1); i >= 0; --i)
#define repds(i,n) for(int i = (int)(n); i > 0; --i)
#define all(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define rall(f,x,...) ([&](decltype((x)) whole) { return (f)(rbegin(whole), rend(whole), ## __VA_ARGS__); })(x)
#define sz(a) (int)(a).size()
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr ll mod = static_cast<ll>(1e9 + 7);

int n;
string s;
void solve() {
    cin >> n >> s;

    ll ans = 1;
    ll cnt = 0;
    for (int i = 0; i < 2 * n; ++i) {
        ll now = ((s[i] == 'W') + cnt) % 2;

        if (now == 0) {
            ++cnt;
        }
        else {
            if (cnt == 0) {
                cout << 0 << endl;
                return;
            }

            ans *= cnt;
            ans %= mod;
            --cnt;
        }

    }

    if (cnt != 0) {
        cout << 0 << endl;
        return;
    }

    reps(i, n) {
        ans *= i;
        ans %= mod;
    }

    cout << ans << endl;

    return;
}


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

    solve();

    return 0;
}


Measured memory_bytes: 720
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>



int swap1(int seisu[], int cou, int n)
{
	int irekae;
	int i, j;

	for (i = 0; i < n; i++) {
		for (j = n - 1; 0 < j; j--) {
			if (seisu[j] < seisu[j - 1]) {
				irekae = seisu[j];
				seisu[j] = seisu[j - 1];
				seisu[j - 1] = irekae;
				cou++;
			}
		}
	}
	return cou;

}



int main(void)
{
	int i = 0, j = 0, n = 0, count = 0;
	int seisu[250];

	scanf("%d", &n);

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


	count = swap1(seisu, count, n);


	for (i = 0; i < n; i++) {

		printf("%d", seisu[i]);
		if (i != (n - 1))
			putchar(' ');
	}

	putchar('\n');

	printf("%d\n", count);

	return 0;

}


Measured memory_bytes: 2100
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

vector<pair<int, int> > v;
int p[111111];

int main(void)
{
	while (1)
	{
		int n, k, i, a, white = 0;

		v.clear();
		for (i = 1; i <= 100000; i++)
			p[i] = 0;

		scanf("%d %d" ,&n, &k);

		if (n == 0 && k == 0)
			break;

		for (i = 0; i < k; i++)
		{
			scanf("%d" ,&a);

			!a ? white = 1 : p[a] = 1;
		}

		for (i = 1; i <= n; i++)
			if (p[i])
			{
				if (!p[i - 1])
					v.push_back(make_pair(i, i));
				else
					v.back().second = i;
			}

		int ans = 0;
		for (i = 0; i < v.size(); i++)
			ans = max(ans, v[i].second - v[i].first + 1);

		if (white)
		{
			++ans;
			for (i = 0; i < v.size() - 1; i++)
				if (v[i + 1].first - v[i].second == 2)
					ans = max(ans, v[i + 1].second - v[i].first + 1);
		}

		printf("%d\n" ,ans);
	}
	return 0;
}



Measured memory_bytes: 3204
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
	class Edge {
		int to, cost;

		public Edge(int to, int cost) {
			// TODO 自動生成されたコンストラクター・スタブ
			this.to = to;
			this.cost = cost;
		}
	}
	
	class Node implements Comparable<Node> {
		int num;
		int dist;
		Node(int num, int dist) {
			this.num = num;
			this.dist = dist;
		}
		@Override
		public int compareTo(Node o) {
			// TODO 自動生成されたメソッド・スタブ
			return this.dist - o.dist;
		}
	}
	
	int n, m;
	
	void dijkstra(int p, int q, ArrayList<LinkedList<Edge>> edges) {
		int INF = Integer.MAX_VALUE / 2;
		int[] d = new int[m + 1]; // 各駅への最短距離
		Arrays.fill(d, INF);
		PriorityQueue<Node> que = new PriorityQueue<Node>();
		d[p] = 0;
		que.add(new Node(p, 0));
		
		while(!que.isEmpty()) {
			Node n = que.poll();
			int v = n.num;
			if (d[v] < n.dist) continue;
			for(Edge e : edges.get(v)) {
				if(d[e.to] > d[v] + e.cost) {
					d[e.to] = d[v] + e.cost;
					que.add(new Node(e.to, d[e.to]));
				}
			}
		}
		
		System.out.println(d[q]);
	}
	

	void run() {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			n = scanner.nextInt();
			m = scanner.nextInt();
			if (n == 0 || m == 0)
				break;
			ArrayList<LinkedList<Edge> > costedges = new ArrayList<LinkedList<Edge> >(m + 1);
			ArrayList<LinkedList<Edge> > timeedges = new ArrayList<LinkedList<Edge> >(m + 1);
			for(int i=0; i < m+1; i++) {
				costedges.add(new LinkedList<Edge>());
				timeedges.add(new LinkedList<Edge>());
			}
			for (int i = 0; i < n; i++) {
				int a = scanner.nextInt();
				int b = scanner.nextInt();
				int cost = scanner.nextInt();
				int time = scanner.nextInt();
				costedges.get(a).add(new Edge(b, cost));
				costedges.get(b).add(new Edge(a, cost));
				timeedges.get(a).add(new Edge(b, time));
				timeedges.get(b).add(new Edge(a, time));
			}
			int k = scanner.nextInt();
			if (k == 0)
				return;
			
			for (int i = 0; i < k; i++) {
				int p = scanner.nextInt();
				int q = scanner.nextInt();
				int r = scanner.nextInt();
				dijkstra(p, q, r == 0 ? costedges : timeedges);
			}
		}
	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		new Main().run();
	}

}

Measured memory_bytes: 93020
#include <bits/stdc++.h>
 
typedef long long ll;

using namespace std;
using Graph = vector<vector<int>>;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)


void Main() {
    string S, T;
    cin >> S >> T;

    T.pop_back();

    if (S == T) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}
 
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}



Measured memory_bytes: 3652
import java.util.Scanner;

/**
 * Created by Reopard on 2014/06/05.
 */
public class Main{
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args){
        String line;
        int p;
        char[] sentence;
        outer:
        while(!(line = sc.nextLine()).equals(".")){
            char[] check_stack = new char[200];
            p = 1;
            sentence = line.toCharArray();
            while(true){
                for(char tmp : sentence){
                    switch(tmp){
                        case '(':
                            check_stack[p++] = '(';
                            break;
                        case ')':
                            if(check_stack[--p] != '('){
                                System.out.println("no");
                                continue outer;
                            }
                            break;
                        case '[':
                            check_stack[p++] = '[';
                            break;
                        case ']':
                            if(check_stack[--p] != '['){
                                System.out.println("no");
                                continue outer;
                            }
                            break;
                        case '.':
                            if(p == 1) System.out.println("yes");
                            else System.out.println("no");
                            continue outer;
                        default:
                            break;
                    }
                }
                line = sc.nextLine();
                sentence = line.toCharArray();
            }
        }
    }
}

Measured memory_bytes: 32996
H,W=(int(i) for i in input().split(' '))
a=[]
log=[]
n=0
for h in range(H):
  a.append([int(i) for i in input().split(' ')])
for h in range(H)[::2]:
  for w in range(W-1):
    if a[h][w]%2!=0:
      a[h][w]-=1
      a[h][w+1]+=1
      log.append([h+1,w+1,h+1,w+2])
      n+=1
  if h+1 != H:
    if a[h][W-1]%2!=0:
      a[h][W-1]-=1
      a[h+1][W-1]+=1
      log.append([h+1,W,h+2,W])
      n+=1
  else:
    break
  for w in range(1,W)[::-1]:
    if a[h+1][w]%2!=0:
      a[h+1][w]-=1
      a[h+1][w-1]+=1
      log.append([h+2,w+1,h+2,w])
      n+=1
  if h+2 != H:
    if a[h+1][0]%2!=0:
      a[h+1][0]-=1
      a[h+2][0]+=1
      log.append([h+2,1,h+3,1])
      n+=1
print(n)
for data in log:
  print('{0[0]} {0[1]} {0[2]} {0[3]}'.format(data))

Measured memory_bytes: 29652
#include <stdio.h>

   int main (void) {

        int a;
        int b;
        int c;
        int d;

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

        c = a * b;
        d = (a + b)* 2;

        printf("%d %d\n", c, d);

                return 0;
   }

Measured memory_bytes: 596
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.replace(/\n$/,"")).split("\n");
while(true){
   var str=Arr.shift();
   if(str=="0 0")break;
   var arr=str.split(" ");
   var data=[0];
   if(arr[0]>0)data=data.concat((Arr.shift()).split(" ").map(Number));
   if(arr[1]>0)data=data.concat((Arr.shift()).split(" ").map(Number));
   data.sort(function(a,b){return a-b;});
   var max=0;
   data.reduce(function(a,b){
      max=Math.max(max,Math.abs(a-b));
   return b;
   });
   console.log(max);
}

Measured memory_bytes: 12436
#include<bits/stdc++.h> 
using namespace std; 
#define ll long long
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(NULL);
#define REP(i,a,b) for(int i=a;i<b;++i)
#define REPN(i,a,b) for(int i=a;i<=b;++i)
#define ld long double
int main() 
{ 
  FASTIO;
int l;
cin>>l;

printf("%.12f\n",(double)l*l*l/27);
  
    return 0;
    
} 


Measured memory_bytes: 256