akhauriyash/Code-Regression huggingface dataset:
import random

def main():
    D = int(input())
    c_list = list(map(int, input().split()))
    s_list = [list(map(int, input().split())) for _ in range(D)]
    t_list = [random.randint(1,26) for _ in range(D)]

    basic_bad = sum(c_list)
    for m in range(10**4):
        d = random.randint(1,D)
        q = random.randint(1,26)

        pre_t = t_list[d-1]
        pre_res = 0

        t_list[d-1] = q
        res = 0
        
        bad = 0
        last_open = [0] * 26
        for i in range(D):
            t = t_list[i]
            res += s_list[i][t-1]

            # ここは毎回26ループ回す必要がないところになりうるので改善可能かも(なおすだけで20回分の処理が消せる)
            # bad = 0
            # for ci in range(26):
            #     bad += c_list[ci]*(i+1 - last_open[ci])
            bad += basic_bad - (i+1 - last_open[t-1]) * c_list[t-1]
            last_open[t-1] = i+1

            res -= bad
            
        if pre_res > res:
            res = pre_res
            t_list[d-1] = pre_t

    for t in t_list:
        print(t)

if __name__ == "__main__":
    main()

Measured memory_bytes: 9828
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int[] A = new int[N];
            for (int i = 0; i < N; i++) {
                A[i] = in.nextInt();
            }

            Arrays.sort(A);

            long a = 0;
            long b = 0;
            for (int i = N - 2; i >= 0; i--) {
                if (A[i] == A[i + 1]) {
                    if (a == 0) {
                        a = A[i];
                    } else if (b == 0) {
                        b = A[i];
                    } else {
                    }
                    A[i] = -1;
                    A[i + 1] = -1;
                }
            }

            System.out.println(a * b);
        }
    }
}


Measured memory_bytes: 49568
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<complex>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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

using Graph=vector<vector<ll>>;

#define ketasitei setprecision(15) //15桁表示


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

	int n,r;
    cin>>n>>r;
    if(n<10)
        cout<<r+(100*(10-n));
    else
        cout<<r;
    cout<<endl;

	return 0;
}

Measured memory_bytes: 256
using System;
using static System.Console;
using static System.Math;
using System.Linq;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            decimal[] tmp = ReadLine().Split(' ').Select(decimal.Parse).ToArray();
            decimal N = tmp[0];
            decimal A = tmp[1];
            decimal B = tmp[2];
            Write(Min(N * A, B));
        }
    }
}

Measured memory_bytes: 13396
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
 
int main() {
	int n; cin >> n;
 
	vector<string> v1(n);
	for (int i = 0; i < n; ++i) {
		cin >> v1[i];
	}
	int m; cin >> m;
 
	vector<string> v2(m);
	for (int i = 0; i < m; ++i) {
		cin >> v2[i];
	}
 
	int res = 0;
	for (int i = 0; i < n; ++i) {
		int t = count(v1.begin(), v1.end(), v1[i]) - count(v2.begin(), v2.end(), v1[i]);
		res = max(res, max(0, t));
	}
 
	cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (ll i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
int main(){
    int N,K,X,Y; cin >> N >> K >> X >> Y;
    int ans=0;
    if (N>K) ans=X*K+(N-K)*Y;
    else ans=X*N;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//const long long MOD = 1e9+7;
const long long MOD = 998244353;
const long long INF_LL = 1e18+3; const int INF_int = 1e9+3;
#define ll long long
#define rep(i,n) for(int i = 0;i<n;i++)
#define lrep(i,n) for(long long i = 0;i<n;i++)
#define All(a) a.begin(),a.end()
#define Debug_Output_ALL(a) for(auto itr = a.begin();itr!=a.end();itr++) cout << *itr << " ";cout << endl;
//x^n(MOD)
long long power(long long n,int x,long long MOD){
    long long a = 1;
    long long b = x;
    while(n>0){
        if(n%2==1){
            a*=b;
            a%=MOD;
        }
        n/=2;
        b = b*b;
        b%=MOD;
    }
    return a;
}
int main(){
    int n,s;
    cin >> n >> s;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    ll dp[n+1][s+1];
    rep(i,n+1) rep(j,s+1) dp[i][j]=0;
    dp[0][0]=1;
    ll ans = 0;
    rep(i,n){
        for(int j = 0;j<s+1;j++){
            if(j<a[i]){
                dp[i+1][j]=2*dp[i][j];
                dp[i+1][j]%=MOD;
            }
            else{
                dp[i+1][j]=2*dp[i][j]+dp[i][j-a[i]];
                dp[i+1][j]%=MOD;
            }
        }
        /*ans+=power(2,dp[i][s],MOD);
        if(s>=a[i]) ans+=dp[i][s-a[i]];
        dp[i+1][s] = dp[i][s]+dp[i][s-a[i]];*/
    }
    cout << dp[n][s] << endl;
}

Measured memory_bytes: 73948
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int s = 10;
        int[][] map = new int[s][s];
        int[] dx = {0,-1,1,0,0,-1,-1,1,1,-2,0,0,2};
        int[] dy = {0,0,0,-1,1,-1,1,-1,1,0,-2,2,0};
        int[] size = {5,9,13};
        while(scan.hasNext()){
        	String[] com = scan.nextLine().split(",");
        	int x = Integer.parseInt(com[0]);
        	int y = Integer.parseInt(com[1]);
        	int t = Integer.parseInt(com[2]) - 1;
        	for(int i = 0;i < size[t];i++){
        		if(x+dx[i] >= 0 && x+dx[i] < s && y+dy[i] >= 0 && y+dy[i] < s){
        			map[y+dy[i]][x+dx[i]] += 1;
        		}
        	}
        }
        int max = 0;
        int count = 0;
        for(int i = 0;i < s;i++){
        	for(int j = 0;j < s;j++){
        		if(map[i][j] > 0){
                                count++; max = (max < map[i][j])?map[i][j]:max;
                        }
        	}
        }
        System.out.println((100-count) + "\n" + max);
    }
}

Measured memory_bytes: 17348
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

using namespace std;

int main(int argc, const char * argv[]) {

    ios::sync_with_stdio(false);
    cin.tie(0);

    int a; cin >> a;
    string s; cin >> s;
    cout << (a >= 3200 ? s : "red") << endl;

    return 0;
}


Measured memory_bytes: 256
import sys

input = sys.stdin.readline


def main():
    r, g, b = map(int, input().split())

    num = int("".join(map(str, [r, g, b])))

    if num % 4 == 0:
        ans = "YES"
    else:
        ans = "NO"
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
  int N, K;
  cin >> N >> K;
  cout << N - K + 1 << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	map<char,int> m;
	for(int i=0;i<s.size();i++){
		m[s[i]]++;
	}
	for(int i=0;i<s.size();i++){
		if(m[s[i]]/2==1){
			continue;
		}
		else{
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes";
	return 0;
} 

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
	template <typename Arg1>
	void __f(const char* name, Arg1&& arg1)
	{
		cerr << name << " = " << arg1 << endl;
	}
	template <typename Arg1, typename... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args)
	{
		const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
		__f(comma+1, args...);
	}
#else
#define debug(...)
#endif

template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}

template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
	return os << "[ " << p.first << ", " << p.second << "]" ;
}

#define FAST_IO std::ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define pb push_back
#define mp make_pair
#define ld long double
#define sz(a) (ll)(a).size()
#define endl "\n"

// priority_queue<ll, vector<ll>, less<ll>>pq;     // Max Heap
// priority_queue<ll, vector<ll>, greater<ll>>pq;  // Min Heap

typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//K-th smallest
//cout << k << "kth (1 based indexing) smallest: " << *A.find_by_order(k - 1) << endl;
//NO OF ELEMENTS < X
//cout << "No of elements less than " << X << " are " << A.order_of_key(X) << endl;

int main()
{
	FAST_IO;

 	string a;
 	cin >> a;
 	if(a[2] == a[3] && a[4] == a[5]) cout << "Yes" << endl;
 	else cout << "No" << endl;   
    return 0;
}

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

struct node {
	node *p, *l, *r;
	int cnt;
	void Init(node *p_) {
		p = p_;
		l = r = nullptr;
		cnt = 0;
	}
};

int it;
node pool[5000000];

node *new_node(node *p) {
	pool[it].Init(p);
	return &pool[it++];
}

class uint_Trie {
	node *root;
	int siz;
public:
	uint_Trie() : root(new_node(nullptr)) {}
	int size() {
		return root->cnt;
	}
	void insert(unsigned val) {
		// if (find(val)) return; // multiset ???????¶????
		node *t = root;
		for (int i = 30; i >= 0; i--) {
			t->cnt++;
			if (val & (1 << i)) {
				if (t->r == nullptr) {
					t->r = new_node(t);
				}
				t = t->r;
			}
			else {
				if (t->l == nullptr) {
					t->l = new_node(t);
				}
				t = t->l;
			}
		}
		t->cnt++;
	}
	void erase(unsigned val) {
		node *t = root, *ne;
		for (int i = 30; i >= 0; i--) {
			t->cnt--;
			if (val & (1 << i)) {
				if (t->r == nullptr) return;
				t = t->r;
			}
			else {
				if (t->l == nullptr) return;
				t = t->l;
			}
		}
		t->cnt--;
		while (t != root && t->cnt == 0) {
			ne = t->p;
			(t == ne->l ? ne->l : ne->r) = nullptr;
			t = ne;
		}
	}
	bool find(unsigned val) {
		node *t = root;
		for (int i = 30; i >= 0; i--) {
			if (val & (1 << i)) {
				if (t->r == nullptr) return false;
				t = t->r;
			}
			else {
				if (t->l == nullptr) return false;
				t = t->l;
			}
		}
		return true;
	}
	unsigned max() {
		assert(root->cnt >= 1);
		node *t = root;
		unsigned res = 0;
		for (int i = 30; i >= 0; i--) {
			assert(t->l != nullptr || t->r != nullptr);
			if (t->r != nullptr) {
				res |= 1 << i;
				t = t->r;
			}
			else {
				t = t->l;
			}
		}
		return res;
	}
	unsigned min() {
		assert(root->cnt >= 1);
		node *t = root;
		unsigned res = 0;
		for (int i = 30; i >= 0; i--) {
			assert(t->l != nullptr || t->r != nullptr);
			if (t->l != nullptr) {
				t = t->l;
			}
			else {
				res |= 1 << i;
				t = t->r;
			}
		}
		return res;
	}
};

int main()
{
	cin.sync_with_stdio(false);
	uint_Trie ut;
	string com;
	int k;
	while (cin >> com, com != "end") {
		if (com == "insert") {
			cin >> k;
			ut.insert(k);
		}
		else {
			int res = ut.max();
			printf("%d\n", res);
			ut.erase(res);
		}
	}
	return 0;
}

Measured memory_bytes: 38184
#include<bits/stdc++.h>
using namespace std;
#define rg register
#define rep(i,a,b) for (rg int i=a;i<=b;i++)
#define per(i,a,b) for (rg int i=b;i>=a;i--)
#define pb push_back
#define lowbit(x) (x&(-x))
#define mk make_pair
#define VI vector<int>
#define pii pair<int,int>
#define pLL pair<long long,long long>
#define fi first
#define se second
#define il inline
#define ll long long
#define db double
#define ld long double
#define inf 0x3f3f3f3f
#define getc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<15,stdin),p1==p2)?EOF:*p1++)
char buf[1<<15],*p1 = buf,*p2 = buf;
inline ll read(){
    #define num ch-'0'
    char ch;bool flag=0;ll res;
    while(!isdigit(ch=getc()))
    (ch=='-')&&(flag=true);
    for(res=num;isdigit(ch=getc());res=res*10ll+num);
    (flag)&&(res=-res);
    #undef num
    return res;
}
inline void write(ll x){
	if (x < 0) x = ~x + 1ll, putchar('-');
	if (x > 9) write(x / 10ll);
	putchar(x % 10ll + '0');
}
#define mid ((l + r)>>1)
#define ls (x<<1)
#define rs ((x<<1)|1)
#undef mid
#undef ls
#undef rs
ll gcd(ll a,ll b) {return b == 0?a:gcd(b,a%b);}
void solve()
{
	ll a = read(),b = read();
	ll c = gcd(a,b);
	int tot = 1;
	for(ll i =2 ;i*i<=c;i++)
	{
		if(c%i==0)
		{
			while(c%i==0) c/=i;
			tot++;
		}
	}
	if(c>1) tot++;
	cout<<tot<<endl;
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("data.txt","r",stdin);
	#endif
//	int T = read();
//	while(T--)
	solve();
}

Measured memory_bytes: 3580
#include<stdio.h>
#define MAX 100
int queue[MAX];
int head=0;
int tail=0;

void enq(int n){
	queue[tail++]=n;
}

int deq(){
	int n=queue[head++];
	return n;
}

int main(void){
	int adj[MAX+1][MAX+1];
	int d[MAX+1];
	int i,j,n,u,k,v;
	int min;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		d[i]=-1;
		for(j=1;j<=n;j++)adj[i][j]=0;
	}
	for(i=0;i<n;i++){
		scanf("%d %d",&u,&k);
		for(j=0;j<k;j++){
			scanf("%d",&v);
			adj[u][v]=1;
		}
	}
	
	enq(1);d[1]=0;
	while(head<tail){
		u=deq();
		for(i=1;i<=n;i++){
			if(adj[u][i]==1 && d[i]==-1){
				enq(i);
				d[i]=d[u]+1;
			}
		}
	}
	
	for(i=1;i<=n;i++)printf("%d %d\n",i,d[i]);
	return 0;
}




Measured memory_bytes: 1812
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) 
#define X first
#define Y second 
#define nl '\n'
#define AC return 0
#define pb(a) push_back(a) 
#define mst(a,b) memset(a, b, sizeof a)
#define rep(i,n) for(int i = 0; (i)<(n); i++)
#define rep1(i,n) for(int i = 1; (i)<=(n); i++)
#define scd(a) scanf("%lld", &a)
#define scdd(a,b) scanf("%lld%lld", &a, &b)
#define scs(s) scanf("%s", s)
//#pragma GCC optimize(2)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
const ll INF = (ll)0x3f3f3f3f3f3f3f, MAX = 9e18, MIN = -9e18;
const int N = 1e6+10, M = 2e6+10, mod = 1e9+7, inf = 0x3f3f3f;
ll a[N]; 


int main()
{
	IOS;
	string s, t;
	cin>>s>>t;
	ll ans = MAX, k;
	rep(i, s.size())
	{
		if(i+t.size() > s.size())
			break;
		k = 0;
		rep(j, t.size())
			if(s[i+j]!=t[j])
				k++;
		ans = min(ans, k);
	}
	cout<<ans<<nl;
	
	AC;
} 

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int N;
int a[210];

int count(int x) {
  int res = 0;
  while (x % 2 == 0) {
    x >>= 1;
    res++;
  }
  return res;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N;
  int ans = 100;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    ans = min(ans, count(a[i]));
  }  
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    int ans = 0;
    for(int i = 1; i < s.size(); i++)
    {
        if(s[i] == s[i - 1])
        {
            ans++;
            s[i] = (s[i - 1] == '0' ? '1' : '0');
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 512
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/

#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
#include <stack>
/*多倍長整数/cpp_intで宣言
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
*/

//#pragma gcc target ("avx2")
//#pragma gcc optimization ("o3")
//#pragma gcc optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a) //少数出力
#define printLdb(a) printf("%.50Lf\n", a) //少数出力
#define printdbd(a) printf("%.16lf\n", a) //少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str()) //string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2.0) //等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0L)*2.0L*PI)
#define rad_to_deg(rad) (((rad)/2.0L/PI)*360.0L)
#define Please return
#define AC 0
#define manhattan_dist(a, b, c, d) (abs(a - c) + abs(b - d)) /*(a, b) から (c, d) のマンハッタン距離 */


using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acosl(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1 && c != ' ') {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

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

ll lcm(ll number1, ll number2) {
	return number1 / gcd(number1, number2) * number2;
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	int n;
	scanf("%d", &n);
	printf("%d\n", (n / 500 * 1000) + ((n % 500) / 5) * 5);

	Please AC;
}

Measured memory_bytes: 760
import sys
input = sys.stdin.buffer.readline
from collections import deque

def main():
    N = int(input())
    memo = []
    base = 0
    for i in range(N-1):
        memo.append(base)
        base += N-i-1
    edge = [[] for _ in range((N*(N-1))//2)]
    IN = [0]*((N*(N-1))//2)
    
    for i in range(N):
        a = list(map(int,input().split()))
        b = []
        for j in a:
            j -= 1
            if i < j:
                b.append(memo[i]+j-i-1)
            else:
                b.append(memo[j]+i-j-1)
        for i in range(N-2):
            edge[b[i]].append(b[i+1])
            IN[b[i+1]] += 1

    def t_sort():
        que = deque([i for i,c in enumerate(IN) if c == 0])
        l = []
        while que:
            now = que.popleft()
            l.append(now)
            for fol in edge[now]:
                IN[fol] -= 1
                if IN[fol] == 0:
                    que.append(fol)
        if len(l) != (N*(N-1))//2:
            print(-1)
            exit()
        return l
    
    ts = t_sort()
    dp = [1]*((N*(N-1))//2)
    for now in ts:
        for fol in edge[now]:
            dp[fol] = max(dp[fol],dp[now]+1)
    
    print(max(dp))

if __name__ == "__main__":
    main()

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

using namespace std;

#define MAX 1024

int main()
{
    int W, N, T = 1;
    while (cin >> W, W) {
        cin >> N;
        char c;
        vector<int> v(N), w(N);
        for (int i = 0; i < N; i++) {
            cin >> v[i] >> c >> w[i];
        }

        int dp[MAX] = {};
        for (int i = 0; i < N; i++) {
            for (int j = W; j >= w[i]; j--) {
                dp[j] = max(dp[j], dp[j-w[i]] + v[i]);
            }
        }
        
        int max_v = *max_element(dp, dp + W + 1), min_w = -1;
        for (int i = W; i >= 0; i--) {
            if (dp[i] == max_v) {
                min_w = i;
            }
        }        
        cout << "Case " << T++ << ":" << endl;
        cout << max_v << endl;
        cout << min_w << endl;
    }
    return 0;
}

Measured memory_bytes: 3100
import sys,math
sys.setrecursionlimit(10**9)
from collections import defaultdict
 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())
#123
n,m=IA()
def f1(n):
    res=1
    for i in range(1,n+1):
        res*=i
    return res
def f(n):
    if n<2:return 0
    return f1(n)//(f1(n-2)*f1(2))

print(f(n)+f(m))

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

using namespace std;
using ll = long long;
constexpr int INF = numeric_limits<int>::max();
template <typename T, typename... Args>
const T& min(const T& a, Args... args) {
  return min(a, min(args...));
}
template <typename T, typename... Args>
const T& max(const T& a, Args... args) {
  return max(a, max(args...));
}

#pragma GCC optimize("O3")
static const auto __ = [] {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  return nullptr;
}();

int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  for (int a = 1; a < 10; ++a) {
    for (int b = 1; b< 10; ++b) {
      if (a * b == n) {
        cout << "Yes" << '\n';
        return 0;
      }
    }
  }
  cout << "No" << '\n';
  return 0;
}


Measured memory_bytes: 256
#include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define pb push_back
#define pf push_front
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


signed main(){
  int n,k;
  cin>>n>>k;
  vector<int> a(n);
  rep(i,n)cin>>a[i];
  sort(a.begin(),a.end(),greater<int>());
  int maxl=0;
  rep(i,k)maxl+=a[i];
  cout<<maxl<<endl;


  return 0;
}



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

int main() {
  int N;
  cin >> N;
  map<string, int> polls;
  int max = 0;
  rep(i,N) {
    string S;
    cin >> S;
    polls[S]++;
    if (polls[S] > max) max = polls[S];
  }
  
  for (auto p : polls) {
    if (p.second == max) cout << p.first << endl;
  }
  return 0;
}


Measured memory_bytes: 25216
#include<stdio.h>
int main(){
    int n;
    scanf("%d", &n);
    int v[20];
    int c[20];
    for(int i=0; i<n;i++){
        scanf("%d", &v[i]);
    }
    for(int i=0; i<n;i++){
        scanf("%d", &c[i]);
    }
    int sum=0;
    for(int i=0; i<n;i++){
        if(v[i]>c[i]){
            sum+=v[i];
            sum-=c[i];
        }
    }
    printf("%d\n", sum);
    return 0;
}

Measured memory_bytes: 128
import itertools
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
lists = [A,B,C,D,E]
time = 0
min = 9999
for i,j,k,m,n in itertools.permutations(lists):
        menu_list = [i,j,k,m,n]
        time = 0
        for l in range(5):
                time += menu_list[l]
                if time % 10 != 0 and l != 4:
                         time = (time - (int(time % 10))) + 10
                else:
                        continue
        if min > time:
                min = time
print(min)

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

typedef long long ll;

int a, b, c, d;

int main(){
    cin >> a >> b >> c >> d;

    if (abs(b - a) <= d && abs(c - b) <= d){
        cout << "Yes" << endl;
    } else if (abs(c - a) <= d){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

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

// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

typedef long long ll; 
typedef long double ld; 
typedef pair<int,int> p32;   
typedef pair<ll,ll> p64;  
typedef pair<double,double> pd; 
typedef pair<ld,ld> pld; 
typedef vector<int> v32;  
typedef vector<ll> v64;  
typedef vector<pd> vpd;   
typedef vector<p32> vp32;  
typedef vector<p64> vp64;  
typedef vector<v32> vv32;  
typedef vector<v64> vv64;  

#define pb push_back
#define mp make_pair
#define prarr(a,n) cerr<<#a<<" : ";for(ll i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl;
#define prmat(mat,row,col) cerr<<#mat<<" :\n";for(ll i=0;i<row;i++) {for(ll j=0;j<col;j++) cerr<<mat[i][j]<<"\t";cerr<<endl;}
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
#define all(a) a.begin(),a.end()
#define sz(x) ((int)x.size())
#define endl '\n'
#define fast_io ios_base::sync_with_stdio(NULL); cin.tie(NULL)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {ll idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ", "; dbs(str.substr(idx + 1), s...);}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
template <class T> void prall(T a) { prc(all(a)); }


const int inf=1000*1000*1000+9; 
const ll infl=1ll*inf*inf; 
int mod=1000*1000*1000+7;  
// ---------------------------------------------------------------------------- -------------- 


void solve(){
	int n,k,c; cin>>n>>k>>c; 
	string str; cin>>str; 
	v32 f,s;  
	int cnt=0; 
	for(int i=0;i<n;i++){
		if(cnt==k) break; 
		if(str[i]=='o'){
			f.push_back(i); 
			i+=c; 
			cnt++; 
		}
	}	
	cnt=0; 
	for(int i=n-1;i>=0;i--){
		if(cnt==k) break; 
		if(str[i]=='o'){
			s.push_back(i); 
			i-=c; 
			cnt++; 
		}
	}
	reverse(all(s)); 
	for(int i=0;i<sz(s);i++){
		if(f[i]==s[i]){
			cout<<f[i]+1<<endl; 
		}
	}
}



int main(){
	// clock_t beg=clock(); 
  fast_io; 
  int testcases=1; 
  // freopen("student.in","r",stdin); 
  // freopen("student.out","w",stdout); 
  // cin>>testcases; 
  cout << fixed << setprecision(13); 
  while(testcases--){
    solve(); 	
  }
	// clock_t end=clock(); 
	// fprintf(stderr, "%lf\n", (double)(end-beg)/(CLOCKS_PER_SEC));
}



Measured memory_bytes: 3468
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
        int b = sc.nextInt();
		if(a*2<=b && b<=a*4 && b%2==0){System.out.println("Yes");}
		else{System.out.println("No");}
	}
}
	

Measured memory_bytes: 35800
rooms = [[[0] * 10 for _ in range(3)] for _ in range(4)]

N = int(input())
for _ in range(N):
    b, f, r, v = map(int, input().split())
    rooms[b - 1][f - 1][r - 1] += v

for i, b in enumerate(rooms):
    for f in b:
        print(' ' + ' '.join([str(i) for i in f]))
    if i < len(rooms) - 1:
        print('#' * 20)



Measured memory_bytes: 5608
import sys
si = sys.stdin.readline

n = int(si())
t = 0
flag = False
while n:
    n -= 1
    a, b = [int(e) for e in si().split()]
    if a == b:
        t += 1
    else:
        t = 0
    if t >= 3:
        flag = True
if flag:
    print('Yes')
else:
    print('No')


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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 2e5 + 5;

int v[MAXN], n;

vector<pii> word;

bool check(int k) {
	if (k <= 1) {
		return false;
	}
	
	word.clear();
	
	//printf("# %d\n", k);
	
	word.pb(mp(1, 0));
	REP(i, 1, n) {
		if (v[i - 1] >= v[i]) {
			while(word.back()._1 > v[i]) {
				word.pop_back();
			}
			int cur = word.back()._2;
			if (cur == k - 1) {
				int pos = word.back()._1 - 1;
				if (pos == 0) {
					return false;
				}
				word.pop_back();
				if (!word.empty() && word.back()._1 == pos) {
					if (SZ(word) == 1 || word[SZ(word) - 2]._2 != word.back()._2 + 1) {
						word.back()._2++;
					} else {
						word.pop_back();
					}
				} else {
					word.pb(mp(pos, word.back()._2 + 1));
				}
				word.pb(mp(pos + 1, 0));
			} else {
				if (word.back()._1 == v[i]) {
					if (SZ(word) == 1 || word[SZ(word) - 2]._2 != word.back()._2 + 1) {
						word.back()._2++;
					} else {
						word.pop_back();
					}
				} else {
					word.pb(mp(v[i], cur + 1));
				}
			}
		} else {
			if (word.back()._2 != 0) {
				word.pb(mp(v[i - 1] + 1, 0));
			}
		}
		
		
		/*REP(i, 0, SZ(word)){
			printf("%d %d,", word[i]._1, word[i]._2);
		}
		printf("\n");*/
	}
	return true;
}

void solve(){
	scanf("%d", &n);
	bool fl = false;
	REP(i, 0, n) {
		scanf("%d", &v[i]);
		if (i && v[i] <= v[i - 1]) {
			fl = true;
		}
	}
	if (!fl) {
		printf("1\n");
		return;
	}
	int l = 1, r = n;
	for(; l + 1 < r; ) {
		int mid = (l + r) / 2;
		if (check(mid)) {
			r = mid;
		} else {
			l = mid;
		}
	}
	printf("%d\n", r);
}   

int main(){

    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


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

int a[100005] = {};
int box[100005] = {};

int main()
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
        box[a[i]]++;
    }
    int ans = 0;
    for (int i = 1; i <= 1e5 + 1; i++)
    {
        int cnt = box[i-1] + box[i] + box[i+1];
        ans = max(ans, cnt);
    }
    printf("%d\n", ans);
    return 0;
}

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007


int main(){

  ll l,r;
  cin >> l >> r;
  ll res = 0;
  while(l <= r && l > 0){
    l *= 2;
    res++;
  }
  cout << res << endl;



  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int a[5],i;
	for(i=0;i<5;i++) scanf("%d",&a[i]);
	sort(a,a+5,greater<int>());
	for(i=0;i<4;i++) printf("%d ",a[i]);
	printf("%d\n",a[4]);
	return 0;
}

Measured memory_bytes: 1040
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<map>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
int main() {
	vector<int> num(3, 0), num2(3);
	string s;
	cin >> s;
	for (auto t : s)num[t - 'a']++;
	sort(all(s));
	auto it = s.begin(), it2 = it;
	while (it != s.end()) {
		it2 = it;
		it = upper_bound(all(s), *it);
		num2[*it2 - 'a'] += it - it2;
	}
	rep(i, 0, 3) {
		if (num[i] != num2[i])while (1) {}
	}
	int M = 0, m = num2[0];
	for (auto v : num2) {
		M = max(M, v);
		m = min(m, v);
	}
	puts(M - m <= 1 ? "YES" : "NO");
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#include <string>
#include <utility>
#include <map> 
#include <queue>
#include <stack>
#include <iomanip>
#include <sstream>
#define MP make_pair
#define PB push_back
#define SZ size()
#define B begin()
#define E end()
#define ll long long
#define REP(i,a,n) for(ll i=a; i<n; ++i)
#define RED(i,n,a) for(ll i=n; i>=a; --i)
#define m9 1000000007
#define endl "\n"
#define F first
#define S second
#define ld long double
#define eps 0.00000000001
#define MAX 1000000007
#define vll vector <ll> 
#define pll pair <ll,ll> 

using namespace std;

ll gcd(ll a, ll b){
    if(a%b==0){
        return b;
    }
    else{
        return gcd(b, a%b);
    }
}
ll powc(ll a, ll b){
    if(b<0){
        return -1;
    }
    ll res=1;
    while(b>0){
        if(b&1){
            res*=a;
        }
        a*=a;
        //res%=m9, a%=m9;
        b>>=1;
    }
    return res;
}
vector < vector <ll> > graph(2e5+10);
vector <ll> visited(2e5+10,0);
ll cnt=0;
void dfs(ll in){
    cnt++;
    visited[in]=1;
    REP(i,0,(ll)graph[in].SZ){
        if(!visited[graph[in][i]]){
            dfs(graph[in][i]);
        }
    }
}


///target expert

int main(){
    //freopen("input.txt", "r", stdin); 
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, m; cin>>n>>m;
    REP(i,0,m){
        ll u, v; cin>>u>>v;
        graph[u].PB(v), graph[v].PB(u);
    }
    ll ans=0;
    REP(i,1,n+1){
        if(!visited[i]){
            cnt=0; dfs(i);
        }
        ans=max(ans,cnt);
    }
    cout<<ans;
}



Measured memory_bytes: 21852
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	double m5, m10;
	while (cin >> m5 >> m10) {
		if (m5 < 35.50&&m10 < 71)cout << "AAA" << endl;
		else if (m5 < 37.50&&m10 < 77)cout << "AA" << endl;
		else if (m5 < 40 && m10 < 83)cout << "A" << endl;
		else if (m5 < 43 && m10 < 89)cout << "B" << endl;
		else if (m5 < 50 && m10 < 105)cout << "C" << endl;
		else if (m5 < 55 && m10 < 116)cout << "D" << endl;
		else if (m5 < 70 && m10 < 148)cout << "E" << endl;
		else cout << "NA" << endl;
	}
	return 0;
}

Measured memory_bytes: 3144
#include <iostream>

using namespace std;
/** Problem0064 : Secret Number **/
int main()
{
	string s;
	int ans=0, tmp;
	
	while (cin >> s) {
		int len = (int)s.length();
		tmp = 0;
		for (int i=0; i<len; i++) {
			if ('0' <= s[i] && s[i] <= '9') {
				if (tmp>0) {
					tmp*=10; tmp+=s[i]-'0';
				} else
					tmp+=s[i]-'0';
			} else {
				ans+=tmp;
				tmp=0;
			}
		}
		ans += tmp;
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 1184
#include <bits/stdc++.h>
#define ll long long
#define maxn 200005
int n;ll d,a,ans;
struct node {
	ll h,x;
}p[maxn];
int cmp(node a,node b){return a.x<b.x;}
struct segmentTree {
	ll tag[maxn<<2];
	void pushdown(int rt){
		tag[rt<<1]+=tag[rt];
		tag[rt<<1|1]+=tag[rt];
		tag[rt]=0;
	}ll query(int l,int r,int p,int rt){
		if (l==r)return tag[rt];
		pushdown(rt);
		int mid=(l+r)>>1;
		if (p<=mid)return query(l,mid,p,rt<<1);
		else return query(mid+1,r,p,rt<<1|1);
	}void build(int l,int r,int rt){
		if (l==r){tag[rt]=p[l].h;return;}
		build(l,(l+r)>>1,rt<<1);
		build(((l+r)>>1)+1,r,rt<<1|1);
	}void add(int l,int r,int L,int R,ll v,int rt){
		if (l>R||r<L)return;
		if (l<=L&&R<=r){tag[rt]+=v;return;}
		pushdown(rt);
		add(l,r,L,(L+R)>>1,v,rt<<1);
		add(l,r,((L+R)>>1)+1,R,v,rt<<1|1);
	}
}sgt;

int main(){
	scanf("%d%lld%lld",&n,&d,&a);d*=2;
	for(int i=1;i<=n;++i)
		scanf("%lld%lld",&p[i].x,&p[i].h);
	std::sort(p+1,p+n+1,cmp);
	sgt.build(1,n,1);
	int p1=1;
	for(int i=1;i<=n;++i){
		ll d1=sgt.query(1,n,i,1);
		if (d1<0)continue;
		ll cnt=(d1+a-1)/a;
		while (p1<n&&p[p1+1].x-p[i].x<=d)p1++;
	//	printf("%d %d %lld %lld %lld\n",i,p1,p[p1+1].x-p[i].x,d,cnt);
		sgt.add(i,p1,1,n,-cnt*a,1);
		ans+=cnt;
	}printf("%lld",ans);
	return 0;
}



Measured memory_bytes: 9600
H, W = map(int,input().split())

mas = [list(map(str,input())) for _ in range(H)]
mas2 = [[0 for _ in range(W+2)] for __ in range(H+2)]

for i in range(1,H+1):
  for j in range(1,W+1):
    if mas[i-1][j-1] == '#':
      mas2[i][j] = -9
      mas2[i+1][j] += 1
      mas2[i+1][j-1] += 1
      mas2[i][j-1] += 1
      mas2[i-1][j-1] += 1
      mas2[i-1][j] += 1
      mas2[i-1][j+1] += 1
      mas2[i][j+1] += 1
      mas2[i+1][j+1] += 1

mas3 = [l[1:-1] for l in mas2[1:-1]]

for k in range(H):
  print(*["#" if i < 0 else i for i in mas3[k]],sep="")

Measured memory_bytes: 9272
#include <stdio.h>

int main(void){
	int a;
	int s;
	int byou;
	int jikan;
	int hun;
	
	scanf("%d",&s);
	
	byou = s % 60;
	jikan = s / 3600;
	hun = (s % 3600) / 60;
	
	
	printf("%d:%d:%d\n",jikan,hun,byou);
}

Measured memory_bytes: 1020
//C++14 (Clang 3.8.0)

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#define rp(i,a,b) for(int (i)=(int)(a);i<(int)(b);++i)

typedef long long ll;


using namespace std;


int main(){
    int a,b;
    cin>>a>>b;
    cout<<a/b<<endl;
    cout<<a%b<<endl;
    cout<< fixed << setprecision(6) << double(a)/double(b) << endl;
    return 0;
};

Measured memory_bytes: 3252
/* ********************************* JAI SAI RAM ************************************* */
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lb;
#define endl "\n"
ll P=1000000007;

int main()
{
    ll i,j,k,l,m,n,o,p,q,r,s,t,x,h,c,start,end,mid;
    string a[1001];

    cin>>r>>s;
    cout<<r*s<<endl;
    return 0;
}


Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
using VI = vector <int>;
using VVI = vector <VI>;
inline int getBlockStart(int npos, int bakPos) {
    int nextBlock = (bakPos+1-2)/3 * 3 + 2;
    return npos < 0 ? nextBlock : max(nextBlock, (npos-2)/3*3 + 2);
}
inline int checkEqual(VI& A, int i, int j, int k){
    return A[i] == A[k] && A[i] == A[j];
}
inline void solve(VVI& dp, VI& A, int i, int j, int s) {
    if (s <= j && s+3 > j) {
        s += 3;
    }
    if (s <= j || j <= i) {
        return ;
    }
    int plus = s < A.size() ? checkEqual(A, i, j, s) : 0;
    dp[A.size()][A.size()] = max(dp[A.size()][A.size()], dp[i][j] + plus);
    if (s+2 < A.size()) {
        dp[i][s+0] = max(dp[i][s+0], dp[i][j] + checkEqual(A, j, s+1, s+2));
        dp[i][s+1] = max(dp[i][s+1], dp[i][j] + checkEqual(A, j, s+0, s+2));
        dp[i][s+2] = max(dp[i][s+2], dp[i][j] + checkEqual(A, j, s+0, s+1));
        dp[j][s+0] = max(dp[j][s+0], dp[i][j] + checkEqual(A, i, s+1, s+2));
        dp[j][s+1] = max(dp[j][s+1], dp[i][j] + checkEqual(A, i, s+0, s+2));
        dp[j][s+2] = max(dp[j][s+2], dp[i][j] + checkEqual(A, i, s+0, s+1));
        dp[s+0][s+1] = max(dp[s+0][s+1], dp[i][j] + checkEqual(A, i, j, s+2));
        dp[s+0][s+2] = max(dp[s+0][s+2], dp[i][j] + checkEqual(A, i, j, s+1));
        dp[s+1][s+2] = max(dp[s+1][s+2], dp[i][j] + checkEqual(A, i, j, s+0));
    }
}
int main() {
    int N;
    cin >> N;
    VI A;
    int ans = 0;
    for (int i = 0; i <= N; ++i) {
        int upper = 2 + (i > 0) - 2*(i == N);
        for (int j = 0; j < upper; ++j) {
            int v;
            cin >> v;
            A.push_back(v);
        }
        while (A.size() >= 3) {
            int aSize = A.size();
            if (A[aSize-1] == A[aSize-2] && A[aSize-1] == A[aSize-3]) {
                A.pop_back();
                A.pop_back();
                A.pop_back();
                ++ans;
            } else {
                break;
            }
        }
    }
    VVI dp(A.size()+1, VI(A.size()+1, -1));
    VI curPos(N+1, -1);
    VI nextPos(A.size() + 1);
    for (int p = A.size()-1; p >= 0; --p) {
        nextPos[p] = curPos[A[p]];
        curPos[A[p]] = p;
    }
    dp[0][1] = 0;
    for (int i= 0; i < A.size(); ++i) {
       for (int j = i+1; j < A.size(); ++j) {
            if (dp[i][j] == -1) {
                continue;
            }
            solve(dp, A, i, j, getBlockStart(j+1, j));
            solve(dp, A, i, j, getBlockStart(nextPos[i], j));
            solve(dp, A, i, j, getBlockStart(nextPos[j], j));
       }
    }
    if (!A.empty())
        cout << ans + dp[A.size()][A.size()] << endl;
	else
        cout << ans << endl;
    return 0;
}


Measured memory_bytes: 144144
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<cstring>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
#include<time.h>
#include<cassert>

using namespace std;
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-13)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1e9 + 7;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H& b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H& b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H& b) const { return x == b.x && y == b.y; }
	bool operator!=(const H& b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P& b) const { return cost < b.cost; }
	bool operator>(const P& b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E& b) const { return cost < b.cost; }
	bool operator>(const E& b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T& a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T& a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j % i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
ll bitcount(ll x) {
	int sum = 0;
	for (int i = 0; i < 20; i++)
		if ((1ll << i) & x) sum++;
	return sum;
}
/*ll fact_[200000];
ll comb(ll x, ll y, ll mod = Mod) {
	if (!fact_[0]) {
		fact_[0] = 1;
		for (int i = 1; i < 200000; i++) {
			fact_[i] = fact_[i - 1] * i % mod;
		}
	}
	if (x < y) return 0;
	return mod_pow(fact_[x], mod, mod) *
		mod_pow(fact_[x - y], mod - 2, mod) % mod *
		mod_pow(fact_[y], mod - 2, mod) % mod;
}//xCy*/
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int n;
H a[200000];
signed main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i].x;
		a[i].y = i + 1;
	}
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		cout << a[i].y << (i == n - 1 ? "\n" : " ");
	}
}

Measured memory_bytes: 2432
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}

int main()
{
    int N, K, C; cin >> N >> K >> C;
    string S;    cin >> S;

    vector<int> L(K), R(K);

    int p = -1;
    for (int i = 0; i < K; i++) {
        p = S.find('o', p + 1);
        L[i] = p;
        p += C;
    }
    p = N;
    for (int i = K-1; i >= 0; i--) {
        p = S.rfind('o', p - 1);
        R[i] = p;
        p -= C;
    }
    for (int i = 0; i < K; i++) {
        if (L[i] == R[i]) {
            cout << L[i]+1 << endl;
        }
    }
}


Measured memory_bytes: 3332
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll k,s;
cin>>k>>s;
ll ca=0;
for(ll i=0; i<=k; i++){
for(ll q=0; q<=k; q++){
if(0<=s-i-q&&s-i-q<=k)ca++;}}
cout<<ca<<endl;}


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

int main() {
  long long a, b, c;
  cin>>a>>b>>c;
  if (c - (a + b) < 0) {
    cout<<"No"<<endl;
    return 0;
  }
  long long x = (c - (a + b)) * (c - (a + b));
  long long y = 4 * a * b;
  if (y < x) {
    cout<<"Yes"<<endl;
  } else {
    cout<<"No"<<endl;
  }
}

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

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

    int ans = 0;
    for (int i=1; i<=n; i++) {
        if (1 <= i && i <= 9) ans++;
        if (100 <= i && i <= 999) ans++;
        if (10000 <= i && i <= 99999) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
using namespace std;
 
#define fi first
#define se second
 
int main(){
    double n, ans=0;
    cin >> n;
    vector<double> x(n);
    vector<string> u(n);
    rep(i, n){
        cin >> x.at(i) >> u.at(i);
        if(u.at(i) == "JPY")ans += x.at(i);
        else ans += x.at(i)*380000.0;
    }
    cout << setprecision(10) << ans;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main()
{

    int n;
    scanf("%d",&n);
    if(n/10==9||n%10==9)
        printf("Yes\n");
    else
    printf("No\n");


    return 0;
}






Measured memory_bytes: 256
N, K, Q = map(int, input().split())
A = []
for i in range(Q):
    A.append(int(input()))
ansnum = [0] * N

for i in range(len(A)):
    ansnum[A[i]-1] += 1

for i in range(N):
    if K - (Q - ansnum[i]) >= 1:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 8632