akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp22
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] ab = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int ans = 0;
            for (int i = 1; i <= ab[1]-ab[0]; i++)
            {
                ans += i;
            }
            ans -= ab[1];
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	if((a!=b&&b!=c&&a!=c)||(a==b&&b==c)){
		cout<<"No"<<endl;
	}
	else{
		cout<<"Yes"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
N = int(input())
V = list(map(int, input().split()))
V_s = sorted(V)
while len(V_s) > 1:
  V_s = sorted(V_s)
  add = (V_s[0] + V_s[1])/2
  V_s.pop(0)
  V_s.pop(0)
  V_s.append(add)
print(V_s[0])

Measured memory_bytes: 38384
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;
typedef pair<int, int> pii;
const int INF = 1000000000;

int dp[101][101];

int main(){
        int N, M;
        cin >> N >> M;
        vector<pii> p(M);
        for(int i = 0; i < M; ++i){
                cin >> p[i].first >> p[i].second;
        }
        sort(p.begin(), p.end());
        for(int i = 0; i < 102; ++i){
                for(int j = 0; j < 101; ++j){ dp[i][j] = INF; }
        }
        dp[0][0] = 0;
        for(int i = 0; i < N; ++i){
                for(int j = 0; j < M; ++j){
                        if(dp[i][j] >= INF){ continue; }
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j]);
                        if(p[j].first <= i + 1){
                                int r = p[j].second;
                                dp[r][j + 1] = min(dp[r][j + 1], dp[i][j] + 1);
                        }
                }
        }
        int answer = INF;
        for(int i = 0; i <= M; ++i){ answer = min(answer, dp[N][i]); }
        if(answer >= INF){
                cout << "Impossible" << endl;
        }else{
                cout << answer << endl;
        }
        return 0;
}

Measured memory_bytes: 1240
fn main(){
	let mut inp = String::new();
	std::io::stdin().read_line(&mut inp).ok();
	let p : Vec<_> = inp.trim().split(' ').collect();
	let a : i32 = p[0].parse().unwrap();
	let pay : i32 = a * 800;
	let res : i32 = a / 15;
	println!("{}", pay - (res * 200));
}




Measured memory_bytes: 4352
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
 
#define MOD 1000000007

int main(){
  int n;
  cin>>n;
  if(n==1){
    cout << "0 0 0 0 0" << endl;
    return 0;
  }
  vector<int> v;
  rep(i,0,n){
    int a = 0;
    cin>>a;
    if(v.sz>=2){
      if(a==v[v.sz-1]&&a==v[v.sz-2]){
        continue;
      }
    }
    v.pb(a);
  }
  int ans1=0;
  int ans2=0;
  int ans3=0;
  int ans4=0;
  int ans5=0;
  rep(i,1,v.sz-2){
    if(v[i-1]<v[i]&&v[i]==v[i+1]&&v[i+1]>v[i+2]){
      ans1++;
    }
    else if(v[i-1]>v[i]&&v[i]==v[i+1]&&v[i+1]<v[i+2]){
      ans2++;
    }
    else if(v[i]==v[i+1]){
      ans3++;
    }    
  }
  rep(i,1,v.sz-1){
    if(v[i-1]<v[i]&&v[i]>v[i+1]){
      ans4++;
    }
    else if(v[i-1]>v[i]&&v[i]<v[i+1]){
      ans5++;
    }   
  }
  cout << ans1 << " " << ans2 << " " << ans3 << " " << ans4 << " " << ans5 << endl;
  return 0;
}


Measured memory_bytes: 1676
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 0;
		int sum = 0;
		while(sc.hasNext()){
			n=sc.nextInt();
			for(int i = 0 ; i < 600/n-1 ; i ++){
				sum += ((i+1)*n)*((i+1)*n)*n;
			}
			System.out.println(sum);
			sum=0;
		}
	}
}

Measured memory_bytes: 17176
#include <vector>
#include <algorithm>
#include <utility>
#include <iostream>
#include<stdio.h>
 
using namespace std;

void trace(int A[], int N){
    for(int i=0;i<N;++i){
        if(i<N-1){
        cout << A[i] << " ";
    }
    else{
        cout << A[i] << endl;
    }
    }
} 

void insert(int A[], int N){
    int j=0,i=0,v=0;
    for(int i=1;i<N;++i){
        v = A[i];
        j = i-1;
        while(j>=0 && A[j]>v){
            A[j+1]=A[j];
            --j;
        }
        A[j+1]=v;
        trace(A,N);
    }
}

int main(){
    int   N;
    cin >> N;
    int A[N];
    for(int i=0;i<N;++i){
        cin >> A[i];
    }
    int v=0;
    int j=0;

    trace(A,N);
    insert(A,N);

    return 0;
}


Measured memory_bytes: 3108
import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.io.PrintWriter;

import java.util.TreeSet;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        PrintWriter out = new PrintWriter(System.out);

        final String[] sl = s.split(" ");
        int AB = Integer.parseInt(sl[0]);
        int BC = Integer.parseInt(sl[1]);
        int CA = Integer.parseInt(sl[2]);

        TreeSet<Integer> ts = new TreeSet<>();
        ts.add(AB);
        ts.add(BC);
        ts.add(CA);

        int ans = 1;
        int cnt = 1;
        for (Integer i : ts) {
            if (2 < cnt) break;
            ans *= i;
            cnt++;
        }

        out.println(ans / 2);

        out.flush();
    }
}


Measured memory_bytes: 22612
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np


def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def main():
	n,k=map(int,input().split())
	A=list(map(int,input().split()))
	A.sort()
	
	comb=[1]
	for i in range(n-k):
		comb.append((comb[-1]*(k+i)*pow(i+1,mod-2,mod))%mod)
	ans=0
	
	for i in range(n-k+1):
		ans+=((comb[i]*A[k-1+i])-(comb[i]*A[n-k-i]))%mod
		ans=ans%mod
	print(ans)


if __name__ == "__main__":
	main()


Measured memory_bytes: 58096
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace a
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var now = int.Parse(input[0]);
            var left = int.Parse(input[1]);

            var begin = (now + left) % 24;

            Console.WriteLine(begin.ToString());
        }
    }
}


Measured memory_bytes: 11092
X, Y = map(int, input().split())

if 0 <= X < Y or X < Y <= 0:
    print(Y-X)
elif 0 < Y < X or Y < X < 0:
    print(2+X-Y)
elif X < 0 < Y or Y < 0 < X:
    print(1+abs(X+Y))

if X == 0 and Y < 0:
    print(abs(Y)+1)
elif Y == 0 and X > 0:
    print(abs(X)+1)


Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iterator>
#include<sstream>
#include<iomanip>
#include<map>
#include<queue>
#include<deque>
#include<fstream>
#include<random>

#define rep(i, n) for (ll i = 0; i < n; i++) 
#define rrep(i, n) for(ll i = n-1; i>=0; i--)
#define range(i, n, m) for (ll i = n; i < m; i++) 
#define rrange(i, n, m) for (ll i = n - 1; i => m; i--) 
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vp vector<pair<ll, ll> >
#define vvp vector<vector<pair<ll, ll> > >
#define First first
#define Second second.first
#define Third second.second
//#define MOD 998244353
#define MAX 100000

typedef long long int ll;
typedef unsigned long long int ull;

using namespace std;

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

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

	string S;
	cin >> S;

	string sub = "";
	string bsub = "";
	ll cnt = 0;

	rep(i, S.size()) {
		sub += S[i];
		if (bsub != sub) {
			cnt++;
			bsub = sub;
			sub = "";
		}
	}


	cout << cnt << endl;



	return 0;
}



Measured memory_bytes: 832
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	long N,X;

	public long f(long a,long b){

		if(a > b){
			long tmp = a;
			a = b;
			b = tmp;
		}

		if(b % a == 0){
			return 2 * a * (b / a) - a;
		}
		return 2 * a * (b / a) + f(b % a,a);
	}


	public void solve(){
		N = nextLong();
		X = nextLong();

		out.println(f(N - X,X) + N);
	}

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

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

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

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 8020
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main(void){
    long long a,b,c;
    long long d=1;
    cin>>a>>b;
    c=gcd(a,b);
    long long x=c;
    long long z=1;
    for(long long i=2;i<=pow(x,0.5)+1&&c!=1;){
        
        if(c%i==0){
            if(z!=i) d++;
            c/=i;
            z=i;
        }
        else i++;
    }
    if(c>=2) d++;
    cout<<d;
}


Measured memory_bytes: 640
f=0
while 1:
    try:n=int(input())
    except:break
    if f:print()
    f=1
    a=[[0 for _ in range(5)]for _ in range(8)]
    for i in range(4,-1,-1):
        b=n%10
        if b>=5:a[0][i]=1
        else: a[1][i]=1
        a[b%5+3][i]=1
        n//=10
    for i in range(8):
        for j in range(5):
            if i==2:print('=',end='')
            else:print(' ' if a[i][j] else '*',end='')
        print()

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

using namespace std;
typedef long long int ll;
typedef long double ld;
#define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
#define REPR(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define FOR(i, n, m) for(ll i = (ll)n; i < (ll)(m); i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define PRINT(x) std::cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll countDigit(ll n) { return floor(log10(n) + 1); } 
typedef pair <ll,ll> P;
static const ll dx[8] = {0,1,0,-1, 1, -1, 1, -1}, dy[8] = {1,0,-1,0,1,1,-1,-1};

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) os << v[i] << " ";  
    return os; 
}

template <typename T1, typename T2> 
ostream& operator<<(ostream& os, const map<T1, T2>& m) 
{ 
    for (auto p : m) os << "<" << p.first << ", " << p.second << "> "; 
    return os; 
}

int main()
{
  ll N;
  cin >> N;
  
  vector<ll> A(N);
  REP(i, N) { 
      cin >> A[i];
  }
  sort(ALL(A));
  reverse(ALL(A));
  priority_queue<ll> pq;
  pq.push(A[0]);
  ll ans = 0;
  REP(i, N-1) {
    ans += pq.top();
    pq.pop();
    pq.push(A[i+1]);
    pq.push(A[i+1]);
  }
  PRINT(ans);
  return 0;
} 


Measured memory_bytes: 6904
#include<iostream>
#include<vector>
#include<algorithm>
#include<stdlib.h>
#include<utility>
#include<functional>
#include<cfenv>
#include<cmath>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<set>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define vint vector<ll>
#define vvint vector<vint>
#define P pair<ll,ll>
#define INT_MAX 2147483647
#define MOD 998244353
#define PI 3.14159265358979323846
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;

#define MAX 1000000000000

int main(void) {
	string s; cin >> s;
	int count = 0;
	int ans = 0;
	rep(i, 3) {
		if (s[i] == 'R') {
			count++;
			ans = max(ans, count);
		}
		else {
			count = 0;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;

int main(){
  ll infty = 1e12;
  int n, W, vsum=0;
  cin >> n >> W;
  vector<ll> w, v;
  rep(i, n) {
    ll x, y;
    cin >> x >> y;
    w.push_back(x);
    v.push_back(y);
    vsum += y;
  }
  vector<ll>tmp(vsum + 1, infty);
  vector<vector<ll>> dp(n + 1, tmp);

  dp[0][0] = 0;
  rep2(i, 1, n+1){
      dp[i][0] = 0;
      rep2(j, 1, vsum+1){
        if (j - v[i - 1] >= 0) {
          dp[i][j] = min(dp[i - 1][j - v[i - 1]] + w[i - 1], dp[i - 1][j]);
        } else {
          dp[i][j] = min(w[i-1], dp[i - 1][j]);
        }
      }
  }

  auto it = upper_bound(dp[n].begin(), dp[n].end(), W);
  cout << it - dp[n].begin() - 1 << endl;
  return 0;
}

Measured memory_bytes: 83056
/*************************************************************************
  >         File: A.cc
  >       Author: Yuan Lei
  >         Mail: yuanlei@indeed.com
  > Created Time: Sat Apr  8 21:37:31 2017
*************************************************************************/
#include <vector>
#include <cstdio>
#include <bitset>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <cstring>
#include <cassert>
#include <numeric>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <string>
#include <iostream>
#include <algorithm>
#include <functional>
#include <iomanip>

constexpr int N = 60;

int cnt[N][N];
int need[N];

int main() {
  std::ios::sync_with_stdio(0);
  int n;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    std::string s;
    std::cin >> s;
    for (int c = 0; c < 26; ++c) {
      cnt[i][c] = std::count(s.begin(), s.end(), 'a' + c);
    }
  }
  std::string ans;
  for (int c = 0; c < 26; ++c) {
    need[c] = 55;
    for (int i = 0; i < n; ++i) {
      need[c] = std::min(need[c], cnt[i][c]);
    }
    ans += std::string(need[c], 'a' + c);
  }
  std::cout << ans << std::endl;
  


  return 0;
}


Measured memory_bytes: 256
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("avx") 
#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define makeunique(x) sort(all(x)), (x).resize(unique(all(x)) - (x).begin())
#define re return
#define fi first
#define se second
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqrt(x) sqrt(abs(x))
#define y0 y3487465
#define y1 y8687969
#define j0 j5743892
#define j1 j542893
                         
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double D;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<vi> vvi;

template<class T> T abs(T x) { re x > 0 ? x : -x; }
template<class T> T gcd(T a, T b) { re a ? gcd (b % a, a) : b; }
template<class T> T sqr(T a) { re a * a; }
template<class T> T sgn(T a) { re a > 0 ? 1 : (a < 0 ? -1 : 0); }

const double pi = acos(-1.0);

#define filename ""

int n;
int m;

int main () {
//  freopen (filename".in", "r", stdin);
//  freopen (filename".out", "w", stdout);
    cin >> n;
    cout << 360 / gcd(360, n) << endl;
    
    return 0;
}


Measured memory_bytes: 3628
#132

n = int(input())
p = list(map(int, input().split()))
res = 0
for i in range(1, n-1):
    if (p[i-1] < p[i] and p[i] < p[i+1]) or (p[i-1] > p[i] and p[i] > p[i+1]):
        res += 1
print(res)

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

using namespace std;

#define REP(var, n)  for (decltype(n) var = 0; var < (n); var++)
#define RREP(var, n)  for (auto var = n - 1; var != static_cast<decltype(var)>(-1); var--)
#define FOR(var, a, b)  for (auto var = (a); var < (b); var++)
#define RFOR(var, a, b)  for (auto var = b - 1; var != a; var--)

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

#define all(c) begin(c),end(c)

template<typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
    if (!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}


template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    return os << '(' << p.first << ',' << p.second << ')';
}


auto solve() {
    int n;
    cin >> n;
    vi a(n);
    for (auto &&e:a)cin >> e;

    // [l,r)
    function<int(int, int)> dfs = [&](int l, int r) {


        if (l == r) return 0;
        if (l > r) return -111111;

        int left = l;

        int res = 0;
        int mn = 1000;
        FOR(i, l, r) {
            mn = min(mn, a[i]);
        }
        FOR(i, l, r) {
            a[i] -= mn;
        }
        
        FOR(i, l, r) {
            if (a[i] == 0) {
                res += dfs(left, i);
                left = i + 1;
            }
        }
        if (left != r) {
            res += dfs(left, r);
        }

        return mn + res;
    };

    return dfs(0, n);
}


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

    cout << solve() << endl;
//    solve();

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
string s;
int main(){
	cin>>s;
	int ans=0;
	int ans2=0;
	REP(i,s.size()){
		if(i%2==0){
			if(s[i]=='0')ans++;
		}else{
			if(s[i]=='1')ans++;
		}
	}
	REP(i,s.size()){
		if(i%2==1){
			if(s[i]=='0')ans2++;
		}else{
			if(s[i]=='1')ans2++;
		}
	}
	cout<<min(ans,ans2)<<endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a=0;
    cin>>a;
    if(a<1200){
        cout<<"ABC";
    }
    else if(a>=1200&&a<2800){
        cout<<"ARC";
    }
    else{
        cout<<"AGC";
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i <(n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define inf 2147483647 //int値の最大値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定
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;
}
int gcd(int a, int b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int two(int n){
	ll ans=1;
	rep(i,n){
		ans*=2;
	}
	return ans;
}
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

   int n;
   cin>>n;
   int ma=1;
   vector<int>a;
rep(i,n){
    if(pow(2,i) <n){
        ma=pow(2,i);
    }
    else if(pow(2,i)==n)ma=n;
    else break;
}
cout<<ma<<endl;
}

Measured memory_bytes: 4128
#include<cstdio>
int main() {
	int n, a, x, i, j;
	long long p[6001], pp[6001];
	scanf("%d%d", &n, &a);
	for (i = 0; i <= 6000; i++) {
		p[i] = 0;
	}
	p[3000] = 1;
	for (i = 0; i < n; i++) {
		scanf("%d", &x);
		x -= a;
		for (j = 500; j <= 5500; j++) {
			pp[j + x] = p[j];
		}
		for (j = 500; j <= 5500; j++) {
			p[j] += pp[j];
		}
	}
	printf("%lld", p[3000] - 1);
	return 0;
}

Measured memory_bytes: 256
c,gx,gy,map[20][20],n,x,y;check(int a,int b){if(map[a][b]==1 ||a>gx ||b>gy)return;if(a==gx && b==gy){c++;return;}check(a+1,b);check(a,b+1);}
main(){for(;scanf("%d%d",&gx,&gy),gx;printf("%d\n",c)){scanf("%d",&n);for(x=0;x<20;x++)for(y=0;y<20;y++)map[x][y]=0;for(c=0;n--;map[x][y]=1)scanf("%d %d",&x,&y);check(1,1);}exit(0);}

Measured memory_bytes: 0
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;

int mcm(int p[], int n) {
	int m[n+1][n+1];
	memset(m, 0, sizeof(m));

	for (int s = 0; s < n; s++) {
		for (int i = 1, j = s + 2; j <= n; i++, j++) {
			m[i][j] = 1 << 30;
			for (int k = i; k <= j; k++) {
				m[i][j] = min(m[i][j], m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j]);
			}
		}
	}
	return m[1][n];
}

int main() {
	int n, d;
	cin >> n;
	int p[n+1];
	for (int i = 0; i < n-1; i++) {
		cin >> p[i] >> d;
	}
	cin >> p[n-1] >> p[n];
	int ans = mcm(p, n);
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3104
#include <stdio.h>
int main(){
    int S,h,m,s;
    scanf("%d",&S);
    h = S/3600;
    m = (S-3600*h)/60;
    s = S-3600*h-60*m;
    printf("%d:%d:%d\n",h,m,s);
    return 0;
}

Measured memory_bytes: 592
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>

using namespace std;

 
int main(){

	int n,t,E;
	int x;
	int sum=0;
	cin>>n>>t>>E;
	for(int i=0;i<n;i++){
		cin>>x;
		bool f=false;
		for(int j=0;j*x<=t+E;j++)
		{
			if(j*x>=t-E&&j*x<=t+E)f=true;
		}
		if(f==true)sum=i+1;
	}

	if(sum==0)sum=-1;
	cout<<sum<<endl;
	
	return 0;
}

Measured memory_bytes: 1164
#include<bits/stdc++.h>  
using namespace std; 
vector<vector<int> > L;
int max(int a, int b){
	return a>b ? a:b ;
}
string LCS(string S1, string S2){
/*	printf("%s %s\n",S1.c_str(),S2.c_str() );
	printf("%d %d\n",strlen(S1.c_str()),strlen(S2.c_str()) );*/
	int i,j;
	for(i=0;i<=strlen(S1.c_str());i++){
		for(j=0;j<=strlen(S2.c_str());j++){
	//		printf("%d %d\n", i,j);
			if(i==0 || j==0) L[i][j] = 0;
			else{
				if(S1[i-1] == S2[j-1]) L[i][j] = L[i-1][j-1] + 1;
				else L[i][j] = max(L[i][j-1],L[i-1][j]);
			}
		}
	}
//	printf("%d\n", L[i-1][j-1]);
	//return S1;
	string ansString;
	for(i=strlen(S1.c_str()), j=strlen(S2.c_str()) ; i>=0 && j>=0 ;)
	{
		if(L[i][j] == 0) break;
		if(L[i][j] != max(L[i-1][j],L[i][j-1])){ 
			ansString.push_back(S1[i-1]);
			i--;
			j--;
		}
		else if(L[i][j] == L[i-1][j]) i--;
		else if(L[i][j] == L[i][j-1]) j--;
	}

	reverse(ansString.begin(),ansString.end());
	return ansString;
}
int main()
{

	string s,t;
	cin >> s;
	cin >> t;
	L.resize(strlen(s.c_str())+1, {});
	for(int i=0;i<=strlen(s.c_str());i++) L[i].resize(strlen(t.c_str())+1, 0);
	//scanf("%s",s);
	//scanf("%s",t);
	
	string commonSeq = LCS(s,t);
	printf("%s\n",commonSeq.c_str());
	return 0;
}


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

int main()
{
    int n;
    cin>>n;
    vector<vector<int>> ar(n,vector<int>(3,0));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<3;j++)
        {
            cin>>ar[i][j];
        }
    }
    vector<vector<int>> dp(n,vector<int>(3,0));
    for(int i=0;i<3;i++)
    {
        dp[0][i]=ar[0][i];
    }
    for(int i=1;i<n;i++)
    {
        for(int j=0;j<3;j++)
        {
            dp[i][j]=(max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3])+ar[i][j]);
        }
    }
    int res=max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
    printf("%d",res);
}

Measured memory_bytes: 14256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<(n);i++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;
int main(){
    int n;cin>>n;
    int a[n];
    int c[3];
    rep(i,n)cin>>a[i];
    rep(i,3)c[i]=0;
    ll ans =1;
    rep(i,n){
        int cnt =0;
        bool f =true;
        if(a[i]==c[0]){cnt++;c[0]++;f=false;}
        if(a[i]==c[1]){
            cnt++;
            if(f)c[1]++;
            f=false;
        }
        if(a[i]==c[2]){
            cnt++;
            if(f)c[2]++;
            f=false;
        }
        if(f){
            cout<<0<<endl;
            return 0;
        }
        ans*=cnt;
        ans%=mod;
    }
    cout<<ans<<endl;

}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <limits.h>
#include <vector>
#include <map>
#include <string>
#include <tuple>
#include <math.h>
using namespace std;
typedef long long ll;

int main(void){
    ll n, a[200020];
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i] -= i;
    }
    
    sort(a, a + n);
    
    ll ans = 0;
    if (n % 2 == 0) {
        ll m = (a[n / 2 - 1] + a[n / 2]) / 2;
        for (int i = 0; i < n; i++) {
            ans += abs(a[i] - m);
        }
    }
    else {
        ll m = a[n / 2];
        for (int i = 0; i < n; i++) {
            ans += abs(a[i] - m);
        }
    }
    
    cout << ans << endl;
    
    
}


Measured memory_bytes: 1792
/*{{{*/
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB emplace_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 502;
int v[SIZE][SIZE];
int d[SIZE][SIZE];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
void upd(int x,int y){
    REP(i,4){
        int nx=x+dx[i];
        int ny=y+dy[i];
        if(v[x][y]+d[nx][ny]<v[nx][ny]){
            v[nx][ny]=v[x][y]+d[nx][ny];
            upd(nx,ny);
        }
    }
}
int main(){
    int N;
    R(N);
    FOR(i,1,N)FOR(j,1,N){
        v[i][j]=min({i,j,N+1-i,N+1-j});
        d[i][j]=1;
    }
    int sum=0;
    FOR(i,1,N*N){
        int id;
        R(id);
        int x=(id-1)/N+1;
        int y=(id-1)%N+1;
        d[x][y]=0;
        sum+=v[x][y]-1;
        v[x][y]--;
        upd(x,y);
    }
    W(sum);
    return 0;
}


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

using namespace std;

using int64 = long long;

int main() {
  int N, C[100000];
  cin >> N;
  for(int i = 0; i < N; i++) cin >> C[i];
  int Q;

  int st[100000] = {};
  cin >> Q;
  for(int i = 0; i < Q; i++) {
    int t, x, d;
    cin >> t >> x >> d;
    if(t == 1) {
      --x;
      st[x] += d;
      if(st[x] > C[x]) {
        cout << x + 1 << endl;
        return (0);
      }
    } else {
      --x;
      st[x] -= d;
      if(st[x] < 0) {
        cout << x + 1 << endl;
        return (0);
      }
    }
  }

  cout << "0" << endl;
}




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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define range(a) a.begin(), a.end()

using namespace std;
using ll = long long;

void chmax(int &x, int y) {
  x = max(x, y);
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N, K; cin >> N >> K;
  int R, S, P; cin >> R >> S >> P;
  string T; cin >> T;

  vector<int> dpR(K, 0);
  vector<int> dpS(K, 0);
  vector<int> dpP(K, 0);
  for (int i = 0; i < N; i++) {
    int epR = dpR[i % K];
    int epS = dpS[i % K];
    int epP = dpP[i % K];
    chmax(dpR[i % K], epP + (T[i] == 's' ? R : 0));
    chmax(dpR[i % K], epS + (T[i] == 's' ? R : 0));
    chmax(dpS[i % K], epR + (T[i] == 'p' ? S : 0));
    chmax(dpS[i % K], epP + (T[i] == 'p' ? S : 0));
    chmax(dpP[i % K], epR + (T[i] == 'r' ? P : 0));
    chmax(dpP[i % K], epS + (T[i] == 'r' ? P : 0));
  }
  int ans = 0;
  for (int i = 0; i < K; i++) {
    ans += max({dpR[i], dpP[i], dpS[i]});
  }
  cout << ans << endl;
}


Measured memory_bytes: 1488
import java.util.Scanner;

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

        int n = sc.nextInt();

        for (i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        for (i = n-1; i >= 0; i--) {
            if (i == 0) {
                System.out.printf("%d\n",a[i]);
            } else {
                System.out.printf("%d ", a[i]);
            }
        }

        sc.close();
    }

}


Measured memory_bytes: 26424
import java.util.*;
import java.io.*;

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };
	static final int INF = Integer.MAX_VALUE / 3;
	static final long LINF = Long.MAX_VALUE / 3;

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int a = fs.nextInt(), b = fs.nextInt();
		for(int i=0;i<3000;i++) {
			int c = (int)((double)i * 0.08);
			int d = (int)((double)i * 0.10);
			if(a == c && b == d) {
				System.out.println(i);
				return;
			}
		}
		System.out.println(-1);
	}

	//MOD culculations
	static long plus(long x, long y) {
		long res = (x + y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long sub(long x, long y) {
		long res = (x - y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long mul(long x, long y) {
		long res = (x * y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long div(long x, long y) {
		long res = x * pow(y, mod - 2) % mod;
		return res < 0 ? res + mod : res;
	}

	static long pow(long x, long y) {
		if (y < 0)
			return 0;
		if (y == 0)
			return 1;
		if (y % 2 == 1)
			return (x * pow(x, y - 1)) % mod;
		long root = pow(x, y / 2);
		return root * root % mod;
	}
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

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

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}

Measured memory_bytes: 23124
#!/usr/bin/env python3
# Daydream
import sys

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

tokens = ['dream', 'dreamer', 'erase', 'eraser']

def solve(S: str):
    print(YES if is_valid2(S) else NO)
    return

def is_valid(S):
    if S == '':
        return True
    for token in tokens:
        sub = S[-len(token):]
        if sub == token:
            return is_valid(S[:-len(token)])
    return False

def is_valid2(S):
    import re
    x = r"^(dream|dreamer|erase|eraser)*$"
    return True if re.match(x, S) else False

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

if __name__ == '__main__':
    main()


Measured memory_bytes: 6716
#define _DEBUG
#include "bits/stdc++.h"
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#ifdef _DEBUG
#define debug(...) CHOOSE((__VA_ARGS__,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
#else
#define debug(...)
#endif
#define rep(index,num) for(int index=0;index<(int)num;index++)
#define rep1(index,num) for(int index=1;index<=(int)num;index++)
#define brep(index,num) for(int index=(int)num-1;index>=0;index--)
#define brep1(index,num) for(int index=(int)num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=(ll)1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	ll K,A[200001];
	scan(N>>K);
	rep(i,N) scan(A[i]);
	ll amin=0,amax=INFl;
	while(amin+1<amax){
		ll amid=(amin+amax)/2;
		ll kaisu=0;
		rep(i,N) kaisu+=A[i]/amid+(A[i]%amid!=0)-1;
		if(kaisu<=K){
			amax=amid;
		}
		else{
			amin=amid;
		}
	}
	prin(amax);
	return 0;
}


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

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cout << #a << " = " << a << endl;

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	int a, b;
	cin >> a >> b;
	FOR(i, 1, 4) if (i == a || i == b) continue;
	else cout << i;
	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mkp make_pair
#define rep(i,s,f) for(i=s;i<f;i++)
#define db cout<<'h'<<'i'<<endl 
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
#define B begin()
#define E end()
#define vi vector<int>
#define vii vector<pair<int,int>>
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define PI 3.14159265
#define mod 1000000007
#define mod2 998244353
#define space 200005
//<<fixed << setprecision(9)
vi G[space];
ll val[space];
void dfs(int n,int p)
{
    for(auto z:G[n])
    {
        if(z!=p)
        {
            val[z]+=val[n];
            dfs(z,n);
        }
    }
}
int main()
{
    int n,i,j,t;
    boost;
    int q;
    cin>>n>>q;

    rep(i,0,n-1)
    {
        cin>>j>>t;
        G[j].pb(t);
        G[t].pb(j);
    }
    rep(i,0,q)
    {
        cin>>j>>t;
        val[j]+=t;
    }
    dfs(1,-1);
    rep(i,1,n+1)cout<<val[i]<<' ';
    return 0;
}



Measured memory_bytes: 24320
#include<iostream>
#include<cmath>

using namespace std;

double Calculate(double);

int main(){
  double n;
  while(1){
    cin >> n;
    if(n == 0) break;
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(6);
    cout << Calculate(n) << endl;
  }
  return 0;
}

double Calculate(double n){
  double t1, t2, a, b;
  if((int)n%3 != 0) n *= 3.0;
  t1 = M_PI*(5.0/6.0 - 1.0/n);
  t2 = M_PI/n;
  a = 1.0/sqrt((3.0*(1.0 + 4.0*sin(t2)*sin(t2) - 4.0*sin(t2)*cos(t1))));
  b = 2.0*a*sin(t2);
  return n*a*b*sin(t1);
}

Measured memory_bytes: 1304
#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() {
  string S, T;
  cin >> S;
  cin >> T;
  
  bool ans = true;
  rep(i, S.size()) {
    if (S[i] != T[i]) ans = false;
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3628
#include <cstdio>
#include <iostream>

using namespace std;

int main() {
    string a, b;
    cin >> a >> b;
    int x = stoi(a+b);
    for (int i = 1; i < x; i++) { 
        if (x / i == i && x % i == 0) {
            printf("Yes\n");
            return 0;
        }
    }
    printf("No\n");
    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pii pair<int,int>
#define pll pair<lli, lli>
#define vi  vector<int>
#define vii vector<pair<int,int>>
#define vll vector<lli>
#define pb  push_back
#define mpr  make_pair
#define ss  second
#define ff first
#define INF 1000000001
#define inf1 1000000000000000001
#define pie 3.14159265358979323846264338327950L
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define testcase() int tc;cin>>tc;while(tc--)
#define clean(x) memset(x,0,sizeof(x))
const lli maxn = 300000+5;
const lli mod= 1000000007;
vector<lli> catlan(int n) {
    vector<lli> dp(n + 1, 0);
    dp[0] = 1;
    dp[1] = 1;
    for (int i = 2; i <= n; i ++) {
        for (int j = 0; j < i; ++ j) {
            dp[i] += dp[j] * dp[i - j - 1];
        }
    }
    return dp;
}
lli digit(lli n){int res=(int)log10(n)+1;return res;}
lli lcm(lli a,lli b){lli ans=(a*b)/(__gcd(a,b));return ans;}
lli b_ex(lli n,lli a){lli res=1;while(n){if(n%2==1)res*=a;n>>=1;a=a*a;}return res;}
lli ncr(lli n,lli k){lli ans=1;if(k>n-k)k=n-k;for(lli i=1;i<=k;i++){ans*=(n-i+1),ans=ans/i;}return ans;}
lli power(lli a , lli n){lli ans = 1;while(n){if(n % 2)ans = (ans * a) % mod;n /= 2;a = (a * a) % mod;}return ans;}
lli set_bits(lli n)
{
    int c=0;
    if(n==0)return 0;
    while(n)
    {
        if((n&1)==1)
        {
           cout<<c<<" ";
        }
        c++;
        n=n>>1;
    }
    return c;
}

lli inf = 5e17;
///=================== ALWAYS CHECK 1 or 0 base case=================================================================================///
///------------------ALWAYS lli-----TEMP TSF99--------------------------------------------------------------------------------------//


void solve()
{
    string a,b;cin>>a>>b;
    int ans=0;
    for(int i=0;i<a.size();i++)
    {
        if(a[i]!=b[i])ans++;
    }
    cout<<ans<<endl;
}
int main()
{
    solve();
}


Measured memory_bytes: 3780
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    int colour[8]={0};
    int min=0,max=0;
    for(int i=0;i<n;i++)
    {
        if(a[i]<=399 && colour[0]==0)
        {
            min++;
            colour[0]=1;
        }
        if(a[i]>=400 && a[i]<=799 && colour[1]==0)
        {
            min++;
            colour[1]=1;
        }
        if(a[i]>=800 && a[i]<=1199 && colour[2]==0)
        {
            min++;
            colour[2]=1;
        }
        if(a[i]>=1200 && a[i]<=1599 && colour[3]==0)
        {
            min++;
            colour[3]=1;
        }
        if(a[i]>=1600 && a[i]<=1999 && colour[4]==0)
        {
            min++;
            colour[4]=1;
        }
        if(a[i]>=2000 && a[i]<=2399 && colour[5]==0)
        {
            min++;
            colour[5]=1;
        }
        if(a[i]>=2400 && a[i]<=2799 && colour[6]==0)
        {
            min++;
            colour[6]=1;
        }
        if(a[i]>=2800 && a[i]<=3199 && colour[7]==0)
        {
            min++;
            colour[7]=1;
        }
        if(a[i]>=3200)

            max++;

    }

    if(min==0)
    {
        cout<<1<<" "<<max;
        return 0;
    }


    int s=min+max;


    cout<<min<<" "<<min+max;


}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define x first
#define y second
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define all(x) x.begin(),x.end()
#define endl '\n'
int arr[100010];
vector<int> gr[100010];

int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++)cin>>arr[i];
	for(int i=0;i<m;i++){
		int u,v;
		cin>>u>>v;
		gr[u].pb(v);
		gr[v].pb(u);
	}
	int c=0;
	for(int i=1;i<=n;i++){
		int f=1;
		for(auto x:gr[i]){
			if(arr[x]>=arr[i]){
				f=0;
				break;
			}
		}
		if(f){
			c++;
			// cout<<i<<endl;
		}
	}
	cout<<c<<endl;
	return 0;
}

Measured memory_bytes: 9148
#include <bits/stdc++.h>
using namespace std;
#define rep(i,k,n) for(int i = k; i < n; i++)  
#define repp(i,k,n) for(int i = k; i <= n; i++) 
#define per(i,k,n) for(int i = k; i >= n; i--)

#define int long long
#define all(a) a.begin(),a.end()       

#define pb push_back
typedef long long ll; 
typedef pair<int, int> ii;
typedef pair<int,ii > iii; 
typedef vector<ii> vii;
typedef vector<char> vchar;
typedef vector<int> vi;
#define ff first
#define ss second

#define mem(a, b) memset(a, b, sizeof(a));
#define mem0(a) memset(a, 0, sizeof(a));

#define INF 1000000000
#define mod 998244353
//#define mod 1000000007
#define endl "\n"


   //=\/=\/=\/=\/=\/=\/=\/=\/=\/=\        Jai Hind Dosto        /=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\\
  //=\/=\/=\/=\       RETARDED     ̿̿ ̿̿ ̿̿ ̿'̿'\̵͇̿̿\з= ( ▀ ͜͞ʖ▀) =ε/̵͇̿̿/’̿’̿ ̿ ̿̿ ̿̿ ̿̿      NISHAN                 /=\/=\/=\/=\\
 //=\/=\/=\/=\         APE                                           SINGH                   /=\/=\/=\/=\\
//=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\\


int modPow(int a, int b);
void solve(){


    int a;
    float b;
    cin >> a >>b;
    b*=100;
    int c = b;
    int d = a*c;
    d/=100;
    cout << d <<endl;



}






signed main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //cout << fixed;
    //cout <<setprecision(2);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    
   // int test=1; cin >> test;
   // while(test--)
    solve();
}


int modPow(int a, int b){
    if(b==0)return 1;
    if(b%2==0){
        int x = a*a;
        x%=mod;
        return modPow(x,b/2);
    }
    return (a*modPow(a,b-1))%mod;
}


Measured memory_bytes: 3716
#include<bits/stdc++.h>
#define LL long long
#define M 1000000007
using namespace std;
int main(void){
	int n;
	int i;
	LL sum;
	cin>>n;
	sum=1;
	for(i=1;i<=n;i++){
		sum*=(LL)i;
		sum%=(LL)M;
	}
	cout<<sum<<endl;
	return 0;
}

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

int main(){
    string s; cin >> s;
    if(s[0]==s[1]||s[1]==s[2]||s[2]==s[3]){
        cout << "Bad" << endl;
    }
    else{
        cout << "Good" << endl;
    }
}

Measured memory_bytes: 256
i = str(raw_input())
top = i[0]

if int(i[0])<int(i[1]):
	top = str(int(i[0])+1)
elif int(i[0])==int(i[1]):
	if int(i[1])<int(i[2]):
		top = str(int(i[0])+1)

print str(top)*3

Measured memory_bytes: 2568
// 2019/06/28
// AtCoder Beginner Contest 091 - A

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // Input
       int a = sc.nextInt();
       int b = sc.nextInt();
       int c = sc.nextInt();

        // Make string
       String ans;
       if(a + b >= c){
           ans = "Yes";
       } else {
           ans = "No";
       }
       
       // Output
       System.out.println(ans);
    }
}

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

vector<vector<int>> m;
int xv[]={1,1,1,0,-1,-1,-1,0},yv[]={1,0,-1,-1,-1,0,1,1};


void bfs(int x,int y){
    stack<pair<int,int>> stk;
    m[x][y]=0;
    for(int i=0;i<8;i++){
        if(m[x+xv[i]][y+yv[i]]){
            stk.push(make_pair(x+xv[i],y+yv[i]));
        }
    }
    while(!stk.empty()){
        pair<int,int> tg=stk.top();
        stk.pop();
        bfs(tg.first,tg.second);
    }
    
}


void solve(int c,int r){
    int in,ans=0;
    m=vector<vector<int>>(r+2,vector<int>(c+2,0));
    for(int i=1;i<=r;i++){
        for(int j=1;j<=c;j++){
            cin>>in;
            m[i][j]=in;
        }
    }
    stack<pair<int,int>> stk;
    
    for(int i=1;i<=r;i++){
        for(int j=1;j<=c;j++){
            if(m[i][j]){
                ans++;
                bfs(i,j);
            }
        }
    }
    
    cout<<ans<<endl;
}

int main(void){
    int a,b;
    while(cin>>a>>b,a){
        solve(a,b);
    }
}

Measured memory_bytes: 4964