akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define REV(x) reverse(ALL(x))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ld = long double;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using Pll_ll = pair<ll, ll>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;
const double EPS = 1E-10;

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


int main(){
    string S; cin >> S;
    int w; cin >> w;
    REP(i, S.length()){
        cout << S[i];
        i += w - 1;
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll n;
    cin >> n;
    
    vector<vector<pair<ll, ll>>> G(n);
    rep(i, n-1) {
        ll a, b, c;
        cin >> a >> b >> c;
        a--;  b--;
        G[a].pb(make_pair(b, c));
        G[b].pb(make_pair(a, c));
    }
    
    vl dist(n, -1);  // dist[i] : 頂点iの根からの距離
    queue<ll> Q;

    const ll root = 0;  // デフォルトで根は頂点0
    dist[root] = 0;
    Q.push(root);
    while(!Q.empty()) {
        ll v = Q.front();
        Q.pop();
        for(auto p : G[v]) {
            ll u = p.first;
            ll cost = p.second; 
            if(dist[u] != -1) {
                continue;
            }
            dist[u] = dist[v] + cost;
            Q.push(u);
        }
    }

    vl ans(n);
    rep(i, n) {
        if(dist[i]%2 == 1) {
            ans[i] = 1;
        }
    }

    rep(i, n) {
        out(ans[i]);
    }
    
    re0;
}

Measured memory_bytes: 9472
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.StringTokenizer;

public class Main {
  private static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(final InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

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

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

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

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

  private static class OutputWriter extends PrintWriter {
    public OutputWriter(final OutputStream outputStream) {
      super(outputStream);
    }

    @Override
    public void println() {
      super.println();
      super.flush();
    }
  }

  private static boolean isLocal() {
    return new File("./.vscode/launch.json").exists();
  }

  public static void main(final String[] args) throws IOException {
    final InputStream inputStream = isLocal() ? new FileInputStream("in.txt") : System.in;
    final OutputStream outputStream = System.out;
    final InputReader in = new InputReader(inputStream);
    final OutputWriter out = new OutputWriter(outputStream);
    final Task solver = new Task();
    int testcase = 1;
    while (testcase-- > 0) {
      solver.solve(in, out);
    }
    out.close();
  }

  private static class Task {
    public void solve(final InputReader in, final PrintWriter out) {
      final double PI = 3.141592653589793238462643383279502884197169399;
      out.println(PI * in.nextInt() * 2);
    }
  }
}


Measured memory_bytes: 33404
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

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

//    	File file = new File("src/in.txt");

        //コード
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);

    	int N = sc.nextInt();


    	ArrayList<Integer> result = new ArrayList<>();

    	for(int i=0;i<N;i++) {
    		result.add(sc.nextInt());
    	}
    	Collections.sort(result);
    	int min = result.get(0);
    	int max = result.get(N-1);
    	int ans = 10000000;
    	for (int i=min;i<=max;i++) {
    		int sum = 0;
    		for(int j=0;j<N;j++) {
    			sum += (result.get(j)-i)*(result.get(j)-i);
    		}
    		if(sum<ans) {
    			ans = sum;
    		}
    	}
    	System.out.println(ans);
    }

}

Measured memory_bytes: 21972
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const [a, b]: number[] = input[0].split(' ').map((x: string): number => +x);

const maxi: number = Math.max(a+b, a-b, a*b);
console.log(maxi);

Measured memory_bytes: 7372
#include <iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
    int n,d,x,ans,i;
    cin>>n>>d>>x;
     ans=x;
    for(i=0;i<n;i++)
    {
        int a;
        cin>>a;
        ans=ans+(d-1)/a+1;
    }
    cout<<ans<<endl;
return 0;
}


Measured memory_bytes: 256
steps = list(list(input()))
even = True
odd = True
for i in range(0, len(steps), 2):
    if not (steps[i] == 'R' or  steps[i] == 'U' or  steps[i] == 'D'):
        odd = False

for i in range(1, len(steps), 2):
    if not (steps[i] == 'L' or  steps[i] == 'U' or  steps[i] == 'D'):
        even = False

if even and odd:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;

unsigned long long int GCD(unsigned long long int a,unsigned long long int b){
	if(a < b){
		return GCD(b,a);
	}
	if(b == 1){
		return 1;
	}
	if(b == 0){
		return a;
	}
	return GCD(b,a%b);
}

int main()
{
	unsigned long long int A,B,C,D,gc,lc,k1,k2,k3,k4,k5,k6,m1,m2,m3;
	cin>>A>>B>>C>>D;
	gc = GCD(C,D);
	lc = (C*D)/gc;
	k1 = A / C;
	k2 = B / C;
	k3 = A / D;
	k4 = B / D;
	k5 = A / lc;
	k6 = B / lc;
	if( A % C == 0){
		m1 = k2 - k1+1;
	}else{
		m1 = k2 - k1;
	}

	if( A % D == 0){
		m2 = k4 - k3+1;
	}else{
		m2 = k4 - k3;
	}

	if( A % lc == 0){
		m3 = k6 - k5+1;
	}else{
		m3 = k6 - k5;
	}
	cout<<(B-A+1)-(m1+m2-m3)<<endl;
	/*cout<<A<<" "<<B<<" "<<C<<" "<<D<<" "<<gc<<" "<<lc<<endl;
	cout<<m1<<" "<<m2<<" "<<m3<<endl;*/
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    if((a*b)%2==0)cout<<"Even"<<endl;
    else cout<<"Odd"<<endl;
    return 0;
}


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

#define ll long long
#define mk make_pair
#define pb push_back
#define ff first
#define sc second
#define all(x) x.begin(), x.end()

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

ll sum(int n){
   if(n == 0){
      return n;
   }else{
      return sum(n/10) + n%10;
   }
}
using namespace std;


int main(){
   
   ios_base::sync_with_stdio(0);
   cin.tie(0);
   cout.tie(0);
   
   int n; cin >> n;
   int ans = 0;
   for(int i = 1; i <= n; i++){
      ans += i;
   }
   cout << ans;
   return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define endl '\n'
const ll mod = 1000000007;
const double PI = 3.141592653589793238463;
using namespace std;
bool visited[(int)1e5+1];
int a[(int)1e5+1];
int c=0;
void dfs(int x){
    c++;
    if (!visited[x])
        visited[x]=true;
    else
        return;
    if (x==2)
        return;
    dfs(a[x]);
}
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int x,y;
    cin>>x;
    for (int i=1;i<=x;i++)
        cin>>a[i];

    dfs(1);
    cout<<(visited[2]?c-1:-1);
    return 0;
}


Measured memory_bytes: 768
n, x = map(int, input().split())
l = list(map(int, input().split()))

d = 0
ans = 1
for i in range(n):
    d += l[i]
    if d > x:
        break
    ans += 1

print(ans)
        
    


    
        
            



    









                                        




    




        


    







        



Measured memory_bytes: 2940
#include <stdio.h>

using namespace std;

int main(){
	int n;
	scanf("%d",&n);
	int A[n];

	for(int i = 0; i < n; i++) scanf("%d",&A[i]);

	for(int i = n-1; i > 0; i--) printf("%d ",A[i]);
	printf("%d\n",A[0]);
}






Measured memory_bytes: 2696
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, K, X(0);
 
int main()
{
	cin>>N>>K;
	ll A[N];
	for(ll i(0);i<N;++i)
		cin>>A[i];

	for(ll i(40);i>=0;--i)
	{
		int cnt(0);
		for(ll j(0);j<N;++j)
		{
			if((A[j]>>i)&1)
				cnt++;
		}
		if(cnt*2<=N && (X+(1LL<<i)<=K))
			X+=(1LL<<i);
	}
	ll ans(0);
	for(ll i(0);i<N;++i)
		ans+=(X^A[i]);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1024
# coding: utf-8
# Your code here!
n=int(input())

Taro=0
Hanako=0

for i in range(n):
    Tcard,Hcard=input().split()
    
    if Tcard==Hcard:
        Taro+=1
        Hanako+=1
    elif Tcard>Hcard:
        Taro+=3
    else:
        Hanako+=3

print(Taro,Hanako)


Measured memory_bytes: 5600
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int N,M;
int G[(5000*5001)/2];
int sum(int a){
  return N*(N+1)/2 - (N-a)*(N-a+1)/2;
}
int calc_id(int y,int x){
  return sum(x-1)+ y - x;
}
int main(){
  scanf("%d %d",&N,&M);
  memset(G,-1,sizeof(G));
  for(int i=0;i<M;i++){
    int a,b,x;
    scanf("%d %d %d",&a,&b,&x);
    int id = calc_id(a,b);
    G[id] = max(G[id],x);
  }
  int res = 0;
  for(int y=1;y<=N;y++){
    for(int x=1;x<=y;x++){
      int id = calc_id(y,x);
      if(G[id]==-1) continue;
      res++;
      if(y+1 > N) continue;
      int id1 = calc_id(y+1,x);
      int id2 = calc_id(y+1,x+1);
      G[id1]=max(G[id1],G[id]-1);
      G[id2]=max(G[id2],G[id]-1);
    }
  }
  printf("%d\n",res);
}

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

template<class T,class U>
ostream& operator<<(ostream& o, const pair<T,U> &p){
    o<<"("<<p.first<<", "<<p.second<<")";
    return o;
}
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }

using P = pair<int,int>;

// ←↓→↑
int dx[4] = {-1,0,+1,0};
int dy[4] = {0,1,0,-1};
int Y,X;
vector<string> s;
vector<P> loop;
int cost[50][50];

bool space(P p){
    int y = p.first, x = p.second;
    if(!(y>=0 && x>=0 && y<Y && x<X)) return false;
    if(s[y][x] == '#') return false;
    return true;
}

P next(P p,int dir){
    return P(p.first+dy[dir], p.second+dx[dir]);
}

void dfs(P p,int dir,int depth){
    int y = p.first, x = p.second;
    if(p == P(0,0) && cost[0][0]) return;
    if(cost[y][x]){
        loop.push_back({cost[y][x],depth});
    }
    cost[y][x] = depth;
    for(int turn : {-1,0,+1,+2}){
        int nd = (dir+4+turn)%4;
        P to = next(p,nd);
        if(space(to)){
            dfs(to,nd,depth+1);
            break;
        }
    }
}

bool solve(){
    s.clear();
    s.resize(Y);
    loop.clear();
    rep(y,50)rep(x,50) cost[y][x] = 0;
    rep(y,Y) cin>>s[y];
    dfs(P(0,0),1,1);
    int corner[] = {cost[Y-1][0], cost[Y-1][X-1], cost[0][X-1]};
    if(!(cost[Y-1][0] && cost[Y-1][X-1] && cost[0][X-1])){
        return false;
    }
    bool ng = false;
    for(P lp: loop){
        rep(i,3){
            if(lp.first<=corner[i] && corner[i]<=lp.second){
                ng = true;
            }
        }
    }
    return !ng;
}

int main(void){
    while(cin>>Y>>X, Y|X){
        cout<<((solve()) ? "YES" : "NO")<<endl;
    }
    return 0;
}



Measured memory_bytes: 3276
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const ll inf = 1e18;
const int mx = 1e5;

int main() {
    vint c(mx,0);
    vector<bool> prime(mx+1,true);
    for (int i = 2; i <= mx; i++) {
        if (prime[i]) {
            for (int j = 2*i; j <= mx; j += i) prime[j] = false;
        }
    }
     for (int i = 3; i <= mx; i += 2) {
        if (prime[i] && prime[(i+1)/2]) c[i] = c[i-2]+1;
        else c[i] = c[i-2];
    }
    int q;
    cin >> q;
    rep(i,q) {
        int l, r;
        cin >> l >> r;
        cout << c[r] - c[l-2] << endl;
    }
}

Measured memory_bytes: 1024
#!/usr/bin python3
# -*- coding: utf-8 -*-

def cnt(st):
    x = st.copy()
    ret = 0
    for i in range(1,len(st)):
        if x[i]==x[i-1]:
            ret += 1
            x[i] = '0'
    return ret

def main():
    S = list(input())
    K = int(input())
    res1 = cnt(S)
    res2 = cnt(S+S)
    res3 = cnt(S+S+S)
    d1=res2-res1
    d2=res3-res2
    x2=(K-1)//2
    x1=K-1 - x2
    ret=res1+x1*d1+x2*d2
    print(ret)

if __name__ == '__main__':
    main()

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

using namespace std;

int main(int argc, char *argv[]) {
  int n, m, masu[1000];
  vector<int> result;
  while (true) {
    cin >> n >> m;
    if (n == 0 && m == 0)
      break;
    for (int i = 0; i < n; i++)
      cin >> masu[i];

    int dice, hoge = 0, i;
    for (i = 1; i <= m; i++) {
      cin >> dice;
      if (hoge + dice >= n-1) {
        result.push_back(i);
        break;
      }
      hoge += dice + masu[hoge+dice];
      if (hoge >= n-1) {
        result.push_back(i);
        break;
      }
      if (hoge < 0)
        hoge = 0;
    }
    for (int j = i+1; j <= m; j++)
      cin >> dice;
  }


  for (int i = 0; i < result.size(); i++)
    cout << result[i] << endl;
  return 0;
}

Measured memory_bytes: 1212
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


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

	int n, m, i, j, k;
	cin >> n >> m;
	vector<vector<int>> a(n, vector<int>(m));
	for (i = 0; i < n; i++) {
		for (j = 0; j < m; j++) cin >> a[i][j];
	}

	vector<tuple<int, int, int, int>> ans;
	
	for (i = 0; i < n; i++) {
		for (j = 0; j < m; j++) {
			if (a[i][j] % 2) {				
				if ((j < m - 1)) {
					ans.push_back(make_tuple(i, j, i, j + 1));
					a[i][j]--;
					a[i][j + 1]++;
				}
				else {
					if (i < n - 1) {
						ans.push_back(make_tuple(i, j, i + 1, j));
						a[i][j]--;
						a[i + 1][j]++;
					}
				}
			}
		}
	}

	cout << ans.size() << "\n";
	for (auto p : ans) {
		cout << get<0>(p) + 1 << " " << get<1>(p) + 1 << " " << get<2>(p) + 1 << " " << get<3>(p) + 1 << "\n";
	}


	return 0;
}


Measured memory_bytes: 5236
#include<iostream>
#include<unordered_map>
#include<stack>
#include<algorithm>
#include<set>
#include<cstring>
#include<vector>
#include<numeric>
#include<map>
#include<climits>
using namespace std;


int32_t main() 
{
	#ifndef ONLINE_JUDGE
	freopen("input/input.txt", "r", stdin);
	freopen("input/output.txt", "w", stdout);
	#endif
	long long int a, b, c ,d;
	cin >> a >> b >> c >> d;
	long long int op1 = b*c;
	long long int op2 = b*d;
	long long int op3 = a*c;
	long long int op4 = a*d;
	cout << max({op1, op2, op3, op4});
	return 0;
}

Measured memory_bytes: 3632
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
#include <map>
#include <queue>
using namespace std;

#define ll long long
const int MOD = 1000000007;//10^9+7

ll max(ll a, ll b) {

	if (a > b)return a;
	else return b;

}
double max(double a, double b) {

	if (a > b)return a;
	else return b;

}
//a??¨b?????§?????????

ll min(ll a, ll b) {

	if (a < b)return a;
	else return b;

}
//a??¨b????°??????????

ll avd_i(ll a, ll b) {

	if (a > b)return a - b;
	else return b - a;

}
double avd_d(double a, double b) {

	double re;
	if (a > b)re = a - b;
	else re = b - a;
	return re;

}
//a??¨b???????????¶??????

ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}
//p????´???°,a???b??????p??§?????£?????????

ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}
//p????´???°,(nCr)%p

ll gcd(ll a, ll b) {

	if (a > b) {

		ll tmp = a;
		a = b;
		b = tmp;

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

}
//?????§??¬?´???°

ll lcm(ll a, ll b) {

	return (a / gcd(a, b))*b;

}
//????°???¬?????°

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

	cin >> a >> b >> c;

	if (a < b&&b < c)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

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

int main() {
  int takoyaki_count;
  int delicious[50];
  int stamina = 0;

  cin >> takoyaki_count;
  for(int i=0; i<takoyaki_count; i++) {
    cin >> delicious[i];
  }

  for(int i=0; i<takoyaki_count-1; i++) {
    for(int j=i+1; j<takoyaki_count; j++) {
      stamina += delicious[i]*delicious[j];
    }
  }

  cout << stamina << endl;
}

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

int main()
{
	int n;
	cin >> n;
	vector<long long> a(n+1);
	for(int i = 0; i < n+1;i++)
	{
		cin >> a[i];
	}

	sort(a.begin(), a.end());
	long long ans = a[1] - a[0];
	for(int i = 2; i < n+1;i++)
	{
		ans = __gcd(a[i]-a[i-1],ans);
		//cout << a[i] - a[i-1] << endl;
	}
	cout << ans << endl;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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(void) {
    string S;
    cin >> S;

    int Q;
    cin >> Q;

    deque<char> que;
    for (auto c : S) {
        que.push_back(c);
    }

    int dir = 1;

    for (int i = 0; i < Q; i++) {
        int q;
        cin >> q;
        if (q == 1) {
            dir *= -1;
        } else {
            int f;
            char c;
            cin >> f >> c;
            if (f == 1) {
                if (dir == 1) {
                    que.push_front(c);
                } else {
                    que.push_back(c);
                }
            } else {
                if (dir == 1) {
                    que.push_back(c);
                } else {
                    que.push_front(c);
                }
            }
        }
    }

    if (dir == -1) {
        reverse(que.begin(), que.end());
    }

    for (int i = 0; i < (int) que.size(); i++) {
        cout << que[i];
    }
    cout << endl;

    // this is also OK.
    // while (!que.empty()) {
    //     cout << que.front();
    //     que.pop_front();
    // }
    // cout << endl;

    return 0;
}


Measured memory_bytes: 4020
x=[]

for j in range(100):
    m=j+1
    pf={}
    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:pf[m]=1
    x.append(pf)

N=int(input())
if N==1:
    print(0)
    exit()

from collections import defaultdict
d=defaultdict(int)
for i in range(1,N):
    for k in x[i].keys():
        d[k]+=x[i][k]

#print(d)
over2=0
over4=0
over14=0
over24=0
over74=0
for k in d.keys():
    if d[k]>=2:
        over2+=1
    if d[k]>=4:
        over4+=1
    if d[k]>=14:
        over14+=1
    if d[k]>=24:
        over24+=1
    if d[k]>=74:
        over74+=1

ans=0
#case1
ans+=over4*(over4-1)//2*(over2-2)
#case2
ans+=over14*(over4-1)
#case3
ans+=over24*(over2-1)
#case4
ans+=over74
print(ans)

Measured memory_bytes: 3316
import math
K = int(input())

bc = []
for b in range(1, K + 1):
    for c in range(1, K + 1):
       bc.append(math.gcd(b, c))
ans = 0
for a in range(1,  K + 1):
    for g in bc:
        ans += math.gcd(g, a)
print(ans)

Measured memory_bytes: 9428
#include<stdio.h>
 
double w, h;
 
int main(void){
    double x, y;
    double grad;
 
    scanf("%lf %lf %lf %lf", &w, &h, &x, &y);
 
    printf("%f ", w*h/2);
    printf("%d", (x == w/2 && y == h/2) ? 1 : 0);
 
    return 0;
 
}

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

int main()
{
    int N, W;
    cin >> N >> W;
    vector<long> w(N);
    vector<long> v(N);
    for (int i = 0; i < N; i++) {
        cin >> w[i] >> v[i];
    }

    const long INF = 1000000001;
    const long MAX_VAL = N * 1000;
    vector<vector<long>> dp(N + 1, vector<long>(MAX_VAL + 1, INF));
    // dp[i+1][j]: i番目までの品物を使って、価値の総和がjになるように選んだ場合の、重さの最小値
    // dp[i+1][j] = min(dp[i][j], dp[i][j-v[i]]+w[i])
    for (int i = 0; i < N; i++) {
        dp[i][0] = 0;
        for (int j = 0; j <= MAX_VAL; j++) {
            if (j - v[i] < 0) {
                dp[i + 1][j] = dp[i][j];
            } else {
                dp[i + 1][j] = min(dp[i][j], dp[i][j - v[i]] + w[i]);
            }
        }
    }
    int ans = 0;
    for (int j = 0; j <= MAX_VAL; j++) {
        if (dp[N][j] <= W) ans = j;
    }
    cout << ans << endl;
    return 0;
}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int q  = sc.nextInt();
		List<Integer> p = new ArrayList<Integer>();
		for(int i = 0; i < n; i++) {
			p.add(k-q);
		}
		for(int j = 0; j < q; j++) {
			int ans = sc.nextInt()-1;
			p.set(ans, p.get(ans)+1);
		}
		for(int i = 0; i < n; i++) {
			if(p.get(i)>0) {
				System.out.println("Yes");
			}
			else {
				System.out.println("No");
			}
		}
	}
}

Measured memory_bytes: 69920
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    vvll dp(4, vll(s.size() + 1, 0));
    dp[0][0] = 1;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'A') {
            dp[1][i + 1] = (dp[0][i] + dp[1][i]) % MOD;
            dp[0][i + 1] = dp[0][i];
            dp[2][i + 1] = dp[2][i];
            dp[3][i + 1] = dp[3][i];
        } else if (s[i] == 'B') {
            dp[2][i + 1] = (dp[1][i] + dp[2][i]) % MOD;
            dp[0][i + 1] = dp[0][i];
            dp[1][i + 1] = dp[1][i];
            dp[3][i + 1] = dp[3][i];
        } else if (s[i] == 'C') {
            dp[3][i + 1] = (dp[2][i] + dp[3][i]) % MOD;
            dp[0][i + 1] = dp[0][i];
            dp[1][i + 1] = dp[1][i];
            dp[2][i + 1] = dp[2][i];
        } else {
            dp[0][i + 1] = 3 * dp[0][i] % MOD;
            dp[1][i + 1] = (dp[0][i] + (3 * dp[1][i] % MOD)) % MOD;
            // dp[2][i + 1] = dp[2][i];
            // dp[3][i + 1] = dp[3][i];
            dp[2][i + 1] = (dp[1][i] + (3 * dp[2][i] % MOD)) % MOD;
            // dp[1][i + 1] = dp[1][i];
            // dp[3][i + 1] = dp[3][i];
            dp[3][i + 1] = (dp[2][i] + (3 * dp[3][i] % MOD)) % MOD;
            // dp[1][i + 1] = dp[1][i];
            // dp[2][i + 1] = dp[2][i];
        }
    }
    // DEBUG_VLL(dp[0])
    // DEBUG_VLL(dp[1])
    // DEBUG_VLL(dp[2])
    // DEBUG_VLL(dp[3])
    cout << dp[3][s.size()] << '\n';
    return 0;
}


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

using namespace std;

typedef long long lli;

lli solve(int& a, int& m){
  int x=1;
  lli cnt=1;
  while(1){
    x = (a*x)%m;
    if(x == 1) return cnt;
    ++cnt;
  }
}

int main(){
  int a1, m1, a2, m2, a3, m3;
  lli x, y, z, ans;
  while(1){
    cin >> a1 >> m1 >> a2 >> m2 >> a3 >> m3;
    if(!a1 && !m1 && !a2 && !m2 && !a3 && !m3) break;
    x = solve(a1, m1);
    y = solve(a2, m2);
    z = solve(a3, m3);
    ans = (x*y)/__gcd(x, y);
    ans = (ans*z)/__gcd(ans, z);
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1156
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vector<T>>;
using ll = long long;
using ld = long double;

#define REPi(i, s, e) for(int i = (s); i < (e); ++i)
#define REPll(i, s, e) for(ll i = (s); i < (e); ++i)

ll gcd(ll a, ll b)
{
	return b != 0 ? gcd(b, a % b) : a;
}

int main()
{
	cin.tie(0);

	int N, D; cin >> N >> D;
	int range = (D * 2 + 1);
	cout << (N + range - 1) / range << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <iomanip>
#include <limits>
#include <cstring>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<double, double >pd;
typedef pair<string, string> sP;
typedef pair<ll, P> PP;
typedef pair<P, P> PPP;

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 5e14;
const double eps = 1e-10;
const double PI = acos(-1);
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const int tx[8] = { -1,-1,-1,0,0,1,1,1 }, ty[8] = { -1,0,1,-1,1,-1,0,1 };

#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second

ll x, y, ans;

int main() {
	cin >> x >> y;
	while (true) {
		if (x > y) {
			cout << ans << endl;
			return 0;
		}
		x *= 2;
		ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
package main

import(
    "fmt"
)



func main() {
    var n int
    fmt.Scan(&n)
    var ans float64 = 0.0
    for i:=0; i<n; i++{
        var a float64
        var b string
        fmt.Scan(&a,&b)
        if b == "JPY"{
            ans += a
        } else {
            ans += a * 380000.0
        }
    }
    fmt.Println(ans)
}





func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

func min32(a, b int) int {
    if a >= b {
        return b
    }
    return a
}

func max32(a, b int) int {
    if a >= b {
        return a
    }
    return b
}

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}

func scanNums(len int) (nums []int){
    var num int
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanNums64(len int) (nums []int64){
    var num int64
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanString(len int) (str []string){
    var s string
    for i:=0; i<len; i++{
        fmt.Scan(&s)
        str = append(str,s)
    }
    return
}

func scanTwoNums(n,m int) ([][]int){
    Nums := make([][]int, n)
    for i:=0; i<n; i++{
        Nums[i] = make([]int, m)
    }
    return Nums
}


Measured memory_bytes: 512
#include<cstdio>
#include<cstdlib>
#include<iostream>

using namespace std;

int main(){
    char x,y,ch;
    int s;
    
    while( cin>>x>>y ){
        
        s=x-y;
        if(s > 0)   printf(">\n");
        if(s < 0)   printf("<\n");
        if(s == 0)    printf("=\n");
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

//Drawing Lots II
public class Main{

	static int sim(char[][] s, int n, int d, int start){
		int t = start;
		for(int i=0;i<d;i++){
			if(t>0&&s[i][t-1]=='1')t--;
			else if(t<n-1 && s[i][t]=='1')t++;
		}
		return t;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			int m = sc.nextInt()-1;
			int g = sc.nextInt()-1;
			int d = sc.nextInt();
			char[][] s = new char[d][n-1];
			for(int i=0;i<d;i++)s[i]=sc.next().toCharArray();
			if(sim(s,n,d,m)==g){
				System.out.println(0);
				continue;
			}
			boolean ok = false;
			for(int i=0;i<d;i++){
				for(int j=0;j<n-1;j++){
					if(ok || s[i][j]=='1')continue;
					boolean left, right;
					if(j==0||s[i][j-1]=='0')left = true;
					else left = false;
					if(j==n-2||s[i][j+1]=='0')right = true;
					else right = false;
					if(left&&right){
						s[i][j]='1';
						if(sim(s,n,d,m)==g){
							System.out.println((i+1)+" "+(j+1));
							ok = true;
							break;
						}
						s[i][j]='0';
					}
				}
			}
			if(!ok)System.out.println("1");
		}
	}
}

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

using namespace std;

int main()
{ int x,a;
cin>>x>>a;
if (a>x)
{
    cout <<1;return 0;
}
int ans=0;
ans+=x/a;
if (x%a!=0)ans++;
cout <<ans;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
 int n,k;
  cin>>n>>k;
  n+=2;
  k*=2;
  if(n>k)
  {
    cout<<"YES"<<endl;
  }
  else
  {
    cout<<"NO"<<endl;
  }
return 0;
}

Measured memory_bytes: 764
#include<stdio.h>
int main(){
  char s[100],k = 'B';
  scanf("%s",&s);
  for(int i = 1;i < strlen(s);i++){
    if(s[i] == k){
      int j = i - 1;
      while(s[j] == k && j > 0){
        j--;
      }
      s[j] = k;
    }
  }
  for(int i = 0;i < strlen(s);i++){
    if(s[i] != k){
      printf("%c",s[i]);
    }
  }
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int n;

int main(){
  while(scanf("%d",&n) && n){
    n = 1000 - n;
    printf("%d\n", n/500 + (n%500)/100 + (n%100)/50 + (n%50)/10 + (n%10)/5 + (n%5));
  }
  return 0;
}

Measured memory_bytes: 1188
def primes(n):
    candidate = list(range(2, n+1))
    prime = []
    limit = n**0.5 + 1
    while True:
        p = candidate[0] 
        if limit <= p:
            prime.extend(candidate)
            break
        prime.append(p)

        candidate = [i for i in candidate if i % p != 0]
    return prime
N=int(input())
M=55555
L=primes(M)
L=[i for i in L if i%5==1]
S=L[:N]
S=list(map(str,S))
print(" ".join(S))

Measured memory_bytes: 11760
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int d = scan.nextInt();
		int n = scan.nextInt();
		int i = 0;
		int answer = n;
		for(i = 0; i < d; i++) {
			answer = answer * 100;
		}
		if(n == 100) {
			if(d == 0) {
				answer++;
			} else if(d == 1) {
				answer = answer + 100;
			} else if(d == 2) {
				answer = answer + 10000;
			}
		}
		System.out.println(answer);
	}
}

Measured memory_bytes: 21716
#include <stdio.h>
#include <stdlib.h>

int top = 0;
int S[100];
void push( int);
int pop(void);

int main()
{

  
  char C[7];
  int a, b, del;
    
  while((scanf("%s",C)) != EOF ){      
    
    if(C[0] == '+'){
      
      a = pop();      
      b = pop();      
      push(a+b);
    }
    else if(C[0] == '-'){
     
      a = pop();
      b = pop();
      push(b-a);
    }
    else if(C[0] == '*'){
      
      a = pop();
      b = pop();
      push(a*b);
    }
    else{
      push(atoi(C));
    }
  }
    
  printf("%d\n",S[top]);
    
  return 0;
    
}
   


void push(int x){
  top = top + 1;
  S[top] = x;
}

int pop(void){
  top = top - 1;
  return S[top+1];
}

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

int main()
{
    int n;
    cin >> n;
    //vector<int> c(n);
    vector<int> vec{istream_iterator<int>(cin), istream_iterator<int>()};
    sort(vec.begin(),vec.end(),greater<int>());
    int alice = 0;
    int bob = 0;
    for (int i=0; i<n; ++i){
        if (i%2 == 0) alice += vec[i];
        else bob += vec[i];
    }
    cout << alice - bob << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int n;
  scanf("%d",&n);
  if(n<105){
    printf("0");
  }
  else if(n<135){
    printf("1");
  }
  else if(n<165){
    printf("2");
  }
  else if(n<189){
    printf("3");
  }
  else if(n<195){
    printf("4");
  }
  else if(n<201){
    printf("5");
  }
}


Measured memory_bytes: 128
n, m = map(int, input().split())

a = [list(map(int, input().split())) for i in range(n)]

x = [True] * m

for i in a:
    y = i[0]
    xx = [False] * m
    for j in range(y):
        xx[i[j + 1] - 1] = True
    for j in range(m):
        if xx[j] == False:
            x[j] = False

print(sum(x))


Measured memory_bytes: 3060
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long c = sc.nextLong();
		long count = Math.min(c, a + b + 1) + b;
		System.out.println(count);
	}
}


Measured memory_bytes: 23636
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main(){
    int n;
    cin >> n;
    cout << 180 * ( n - 2 ) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a[3],i,temp,j;
    for(i=0;i<3;i++){scanf("%d",&a[i]);}
    for(i=0;i<3;i++){for(j=i+1;j<3;j++)
        {if(a[i]>a[j]){temp=a[i];a[i]=a[j];a[j]=temp;}}}
    printf("%d\n",a[2]-a[0]);
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
 
using namespace std;
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<long long , long long>
#define pb push_back
#define ll long long
#define ld long double
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define fill(a,b) memset((a),(b),sizeof((a)))
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
ll power(ll x,ll y,ll m){ll r=1;for(;y;y>>=1){if(y&1)r=r*x%m;x=x*x%m;}return r;}
const ll mod = 1e9 + 7;
 
int run_test(){
      ll n,d;
      cin >> n >> d;
      ll ans =0;
      for(int i =0; i<n; i++){
            ll x, y;
            cin >> x >> y;
            if(x*x + y*y <= d*d){
                  ans++;
            }
      }
      cout << ans;
      return 0;
}
 
int main(){
    FAST;
    ll t;
    t = 1;
 
    while(t--){
        run_test();
    }
}

Measured memory_bytes: 3660
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

const int INF = 1e9;
const int MOD = 1000000007;

int main() {
  size_t N, A, count = 0;
  int val1, val2;
  unordered_map<int, size_t> map1, map2;
  cin >> N;
  for (size_t i = 0; i < N; ++i) {
    cin >> A;
    val1 = A + i;
    val2 = i - A;
    count += map1[val2] + map2[val1];
    map1[val1]++;
    map2[val2]++;
  }

  cout << count << endl;

  return 0;
}


Measured memory_bytes: 33856
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <iomanip>
#include <functional>
//#pragma optimize GCC("O3")
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	// Chceme spravit postupnost RRRR...WWW...
	// Povieme si, ze i bude hranica.
	// Spocitame, kolko je W nalavo a kolko je R napravo.
	// Tie zvysne zmenime.
	int n;
	cin >> n;
	string s;
	cin >> s;
	vector<int>pfw(1, 0);
	for (int i = 0; i < n; i++)
	{
		pfw.push_back(pfw.back());
		if (s[i] == 'W')
			pfw.back()++;
	}
	vector<int>sfr(n+1, 0);
	for (int i = n-1;i>=0;i--)
	{
		sfr[i] = sfr[i + 1];
		if (s[i] == 'R')
			sfr[i]++;
	}
	int ans = n;
	for (int i = 0; i <= n; i++)
	{
		ans = min(ans, max(sfr[i], pfw[i]));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 5256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
int main()
{
  ll L[87];
  ll N;
  cin >> N;
  L[0] = 2LL;
  L[1] = 1LL;
  for (int i = 2; i <= N; i++)
  {
    L[i] = L[i - 1] + L[i - 2];
  }
  cout << L[N] << endl;
  return 0;
}

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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} comb(2000009);

int main(){
  int x,y;
  cin>>x>>y;
  int sum=x+y;
  if(sum%3!=0){
    cout<<0<<endl;
  }
  else{
    int n=sum/3;
    x-=n;y-=n;
    cout<<comb(x+y,x).x<<endl;
  }
  return(0);
}



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

int main(){
  int N, T, A;
  long H;
  double min=1000;
  cin >> N >> T >> A;
  int ans;
  for(int i=0; i<N; i++){
    cin >> H;
    double kion = T-H*0.006;
    if(abs(kion-A)<min){
      min = abs(kion-A);
      ans = i;
    }
  }
  cout << ans+1 << endl;
  return 0;
}

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

int main()
{
    long long a, b, ba, bb;
    long long gcd, lcd = 0;
    while(cin >> a >> b)
    {
        ba = a;
        bb = b;
        while(b!=0)
        {
            gcd = b;
            b = a % b;
            a = gcd;
        }
        lcd = ba * bb / gcd;
        cout << gcd << " "<< lcd << endl;
    }
    
    return EXIT_SUCCESS;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

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;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll x, y; cin >> x >> y;
    ll cnt = 0;
    for (ll i=x; i<=y; i*=2) cnt++;
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
using namespace std;
#include<bitset>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<deque>
#include<stdint.h>
#include<set>
#include<vector>
#include<iomanip>
#include<iostream>
#include<stack>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<cstring>
#include<ctime>
#include<map>
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
/************/
long long n,m,xx,i,j,fa[1005],dis[1005],x,y,mod=1e9+7,par[1005],vis[1005],dep[1005];
int find(int x)
{
	if (fa[x]==x)
	{
		return x;
	}
	return fa[x]=find(fa[x]);
}
long long mpow(long long x,long long y)
{
	if (y==0) return 1;
	if (y==1) return x;
	long long z=mpow(x,y/2);
	z=z*z%mod;
	if (y&1) z=z*x%mod;
	return z;
}
struct ii
{
	long long x,y,z,ty;
}bi[2005];
void init()
{
	long long i;
	for (i=1;i<=n;i++) fa[i]=i;
}
long long kar()
{
	init();
	long long i,ans=0,s=0,ans2,t;
	for (i=1;i<=m;i++)
	{
		if (find(bi[i].x)!=find(bi[i].y))
		{
			fa[find(bi[i].x)]=find(bi[i].y);
			bi[i].ty=1;
			ans+=bi[i].z;
		}
	}
	return ans;
}
bool cmp(ii x,ii y)
{
	return x.z*2+x.ty<y.z*2+y.ty;
}
void dfs(int x)
{
	int i;
	if (vis[x]) return;
	vis[x]=1;
	for (i=1;i<=m;i++)
	{
		if (!bi[i].ty) continue;
		if (bi[i].x==x||bi[i].y==x)
		{
			int y=(bi[i].x^bi[i].y^x);
			if (!vis[y])
			{
				par[y]=x;
				dis[y]=bi[i].z;
				dep[y]=dep[x]+1;
				dfs(y);
			}
		}
	}
}
long long getmin(int x,int y)
{
	if (dep[x]>dep[y]) swap(y,x);
	int i;
	long long ans=0;
	while (dep[x]<dep[y])
	{
		ans=max(ans,dis[y]);
		y=par[y];
	}
	while (x!=y)
	{
		ans=max(ans,dis[x]);
		x=par[x];
		ans=max(ans,dis[y]);
		y=par[y];
	}
	return ans;
}
int main()
{
	cin>>n>>m>>xx;
	for (i=1;i<=m;i++)
	{
		cin>>bi[i].x>>bi[i].y>>bi[i].z;
	}
	sort(bi+1,bi+m+1,cmp);
	long long mst=kar(),ok=0;
	if (mst>xx)
	{
		cout<<0;
		return 0;
	}
	if (mst==xx) ok=1;
	dfs(1);
	int cnt1=0,cnt2=0;
	for (i=1;i<=m;i++)
	{
		long long t=mst-getmin(bi[i].x,bi[i].y)+bi[i].z;
		if (t<xx) cnt1++;
		if (t==xx) cnt2++;
	}
	if (!cnt2)
	{
		cout<<0;
		return 0;
	}
	if (ok) cout<<((mpow(2,m)-2*mpow(2,m-cnt2)%mod)%mod+mod)%mod;
	else cout<<mpow(2,m-cnt1-cnt2)*2*(mpow(2,cnt2)-1)%mod;
	return 0;
}

Measured memory_bytes: 384