akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    int n; cin >> n;
    vector<string> str;
    for(int i=0; i<n; ++i){
        string s; cin >> s; 
        sort(s.begin(), s.end());
        str.push_back(s);
    } 
    map<string, ll> mp;
    for(int i=0; i<n; ++i){
        mp[str[i]]++;
    }
    ll res = 0;
    for(auto it=mp.begin(); it!=mp.end(); it++){
        ll d = (it->second);
        res += d*(d-1)/2;
    }
   
    cout << res << endl;
    return 0;
}

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

int main(){
  int n;
  cin  >> n;
  int h;
  int maxh = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++){
    cin >> h;
    if (maxh <= h){
      cnt++;
      maxh = h;
    }
  }
  cout << cnt << endl;
  return 0;
}


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

#define ff first
#define ss second
#define PI acos(-1)
#define pb push_back
#define int long long
#define ld long double
#define sp fixed<<setprecision
#define bp __builtin_popcountll
#define all(x) x.begin(),x.end()
#define pii pair<long long,long long>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

const int M = (1e9)+7;
const int N = 1e6+5;

signed main()
{
    FAST
    int tc=1;
	//cin>>tc;
    for(int ti=1;ti<=tc;ti++)
    {
        int n,x;
      	cin>>n;
      	int f[n+1] = {},cnt_f[n+1] = {},pre[n+1] = {},suf[n+1] = {};
      	for(int i=0;i<n;i++)cin>>x,f[x]++;
	    for(int i=1;i<=n;i++)cnt_f[f[i]]++;
	    for(int i=1;i<=n;i++)pre[i] = (i*cnt_f[i]) + pre[i-1];
      	suf[n] = cnt_f[n];
      	for(int i=n-1;i>=0;i--)suf[i] = suf[i+1] + cnt_f[i];
      	int ans[n+1] = {};
      	for(int i=1;i<=n;i++)
        {
          	int max_k = suf[i];
	        max_k += pre[i-1]/i;
          	ans[max_k] = max(ans[max_k],i);
        }
      	for(int i=n-1;i>=1;i--)ans[i] = max(ans[i+1],ans[i]);
      	for(int i=1;i<=n;i++)cout<<ans[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 15240
#define MOD 1000000007;
#define input ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll long long

#include <bits/stdc++.h>

using namespace std;
const int N = 3e5 + 5;
set<int> st[N+1];
int main() {

    ll n,m;
    cin >> n>>m;

    int x, y;
    for (int i = 1; i <= m; i++) {

        cin >> x >> y;
        st[x].insert(y);
        st[y].insert(x);
    }
    bool flag= false;
  for(auto a: st[n])
  {
      if(st[a].empty()== false&&*st[a].begin()==1)
          flag= true;

  }
  if(flag)
      cout<<"POSSIBLE";
  else
      cout<<"IMPOSSIBLE";

}

Measured memory_bytes: 33024
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll h, w, a, b;
  cin >> h >> w >> a >> b;
  rep(i, h) {
    if (i < b) {
      rep(j, w) { cout << (j < a ? 1 : 0); }
      cout << endl;
    } else {
      rep(j, w) { cout << (j < a ? 0 : 1); }
      cout << endl;
    }
  }  // i

  return 0;
}


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

#define ll long long
#define deb(x) cerr << #x << ":" << x << "\n"
#define all(x) x.begin(),x.end()
#define sz(x) x.size()

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

void solve()
{
	ll n,k;
	cin>>n>>k;
	vector<ll> v(n);
	for(auto &x:v)cin>>x;
	for(int i=k;i<n;i++){
		if(v[i]>v[i-k]){
			cout<<"Yes\n";
		}else cout<<"No\n";
	}
}

int main()
{

    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 4780
N, C = map(int, input().split())
D, D2 = [], []
for _ in range(N):
    x, v = map(int, input().split())
    D.append((x,v))
    D2.append((C-x,v))
P, S, x0 = [0], [], 0
for x, v in D:
    P.append(P[-1] + v - (x - x0))
    S.append(P[-1] - x)
    x0 = x
T = [0]
for i in range(N):
    T.append(max(T[-1],S[i]))
Q, R, x0 = [0], [0], 0
for i, d in enumerate(reversed(D)):
    x, v = d
    x = C-x
    Q.append(Q[-1]+v-(x-x0))
    R.append(Q[-1]+T[-2-i])
    x0 = x
m1 = max(P+Q+R)
D = list(reversed(D2))
P, S, x0 = [0], [], 0
for x, v in D:
    P.append(P[-1] + v - (x - x0))
    S.append(P[-1] - x)
    x0 = x
T = [0]
for i in range(N):
    T.append(max(T[-1],S[i]))
Q, R, x0 = [0], [0], 0
for i, d in enumerate(reversed(D)):
    x, v = d
    x = C-x
    Q.append(Q[-1]+v-(x-x0))
    R.append(Q[-1]+T[-2-i])
    x0 = x
m2 = max(P+Q+R)
print(max(m1,m2))

Measured memory_bytes: 149200
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cstdio>

using namespace std;

int n,m;
int bs[20];
int as[20];
int dp[1<<14];
int combSum[1<<14];
const int INF=1000000000;

int main(){
  int tmp[20]; 
  while(scanf("%d %d",&n,&m)&&(n|m)){
    memset(combSum,0,sizeof(combSum));
    for(int i=0;i<n;i++)
      scanf("%d %d",bs+i,as+i);
    for(int mask=1;mask<(1<<n);mask++)
      for(int i=0;i<n;i++)
	if((mask>>i)&1)combSum[mask]+=as[i];
    for(int mask=(1<<n)-1;mask>=0;mask--){
      int res=INF;
      if(mask==(1<<n)-1)res=0;
      else{
    	int cemp=m;
    	int sz=0;
    	for(int i=0;i<n;i++){
    	  if((mask>>i)&1)cemp+=bs[i]-as[i];
    	  else tmp[sz++]=i;
    	}
	int revMask=(~mask)&((1<<n)-1);
	int sub=revMask;
	do{
	  int nmask=mask|(sub);
	  int sum=combSum[sub];
	  if(nmask!=mask&&sum<=cemp)
	    res=min(res,dp[nmask]+1);
	  sub=(sub-1)&revMask;
	}while(sub!=revMask);
      }
      dp[mask]=res;
    }
    if(dp[0]==INF)printf("Impossible\n");
    else printf("%d\n",dp[0]);
  }

  return 0;
}

Measured memory_bytes: 1012
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, K = map(int, input().split())

    div_list = [[] for _ in range(K+1)]
    for d in range(1, K+1):
        for i in range(2, K+1):
            if d*i > K:
                break
            div_list[d*i].append(d)

    ans = [0] * (K+1)
    for i in range(K, 0, -1):
        ans[i] = (ans[i] + pow(K // i, N, mod))%mod
        for d in div_list[i]:
            ans[d] = (ans[d] - ans[i])%mod
    ret = 0
    for i in range(1, K+1):
        ret = (ret + (ans[i] * i)%mod)%mod
    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 95028
#include<stdio.h>
#include<string.h>
int main(){
  while(1){
    int dp[17][17], cond[17][17], x, y, i, j;
    int ans = 0;
    scanf("%d%d", &x, &y);
    if(x == 0 && y == 0)return 0;
    memset(dp, 0, sizeof(dp));
    for(i = 0;i < y;i++){
      for(j = 1;j <= x;j++){
	scanf("%d", &cond[i][j]);
      }
    }
    for(i = 0;i <= y;i++){
      for(j = 1;j <= x;j++){
	if(cond[i][j] == 1)continue;
	if(i == 0)dp[i][j] = 1;
	if(i > 2 && cond[i - 2][j] == 2)
	  dp[i][j] += dp[i - 2][j];
	if(i > 0 && cond[i][j] != 1){
	  if(cond[i - 1][j] == 0)
	    dp[i][j] += dp[i - 1][j];
	  if(cond[i][j] != 2 && cond[i - 1][j - 1] == 0)
	    dp[i][j] += dp[i - 1][j - 1];
	  if(cond[i][j] != 2 && cond[i - 1][j + 1] == 0)
	    dp[i][j] += dp[i - 1][j + 1];
	}
      }
    }
    for(j = 1;j <= x;j++){
      if(cond[y - 1][j] != 1)
	ans += dp[y - 1][j];
      if(cond[y - 2][j] == 2)
	ans += dp[y - 2][j];
    }
   
    printf("%d\n", ans);
  }
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
//template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
signed main(){
  int n,a,b;
  cin>>n>>a>>b;
  if(n*a<=b)
    cout<<n*a<<endl;
  else
    cout<<b<<endl;
}

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

typedef long long int ll;

int main() {
  ll n, k;
  cin >> n >> k;
  ll ans = 0;
  if (k % 2 == 0) {  // Kが偶数ならa,b,cはそれぞれKの倍数
    ans = pow(n / k, 3);
    ans += pow(n / (k / 2) - n / k, 3);
  } else {
    ans = pow(n / k, 3);
  }
  cout << ans << endl;
}


Measured memory_bytes: 384
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <forward_list>
#include <random>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#endif

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 100005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector< int > Div( int n ) {
    vector< int > ret;
    for( int i = 1; i * i <= n; ++i ) {
        if( n % i == 0 ) {
            ret.pb( i );

            if( i * i != n ) ret.pb( n / i );
        }
    }
    sort( all( ret ) );
    return ret;
}

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

    int n;
    cin >> n;
    LL cnt = 0;
    LL before = 0;
    for( int i = 0; i < n; ++i ) {
        LL a;
        cin >> a;
        if( a == 0 ) {
            before = 0;
            continue;

        }
        if( before == 1 ) {
            --a;
            ++cnt;

        }
        cnt += a / 2;
        before = a % 2;

    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
   public static void main(String[] args){
     Scanner scanner = new Scanner(System.in);
     for(int i=1;i>0; i++){
          int x = scanner.nextInt();
          if(x==0)break;
       System.out.println("Case "+i+": "+x);
      
   }   
}
}

Measured memory_bytes: 43336
import java.lang.reflect.Array;
import java.util.*;
public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}

	public Main() {
		new AOJ0596().doIt();
	}
	
	class AOJ0596{
		boolean isGo[][];
		int n,k;
		Taxi taxi[];
		int[][] c;
		int d[];//頂点sからの最短距離
		boolean used[];//素手に使用されたかのフラグ
		int V;//頂点数
		int INF;

		void dijkstra(int s){
			V = n;
			INF = Integer.MAX_VALUE;
			d = new int[V];
			used = new boolean[V];
			Arrays.fill(d,INF);
			Arrays.fill(used, false);
			d[s] = 0;
			while(true){
				int v=-1;
				for(int u=0;u<V;u++){//まだ使われていない頂点のうち最小のものを探す
					if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
				}
				if(v==-1)break;
				used[v]=true;
				for(int u=0;u<V;u++)if(c[v][u]!=-1){
					d[u] = Math.min(d[u],d[v]+c[v][u]);
				}
			}
		}
		
		void doIt(){
			n = in.nextInt();
			k = in.nextInt();
			taxi = new Taxi[n];
			for(int i=0;i<n;i++)taxi[i] = new Taxi(in.nextInt(), in.nextInt());
			isGo = new boolean[n][n];
			
			ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();
			for(int i=0;i<n;i++)list.add(new ArrayList<Integer>());
			c = new int[n][n];
			for(int i=0;i<k;i++){
				int a = in.nextInt()-1;
				int b = in.nextInt()-1;
				isGo[a][b] = isGo[b][a] = true;
				list.get(a).add(b);
				list.get(b).add(a);
			}
			for(int i=0;i<n;i++){
				Arrays.fill(c[i], -1);
				LinkedList<Integer> q = new LinkedList<Integer>();
				q.add(i);q.add(0);
				while(q.size()>0){
					int a = q.remove();
					int cost = q.remove();
					if(cost>taxi[i].road)continue;
					if(cost<=taxi[i].road)c[i][a] = cost;
					for(int s=0;s<list.get(a).size();s++){
						if(c[i][list.get(a).get(s)]>=0)continue;
						q.add(list.get(a).get(s));
						q.add(cost+1);
					}
				}
			}
			for(int i=0;i<n;i++)for(int s=0;s<n;s++)if(c[i][s]>0)c[i][s] = taxi[i].kin;
//			for(int i=0;i<n;i++){
//				for(int s=0;s<n;s++)System.out.print(c[i][s]+" ");
//				System.out.println();
//			}
			dijkstra(0);
			System.out.println(d[n-1]);
		}
		class Taxi{
			int kin;
			int road;
			public Taxi(int kin,int road) {
				this.kin = kin;
				this.road = road;
			}
		}
	}

}

Measured memory_bytes: 764232
#include <bits/stdc++.h>
using namespace std;
// マクロ
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
// 型エイリアス
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;

int main() {
    int n;
    cin >> n;
    vi p(n);
    rep(i,n) cin >> p[i];
    int ans = 1;
    int before_min = p[0];
    for(int i = 1; i < n; i++){
            if(p[i] < before_min) {
                ans++;
                before_min = p[i];
            }
    }
    cout << ans <<endl;
}

Measured memory_bytes: 1024
N,K = map(int,input().split())
S = list(input())
if S[K-1] == 'A':
    S[K-1] = 'a'
elif S[K-1] == 'B':
    S[K-1] = 'b'
else:
    S[K-1] = 'c'
print(''.join(S))

Measured memory_bytes: 3060
package main

import (
	"fmt"
	"math"
	"os"
)

type point struct {
	x int64
	y int64
}

func calc(i, j point) float64 {
	x := i.x - j.x
	y := i.y - j.y
	return math.Sqrt(float64(x*x + y*y))
}

func remove(a []point, i int) []point {
	o := make([]point, 0)
	for j := 0; j < len(a); j++ {
		if j == i {
			continue
		}
		o = append(o, a[j])
	}
	return o
}

func permutation(a []point, x []point, xx [][]point) [][]point {
	if len(a) == 0 {
		x2 := make([]point, len(x))
		copy(x2, x)
		return append(xx, x2)
	}

	for i, c := range a {
		xx = permutation(remove(a, i), append(x, c), xx)
	}
	return xx
}

func run2(a []point, n int) int {
	p := permutation(a, make([]point, 0, n), make([][]point, 0))
	f := len(p)
	var total float64
	for _, x := range p {
		var sum float64
		for i := 1; i < len(x); i++ {
			c := calc(x[i-1], x[i])
			sum += c
		}
		total += sum / float64(f)
	}
	fmt.Println(total)
	return 0
}

func run() int {
	var n int
	var a []point
	fmt.Scanln(&n)
	for i := 0; i < n; i++ {
		var p point
		fmt.Scanf("%d %d\n", &p.x, &p.y)
		a = append(a, p)
	}
	return run2(a, n)
}

func main() {
	os.Exit(run())
}


Measured memory_bytes: 10112
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n+1);
  for (int i = 0; i < m; i++){
    int u, v;
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  vector<bool> used(n+2, 0);
  int ans = 0;
  for (int i = 1; i <= n; i++)
  	{
    if (!used[i]){
      used[i] = true;
      ans++;
      queue<int> q;
      q.push(i);
      while (!q.empty()){
        int v = q.front();
        q.pop();
        for (int &w : a[v]){
          if (!used[w]){
            used[w] = true;
            q.push(w);
          }
        }
      }
    }
  }

  cout << ans - 1 << endl;
}


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

int main (void){
  string n;
  cin >> n;
  if(n[0] == n[1] && n[1] == n[2] || n[1] == n[2] && n[2] == n[3]){
    cout << "Yes\n";
  }else{
    cout << "No\n";
  }
  return 0;
}

Measured memory_bytes: 3568
#include<stdio.h>
int main()
{
	int a,b,c,d,e;
	scanf("%d",&a);
	b=a/1000;
	c=(a%1000)/100;
	d=(a%100)/10;
	e=a%10;
	if(b+c+d+e==7)
	   printf("%d+%d+%d+%d=7",b,c,d,e);
	else if(b+c+d-e==7)
	    printf("%d+%d+%d-%d=7",b,c,d,e);
	else if(b+c-d+e==7)
	    printf("%d+%d-%d+%d=7",b,c,d,e);
	else if(b+c-d-e==7)
	    printf("%d+%d-%d-%d=7",b,c,d,e);
	else if(b-c+d+e==7)
	    printf("%d-%d+%d+%d=7",b,c,d,e);
	else if(b-c+d-e==7)
	    printf("%d-%d+%d-%d=7",b,c,d,e);
	else if(b-c-d+e==7)
	    printf("%d-%d-%d+%d=7",b,c,d,e);
	else if(b-c-d-e==7)
	    printf("%d-%d-%d-%d=7",b,c,d,e);
	return 0;
}

Measured memory_bytes: 128
N = int(input())
li = list(map(int, input().split()))
count = 0
if N < 2:
    print(0)
else:
    for i in range(N-2):
        for j in range(i+1, N-1):
            for k in range(j+1, N):
                li2 = [li[i], li[j], li[k]]
                li2.sort()
                if (li2[2] < li2[1] + li2[0]) and (li[i] !=li[j] and li[j] != li[k] and li[i] != li[k]):
                    count += 1
    print(count)


Measured memory_bytes: 68344
H, W, N = map(int, input().split())
*s, = map(lambda x: int(x) - 1, input().split())
S = input()
T = input()
l = t = 0
b = H
r = W
if S[-1] == 'L':
    l += 1
elif S[-1] == 'R':
    r -= 1
elif S[-1] == 'U':
    t += 1
else:
    b -= 1

for i in range(N - 2, -1, -1):
    a = T[i]
    if a == 'L':
        r += 1
        r = min(r, W)
    elif a == 'R':
        l -= 1
        l = max(l, 0)
    elif a == 'U':
        b += 1
        b = min(b, H)
    else:
        t -= 1
        t = max(t, 0)
    a = S[i]
    if a == 'L':
        l += 1
    elif a == 'R':
        r -= 1
    elif a == 'U':
        t += 1
    else:
        b -= 1
    if b <= t or r <= l:
        print('NO')
        exit()

print('YES' if t <= s[0] < b and l <= s[1] < r else 'NO')


Measured memory_bytes: 74584
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;
using namespace std;

int func(int a, int K)
{
    if(a%K==0) {
        return (a/K);
    }
    else if(a<K) {
        return 0;
    }
    else {
        return func(a-a/K-1, K);
    }
}

int main(int argc, char* argv[])
{
    int n;
    scanf("%d", &n);
    ll sum=0;
    int i;
    for(i=0; i<n; i++) {
        int a,K;
        scanf("%d%d", &a, &K);
        while(1) {
            if(a<K) {
                a=0; break;
            }
            int b=a/K;
            int c=a-K*b;
            if(c==0) {
                a=b;
                break;
            }
            else {
                if(c>=(b+1)) {
                    int d=c%(b+1);
                    a=K*b+d;
                }
                else {
                    a=a-(b+1);
                }
            }
        }
        sum^=a;
    }
    if(sum==0) {
        printf("Aoki\n");
    }
    else {
        printf("Takahashi\n");
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <utility>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <cmath>

#define loop(i, n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef pair<int, int> pint;

//const int MAX = 1000000000;
const int MOD = 1000000007;

// OK a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }   
    return res;
}

long long fact(int n) {
    //cout << n << " ";
    long long ans = 1;
    while (n > 1) {
        ans *= n;
        ans %= MOD;
        n--;
    }   
    //cout << ans << endl;
    return ans;
}

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b); 
        u -= t * v; swap(u, v); 
    }   
    u %= m;
    if (u < 0) u += m;
    return u;
}

long long modmult(long long a, long long b) {
    return ((a % MOD) * (b % MOD)) % MOD;
}

long long moddiv(long long a, long long b) {
    return ((a % MOD) * modinv(b, MOD)) % MOD;
}

long long comb(int n, int r) {
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
//  long long factn = fact(n);
//  long long factnr = fact(n - r);
//  long long factr = fact(r);
//  return factn * modinv(factnr, MOD) % MOD * modinv(factr, MOD) % MOD;
    long long ret = 1;
    loop(i, r) {
        ret = modmult(ret, n-i);
    }
    loop(i, r) {
        ret = moddiv(ret, i+1);
    }
    return ret;
}

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    int ans = modpow(2, n, MOD) - 1 - comb(n, a) - comb(n, b);
    //cout << ans << endl;
    if (ans < 0) cout << ans % MOD + MOD << endl;
    else cout << ans % MOD << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);
#define ADD +
#define SUBTRACT -
#define MULTIPLY *
#define DIVIDE /
#define MOD %
#define INCREMENT(x) ++x
#define DECREMENT(x) --x
#define in(a,b) cin>>a>>b;
#define out(a,b) cout<<a<<endl<<b<<endl;
#define scan(a) scanf("%d",&a);
#define print(a) printf("%d\n",a);
#define scanii(a,b) scanf("%d %d",&a,&b);
#define printii(a,b) printf("%d\n%d\n",a,b);
#define scaniii(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define ll long long
#define ull unsigned long long
#define sll signed long long
#define f1(i,a) for(int i=0;i<a;++i)
#define f2(i,a) for(int i=a-1;i>=0;--i)
#define pi acos(-1)
#define mod 1000000007
#define TRUE 1
#define FALSE 0
#define ZERO 0
#define MP make_pair
#define F first
#define S second
#define en puts("");
#define elif else if
typedef ll int lli;
typedef sll int slli;
typedef ull int ulli;
const int sz=10000;
using namespace std;

int clue();
int result();
void show();
bool check();

int div(lli n) {
    int count=0;
    for(int i=1;i*i<=n;++i) {
        if(n%i==0) {
            if(n/i==i) {
                ++count;
            }
            else {
                count+=2;
            }
        }
    }
    // cout<<count<<endl;

    return count;
}
int main() {

    int n,k;
    cin>>n>>k;
    int a[n];
    f1(i,n) {
        cin>>a[i];
    }
    sort(a,a+n);
    lli sum=0;
    f1(i,k) {
        sum+=a[i];
    }

    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 3644
#include <stdio.h>

int main(void){
	while(1){
		int b, r, g, c, s, t;
		long medal;
	
		scanf(" %d %d %d %d %d %d", &b, &r, &g, &c, &s, &t);
		if(t==0) break;
	
		medal = 100 + (15-2)*(b*5+r*3) + 15*(b+r) + 7*g + 2*c -3*(t-s-b*5-r*3);
	
		printf("%ld\n", medal);
	}

	return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
#define P pair<ll, ll>



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

ll t;
int main() {
	cin >> t;
	REP(i, t) {
		ll a, b, c, d;
		cin >> a >> b >> c >> d;
		ll aa = a;
		ll e = gcd(b, d);
		aa %= e;
		ll x = (b - aa + e - 1) / e - 1;
		aa += e * x;
		if (a < b or b > d or aa > c) {
			cout << "No" << endl;
		}
		else cout << "Yes" << endl;
	}

}

Measured memory_bytes: 764
#include<iostream>
#include<vector>
#include<utility>

#define INF (1 << 29)

using namespace std;

int n;
int dp[1 << 16];

//cost[??????????????°][????????¢?????????]
int cost[16][17];

/*
//now?????????????????¢???????????????, all??????????????§???????????¢???????????????
int tsp(int now, int all)
{
    //???????????¨???????????¶?????????return
    if(dp[now][all] != INF)return dp[now][all];

    int res = INF;
    for(int i = 0; i < n; i++)
    {
        //??????????????¢????????????????¬????
        if(all & (1 << i))continue;

        //????????¢?????????????????£??????i???????????¢??????
        res = min(res, cost[i][min_index] + tsp(i, all | (1 << i) ));
    }
    return dp[now][all] = res;
}
//*/

int main()
{
    while(cin >> n, n)
    {        
        for(int i= 0; i < n; i++)
        {
            for(int j = 0; j <= n; j++)
            {
                cin >> cost[i][j];
                //cost[y][x]
            }
        }
        fill(dp, dp + (1 << n), INF);
        dp[0] = 0;

        for(int i = 0; i < (1 << n); i++)
        {
            vector<int> cleared;
            vector<int> not_cleared;
            for(int j = 0, mask = 1; j < n; j++, mask <<= 1)
            {
                if(i & mask)
                {
                    //j?????????????????¢????????????
                    cleared.push_back(j);
                }
                else
                {
                    //j?????????????????¢???????????????
                    not_cleared.push_back(j);
                }
            }
            //if(cleared.size() == 1)dp[i]=cost[cleared[0]][0];

            for(const auto& g : not_cleared)
            {
                int tmp_cost = cost[g][0];
                
                for(const auto& clear : cleared)
                    tmp_cost = min(tmp_cost, cost[g][clear + 1]);
                
                dp[i | 1 << g] = min( dp[i | 1 << g], dp[i] + tmp_cost );
            }
        }
        cout << dp[(1 << n) - 1] << endl;
    }



    return 0;
}

Measured memory_bytes: 3392
#include <bits/stdc++.h>
using namespace std;
std::vector<int> v;

int main() { 
     int N,A,B;
     cin >> N >> A >> B;
     int ans = B-A;
     if(ans%2==0){
          cout << "Alice";
     }else{
          cout<<"Borys";
     }
	return 0;
}


Measured memory_bytes: 3584
#include<iostream>
#include<cstring>
#include<queue>
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=1010,M=20010;
 int a[N][N];
 typedef pair<int,int> pii;
 string s[7]={"","Yakk","Doh","Seh","Ghar","Bang","Sheesh"};
int main()
{
    string s;
    cin>>s;
    if(s.back()=='s')
    {
        s+="es";
    }
    else
        s+="s";
    cout<<s<<endl;
    return 0;
}  

Measured memory_bytes: 3584
import java.util.*;
import java.io.*;
class Main {
    static boolean isPossible(int[][] a) {
        for(int i = 2; i<a.length; i++) {
            if(a[i][0]==a[i][1] && a[i-1][0]==a[i-1][1] && a[i-2][0]==a[i-2][1]) return true;
        }
        return false;
    }
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] a = new int[n][2];
        for(int i = 0; i<n; i++) {
            a[i][0] = sc.nextInt();
            a[i][1] = sc.nextInt();
        }
        if(isPossible(a)) System.out.println("Yes");
        else System.out.println("No");
    }
}

Measured memory_bytes: 36008
//Sum of Prime Numbers
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

vector<ll> p;

int main(){
  p.push_back(2);
  for(int i=3; p.size()!=10000; i+=2){
    bool flag=true;
    for(int j=0; j<p.size(); j++){
      if(i%p[j]==0){
        flag=false;
        break;
      }
    }
    if(flag)p.push_back(i);
  }

  int n;
  while(true){
    ll ans=0;
    cin>>n;
    if(n==0)break;
    for(int i=0; i<n; i++){
      ans+=p[i];
    }
    cout<<ans<<endl;
  }
  return 0;
}

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

int n,m,q;
int a[55],b[55],c[55],d[55];

int dfs(vector<int> A){
  if(A.size()==n){
    int sum=0;
    rep(i,q){
      if(A[b[i]-1]-A[a[i]-1]==c[i]) sum+=d[i];
    }
    return sum;
  }
  int ret=0;
  for(int i=1;i<=m;i++){
    if(A.size()==0||A[A.size()-1]<=i){
	A.push_back(i);
	ret=max(ret,dfs(A));
	A.pop_back();
    }
  }
  return ret;
}
    
      
      

int main(){
  cin>>n>>m>>q;
  rep(i,q){
    cin>>a[i]>>b[i]>>c[i]>>d[i];
  }
  vector<int> A;
  cout<<dfs(A)<<endl;
  return 0;
}



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

using namespace std;

int main(){
    int cnt=0;
    string s,t;
    cin>>s>>t;
    for(int i=0; i<3; i++){
        if(s[i]==t[i]){
            cnt++;
        }
    }
    cout<<cnt<<endl;
    return 0;
}

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

std::vector<uint64_t> read_vec_sorted(size_t n) {
    std::vector<uint64_t> vec;
    for (size_t i = 0; i < n; i++) {
        uint64_t v;
        std::cin >> v;
        vec.push_back(v);
    }
    std::sort(vec.begin(), vec.end(), std::greater<uint64_t>{});
    return vec;
}

void append(std::vector<uint64_t> &v, const std::vector<uint64_t> u) {
    v.insert(v.end(), u.begin(), u.end());
}
int main() {
    size_t max_red, max_green, n_red, n_green, n_none;
    std::cin >> max_red >> max_green >> n_red >> n_green >> n_none;
    auto v_red = read_vec_sorted(n_red);
    v_red.resize(max_red);
    auto v_green = read_vec_sorted(n_green);
    v_green.resize(max_green);
    auto v_none = read_vec_sorted(n_none);

    std::vector<uint64_t> all;
    append(all, v_red);
    append(all, v_green);
    append(all, v_none);
    std::sort(all.begin(), all.end(), std::greater<uint64_t>{});

    uint64_t total = 0;
    for (size_t i = 0; i < max_red + max_green; i++) {
        total += all[i];
    }
    std::cout << total << std::endl;

    return 0;
}


Measured memory_bytes: 7540
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
//typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define cc continue
#define bb break
#define rem 1000000007
#define PI 3.141592653589793238462643383279502
//fflush(stdin);
// do {
// // process permutation
// } while (next_permutation(permutation.begin(),permutation.end()));
class abc
{
    public:
    ll x,y;
};
int main()
{
    FAST
    // freopen("input1.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    /*ll tests;
    cin>>tests;
    rep (gg,0,tests)
    {}*/
    ll h;
    cin>>h;
    ll step=0;
    while (h>0)
    {
        step++;
        h/=2;
    }
    ll ans=0;
    rep (i,0,step)
    {
        ans+=(ll)(pow(2,i));
    }
    cout<<ans<<"\n";
}


Measured memory_bytes: 512
#include<iostream>

int main(){
int N,i;
std::cin >> N;
int a,b,c;
for(i=N;i<=999;i++){
	c=(i%10);
	b=(i%100-c)/10;
	a=(i-b*10-c)/100;
	if(a==b && a==c)
	break;
	}
std::cout << i << std::endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<long double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

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

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }
// #define INF 1LL<<60

#define INF 1e+9
#define MAX_V 100005

struct edge {
    int to;
    int cost;
};

// <最短距離, 頂点の番号>
using P = pair<int, int>;

int V;
vector<edge> G[MAX_V];
vector<int> par(MAX_V, -1);
int d[MAX_V];

void dijkstra(int s) {
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+V, INF);
    d[s] = 0;
    que.push(P(0, s));

    while (!que.empty()) {
        P p = que.top();
        que.pop();
        int v = p.second;
        if (d[v] < p.first) continue;

        for (int i=0; i<G[v].size(); ++i) {
            edge e = G[v][i];
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                par[e.to] = v;
                que.push(P(d[e.to], e.to));
            }
        }
    }
}


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

    for (int i=0; i<M; ++i) {
        int a, b, c;
        cin >> a >> b;
        c = 1;
        a--; b--;
        edge e1 = {b, c}, e2 = {a, c};
        G[a].push_back(e1);
        G[b].push_back(e2);
    }
    par[0] = 0;
    dijkstra(0);

    bool flag = true;
    REP(i, N) if(par[i] == -1) flag = false;
    if(!flag) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
        FOR(i, 1, N-1) {
            cout << par[i] + 1 << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 13456
#include "bits/stdc++.h"
#include "sstream"
#define quick ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
const int N=1e5+1;
map<string,long long>mp;
int main() {
    quick
int n; cin>>n; string s; long long ans=0;
while(n--){
    cin>>s;
     sort(s.begin(),s.end()); mp[s]++;
}
for(auto i:mp){
    ans+=(i.second-1)*i.second/2;
}
cout<<ans;
}

Measured memory_bytes: 11264
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

def main():
    A,B,M = mis()
    a = lmis()
    b = lmis()
    ans = min(a) + min(b)
    for _ in range(M):
        x, y, c = mis()
        x -= 1
        y -= 1
        ans = min(ans, a[x]+b[y]-c)
    print(ans)


main()







Measured memory_bytes: 20796
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] time = new int[n];
		for(int i=0; i<n; i++){
			time[i] = sc.nextInt();
		}
		int m = sc.nextInt();
		int[] prob = new int[m];
		int[] x = new int[m];
		for(int i=0; i<m; i++){
			prob[i] = sc.nextInt();
			x[i] = sc.nextInt();
		}
		int[] sum = new int[m];
		for(int i=0; i<m; i++){
			for(int j=0; j<n; j++){
				if(j==prob[i]-1)sum[i] += x[i];
				else sum[i] += time[j];
			}
		System.out.println(sum[i]);
		}
	}
}

Measured memory_bytes: 21844
function prime(max){
   var arr=[];
   for(var i=0;i<=max;i++)arr[i]=i;
   arr[0]=false;
   arr[1]=false;
   var sqrt=Math.floor(Math.sqrt(max));
   for(var i=2;i<=sqrt;i++){
      if(arr[i]==false)continue;
         for(var j=i+i;j<=max;j+=i){
            arr[j]=false;
         }
   }
   var result={};
   for(var i=0;i<=max;i++){
      if(arr[i]!==false)result[arr[i]]=true;
   }
   return result;
}
var p=prime(999999);
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
while(true){
   var v=Arr.shift();
   if(v=="0 0 0")break;
   var adn=v.split(" ").map(Number);
   var cnt=0;
   var sum=adn[0]-adn[1];
   while(cnt!=adn[2]){
      sum+=adn[1];
      if(p.hasOwnProperty(sum))cnt++;
   }
   console.log(sum);
}

Measured memory_bytes: 40212
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main()
{
    int i, j, k,a;
    char s[20];
    scanf("%d", &a);
    scanf("%s", &s);
    if(a>=3200)
        printf("%s", s);
    else
        printf("red");
    return 0;
}

Measured memory_bytes: 128
using System;
using System.Linq;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int a = sc.NextInt();
        int b = sc.NextInt();
        Console.WriteLine(a * b) ;
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


Measured memory_bytes: 27332
def solve():
    N = int(input())
    t_p = 0
    x_p = 0
    y_p = 0
    for i in range(1, N+1):
        t, x, y = map(int, input().split())
        # 空間的に可能かどうか。奇数秒後はx+yが奇数に、偶数秒後はx+yが偶数にならないといけない。
        if (t%2==0 and (x+y)%2==1) or (t%2==1 and (x+y)%2==0):
            print('No')
            exit()
        #　時間的に可能かどうか。
        if (t - t_p) < abs(x - x_p) + abs(y - y_p):
            print('No')
            exit()
        t_p, x_p, y_p = t, x, y
    print('Yes')


if __name__ == '__main__':
    solve()

Measured memory_bytes: 3064
def power(m: int, n: int) -> int:
    modulo = 10 ** 9 + 7
    if n == 0:
        return 1
    elif n == 1:
        return m
    elif n % 2 == 0:
        return power(m, n // 2) ** 2 % modulo
    else:
        return power(m, n // 2) ** 2 * m % modulo


if __name__ == "__main__":
    m, n = map(lambda x: int(x), input().split())
    print(f"{power(m, n)}")



Measured memory_bytes: 5608
use proconio::input;

fn main() {
  input! {
    n: usize,
    a: [usize;n]
  }

  let mut min = a[0];
  let mut count = 0;
  for i in 0..n {
    let val = a[i];
    if min >= val {
      min = val;
      count += 1;
    }
  }
  println!("{}", count);
}

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

int main(){
  vector<int> t;
  vector<int> n;

  for(int i = 0; i < 4; i++) {
    int T, N;
    cin >> T >> N;
    t.push_back(T);
    n.push_back(N);
  }

  for(int i = 0; i < 4; i++) {
    switch(t[i]) {
    case 1:
      cout << (6000 * n[i]) << endl;
      break;
    case 2:
      cout << (4000 * n[i]) << endl;
      break;
    case 3:
      cout << (3000 * n[i]) << endl;
      break;
    case 4:
      cout << (2000 * n[i]) << endl;
      break;
    }
  }

  return 0;
}



Measured memory_bytes: 3116
#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--)
int main(){
	long long A[3];
	cin>>A[0]>>A[1]>>A[2];
	if(A[0]%2==0||A[1]%2==0||A[2]%2==0){
	   cout<<0<<endl;
	}else{
	   sort(A,A+3);
	   cout<<A[0]*A[1]<<endl;
	}
	return(0);
}

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

#define INF (1<<30)
#define MAX 2000000

// ここからプロトタイプ宣言
void Insert(int key);
void IncreaseKey(int i, int key);
int Extract();
void maxHeapify(int i);
// ここまでプロトタイプ宣言


int H, A[MAX+1];

int main(){
	int key;
	string com;

	while(1){
		cin>>com;
		if(com[0]=='e' && com[1]=='n')break;

		if(com[0]=='i'){
			cin>>key;
			Insert(key);
		}else{
			cout<<Extract()<<endl;
		}
	}
	
	return 0;
}



//---------------------
void Insert(int key){
	H++;
	A[H] = -INF;
	IncreaseKey(H,key);	
}



void IncreaseKey (int i, int key){
	if(key<A[i]) return;
		// エラー；新しいキーは現在のキーより小さい

	A[i]=key;	// 実際のキー挿入動作

	// ヒープ化
	while(i>1 && A[i/2]<A[i]){
		swap(A[i],A[i/2]);

		i=i/2;

		// 一番デカイ値が、根に向かうように動かす！
	}
}



int Extract(){	// 取り出し
	int maxv;

	if(H<1) return -INF;

	maxv=A[1];	// 取り出す
					// そして
	A[1]=A[H--];	// 葉の１つを、代わりに根に入れる（葉を１つ消す）

	maxHeapify(1);	// ヒープ化
	
	return maxv;
	
}



void maxHeapify(int i){
	int largest;

	int l = i*2;
	int r = i*2 +1 ;

	if(l<=H && A[l]>A[i]){
		largest = l;
	}else{
		largest=i;
	}

	if(r<=H && A[r]>A[largest]){
		largest=r;
	}

	if(largest != i){
		swap(A[i],A[largest]);

		maxHeapify(largest);
	}
}



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

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

typedef pair<int, int> pii;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<long long int> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long int>> vvll;

int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int leftUnhappy = 0;
  int rightUnhappy = 0;
  if(s[0] == 'L') leftUnhappy = 1;
  if(s[n-1] == 'R') rightUnhappy = 1;

  int unhappyPair = 0;
  for(int i=1;i<n;i++) {
    if(s[i-1] == 'R' && s[i] == 'L') unhappyPair++;
  }

  if(k <= unhappyPair) {
    unhappyPair -= k;
    cout << n - unhappyPair * 2 - leftUnhappy - rightUnhappy << endl;
  } else {
    cout << n - 1 << endl;
  }
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;

int n;
string s;

int main()
{
    cin >>n;
    map<ll,int> m;
    ll x;
    ll s(0);
    while(n--)
    {
        cin >> x;
        if(m[x]) s--,m[x]=0;
        else s++,m[x]=1;
    }
    cout << s;
    return 0;
}


Measured memory_bytes: 6528
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <stack>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
int N;

int main() {
  INCANT;
  cin >> N;
  vector<int> v(N);
  rep(i, N) cin >> v[i];
  vector<int> ans;
  while(v.size()>0) {
    stack<int> tmp;
    rep(i, v.size()) {
      if (v[i]==i+1) tmp.push(i);
    }
    if (tmp.empty()) {
      cout <<  -1 << endl;
      return 0;
    }
    
    ans.push_back(v[tmp.top()]);
    v.erase(v.begin()+tmp.top());
    tmp.pop();
  }

  for (int i=N-1; i>=0; i--) cout << ans[i] << endl;
  return 0;
}

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

using namespace std;

typedef long long int llint;
typedef unsigned long long int ullint;

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

//#define DEBUG

#ifdef DEBUG
#define dump(i) cout << "[*] " #i ": " << i << endl
#define line cout << "[*] --------- [*]" << endl
#else
#define dump(i)
#define line
#endif

int n;
ullint t[101];

ullint gcd(ullint x, ullint y) {
	if (y == 0) return x;
	return gcd(y, x % y);
}

ullint lcm(ullint x, ullint y) {
	const ullint r = (x > y) ? gcd(x, y) : gcd(y, x);
	return x / r * y;
}

inline void input() {
	cin >> n;
	rep(i, n) {
		cin >> t[i];
	}
}

inline void solve() {
	ullint ans = 1;
	rep(i, n) {
		ans = lcm(t[i], ans);
	}
	cout << ans << endl;
}

int main() {
	input();
	line;
	solve();
	return 0;
}


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

using namespace std;

int main() {
	string s, t; cin >> s >> t;
	int n = s.length();
	int k = 0;
	for (int i = 0; i < n; i++)
		if (s[i] != t[i])
			k++;
	cout << k << '\n';
	return 0;
}


Measured memory_bytes: 3820